[pve-devel] [PATCH v2 storage 1/2] rbd plugin: status: drop outdated fallback

Fiona Ebner f.ebner at proxmox.com
Wed May 14 11:36:57 CEST 2025


As commit e79ab52 ("Fix #2346: rbd storage shows wrong %-usage")
mentions, Ceph provides a 'stored' field since version 14.2.2 as an
approximation of the actually stored amount of user data. The commit
forgot to update the accompanying comment however.

The 'bytes_used' field refers to the raw usage without factoring out
replication (default: 3). The 'max_avail' value is after factoring out
replication, so using 'bytes_used' in the same calculation would lead
to very confusing results.

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---

No changes in v2.

 src/PVE/Storage/RBDPlugin.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/PVE/Storage/RBDPlugin.pm b/src/PVE/Storage/RBDPlugin.pm
index 73bc97e..154fa00 100644
--- a/src/PVE/Storage/RBDPlugin.pm
+++ b/src/PVE/Storage/RBDPlugin.pm
@@ -702,9 +702,9 @@ sub status {
     }
 
     # max_avail -> max available space for data w/o replication in the pool
-    # bytes_used -> data w/o replication in the pool
+    # stored -> amount of user data w/o replication in the pool
     my $free = $d->{stats}->{max_avail};
-    my $used = $d->{stats}->{stored} // $d->{stats}->{bytes_used};
+    my $used = $d->{stats}->{stored};
     my $total = $used + $free;
     my $active = 1;
 
-- 
2.39.5





More information about the pve-devel mailing list