mirror of https://github.com/apache/cloudstack.git
bug 11263: only update host Id when VM is in running state when detected external VM migration
This commit is contained in:
parent
de4e5ea02f
commit
bf814aeadd
|
|
@ -1577,13 +1577,20 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
|
|||
}
|
||||
}
|
||||
|
||||
if(vm.getHostId() == null || hostId != vm.getHostId()) {
|
||||
if(serverState == State.Running) {
|
||||
try {
|
||||
stateTransitTo(vm, VirtualMachine.Event.AgentReportMigrated, hostId);
|
||||
if(hostId != vm.getHostId()) {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("detected host change when VM " + vm + " is at running state, VM could be live-migrated externally from host "
|
||||
+ vm.getHostId() + " to host " + hostId);
|
||||
}
|
||||
|
||||
stateTransitTo(vm, VirtualMachine.Event.AgentReportMigrated, hostId);
|
||||
}
|
||||
} catch (NoTransitionException e) {
|
||||
s_logger.warn(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (agentState == serverState) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue