mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-7778: Start VM checkWorkItem loop should also check VM DB state before going into idle waiting to exit faster.
This commit is contained in:
parent
fed5422c10
commit
94969b0654
|
|
@ -631,6 +631,15 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
|||
return true;
|
||||
}
|
||||
|
||||
// also check DB to get latest VM state to detect vm update from concurrent process before idle waiting to get an early exit
|
||||
VMInstanceVO instance = _vmDao.findById(vm.getId());
|
||||
if (instance != null && instance.getState() == State.Running) {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("VM is already started in DB: " + vm);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (vo.getSecondsTaskIsInactive() > VmOpCancelInterval.value()) {
|
||||
s_logger.warn("The task item for vm " + vm + " has been inactive for " + vo.getSecondsTaskIsInactive());
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue