CLOUDSTACK-4941:

Adding the missing file
During HA and maintenance call different planners (if the original planners are not able to find capacity) which skip some heurestics
This commit is contained in:
Nitin Mehta 2013-12-18 20:26:51 -08:00
parent 15403a1f29
commit d2f194064d
1 changed files with 5 additions and 8 deletions

View File

@ -551,18 +551,15 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai
params.put(VirtualMachineProfile.Param.HaTag, _haTag);
}
// First try starting the vm with its original planner, if it doesn't succeed send HAPlanner as its an emergency.
_itMgr.advanceStart(vm.getUuid(), params, null);
VMInstanceVO started = _instanceDao.findById(vm.getId());
if (started != null && started.getState() == VirtualMachine.State.Running) {
s_logger.info("VM is now restarted: " + vmId + " on " + started.getHostId());
return null;
}else {
try{
// First try starting the vm with its original planner, if it doesn't succeed send HAPlanner as its an emergency.
_itMgr.advanceStart(vm.getUuid(), params, null);
}catch (InsufficientCapacityException e){
s_logger.warn("Failed to deploy vm " + vmId + " with original planner, sending HAPlanner");
_itMgr.advanceStart(vm.getUuid(), params, _haPlanners.get(0));
}
started = _instanceDao.findById(vm.getId());
VMInstanceVO started = _instanceDao.findById(vm.getId());
if (started != null && started.getState() == VirtualMachine.State.Running) {
s_logger.info("VM is now restarted: " + vmId + " on " + started.getHostId());
return null;