(CLOUDSTACK-2068) Anti-Affinity - When Vm deployment associated with anity-affinity group fails , it is still included in the vmlist of the anti-affiity group

Changes:
- Added removal of the groups association when VM reaches 'Error' state.
This commit is contained in:
Prachi Damle 2013-04-17 14:59:04 -07:00
parent e8269a6e26
commit 112446602d
2 changed files with 2 additions and 2 deletions

View File

@ -95,7 +95,7 @@ public class ListVMsCmd extends BaseListTaggedResourcesCmd {
@Parameter(name=ApiConstants.DETAILS, type=CommandType.LIST, collectionType=CommandType.STRING,
description="comma separated list of host details requested, " +
"value can be a list of [all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min]." +
"value can be a list of [all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min, affgrp]." +
" If no parameter is passed in, the details will be defaulted to all" )
private List<String> viewDetails;

View File

@ -295,7 +295,7 @@ public class AffinityGroupServiceImpl extends ManagerBase implements AffinityGro
if (!status) {
return false;
}
if ((newState == State.Expunging)) {
if ((newState == State.Expunging) || (newState == State.Error)) {
// cleanup all affinity groups associations of the Expunged VM
SearchCriteria<AffinityGroupVMMapVO> sc = _affinityGroupVMMapDao.createSearchCriteria();
sc.addAnd("instanceId", SearchCriteria.Op.EQ, vo.getId());