bug 9066: don't allow enabling ha for vm created from Ha disbled service offering

status 9066: resolved fixed
This commit is contained in:
alena 2011-03-22 10:46:10 -07:00
parent 8906b77e19
commit 05be5acfda
1 changed files with 5 additions and 0 deletions

View File

@ -1615,6 +1615,11 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
if (vmInstance == null) {
throw new InvalidParameterValueException("unable to find virtual machine with id " + id);
}
ServiceOffering offering = _configMgr.getServiceOffering(vmInstance.getServiceOfferingId());
if (!offering.getOfferHA() && ha != null && ha) {
throw new InvalidParameterValueException("Can't enable ha for the vm as it's created from the Service offering having HA disabled");
}
userId = accountAndUserValidation(id, account, userId,vmInstance);