mirror of https://github.com/apache/cloudstack.git
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:
parent
1711a36a84
commit
623f3b26ca
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue