server: fix NPE when migrate vm away with volumes (#13131)

This commit is contained in:
Wei Zhou 2026-06-13 07:45:01 +02:00 committed by GitHub
parent d35c1cd3ff
commit 0bbea20062
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -1464,7 +1464,7 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
*/
private void migrateAwayVmWithVolumes(HostVO host, VMInstanceVO vm) {
final DataCenterDeployment plan = new DataCenterDeployment(host.getDataCenterId(), host.getPodId(), host.getClusterId(), null, null, null);
ServiceOfferingVO offeringVO = serviceOfferingDao.findById(vm.getServiceOfferingId());
ServiceOfferingVO offeringVO = serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId());
final VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm, null, offeringVO, null, null);
plan.setMigrationPlan(true);
DeployDestination dest = getDeployDestination(vm, profile, plan, host);