mirror of https://github.com/apache/cloudstack.git
bug 11019: Let VM sync to coordinate with possible VM-relocation under VMware when VM is in starting time
This commit is contained in:
parent
258a1bc451
commit
bbf20ac125
|
|
@ -1554,11 +1554,17 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
|
|||
}
|
||||
|
||||
if(trackExternalChange) {
|
||||
if(vm.getHostId() == null || hostId != vm.getHostId()) {
|
||||
try {
|
||||
stateTransitTo(vm, VirtualMachine.Event.AgentReportMigrated, hostId);
|
||||
} catch (NoTransitionException e) {
|
||||
s_logger.warn(e.getMessage());
|
||||
if(serverState == State.Starting) {
|
||||
if(vm.getHostId() != null && vm.getHostId() != hostId) {
|
||||
s_logger.info("CloudStack is starting VM on host " + vm.getHostId() + ", but status report comes from a different host " + hostId + ", skip status sync for vm: " + vm.getInstanceName());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if(vm.getHostId() == null || hostId != vm.getHostId()) {
|
||||
try {
|
||||
stateTransitTo(vm, VirtualMachine.Event.AgentReportMigrated, hostId);
|
||||
} catch (NoTransitionException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue