mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
return more meaningful error message for create snapshot/snapshot policy for volume which is not attached to a VM
This commit is contained in:
parent
d8273c7feb
commit
4fb3beed76
@ -983,7 +983,7 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
|
||||
|
||||
StoragePoolVO storagePoolVO = _storagePoolDao.findById(volume.getPoolId());
|
||||
if (storagePoolVO == null) {
|
||||
throw new InvalidParameterValueException("Failed to create snapshot policy, volumeId: " + volumeId + " does not have a valid storage pool. Is it destroyed?");
|
||||
throw new InvalidParameterValueException("volumeId: " + volumeId + " please attach this volume to a VM before create snapshot policy for it");
|
||||
}
|
||||
if (storagePoolVO.isLocal()) {
|
||||
throw new InvalidParameterValueException("Failed to create snapshot policy, cannot create a snapshot from a volume residing on a local storage pool, poolId: " + volume.getPoolId());
|
||||
@ -1170,7 +1170,7 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
|
||||
}
|
||||
StoragePoolVO storagePoolVO = _storagePoolDao.findById(volume.getPoolId());
|
||||
if (storagePoolVO == null) {
|
||||
throw new InvalidParameterValueException("VolumeId: " + volumeId + " does not have a valid storage pool. Is it destroyed?");
|
||||
throw new InvalidParameterValueException("VolumeId: " + volumeId + " please attach this volume to a VM before create snapshot for it");
|
||||
}
|
||||
// Determine the name for this snapshot
|
||||
// Snapshot Name: VMInstancename + volumeName + timeString
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user