diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index d05990b4710..90a43f8a9f6 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -2179,16 +2179,22 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura if (forVirtualNetwork) { if (vlanOwner != null) { // verify resource limits - long ipResourceLimit = _resourceLimitMgr.findCorrectResourceLimitForAccount(vlanOwner, ResourceType.public_ip); + //long ipResourceLimit = _resourceLimitMgr.findCorrectResourceLimitForAccount(vlanOwner, ResourceType.public_ip); + long accountIpRange = NetUtils.ip2Long(endIP) - NetUtils.ip2Long(startIP) + 1; - if (s_logger.isDebugEnabled()) { - s_logger.debug(" IPResourceLimit " + ipResourceLimit + " accountIpRange " + accountIpRange); - } - if (ipResourceLimit != -1 && accountIpRange > ipResourceLimit) { // -1 - // means - // infinite - throw new InvalidParameterValueException(" Public IP Resource Limit is set to " + ipResourceLimit + " which is less than the IP range of " + accountIpRange + " provided"); - } + + //check resource limits + _resourceLimitMgr.checkResourceLimit(vlanOwner, ResourceType.public_ip, accountIpRange); + +// if (s_logger.isDebugEnabled()) { +// s_logger.debug(" IPResourceLimit " + ipResourceLimit + " accountIpRange " + accountIpRange); +// } +// if (ipResourceLimit != -1 && accountIpRange > ipResourceLimit) { // -1 +// // means +// // infinite +// throw new InvalidParameterValueException(" Public IP Resource Limit is set to " + ipResourceLimit + +// " which is less than the IP range of " + accountIpRange + " provided"); +// } associateIpRangeToAccount = true; } }