mirror of https://github.com/apache/cloudstack.git
don't update VM state if the state doesn't really change. updating VM state increases the update count, which might cause real VM update fail
This commit is contained in:
parent
9f9f7d3ffd
commit
b77723df13
|
|
@ -398,6 +398,10 @@ public class VMInstanceDaoImpl extends GenericDaoBase<VMInstanceVO, Long> implem
|
|||
Long oldHostId = vmi.getHostId();
|
||||
Long oldUpdated = vmi.getUpdated();
|
||||
Date oldUpdateDate = vmi.getUpdateTime();
|
||||
if ( newState.equals(oldState) && newHostId != null && newHostId.equals(oldHostId) ) {
|
||||
// state is same, don't need to update
|
||||
return true;
|
||||
}
|
||||
|
||||
SearchCriteria<VMInstanceVO> sc = StateChangeSearch.create();
|
||||
sc.setParameters("id", vmi.getId());
|
||||
|
|
|
|||
Loading…
Reference in New Issue