genegr commented on code in PR #13050:
URL: https://github.com/apache/cloudstack/pull/13050#discussion_r3298381011
##########
plugins/storage/volume/flasharray/src/main/java/org/apache/cloudstack/storage/datastore/adapter/flasharray/FlashArrayAdapter.java:
##########
@@ -453,18 +453,46 @@ public void disconnect() {
@Override
public ProviderVolumeStorageStats getManagedStorageStats() {
FlashArrayPod pod = getVolumeNamespace(this.pod);
- // just in case
- if (pod == null || pod.getFootprint() == 0) {
+ if (pod == null) {
return null;
}
Long capacityBytes = pod.getQuotaLimit();
- Long usedBytes = pod.getQuotaLimit() - (pod.getQuotaLimit() -
pod.getFootprint());
+ if (capacityBytes == null || capacityBytes == 0) {
+ // Pod has no explicit quota set; report the array total physical
+ // capacity so the CloudStack allocator has a real ceiling to plan
+ // against rather than bailing out with a zero-capacity pool.
+ capacityBytes = getArrayTotalCapacity();
+ }
Review Comment:
Agreed — pushed `6f64daef2b` removing the cache. You're right that with
`getManagedStorageStats()` polled every 60s, a single extra `GET
/arrays?space=true` per poll (and only when a pod has no quota) is negligible,
and the static shared-state cache wasn't worth the complexity.
`getArrayTotalCapacity()` now does a direct lookup; dropped the
`CachedCapacity` helper and the two `java.util.concurrent` imports it needed.
--
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]