Damans227 commented on code in PR #9564:
URL: https://github.com/apache/cloudstack/pull/9564#discussion_r4446538923
##########
engine/components-api/src/main/java/com/cloud/storage/StorageManager.java:
##########
@@ -447,4 +451,25 @@ void connectHostsToPool(DataStore primaryStore, List<Long>
hostIds, Scope scope,
static ConfigKey<Boolean> getMountDisabledStoragePool() {
return MountDisabledStoragePool;
}
+
+ /**
+ * Resolves the preferred storage pool UUID, checking the Account scope
first, then the Cluster scope and finally the Global value.
+ * @return a pair of the scope where the value was found and the storage
pool UUID, or null if it is not set at any level
+ */
+ static Pair<ConfigKey.Scope, String> getPreferredStoragePoolUuid(Long
accountId, Long clusterId) {
+ if (accountId != null) {
+ String uuid =
PreferredStoragePool.valueInScope(ConfigKey.Scope.Account, accountId, true);
+ if (StringUtils.isNotBlank(uuid)) {
+ return new Pair<>(ConfigKey.Scope.Account, uuid);
Review Comment:
@nvazquez fine to move the cluster and domain fallback to a follow up, those
are new. can we keep the global fallback here though? main still tries the
global pool when the account pool isnt usable, so this would break setups that
rely on it today
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]