CLOUDSTACK-9831: Previous pod_id still remains in the vm_instance table after

VM migration with migrateVirtualMachineWithVolume
This commit is contained in:
Sudhansu 2017-03-13 13:14:12 +05:30
parent 9cc3ae8a94
commit 3564d30233

View File

@ -2287,8 +2287,10 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
work.setResourceId(destHostId);
work = _workDao.persist(work);
// Put the vm in migrating state.
vm.setLastHostId(srcHostId);
vm.setPodIdToDeployIn(destHost.getPodId());
moveVmToMigratingState(vm, destHostId, work);
boolean migrated = false;
@ -2365,6 +2367,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
"Migrate Command failed. Please check logs.");
try {
_agentMgr.send(destHostId, new Commands(cleanup(vm.getInstanceName())), null);
vm.setPodIdToDeployIn(srcHost.getPodId());
stateTransitTo(vm, Event.OperationFailed, srcHostId);
} catch (final AgentUnavailableException e) {
s_logger.warn("Looks like the destination Host is unavailable for cleanup.", e);