You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Checks if the target storage supports the disk offering.
136
+
* Checks if the storage pool supports the disk offering tags.
137
137
* This validation is consistent with the mechanism used to select a storage pool to deploy a volume when a virtual machine is deployed or when a data disk is allocated.
138
138
*
139
139
* The scenarios when this method returns true or false is presented in the following table.
140
140
* <table border="1">
141
141
* <tr>
142
-
* <th>#</th><th>Disk offering tags</th><th>Storage tags</th><th>Does the storage support the disk offering?</th>
142
+
* <th>#</th><th>Disk offering diskOfferingTags</th><th>Storage diskOfferingTags</th><th>Does the storage support the disk offering?</th>
143
143
* </tr>
144
144
* <body>
145
145
* <tr>
@@ -163,7 +163,7 @@ Snapshot takeSnapshot(Long volumeId, Long policyId, Long snapshotId, Account acc
if ((destPool.isShared() && newDiskOffering.isUseLocalStorage()) || destPool.isLocal() && newDiskOffering.isShared()) {
3520
3520
thrownewInvalidParameterValueException("You cannot move the volume to a shared storage and assign a disk offering for local storage and vice versa.");
3521
3521
}
3522
-
if (!doesTargetStorageSupportDiskOffering(destPool, newDiskOffering)) {
3522
+
if (!doesStoragePoolSupportDiskOffering(destPool, newDiskOffering)) {
3523
3523
thrownewInvalidParameterValueException(String.format("Migration failed: target pool [%s, tags:%s] has no matching tags for volume [%s, uuid:%s, tags:%s]", destPool.getName(),
* Checks if the target storage supports the new disk offering.
3549
+
* Checks if the storage pool supports the new disk offering.
3550
3550
* This validation is consistent with the mechanism used to select a storage pool to deploy a volume when a virtual machine is deployed or when a new data disk is allocated.
3551
3551
*
3552
3552
* The scenarios when this method returns true or false is presented in the following table.
if ((storagePoolTags == null || !storagePoolTags.second()) && org.apache.commons.lang.StringUtils.isBlank(diskOfferingTags)) {
3601
3601
if (storagePoolTags == null) {
3602
-
s_logger.debug(String.format("Destination storage pool [%s] does not have any tags, and so does the disk offering. Therefore, they are compatible", destPool.getUuid()));
3602
+
s_logger.debug(String.format("Storage pool [%s] does not have any tags, and so does the disk offering. Therefore, they are compatible", destPool.getUuid()));
3603
3603
} else {
3604
-
s_logger.debug("Destination storage pool has tags [%s], and the disk offering has no tags. Therefore, they are compatible.");
3604
+
s_logger.debug("Storage pool has tags [%s], and the disk offering has no tags. Therefore, they are compatible.");
3605
3605
}
3606
3606
returntrue;
3607
3607
}
3608
3608
if (storagePoolTags == null || CollectionUtils.isEmpty(storagePoolTags.first())) {
3609
-
s_logger.debug(String.format("Destination storage pool [%s] has no tags, while disk offering has tags [%s]. Therefore, they are not compatible", destPool.getUuid(),
3609
+
s_logger.debug(String.format("Storage pool [%s] has no tags, while disk offering has tags [%s]. Therefore, they are not compatible", destPool.getUuid(),
3610
3610
diskOfferingTags));
3611
3611
returnfalse;
3612
3612
}
@@ -3619,7 +3619,7 @@ public boolean doesTargetStorageSupportDiskOffering(StoragePool destPool, String
3619
3619
} else {
3620
3620
result = CollectionUtils.isSubCollection(Arrays.asList(newDiskOfferingTagsAsStringArray), storageTagsList);
if (!volumeApiService.doesTargetStorageSupportDiskOffering(pool, diskOffering.getTags())) {
208
+
if (!volumeApiService.doesStoragePoolSupportDiskOfferingTags(pool, diskOffering.getTags())) {
209
209
logFailureAndThrowException(String.format("Disk offering: %s storage tags are not compatible with selected storage pool: %s", diskOffering.getUuid(), pool.getUuid()));
Stringmsg = String.format("Cannot find disk offering with ID %s that belongs to the service offering %s", serviceOffering.getDiskOfferingId(), serviceOffering.getName());
2031
+
LOGGER.error(msg);
2032
+
thrownewCloudRuntimeException(msg);
2033
+
}
2034
+
if (getStoragePoolWithTags(pools, diskOffering.getTags()) == null) {
2035
+
Stringmsg = String.format("Cannot find suitable storage pool for disk offering %s that belongs to the service offering %s", diskOffering.getName(), serviceOffering.getName());
2036
+
LOGGER.error(msg);
2037
+
thrownewCloudRuntimeException(msg);
2038
+
}
2039
+
}
2022
2040
for (LongdiskOfferingId : dataDiskOfferingMap.values()) {
0 commit comments