mirror of https://github.com/apache/cloudstack.git
(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:
parent
e8269a6e26
commit
112446602d
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Reference in New Issue