CS-13376- Vm is stuck in Stopping state when MS is rebooted after the stop command was issued, but answer wasn't recieved from the backend yet

This commit is contained in:
Pranav Saxena 2012-07-05 11:24:24 +05:30
parent a4740b314f
commit c6448d0e8e
1 changed files with 3 additions and 6 deletions

View File

@ -1815,15 +1815,12 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
}
}
}
else if(info == null && vm.getState() == State.Stopping) { //Handling CS-13376
Host host = _hostDao.findByGuid(info.getHosUuid());
if(host != null ){
s_logger.warn("Marking the VM as Stopped as it was still stopping on the CS" +info.name);
else if(info == null && vm.getState() == State.Stopping) { //Handling CS-13376
s_logger.warn("Marking the VM as Stopped as it was still stopping on the CS" +vm.getName());
vm.setState(State.Stopped); // Setting the VM as stopped on the DB and clearing it from the host
vm.setLastHostId(vm.getHostId());
vm.setHostId(null);
vm.setLastHostId(host.getId());
_vmDao.persist(vm);
}
}
}