Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,11 @@ private VolumeVO createVolumeOnStoragePool(Long volumeId, Long storageId) throws
throw new InvalidParameterValueException(String.format("Disk offering: %s is not compatible with the storage pool", diskOffering.getUuid()));
}

if (!storageMgr.storagePoolHasEnoughSpace(volume.getSize(), storagePool)) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this also check how full the pool really is on disk? the other space checks look at that too, but this one only counts space already handed out

throw new InvalidParameterValueException(String.format("Storage pool %s does not have enough space to create volume %s.",
storagePool.getName(), volume.getUuid()));
}

DataStore dataStore = dataStoreMgr.getDataStore(storageId, DataStoreRole.Primary);
VolumeInfo volumeInfo = volFactory.getVolume(volumeId, dataStore);
AsyncCallFuture<VolumeApiResult> createVolumeFuture = volService.createVolumeAsync(volumeInfo, dataStore);
Expand Down
Loading