mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 01:32:18 +02:00
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)
This commit is contained in:
parent
074f75838e
commit
ae50103704
@ -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)');
|
||||
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user