Merge pull request #1997 from Accelerite/vmpoweroff

CLOUDSTACK-9208: Assertion Error in VM_POWER_STATE handler- Fixed
This commit is contained in:
Rajani Karuturi 2017-05-02 11:06:15 +05:30 committed by GitHub
commit 0ca2841b5e
1 changed files with 4 additions and 1 deletions

View File

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