Commit 0e8387f
flasharray: fall back to array capacity when pod has no quota
FlashArrayAdapter.getManagedStorageStats() returns null whenever the
backing pod has no volumes (footprint == 0) and never reports anything
other than the pod quota otherwise. A freshly-registered pool that sits
on a pod without an explicit quota therefore shows
disksizetotal=0, disksizeused=0
and the ClusterScopeStoragePoolAllocator refuses to allocate any volume
against it (zero-capacity pool is skipped). The plugin is unusable
until a pod quota is set manually on the array - which is not documented
anywhere and not discoverable from the CloudStack side.
Fix: fall back to the arrays total physical capacity (retrieved via
GET /arrays?space=true) when the pod has no quota, or when the quota
is zero. The used value falls back to the pod footprint, defaulting to
0 when absent. Only return null when no capacity value is obtainable at
all, which now only happens if the array itself is unreachable.
The math for usedBytes was also simplified: the previous form
pod.getQuotaLimit() - (pod.getQuotaLimit() - pod.getFootprint())
is just pod.getFootprint() with an extra NPE risk when getQuotaLimit()
is null.1 parent 3166e64 commit 0e8387f
1 file changed
Lines changed: 67 additions & 3 deletions
File tree
- plugins/storage/volume/flasharray/src/main/java/org/apache/cloudstack/storage/datastore/adapter/flasharray
Lines changed: 67 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
453 | 456 | | |
454 | 457 | | |
455 | 458 | | |
456 | | - | |
457 | | - | |
| 459 | + | |
458 | 460 | | |
459 | 461 | | |
460 | 462 | | |
461 | | - | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
462 | 476 | | |
463 | 477 | | |
464 | 478 | | |
465 | 479 | | |
466 | 480 | | |
467 | 481 | | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
468 | 532 | | |
469 | 533 | | |
470 | 534 | | |
| |||
0 commit comments