Skip to content

Commit 11c2776

Browse files
Update with proper message while migrate volume when target pool and offering type mismatches (both are not shared/local)
1 parent 1a03c3f commit 11c2776

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3653,8 +3653,11 @@ public boolean validateConditionsToReplaceDiskOfferingOfVolume(Volume volume, Di
36533653
if (newDiskOffering == null) {
36543654
return false;
36553655
}
3656-
if ((destPool.isShared() && newDiskOffering.isUseLocalStorage()) || destPool.isLocal() && newDiskOffering.isShared()) {
3657-
throw new InvalidParameterValueException("You cannot move the volume to a shared storage and assign a disk offering for local storage and vice versa.");
3656+
if (destPool.isShared() && newDiskOffering.isUseLocalStorage()) {
3657+
throw new InvalidParameterValueException("You cannot move the volume to shared storage, with the disk offering configured for local storage.");
3658+
}
3659+
if (destPool.isLocal() && newDiskOffering.isShared()) {
3660+
throw new InvalidParameterValueException("You cannot move the volume to local storage, with the disk offering configured for shared storage.");
36583661
}
36593662
if (!doesStoragePoolSupportDiskOffering(destPool, newDiskOffering)) {
36603663
throw new InvalidParameterValueException(String.format("Migration failed: target pool [%s, tags:%s] has no matching tags for volume [%s, uuid:%s, tags:%s]", destPool.getName(),

0 commit comments

Comments
 (0)