CLOUDSTACK-9208: Assertion Error in VM_POWER_STATE handler- Fixed

(cherry picked from commit d7eae25322)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Jayapal 2017-03-09 16:00:16 +05:30 committed by Rohit Yadav
parent ad5ec66b0d
commit 765ab549ca
1 changed files with 4 additions and 1 deletions

View File

@ -1273,7 +1273,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) {