CLOUDSTACK-3172: Allow creation of private gateway with same Vlan in different VPCs

This commit is contained in:
Kishan Kavala 2013-07-04 16:08:18 +05:30
parent 812f9442ff
commit 0de3a11788
1 changed files with 5 additions and 2 deletions

View File

@ -3903,8 +3903,11 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
s_logger.debug("Created private network " + privateNetwork);
} else {
s_logger.debug("Private network already exists: " + privateNetwork);
throw new InvalidParameterValueException("Private network for the vlan: " + vlan + " and cidr "+ cidr +" already exists " +
" in zone " + _configMgr.getZone(pNtwk.getDataCenterId()).getName());
//Do not allow multiple private gateways with same Vlan within a VPC
if(vpcId.equals(privateNetwork.getVpcId())){
throw new InvalidParameterValueException("Private network for the vlan: " + vlan + " and cidr "+ cidr +" already exists " +
"for Vpc "+vpcId+" in zone " + _configMgr.getZone(pNtwk.getDataCenterId()).getName());
}
}
//add entry to private_ip_address table