CLOUDSTACK-9208: Assertion Error in VM_POWER_STATE handler- Fixed

This commit is contained in:
Jayapal 2017-03-09 16:00:16 +05:30
parent 850c07cc8a
commit d7eae25322
1 changed files with 4 additions and 1 deletions

View File

@ -1280,7 +1280,10 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
final VirtualMachine vm = profile.getVirtualMachine();
final StopCommand stop = new StopCommand(vm, getExecuteInSequence(vm.getHypervisorType()), checkBeforeCleanup);
try {
final Answer answer = _agentMgr.send(vm.getHostId(), stop);
Answer answer = null;
if(vm.getHostId() != null) {
answer = _agentMgr.send(vm.getHostId(), stop);
}
if (answer != null && answer instanceof StopAnswer) {
final StopAnswer stopAns = (StopAnswer)answer;
if (vm.getType() == VirtualMachine.Type.User) {