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
CLOUDSTACK-9473: storage pool capacity check when volume is resized or migrated
Storage pool checker is not being called on resize and migrate volume.
This may lead to allocated percentage of storage above 100%.
Setup:
1 VMware cluster with 2 Hosts.
Executed Steps:
Applied the following global settings:
storage.overprovisioning.factor = 1
pool.storage.allocated.capacity.disablethreshold = 1
pool.storage.capacity.disablethreshold = 1
Restarted management server
Executed Resize and migrate pool and Observed that Storage pool checker is not performed on resizeVolume and migrateVolume.
Result:
Root cause analysis shows storage pool checker is not called when doing migration and resizing.
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
if (!storageMgr.storagePoolHasEnoughSpaceForResize(storagePool, currentSize, newSize)) {
1146
+
thrownewCloudRuntimeException("Storage pool " + storagePool.getName() + " does not have enough space to resize volume " + volume.getName());
1147
+
}
1140
1148
/*
1141
1149
* get a list of hosts to send the commands to, try the system the
1142
1150
* associated vm is running on first, then the last known place it ran.
@@ -2061,6 +2069,14 @@ public Volume migrateVolume(MigrateVolumeCmd cmd) {
2061
2069
thrownewInvalidParameterValueException("Cannot migrate volume " + vol + "to the destination storage pool " + destPool.getName() + " as the storage pool is in maintenance mode.");
2062
2070
}
2063
2071
2072
+
List<Volume> volumes = newArrayList<Volume>();
2073
+
volumes.add(vol);
2074
+
2075
+
//check if there is space
2076
+
if (!storageMgr.storagePoolHasEnoughSpace(volumes, destPool)) {
2077
+
thrownewCloudRuntimeException("Storage pool " + destPool.getName() + " does not have enough space to migrate volume " + vol.getName());
2078
+
}
2079
+
2064
2080
if (_volumeMgr.volumeOnSharedStoragePool(vol)) {
2065
2081
if (destPool.isLocal()) {
2066
2082
thrownewInvalidParameterValueException("Migration of volume from shared to local storage pool is not supported");
0 commit comments