public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v2 storage 1/2] rbd plugin: status: drop outdated fallback
Date: Wed, 14 May 2025 11:36:57 +0200	[thread overview]
Message-ID: <20250514093658.21308-1-f.ebner@proxmox.com> (raw)

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@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



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


             reply	other threads:[~2025-05-14  9:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-14  9:36 Fiona Ebner [this message]
2025-05-14  9:36 ` [pve-devel] [PATCH v2 storage 2/2] rbd plugin: status: use actual storage usage as basis for calculation Fiona Ebner
2025-05-22 14:32   ` Fiona Ebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250514093658.21308-1-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal