This is an automated email from the ASF dual-hosted git repository.
sureshanaparti pushed a commit to branch 4.19
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.19 by this push:
new 32cc1d46a5c Copy on pool host when storage pool has ScopeType.HOST
(#9356)
32cc1d46a5c is described below
commit 32cc1d46a5c25adfae2e31aba463528672cd285b
Author: Rene Glover <[email protected]>
AuthorDate: Wed Jul 10 02:00:47 2024 -0500
Copy on pool host when storage pool has ScopeType.HOST (#9356)
---
.../storage/motion/StorageSystemDataMotionStrategy.java | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git
a/engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
b/engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
index f3e6049c792..c83d52c3d2b 100644
---
a/engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
+++
b/engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
@@ -103,6 +103,7 @@ import com.cloud.resource.ResourceState;
import com.cloud.storage.DataStoreRole;
import com.cloud.storage.DiskOfferingVO;
import com.cloud.storage.MigrationOptions;
+import com.cloud.storage.ScopeType;
import com.cloud.storage.Snapshot;
import com.cloud.storage.SnapshotVO;
import com.cloud.storage.Storage;
@@ -921,11 +922,17 @@ public class StorageSystemDataMotionStrategy implements
DataMotionStrategy {
HostVO hostVO;
- if (srcStoragePoolVO.getClusterId() != null) {
- hostVO = getHostInCluster(srcStoragePoolVO.getClusterId());
- }
- else {
- hostVO = getHost(destVolumeInfo.getDataCenterId(),
HypervisorType.KVM, false);
+ // if either source or destination is a HOST-scoped storage pool, the
migration MUST be performed on that host
+ if
(ScopeType.HOST.equals(srcVolumeInfo.getDataStore().getScope().getScopeType()))
{
+ hostVO =
_hostDao.findById(srcVolumeInfo.getDataStore().getScope().getScopeId());
+ } else if
(ScopeType.HOST.equals(destVolumeInfo.getDataStore().getScope().getScopeType()))
{
+ hostVO =
_hostDao.findById(destVolumeInfo.getDataStore().getScope().getScopeId());
+ } else {
+ if (srcStoragePoolVO.getClusterId() != null) {
+ hostVO = getHostInCluster(srcStoragePoolVO.getClusterId());
+ } else {
+ hostVO = getHost(destVolumeInfo.getDataCenterId(),
HypervisorType.KVM, false);
+ }
}
return hostVO;