This is an automated email from the ASF dual-hosted git repository.
weizhouapache pushed a commit to branch 4.20
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.20 by this push:
new 0bbea200626 server: fix NPE when migrate vm away with volumes (#13131)
0bbea200626 is described below
commit 0bbea20062654d4b634e5aef4b41bbd33746faf3
Author: Wei Zhou <[email protected]>
AuthorDate: Sat Jun 13 07:45:01 2026 +0200
server: fix NPE when migrate vm away with volumes (#13131)
---
server/src/main/java/com/cloud/resource/ResourceManagerImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
b/server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
index cc789bf5650..6e78e3bea83 100755
--- a/server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
@@ -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);