Skip to content

Commit 3564d30

Browse files
author
Sudhansu
committed
CLOUDSTACK-9831: Previous pod_id still remains in the vm_instance table after
VM migration with migrateVirtualMachineWithVolume
1 parent 9cc3ae8 commit 3564d30

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2287,8 +2287,10 @@ private void orchestrateMigrateWithStorage(final String vmUuid, final long srcHo
22872287
work.setResourceId(destHostId);
22882288
work = _workDao.persist(work);
22892289

2290+
22902291
// Put the vm in migrating state.
22912292
vm.setLastHostId(srcHostId);
2293+
vm.setPodIdToDeployIn(destHost.getPodId());
22922294
moveVmToMigratingState(vm, destHostId, work);
22932295

22942296
boolean migrated = false;
@@ -2365,6 +2367,7 @@ private void orchestrateMigrateWithStorage(final String vmUuid, final long srcHo
23652367
"Migrate Command failed. Please check logs.");
23662368
try {
23672369
_agentMgr.send(destHostId, new Commands(cleanup(vm.getInstanceName())), null);
2370+
vm.setPodIdToDeployIn(srcHost.getPodId());
23682371
stateTransitTo(vm, Event.OperationFailed, srcHostId);
23692372
} catch (final AgentUnavailableException e) {
23702373
s_logger.warn("Looks like the destination Host is unavailable for cleanup.", e);

0 commit comments

Comments
 (0)