Skip to content

Commit 0afa9cf

Browse files
committed
Address Suresh's comments
1 parent 97a64ab commit 0afa9cf

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

engine/components-api/src/main/java/com/cloud/capacity/CapacityManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public interface CapacityManager {
124124
ConfigKey.CATEGORY_ALERT,
125125
Double.class,
126126
StorageAllocatedCapacityDisableThresholdForVolumeResizeCK,
127-
"0.85",
127+
"0.90",
128128
"Percentage (as a value between 0 and 1) of allocated storage utilization above which allocators will disable using the pool for volume resize. " +
129129
"This is applicable only when volume.resize.allowed.beyond.allocation is set to true.",
130130
true,

engine/components-api/src/main/java/com/cloud/storage/StorageManager.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,9 @@ public interface StorageManager extends StorageService {
209209
ConfigKey<Long> HEURISTICS_SCRIPT_TIMEOUT = new ConfigKey<>("Advanced", Long.class, "heuristics.script.timeout", "3000",
210210
"The maximum runtime, in milliseconds, to execute the heuristic rule; if it is reached, a timeout will happen.", true);
211211

212-
ConfigKey<Boolean> AllowVolumeReSizeBeyongAllocation = new ConfigKey<Boolean>("Advanced", Boolean.class, "volume.resize.allowed.beyond.allocation", "false",
213-
"Determines whether volume size can exceed the pool capacity allocation disable threshold (pool.storage.allocated.capacity.disablethreshold) when resize a volume",
212+
ConfigKey<Boolean> AllowVolumeReSizeBeyondAllocation = new ConfigKey<Boolean>("Advanced", Boolean.class, "volume.resize.allowed.beyond.allocation", "false",
213+
"Determines whether volume size can exceed the pool capacity allocation disable threshold (pool.storage.allocated.capacity.disablethreshold) " +
214+
"when resize a volume upto resize capacity disable threshold (pool.storage.allocated.resize.capacity.disablethreshold)",
214215
true, ConfigKey.Scope.Zone);
215216

216217
/**

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3202,8 +3202,11 @@ protected boolean checkPoolforSpace(StoragePool pool, long allocatedSizeWithTemp
32023202
logger.debug("Insufficient un-allocated capacity on: " + pool.getId() + " for storage allocation since its allocated percentage: " + usedPercentage
32033203
+ " has crossed the allocated pool.storage.allocated.capacity.disablethreshold: " + storageAllocatedThreshold);
32043204
}
3205-
if (!AllowVolumeReSizeBeyongAllocation.valueIn(pool.getId())) {
3206-
logger.debug(String.format("Skipping the pool %s as %s is false", pool, AllowVolumeReSizeBeyongAllocation.key()));
3205+
if (!forVolumeResize) {
3206+
return false;
3207+
}
3208+
if (!AllowVolumeReSizeBeyondAllocation.valueIn(pool.getDataCenterId())) {
3209+
s_logger.debug(String.format("Skipping the pool %s as %s is false", pool, AllowVolumeReSizeBeyondAllocation.key()));
32073210
return false;
32083211
}
32093212

@@ -4064,7 +4067,7 @@ public ConfigKey<?>[] getConfigKeys() {
40644067
VmwareCreateCloneFull,
40654068
VmwareAllowParallelExecution,
40664069
DataStoreDownloadFollowRedirects,
4067-
AllowVolumeReSizeBeyongAllocation
4070+
AllowVolumeReSizeBeyondAllocation
40684071
};
40694072
}
40704073

0 commit comments

Comments
 (0)