[pve-devel] [PATCH qemu-server v2 4/4] rrddata: use new pve-vm-9.0 rrd location if file is present

Aaron Lauterer a.lauterer at proxmox.com
Wed Jul 9 18:37:01 CEST 2025


Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---

Notes:
    changes since:
    RFC:
    * switch from pve9-vm to pve-vm-90 schema

 src/PVE/API2/Qemu.pm | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
index 2e6358e..2867a53 100644
--- a/src/PVE/API2/Qemu.pm
+++ b/src/PVE/API2/Qemu.pm
@@ -1628,9 +1628,9 @@ __PACKAGE__->register_method({
     code => sub {
         my ($param) = @_;
 
-        return PVE::RRD::create_rrd_graph(
-            "pve2-vm/$param->{vmid}", $param->{timeframe}, $param->{ds}, $param->{cf},
-        );
+        my $path = "pve-vm-9.0/$param->{vmid}";
+        $path = "pve2-vm/$param->{vmid}" if !-e "/var/lib/rrdcached/db/${path}";
+        return PVE::RRD::create_rrd_graph($path, $param->{timeframe}, $param->{cf});
 
     },
 });
@@ -1672,8 +1672,9 @@ __PACKAGE__->register_method({
     code => sub {
         my ($param) = @_;
 
-        return PVE::RRD::create_rrd_data("pve2-vm/$param->{vmid}", $param->{timeframe},
-            $param->{cf});
+        my $path = "pve-vm-9.0/$param->{vmid}";
+        $path = "pve2-vm/$param->{vmid}" if !-e "/var/lib/rrdcached/db/${path}";
+        return PVE::RRD::create_rrd_data($path, $param->{timeframe}, $param->{cf});
     },
 });
 
-- 
2.39.5





More information about the pve-devel mailing list