storagePool.getClusterId(), allocated, totalOverProvCapacity, capacityType);
if (storagePool.getScope() == ScopeType.ZONE) {
DataCenterVO dc = ApiDBUtils.findZoneById(storagePool.getDataCenterId());
AllocationState allocationState = dc.getAllocationState();
CapacityState capacityState = (allocationState == AllocationState.Disabled) ? CapacityState.Disabled
: CapacityState.Enabled;
capacity.setCapacityState(capacityState);
} else {
if (storagePool.getClusterId() != null) {
ClusterVO cluster = ApiDBUtils.findClusterById(storagePool.getClusterId());
if (cluster != null) {
AllocationState allocationState = _configMgr.findClusterAllocationState(cluster);
CapacityState capacityState = (allocationState == AllocationState.Disabled) ? CapacityState.Disabled
: CapacityState.Enabled;
capacity.setCapacityState(capacityState);
}
}
}