[pve-devel] [PATCH container v2 2/2] 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:03 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/LXC.pm | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/PVE/API2/LXC.pm b/src/PVE/API2/LXC.pm
index 28f7fdd..fc59ec9 100644
--- a/src/PVE/API2/LXC.pm
+++ b/src/PVE/API2/LXC.pm
@@ -712,9 +712,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});
},
});
@@ -756,8 +756,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