NAAS Changes: Before enabling a Zone, Check if the zone has:

- For Advance zone,  a physical Network with Public/Management trafficType
- For Basic zone,  a physical Network with Management trafficType
This commit is contained in:
prachi 2012-01-20 17:21:23 -08:00
parent ecab972060
commit 03653b936e
1 changed files with 17 additions and 0 deletions

View File

@ -1452,6 +1452,23 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
if (allocationStateStr != null && !allocationStateStr.isEmpty()) {
Grouping.AllocationState allocationState = Grouping.AllocationState.valueOf(allocationStateStr);
if(allocationState == Grouping.AllocationState.Enabled){
//check if zone has necessary trafficTypes before enabling
try{
if(NetworkType.Advanced == zone.getNetworkType()){
//zone should have a physical network with public and management traffiType
_networkMgr.getDefaultPhysicalNetworkByZoneAndTrafficType(zoneId, TrafficType.Public);
_networkMgr.getDefaultPhysicalNetworkByZoneAndTrafficType(zoneId, TrafficType.Management);
}else{
//zone should have a physical network with management traffiType
_networkMgr.getDefaultPhysicalNetworkByZoneAndTrafficType(zoneId, TrafficType.Management);
}
}catch(InvalidParameterValueException ex){
throw new InvalidParameterValueException("Cannot enable this Zone since: "+ ex.getMessage());
}
}
zone.setAllocationState(allocationState);
}