This is an automated email from the ASF dual-hosted git repository.
dahn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/main by this push:
new ae501037047 Config 'vm.network.nic.max.secondary.ipaddresses' - Sync
default value (and value if not set) to 10 as per the config description and
default value in parseInt of the config (#11256)
ae501037047 is described below
commit ae5010370476c6f6d19f816a5cb95813c4a2e7ef
Author: Suresh Kumar Anaparti <[email protected]>
AuthorDate: Fri Jul 25 14:43:33 2025 +0530
Config 'vm.network.nic.max.secondary.ipaddresses' - Sync default value (and
value if not set) to 10 as per the config description and default value in
parseInt of the config (#11256)
---
engine/schema/src/main/resources/META-INF/db/schema-42010to42100.sql | 4 ++++
server/src/main/java/com/cloud/configuration/Config.java | 2 +-
server/src/main/java/com/cloud/network/NetworkServiceImpl.java | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git
a/engine/schema/src/main/resources/META-INF/db/schema-42010to42100.sql
b/engine/schema/src/main/resources/META-INF/db/schema-42010to42100.sql
index b9ce11c327f..cc6c4c6ae05 100644
--- a/engine/schema/src/main/resources/META-INF/db/schema-42010to42100.sql
+++ b/engine/schema/src/main/resources/META-INF/db/schema-42010to42100.sql
@@ -23,6 +23,10 @@
ALTER TABLE `cloud`.`backup_schedule` ADD COLUMN `max_backups` int(8) default
NULL COMMENT 'maximum number of backups to maintain';
ALTER TABLE `cloud`.`backups` ADD COLUMN `backup_interval_type` int(5) COMMENT
'type of backup, e.g. manual, recurring - hourly, daily, weekly or monthly';
+-- Update default value for the config
'vm.network.nic.max.secondary.ipaddresses' (and value to default value if value
is null)
+UPDATE `cloud`.`configuration` SET default_value = '10' WHERE name =
'vm.network.nic.max.secondary.ipaddresses';
+UPDATE `cloud`.`configuration` SET value = '10' WHERE name =
'vm.network.nic.max.secondary.ipaddresses' AND value IS NULL;
+
-- Add console_endpoint_creator_address column to cloud.console_session table
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.console_session',
'console_endpoint_creator_address', 'VARCHAR(45)');
diff --git a/server/src/main/java/com/cloud/configuration/Config.java
b/server/src/main/java/com/cloud/configuration/Config.java
index d35bfac501f..01cf6df882d 100644
--- a/server/src/main/java/com/cloud/configuration/Config.java
+++ b/server/src/main/java/com/cloud/configuration/Config.java
@@ -395,7 +395,7 @@ public enum Config {
null),
MaxNumberOfSecondaryIPsPerNIC(
"Network", ManagementServer.class, Integer.class,
- "vm.network.nic.max.secondary.ipaddresses", "256",
+ "vm.network.nic.max.secondary.ipaddresses", "10",
"Specify the number of secondary ip addresses per nic per vm.
Default value 10 is used, if not specified.", null),
EnableServiceMonitoring(
diff --git a/server/src/main/java/com/cloud/network/NetworkServiceImpl.java
b/server/src/main/java/com/cloud/network/NetworkServiceImpl.java
index ea1bc5c7510..bd3a3975eac 100644
--- a/server/src/main/java/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/main/java/com/cloud/network/NetworkServiceImpl.java
@@ -910,7 +910,7 @@ public class NetworkServiceImpl extends ManagerBase
implements NetworkService, C
throw new InvalidParameterValueException("Invalid network id is
given");
}
- int maxAllowedIpsPerNic =
NumbersUtil.parseInt(_configDao.getValue(Config.MaxNumberOfSecondaryIPsPerNIC.key()),
10);
+ int maxAllowedIpsPerNic =
NumbersUtil.parseInt(_configDao.getValue(Config.MaxNumberOfSecondaryIPsPerNIC.key()),
Integer.parseInt(Config.MaxNumberOfSecondaryIPsPerNIC.getDefaultValue()));
Long nicWiseIpCount = _nicSecondaryIpDao.countByNicId(nicId);
if (nicWiseIpCount.intValue() >= maxAllowedIpsPerNic) {
logger.error("Maximum Number of Ips
\"vm.network.nic.max.secondary.ipaddresses = \"{} per Nic has been crossed for
the nic {}.", maxAllowedIpsPerNic, nicVO);