Skip to content
Merged
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)) {
throw new InvalidParameterValueException(String.format("Storage pool %s does not have enough space to create volume %s.",
Comment thread
sp16743 marked this conversation as resolved.
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