Skip to content

Commit 96c9494

Browse files
committed
Fix error message while creating local storage pool
1 parent 56dc119 commit 96c9494

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,10 @@ public PrimaryDataStoreInfo createPool(CreateStoragePoolCmd cmd) throws Resource
10171017
if (Grouping.AllocationState.Disabled == zone.getAllocationState() && !_accountMgr.isRootAdmin(account.getId())) {
10181018
throw new PermissionDeniedException(String.format("Cannot perform this operation, Zone is currently disabled: %s", zone));
10191019
}
1020+
// Check if it's local storage and if it's enabled on the zone
1021+
if (isFileScheme && !zone.isLocalStorageEnabled()) {
1022+
throw new InvalidParameterValueException("Local storage is not enabled for zone: " + zone);
1023+
}
10201024

10211025
managementService.checkJsInterpretationAllowedIfNeededForParameterValue(ApiConstants.IS_TAG_A_RULE,
10221026
Boolean.TRUE.equals(cmd.isTagARule()));

0 commit comments

Comments
 (0)