bug 11019: Let VM sync to coordinate with possible VM-relocation under VMware when VM is in starting time

This commit is contained in:
Kelven Yang 2011-08-11 14:28:32 -07:00
parent ac62f290d3
commit 9e1ee30ea3

View File

@ -1557,6 +1557,13 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
}
if(trackExternalChange) {
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);