From 79bdc6266535ced2412b97369db1ff2fa0c5c712 Mon Sep 17 00:00:00 2001 From: Harikrishna Patnala Date: Thu, 6 Apr 2023 13:25:17 +0530 Subject: [PATCH] Live storage migration of volume in scaleIO within same storage scaleio cluster --- .../main/java/com/cloud/vm/VirtualMachineManagerImpl.java | 3 ++- .../main/java/com/cloud/storage/VolumeApiServiceImpl.java | 8 ++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java index 1b3d914b27a..19b1cd3a747 100755 --- a/engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java @@ -212,6 +212,7 @@ import com.cloud.service.dao.ServiceOfferingDao; import com.cloud.storage.DiskOfferingVO; import com.cloud.storage.ScopeType; import com.cloud.storage.Storage.ImageFormat; +import com.cloud.storage.Storage; import com.cloud.storage.StorageManager; import com.cloud.storage.StoragePool; import com.cloud.storage.VMTemplateVO; @@ -2904,7 +2905,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac * */ protected void executeManagedStorageChecksWhenTargetStoragePoolProvided(StoragePoolVO currentPool, VolumeVO volume, StoragePoolVO targetPool) { - if (!currentPool.isManaged()) { + if (!currentPool.isManaged() || currentPool.getPoolType().equals(Storage.StoragePoolType.PowerFlex)) { return; } if (currentPool.getId() == targetPool.getId()) { diff --git a/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java index 6f9629f5f4a..87af524d0f7 100644 --- a/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java +++ b/server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java @@ -2983,11 +2983,6 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic throw new InvalidParameterValueException("Live Migration of GPU enabled VM is not supported"); } - StoragePoolVO storagePoolVO = _storagePoolDao.findById(vol.getPoolId()); - if (storagePoolVO.getPoolType() == Storage.StoragePoolType.PowerFlex) { - throw new InvalidParameterValueException("Migrate volume of a running VM is unsupported on storage pool type " + storagePoolVO.getPoolType()); - } - // Check if the underlying hypervisor supports storage motion. Long hostId = vm.getHostId(); if (hostId != null) { @@ -3002,7 +2997,8 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic liveMigrateVolume = capabilities.isStorageMotionSupported(); } - if (liveMigrateVolume && HypervisorType.KVM.equals(host.getHypervisorType())) { + StoragePoolVO storagePoolVO = _storagePoolDao.findById(vol.getPoolId()); + if (liveMigrateVolume && HypervisorType.KVM.equals(host.getHypervisorType()) && !storagePoolVO.getPoolType().equals(Storage.StoragePoolType.PowerFlex)) { StoragePoolVO destinationStoragePoolVo = _storagePoolDao.findById(storagePoolId); if (isSourceOrDestNotOnStorPool(storagePoolVO, destinationStoragePoolVo)) {