CLOUDSTACK-2984: createNetwork call - when vlan is specified, check that its not coming from the physical network vnet range as this range is used for dynamic vlan allocation during the network implementation stage

This commit is contained in:
Alena Prokharchyk 2013-07-01 16:08:37 -07:00
parent cd7e21b6b1
commit 724be3f5f7
2 changed files with 9 additions and 3 deletions

View File

@ -3120,10 +3120,10 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
}
}
// Check if a guest VLAN is using the same tag
// Check if the vlan is being used
if (_zoneDao.findVnet(zoneId, physicalNetworkId, vlanId).size() > 0) {
throw new InvalidParameterValueException("The VLAN tag " + vlanId
+ " is already being used for the guest network in zone " + zone.getName());
+ " is already being used for dynamic vlan allocation for the guest network in zone " + zone.getName());
}
String ipRange = null;

View File

@ -2467,7 +2467,13 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
}
}
if (vlanId != null) {
if (vlanSpecified) {
//don't allow to specify vlan tag used by physical network for dynamic vlan allocation
if (_dcDao.findVnet(zoneId, pNtwk.getId(), vlanId).size() > 0) {
throw new InvalidParameterValueException("The VLAN tag " + vlanId
+ " is already being used for dynamic vlan allocation for the guest network in zone " + zone.getName());
}
String uri = "vlan://" + vlanId;
// For Isolated networks, don't allow to create network with vlan that already exists in the zone
if (ntwkOff.getGuestType() == GuestType.Isolated) {