CS-15830. If autoscale vm group creation is attempted on a unimplemented

network an error is thrown.
Enhancing the check to make sure AutoScaleVmGroup should have atleast 1
min member.
This commit is contained in:
Vijay 2012-08-17 20:37:30 +05:30
parent 1711a36a84
commit 623f3b26ca
2 changed files with 6 additions and 1 deletions

View File

@ -843,7 +843,7 @@ public class AutoScaleManagerImpl<Type> implements AutoScaleService, Manager {
if(vmGroup.getCreated() != null)
ApiDBUtils.getAutoScaleVmGroupPolicyIds(vmGroup.getId(), bakupScaleUpPolicyIds, bakupScaleDownPolicyIds);
if (minMembers < 0) {
if (minMembers < 1) {
throw new InvalidParameterValueException(ApiConstants.MIN_MEMBERS + " is an invalid value: " + minMembers, null);
}

View File

@ -286,6 +286,11 @@ public class LoadBalancingRulesManagerImpl<Type> implements LoadBalancingRulesMa
if (zone.getNetworkType() == NetworkType.Advanced) {
NetworkVO lbNetwork = _networkDao.findById(lbNetworkId);
lbNetworkUuid = lbNetwork.getUuid();
if (vmGroup.getState().equals(AutoScaleVmGroup.State_New)) {
if(!lbNetwork.getState().equals(Network.State.Implemented)) {
throw new InvalidParameterValueException("Network is not in implemented state", null);
}
}
}
}