Skip to content

Commit 21b11b9

Browse files
authored
Merge pull request #661 from stardom3645/ablestack-diplo-storage-monitoring-bug-hwryu
기본 스토리지 용량 계산 시, rbd 풀 여러개일 경우 오류 발생 코드 수정
2 parents 86c2628 + 2ce917f commit 21b11b9

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,11 @@ public KVMStoragePool getStoragePool(String uuid, boolean refreshInfo) {
687687
}
688688
if (pool.getType() == StoragePoolType.RBD) {
689689
// queryCephStats 메서드 호출 (직접 Ceph에서 정확한 수치 조회)
690-
Pair<Long, Long> cephStats = queryCephStats("rbd");
690+
String cephPoolName = spd.getSourceDir();
691+
if (cephPoolName == null || cephPoolName.isEmpty()) {
692+
throw new CloudRuntimeException("RBD pool name (source dir) is missing for pool " + uuid);
693+
}
694+
Pair<Long, Long> cephStats = queryCephStats(cephPoolName);
691695
pool.setCapacity(cephStats.first());
692696
pool.setUsed(cephStats.second());
693697
pool.setAvailable(cephStats.first() - cephStats.second());

0 commit comments

Comments
 (0)