mirror of https://github.com/apache/cloudstack.git
propagating fix from 2.2.4
This commit is contained in:
parent
b2cf4e39ea
commit
7bc25643a9
|
|
@ -1822,6 +1822,7 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, ResourceS
|
|||
HostVO host = _hostDao.findById(id);
|
||||
if (!_hostDao.directConnect(host, _nodeId)) {
|
||||
s_logger.info("Someone else is loading " + host);
|
||||
resource.disconnected();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -700,7 +700,7 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
|
|||
} catch (OperationTimedoutException e) {
|
||||
s_logger.debug("Unable to send the start command to host " + dest.getHost());
|
||||
if (e.isActive()) {
|
||||
_haMgr.scheduleStop(vm, destHostId, WorkType.ForceStop);
|
||||
_haMgr.scheduleStop(vm, destHostId, WorkType.CheckStop);
|
||||
}
|
||||
canRetry = false;
|
||||
throw new AgentUnavailableException("Unable to start " + vm.getHostName(), destHostId, e);
|
||||
|
|
@ -734,12 +734,14 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
|
|||
}
|
||||
}
|
||||
} finally {
|
||||
if (startedVm == null && canRetry) {
|
||||
// decrement only for user VM's and newly created VM
|
||||
if (vm.getType().equals(VirtualMachine.Type.User) && (vm.getLastHostId() == null)) {
|
||||
if (startedVm == null) {
|
||||
// decrement only for user VM's and newly created VM
|
||||
if (vm.getType().equals(VirtualMachine.Type.User) && (vm.getLastHostId() == null)) {
|
||||
_accountMgr.decrementResourceCount(vm.getAccountId(), ResourceType.user_vm);
|
||||
}
|
||||
changeState(vm, Event.OperationFailed, null, work, Step.Done);
|
||||
if (canRetry) {
|
||||
changeState(vm, Event.OperationFailed, null, work, Step.Done);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue