mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
set pod after migration (#5972)
Co-authored-by: Daan Hoogland <dahn@onecht.net>
This commit is contained in:
parent
5297b52d98
commit
8db598bc0f
@ -2849,6 +2849,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
|||||||
_networkMgr.commitNicForMigration(vmSrc, profile);
|
_networkMgr.commitNicForMigration(vmSrc, profile);
|
||||||
volumeMgr.release(vm.getId(), srcHostId);
|
volumeMgr.release(vm.getId(), srcHostId);
|
||||||
_networkMgr.setHypervisorHostname(profile, dest, true);
|
_networkMgr.setHypervisorHostname(profile, dest, true);
|
||||||
|
|
||||||
|
updateVmPod(vm, dstHostId);
|
||||||
}
|
}
|
||||||
|
|
||||||
work.setStep(Step.Done);
|
work.setStep(Step.Done);
|
||||||
@ -2856,6 +2858,14 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateVmPod(VMInstanceVO vm, long dstHostId) {
|
||||||
|
// update the VMs pod
|
||||||
|
HostVO host = _hostDao.findById(dstHostId);
|
||||||
|
VMInstanceVO newVm = _vmDao.findById(vm.getId());
|
||||||
|
newVm.setPodIdToDeployIn(host.getPodId());
|
||||||
|
_vmDao.persist(newVm);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We create the mapping of volumes and storage pool to migrate the VMs according to the information sent by the user.
|
* We create the mapping of volumes and storage pool to migrate the VMs according to the information sent by the user.
|
||||||
* If the user did not enter a complete mapping, the volumes that were left behind will be auto mapped using {@link #createStoragePoolMappingsForVolumes(VirtualMachineProfile, DataCenterDeployment, Map, List)}
|
* If the user did not enter a complete mapping, the volumes that were left behind will be auto mapped using {@link #createStoragePoolMappingsForVolumes(VirtualMachineProfile, DataCenterDeployment, Map, List)}
|
||||||
@ -4583,6 +4593,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_networkMgr.setHypervisorHostname(profile, dest, true);
|
_networkMgr.setHypervisorHostname(profile, dest, true);
|
||||||
|
|
||||||
|
updateVmPod(vm, dstHostId);
|
||||||
}
|
}
|
||||||
|
|
||||||
work.setStep(Step.Done);
|
work.setStep(Step.Done);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user