Skip to content

Commit f7078b5

Browse files
committed
#4378: fix NPE while migrate vm with custom offering
1 parent b6a25da commit f7078b5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5793,7 +5793,8 @@ public VirtualMachine migrateVirtualMachine(Long vmId, Host destinationHost) thr
57935793
DeployDestination dest = null;
57945794
if (destinationHost == null) {
57955795
vm.setLastHostId(null); // Last host does not have higher priority in vm migration
5796-
final VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm);
5796+
final ServiceOfferingVO offering = _offeringDao.findById(vm.getId(), vm.getServiceOfferingId());
5797+
final VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm, null, offering, null, null);
57975798
final Host host = _hostDao.findById(srcHostId);
57985799
final DataCenterDeployment plan = new DataCenterDeployment(host.getDataCenterId(), host.getPodId(), host.getClusterId(), null, null, null);
57995800
ExcludeList excludes = new ExcludeList();

0 commit comments

Comments
 (0)