From 330e8e6e9d5d83801324d0785bdb3bf911c2a455 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Sun, 17 Oct 2021 06:54:41 +0530 Subject: [PATCH] vmware: fix NPE for volume migration CLUSTER to ZONE-wide pool (#5582) Scope type of source pool is passed in the method, incorrectly, instead of the target pool. Signed-off-by: Abhishek Kumar --- .../cloudstack/storage/motion/VmwareStorageMotionStrategy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/hypervisors/vmware/src/main/java/org/apache/cloudstack/storage/motion/VmwareStorageMotionStrategy.java b/plugins/hypervisors/vmware/src/main/java/org/apache/cloudstack/storage/motion/VmwareStorageMotionStrategy.java index 04111bc3b6be..2793e02be63f 100644 --- a/plugins/hypervisors/vmware/src/main/java/org/apache/cloudstack/storage/motion/VmwareStorageMotionStrategy.java +++ b/plugins/hypervisors/vmware/src/main/java/org/apache/cloudstack/storage/motion/VmwareStorageMotionStrategy.java @@ -179,7 +179,7 @@ private Pair getHostIdForVmAndHostGuidInTargetClusterForWorkerVm(S if (hostId == null) { throw new CloudRuntimeException("Offline Migration failed, unable to find suitable host for worker VM placement in the cluster of storage pool: " + sourcePool.getName()); } - hostGuidInTargetCluster = getHostGuidInTargetCluster(sourcePool.getClusterId(), targetPool, sourceScopeType); + hostGuidInTargetCluster = getHostGuidInTargetCluster(sourcePool.getClusterId(), targetPool, targetScopeType); } else if (ScopeType.CLUSTER.equals(targetScopeType)) { hostId = findSuitableHostIdForWorkerVmPlacement(targetPool.getClusterId()); if (hostId == null) {