Skip to content

Commit 56241d3

Browse files
committed
Ensure details are set only for zone-wide Solidfire storage pools
1 parent 8b0b163 commit 56241d3

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1562,7 +1562,8 @@ private Map<String, String> getDetails(VolumeInfo volumeInfo, DataStore dataStor
15621562
}
15631563

15641564
// Zone wide storage Solidfire inter-cluster VM migrations needs the destination host mount the LUN before migrating
1565-
if (storagePool.isManaged() && storagePool.getScope() != null && ScopeType.ZONE == storagePool.getScope()) {
1565+
if (storagePool.isManaged() && ScopeType.ZONE.equals(storagePool.getScope()) &&
1566+
isCleanupNeededOnOriginHostAfterInterClusterMigration(dataStore)) {
15661567
details.put(DiskTO.SCOPE, storagePool.getScope().name());
15671568
if (vmProfile.getHostId() != null && srcHostId != null) {
15681569
HostVO host = _hostDao.findById(vmProfile.getHostId());
@@ -1575,6 +1576,18 @@ private Map<String, String> getDetails(VolumeInfo volumeInfo, DataStore dataStor
15751576
return details;
15761577
}
15771578

1579+
private boolean isCleanupNeededOnOriginHostAfterInterClusterMigration(DataStore dataStore) {
1580+
if (dataStore == null || dataStore.getDriver() == null) {
1581+
return false;
1582+
}
1583+
1584+
DataStoreDriver driver = dataStore.getDriver();
1585+
if (driver instanceof PrimaryDataStoreDriver) {
1586+
return ((PrimaryDataStoreDriver)driver).zoneWideVolumesDatastoreCleanupOnOriginHostAfterInterClusterMigration();
1587+
}
1588+
return false;
1589+
}
1590+
15781591
private void setIoDriverPolicy(Map<String, String> details, StoragePoolVO storagePool, VolumeVO volume) {
15791592
if (volume.getInstanceId() != null) {
15801593
UserVmDetailVO ioDriverPolicy = userVmDetailsDao.findDetail(volume.getInstanceId(),

0 commit comments

Comments
 (0)