mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-741 - Making storage disable thresholds configurable at zone level.
This commit is contained in:
parent
e091f43182
commit
807ad0a39a
|
|
@ -61,8 +61,8 @@ public enum Config {
|
|||
VlanCapacityThreshold("Alert", ManagementServer.class, Float.class, "zone.vlan.capacity.notificationthreshold", "0.75", "Percentage (as a value between 0 and 1) of Zone Vlan utilization above which alerts will be sent about low number of Zone Vlans.", null),
|
||||
DirectNetworkPublicIpCapacityThreshold("Alert", ManagementServer.class, Float.class, "zone.directnetwork.publicip.capacity.notificationthreshold", "0.75", "Percentage (as a value between 0 and 1) of Direct Network Public Ip Utilization above which alerts will be sent about low number of direct network public ips.", null),
|
||||
LocalStorageCapacityThreshold("Alert", ManagementServer.class, Float.class, "cluster.localStorage.capacity.notificationthreshold", "0.75", "Percentage (as a value between 0 and 1) of local storage utilization above which alerts will be sent about low local storage available.", null),
|
||||
StorageAllocatedCapacityDisableThreshold("Alert", ManagementServer.class, Float.class, "pool.storage.allocated.capacity.disablethreshold", "0.85", "Percentage (as a value between 0 and 1) of allocated storage utilization above which allocators will disable using the pool for low allocated storage available.", null),
|
||||
StorageCapacityDisableThreshold("Alert", ManagementServer.class, Float.class, "pool.storage.capacity.disablethreshold", "0.85", "Percentage (as a value between 0 and 1) of storage utilization above which allocators will disable using the pool for low storage available.", null),
|
||||
StorageAllocatedCapacityDisableThreshold("Alert", ManagementServer.class, Float.class, "pool.storage.allocated.capacity.disablethreshold", "0.85", "Percentage (as a value between 0 and 1) of allocated storage utilization above which allocators will disable using the pool for low allocated storage available.", null, ConfigurationParameterScope.zone.toString()),
|
||||
StorageCapacityDisableThreshold("Alert", ManagementServer.class, Float.class, "pool.storage.capacity.disablethreshold", "0.85", "Percentage (as a value between 0 and 1) of storage utilization above which allocators will disable using the pool for low storage available.", null, ConfigurationParameterScope.zone.toString()),
|
||||
CPUCapacityDisableThreshold("Alert", ManagementServer.class, Float.class, "cluster.cpu.allocated.capacity.disablethreshold", "0.85", "Percentage (as a value between 0 and 1) of cpu utilization above which allocators will disable using the cluster for low cpu available. Keep the corresponding notification threshold lower than this to be notified beforehand.", null, ConfigurationParameterScope.cluster.toString()),
|
||||
MemoryCapacityDisableThreshold("Alert", ManagementServer.class, Float.class, "cluster.memory.allocated.capacity.disablethreshold", "0.85", "Percentage (as a value between 0 and 1) of memory utilization above which allocators will disable using the cluster for low memory available. Keep the corresponding notification threshold lower than this to be notified beforehand.", null, ConfigurationParameterScope.cluster.toString()),
|
||||
|
||||
|
|
|
|||
|
|
@ -298,6 +298,8 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||
|
||||
@Inject protected ResourceTagDao _resourceTagDao;
|
||||
|
||||
|
||||
|
||||
protected List<StoragePoolAllocator> _storagePoolAllocators;
|
||||
public List<StoragePoolAllocator> getStoragePoolAllocators() {
|
||||
return _storagePoolAllocators;
|
||||
|
|
@ -336,9 +338,6 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||
|
||||
private int _customDiskOfferingMinSize = 1;
|
||||
private int _customDiskOfferingMaxSize = 1024;
|
||||
private double _storageUsedThreshold = 1.0d;
|
||||
private double _storageAllocatedThreshold = 1.0d;
|
||||
//protected BigDecimal _storageOverprovisioningFactor = new BigDecimal(1);
|
||||
private Map<String, HypervisorHostListener> hostListeners = new HashMap<String, HypervisorHostListener>();
|
||||
|
||||
private boolean _recreateSystemVmEnabled;
|
||||
|
|
@ -538,12 +537,6 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||
Map<String, String> configs = _configDao.getConfiguration(
|
||||
"management-server", params);
|
||||
|
||||
/*String overProvisioningFactorStr = configs
|
||||
.get("storage.overprovisioning.factor");
|
||||
if (overProvisioningFactorStr != null) {
|
||||
_overProvisioningFactor = new BigDecimal(overProvisioningFactorStr);
|
||||
}*/
|
||||
|
||||
_retry = NumbersUtil.parseInt(configs.get(Config.StartRetry.key()), 10);
|
||||
_pingInterval = NumbersUtil.parseInt(configs.get("ping.interval"), 60);
|
||||
_hostRetry = NumbersUtil.parseInt(configs.get("host.retry"), 2);
|
||||
|
|
@ -579,25 +572,6 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||
String time = configs.get("storage.cleanup.interval");
|
||||
_storageCleanupInterval = NumbersUtil.parseInt(time, 86400);
|
||||
|
||||
String storageUsedThreshold = _configDao
|
||||
.getValue(Config.StorageCapacityDisableThreshold.key());
|
||||
if (storageUsedThreshold != null) {
|
||||
_storageUsedThreshold = Double.parseDouble(storageUsedThreshold);
|
||||
}
|
||||
|
||||
String storageAllocatedThreshold = _configDao
|
||||
.getValue(Config.StorageAllocatedCapacityDisableThreshold.key());
|
||||
if (storageAllocatedThreshold != null) {
|
||||
_storageAllocatedThreshold = Double
|
||||
.parseDouble(storageAllocatedThreshold);
|
||||
}
|
||||
|
||||
/*String globalStorageOverprovisioningFactor = configs
|
||||
.get("storage.overprovisioning.factor");
|
||||
_storageOverprovisioningFactor = new BigDecimal(NumbersUtil.parseFloat(
|
||||
globalStorageOverprovisioningFactor, 2.0f));
|
||||
*/
|
||||
|
||||
s_logger.info("Storage cleanup enabled: " + _storageCleanupEnabled
|
||||
+ ", interval: " + _storageCleanupInterval
|
||||
+ ", template cleanup enabled: " + _templateCleanupEnabled);
|
||||
|
|
@ -1741,6 +1715,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||
|
||||
private boolean checkUsagedSpace(StoragePool pool) {
|
||||
StatsCollector sc = StatsCollector.getInstance();
|
||||
double storageUsedThreshold = Double.parseDouble(_configServer.getConfigValue(Config.StorageCapacityDisableThreshold.key(), Config.ConfigurationParameterScope.zone.toString(), pool.getDataCenterId()));
|
||||
if (sc != null) {
|
||||
long totalSize = pool.getCapacityBytes();
|
||||
StorageStats stats = sc.getStoragePoolStats(pool.getId());
|
||||
|
|
@ -1755,16 +1730,16 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||
+ pool.getCapacityBytes() + ", usedBytes: "
|
||||
+ stats.getByteUsed() + ", usedPct: "
|
||||
+ usedPercentage + ", disable threshold: "
|
||||
+ _storageUsedThreshold);
|
||||
+ storageUsedThreshold);
|
||||
}
|
||||
if (usedPercentage >= _storageUsedThreshold) {
|
||||
if (usedPercentage >= storageUsedThreshold) {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Insufficient space on pool: "
|
||||
+ pool.getId()
|
||||
+ " since its usage percentage: "
|
||||
+ usedPercentage
|
||||
+ " has crossed the pool.storage.capacity.disablethreshold: "
|
||||
+ _storageUsedThreshold);
|
||||
+ storageUsedThreshold);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1809,6 +1784,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||
totalOverProvCapacity = pool.getCapacityBytes();
|
||||
}
|
||||
|
||||
double storageAllocatedThreshold = Double.parseDouble(_configServer.getConfigValue(Config.StorageAllocatedCapacityDisableThreshold.key(), Config.ConfigurationParameterScope.zone.toString(), pool.getDataCenterId()));
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Checking pool: " + pool.getId()
|
||||
+ " for volume allocation " + volumes.toString()
|
||||
|
|
@ -1816,12 +1792,12 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||
+ ", totalAllocatedSize : " + allocatedSizeWithtemplate
|
||||
+ ", askingSize : " + totalAskingSize
|
||||
+ ", allocated disable threshold: "
|
||||
+ _storageAllocatedThreshold);
|
||||
+ storageAllocatedThreshold);
|
||||
}
|
||||
|
||||
double usedPercentage = (allocatedSizeWithtemplate + totalAskingSize)
|
||||
/ (double) (totalOverProvCapacity);
|
||||
if (usedPercentage > _storageAllocatedThreshold) {
|
||||
if (usedPercentage > storageAllocatedThreshold) {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Insufficient un-allocated capacity on: "
|
||||
+ pool.getId()
|
||||
|
|
@ -1830,7 +1806,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
|
|||
+ " since its allocated percentage: "
|
||||
+ usedPercentage
|
||||
+ " has crossed the allocated pool.storage.allocated.capacity.disablethreshold: "
|
||||
+ _storageAllocatedThreshold + ", skipping this pool");
|
||||
+ storageAllocatedThreshold + ", skipping this pool");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue