mirror of https://github.com/apache/cloudstack.git
HA manager to check target state of the VM to make decisions on whether or not to carry on a cheduled step. Fix NPE in capacity manager when releasing capacity of a stopped VM.
This commit is contained in:
parent
3d5fbe7073
commit
4312d88462
|
|
@ -188,6 +188,11 @@ public class CapacityManagerImpl extends ManagerBase implements CapacityManager,
|
|||
Long clusterId = null;
|
||||
if (hostId != null) {
|
||||
HostVO host = _hostDao.findById(hostId);
|
||||
if (host == null) {
|
||||
s_logger.warn("Host " + hostId + " no long exist anymore!");
|
||||
return true;
|
||||
}
|
||||
|
||||
clusterId = host.getClusterId();
|
||||
}
|
||||
if (capacityCpu == null || capacityMemory == null || svo == null) {
|
||||
|
|
|
|||
|
|
@ -701,6 +701,7 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai
|
|||
(vm.getHostId() != null ? vm.getHostId() : "none") + " State: " + vm.getState());
|
||||
return null;
|
||||
}
|
||||
|
||||
_itMgr.advanceStop(vm.getUuid(), false);
|
||||
s_logger.info("Stop for " + vm + " was successful");
|
||||
return null;
|
||||
|
|
@ -711,6 +712,7 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai
|
|||
(vm.getHostId() != null ? vm.getHostId() : "none") + " State: " + vm.getState());
|
||||
return null;
|
||||
}
|
||||
|
||||
_itMgr.advanceStop(vm.getUuid(), true);
|
||||
s_logger.info("Stop for " + vm + " was successful");
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue