Skip to content

Commit 6dd2ebe

Browse files
authored
Merge pull request #2002 from sudhansu7/CLOUDSTACK-9831
CLOUDSTACK-9831: Previous pod_id still remains in the vm_instance table
2 parents 172a54d + 3564d30 commit 6dd2ebe

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
@@ -2298,8 +2298,10 @@ private void orchestrateMigrateWithStorage(final String vmUuid, final long srcHo
22982298
work.setResourceId(destHostId);
22992299
work = _workDao.persist(work);
23002300

2301+
23012302
// Put the vm in migrating state.
23022303
vm.setLastHostId(srcHostId);
2304+
vm.setPodIdToDeployIn(destHost.getPodId());
23032305
moveVmToMigratingState(vm, destHostId, work);
23042306

23052307
boolean migrated = false;
@@ -2376,6 +2378,7 @@ private void orchestrateMigrateWithStorage(final String vmUuid, final long srcHo
23762378
"Migrate Command failed. Please check logs.");
23772379
try {
23782380
_agentMgr.send(destHostId, new Commands(cleanup(vm.getInstanceName())), null);
2381+
vm.setPodIdToDeployIn(srcHost.getPodId());
23792382
stateTransitTo(vm, Event.OperationFailed, srcHostId);
23802383
} catch (final AgentUnavailableException e) {
23812384
s_logger.warn("Looks like the destination Host is unavailable for cleanup.", e);

0 commit comments

Comments
 (0)