sureshanaparti commented on a change in pull request #4790:
URL: https://github.com/apache/cloudstack/pull/4790#discussion_r639445764
##########
File path: server/src/main/java/com/cloud/server/StatsCollector.java
##########
@@ -1599,10 +1621,21 @@ public String getConfigComponentName() {
@Override
public ConfigKey<?>[] getConfigKeys() {
- return new ConfigKey<?>[] {vmDiskStatsInterval,
vmDiskStatsIntervalMin, vmNetworkStatsInterval, vmNetworkStatsIntervalMin,
StatsTimeout, statsOutputUri};
+ return new ConfigKey<?>[] {vmDiskStatsInterval,
vmDiskStatsIntervalMin, vmNetworkStatsInterval, vmNetworkStatsIntervalMin,
StatsTimeout, statsOutputUri, secondaryStorageCapacityThreshold};
}
public double getImageStoreCapacityThreshold() {
- return _imageStoreCapacityThreshold;
+ double thresholdConfig = secondaryStorageCapacityThreshold.value();
+
+ if (thresholdConfig >= MIN_STORAGE_SECONDARY_CAPACITY_THRESHOLD &&
thresholdConfig <= MAX_STORAGE_SECONDARY_CAPACITY_THRESHOLD) {
+ return thresholdConfig;
+ }
+
+ s_logger.warn(String.format("Invalid [%s] configuration: value set
[%s] is [%s]. Assuming %s as secondary storage capacity threshold.",
+ secondaryStorageCapacityThreshold.key(),
+ thresholdConfig,
+ thresholdConfig <
MIN_STORAGE_SECONDARY_CAPACITY_THRESHOLD ? String.format("lower than '%s'",
MIN_STORAGE_SECONDARY_CAPACITY_THRESHOLD) : String.format("bigger than '%s'",
MAX_STORAGE_SECONDARY_CAPACITY_THRESHOLD),
+ MAX_STORAGE_SECONDARY_CAPACITY_THRESHOLD));
+ return MAX_STORAGE_SECONDARY_CAPACITY_THRESHOLD;
Review comment:
@GutoVeronezi these value limits are controlled/validated in the
configuration manager. you can add this new config to
'_weightBasedParametersForValidation_' in configuration manager. check here:
https://github.com/apache/cloudstack/blob/a0d9acec6f3926ef31430a2be0c2737b30eb5ebb/server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java#L479
you can simply return threshold config value here.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]