Compare commits

...

10 commits

Author SHA1 Message Date
Tiago Sousa
2abc96b39c monitor extend queue file 2025-09-13 18:59:35 +01:00
Thomas Lamprecht
253de0cdfe bump version to 9.0.6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-08-04 12:38:24 +02:00
Thomas Lamprecht
e2c572850b rrd: cope with only partially renamed memavailable field
During initial development of the revised metrics series this field
was sourced by 'memfree' from /proc/meminfo as parsed by our ProcFS
tools, but as memavailable got added for PVE 8.4, as it much better
shows the state of actually available memory [0], I suggested to Aaron
to move the new RRD format also to that metric. While that was done,
the RRD definition was still using the old name, while I fixed in in
pmxcfs, I forgot to do so in the upgrade migration tool, which then
created an RRD file with the old name.

Thus map the old name to the new one here in case there is no existing
entry for the new one already, if one would be parsed later it would
override this fallback anyway.

[0] as while the kernel tries to use unused memory to improve
performance, it has no issue to release that again quickly on memory
pressure.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-08-04 11:43:54 +02:00
Thomas Lamprecht
63862b41c3 bump version to 9.0.5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-08-01 14:58:07 +02:00
Lukas Wagner
054995ba3d pmxcfs: status: avoid g_strdup when not needed
`filename_pve2` is not accessed anymore after assigning the copy to
`filename`, so we can simply 'transfer' the ownership to `filename`
and set `filenname_pve2` to NULL.

The call to `g_free(filename_pve2)` later can handle a NULL arg, it will
simply do nothing in this case.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Reviewed-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Link: https://lore.proxmox.com/20250801095431.117317-5-l.wagner@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-08-01 14:51:29 +02:00
Lukas Wagner
0795244f98 pmxcfs: status: remove string literal params for g_strdup_printf
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Reviewed-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Link: https://lore.proxmox.com/20250801095431.117317-4-l.wagner@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-08-01 14:51:24 +02:00
Lukas Wagner
c66917260e pmxcfs: status: call g_strdup instead of g_strdup_printf when no formatting is needed
This should be a tiny bit more efficient.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Reviewed-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Link: https://lore.proxmox.com/20250801095431.117317-3-l.wagner@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-08-01 14:51:20 +02:00
Lukas Wagner
426cb07ed8 pmxcfs: status: avoid unnecessary string allocations
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Reviewed-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Link: https://lore.proxmox.com/20250801095431.117317-2-l.wagner@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-08-01 14:51:14 +02:00
Lukas Wagner
8239d5c365 pmxcfs: status: add one more missing g_free
Otherwise we leak the memory that was already allocated for `filename`.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Reviewed-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Link: https://lore.proxmox.com/20250801095431.117317-1-l.wagner@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-08-01 14:51:12 +02:00
Stefan Hanreich
8c12940a66 pmxcfs: remove legacy ipam db and mac cache files
Those files get migrated with pve-network >= 0.9.9 - so we do not need
to observe them anymore via pmxcfs.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Link: https://lore.proxmox.com/20250801121029.201766-2-s.hanreich@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-08-01 14:51:12 +02:00
4 changed files with 42 additions and 30 deletions

16
debian/changelog vendored
View file

@ -1,3 +1,19 @@
pve-cluster (9.0.6) trixie; urgency=medium
* rrd: cope with only partially renamed memavailable field when old data was
migrated.
-- Proxmox Support Team <support@proxmox.com> Mon, 04 Aug 2025 12:38:19 +0200
pve-cluster (9.0.5) trixie; urgency=medium
* pmxcfs: remove legacy ipam db and mac cache files.
* pmxcfs: various internal code clean-ups and fixing some smaller memory
leaks.
-- Proxmox Support Team <support@proxmox.com> Fri, 01 Aug 2025 14:58:03 +0200
pve-cluster (9.0.4) trixie; urgency=medium
* pmxcfs: status: fix create sub directories in /var/lib/rrdcached/db when

View file

@ -61,8 +61,6 @@ my $observed = {
'priv/tfa.cfg' => 1,
'priv/token.cfg' => 1,
'priv/acme/plugins.cfg' => 1,
'priv/ipam.db' => 1, # TODO: replaced by sdn/ipam-pve-db.json, remove in PVE 9+
'priv/macs.db' => 1, # TODO: replaced by sdn/mac-cache.json, remove in PVE 9+
'/qemu-server/' => 1,
'/openvz/' => 1,
'/lxc/' => 1,
@ -89,6 +87,7 @@ my $observed = {
'mapping/directory.cfg' => 1,
'mapping/pci.cfg' => 1,
'mapping/usb.cfg' => 1,
'extend-queue' => 1,
};
sub prepare_observed_file_basedirs {

View file

@ -37,6 +37,7 @@ sub create_rrd_data {
$setup = $setup_pve2;
$timeframe = "year" if $timeframe eq "decade"; # we only store up to one year in the old format
}
my $is_node = !!($rrdname =~ /^pve-node/);
my ($reso, $count) = @{ $setup->{$timeframe} };
my $ctime = $reso * int(time() / $reso);
@ -70,6 +71,8 @@ sub create_rrd_data {
my $name = $names->[$i];
if (defined(my $val = $line->[$i])) {
$entry->{$name} = $val;
$entry->{memavailable} = $val
if $is_node && $name eq 'memfree' && !exists($entry->{memavailable});
} else {
# leave empty fields undefined
# maybe make this configurable?

View file

@ -88,8 +88,6 @@ static memdb_change_t memdb_change_array[] = {
{.path = "priv/acme/plugins.cfg"},
{.path = "priv/tfa.cfg"},
{.path = "priv/token.cfg"},
{.path = "priv/ipam.db"}, // TODO: replaced by sdn/ipam-pve-db.json remove with PVE 9 or later
{.path = "priv/macs.db"}, // TODO: replaced by sdn/mac-cache.json remove with PVE 9 or later
{.path = "datacenter.cfg"},
{.path = "vzdump.cron"},
{.path = "vzdump.conf"},
@ -1369,21 +1367,23 @@ static void update_rrd_data(const char *key, gconstpointer data, size_t len) {
} else if (g_file_test(filename_pve2, G_FILE_TEST_EXISTS)) {
// old file exists, use it
use_pve2_file = 1;
filename = g_strdup_printf("%s", filename_pve2);
g_free(filename);
filename = filename_pve2;
filename_pve2 = NULL;
} else {
// neither file exists, check for directories to decide and create file
char *dir_pve2 = g_strdup_printf(RRDDIR "/pve2-node");
char *dir_pve90 = g_strdup_printf(RRDDIR "/pve-node-9.0");
if (g_file_test(dir_pve90, G_FILE_TEST_IS_DIR)) {
if (g_file_test(RRDDIR "/pve-node-9.0", G_FILE_TEST_IS_DIR)) {
int argcount = sizeof(rrd_def_node_pve9_0) / sizeof(void *) - 1;
create_rrd_file(filename, argcount, rrd_def_node_pve9_0);
} else if (g_file_test(dir_pve2, G_FILE_TEST_IS_DIR)) {
} else if (g_file_test(RRDDIR "/pve2-node", G_FILE_TEST_IS_DIR)) {
use_pve2_file = 1;
g_free(filename);
filename = g_strdup_printf("%s", filename_pve2);
filename = filename_pve2;
filename_pve2 = NULL;
char *dir = g_path_get_dirname(filename);
checked_mkdir(dir, 0755);
@ -1402,8 +1402,6 @@ static void update_rrd_data(const char *key, gconstpointer data, size_t len) {
int argcount = sizeof(rrd_def_node_pve9_0) / sizeof(void *) - 1;
create_rrd_file(filename, argcount, rrd_def_node_pve9_0);
}
g_free(dir_pve2);
g_free(dir_pve90);
}
skip = 2; // first two columns are live data that isn't archived
@ -1433,7 +1431,7 @@ static void update_rrd_data(const char *key, gconstpointer data, size_t len) {
}
filename = g_strdup_printf(RRDDIR "/pve-vm-9.0/%s", vmid);
char *filename_pve2 = g_strdup_printf(RRDDIR "/%s/%s", "pve2-vm", vmid);
char *filename_pve2 = g_strdup_printf(RRDDIR "/pve2-vm/%s", vmid);
int use_pve2_file = 0;
@ -1445,21 +1443,21 @@ static void update_rrd_data(const char *key, gconstpointer data, size_t len) {
// old file exists, use it
use_pve2_file = 1;
g_free(filename);
filename = g_strdup_printf("%s", filename_pve2);
filename = filename_pve2;
filename_pve2 = NULL;
} else {
// neither file exists, check for directories to decide and create file
char *dir_pve2 = g_strdup_printf(RRDDIR "/pve2-vm");
char *dir_pve90 = g_strdup_printf(RRDDIR "/pve-vm-9.0");
if (g_file_test(dir_pve90, G_FILE_TEST_IS_DIR)) {
if (g_file_test(RRDDIR "/pve-vm-9.0", G_FILE_TEST_IS_DIR)) {
int argcount = sizeof(rrd_def_vm_pve9_0) / sizeof(void *) - 1;
create_rrd_file(filename, argcount, rrd_def_vm_pve9_0);
} else if (g_file_test(dir_pve2, G_FILE_TEST_IS_DIR)) {
} else if (g_file_test(RRDDIR "/pve2-vm", G_FILE_TEST_IS_DIR)) {
use_pve2_file = 1;
g_free(filename);
filename = g_strdup_printf("%s", filename_pve2);
filename = filename_pve2;
filename_pve2 = NULL;
int argcount = sizeof(rrd_def_vm) / sizeof(void *) - 1;
create_rrd_file(filename, argcount, rrd_def_vm);
@ -1470,8 +1468,6 @@ static void update_rrd_data(const char *key, gconstpointer data, size_t len) {
int argcount = sizeof(rrd_def_vm_pve9_0) / sizeof(void *) - 1;
create_rrd_file(filename, argcount, rrd_def_vm_pve9_0);
}
g_free(dir_pve2);
g_free(dir_pve90);
}
skip = 4; // first 4 columns are live data that isn't archived
@ -1506,7 +1502,7 @@ static void update_rrd_data(const char *key, gconstpointer data, size_t len) {
}
filename = g_strdup_printf(RRDDIR "/pve-storage-9.0/%s", node);
char *filename_pve2 = g_strdup_printf(RRDDIR "/%s/%s", "pve2-storage", node);
char *filename_pve2 = g_strdup_printf(RRDDIR "/pve2-storage/%s", node);
// check existing rrd files and directories
if (g_file_test(filename, G_FILE_TEST_EXISTS)) {
@ -1515,22 +1511,22 @@ static void update_rrd_data(const char *key, gconstpointer data, size_t len) {
} else if (g_file_test(filename_pve2, G_FILE_TEST_EXISTS)) {
// old file exists, use it
g_free(filename);
filename = g_strdup_printf("%s", filename_pve2);
filename = filename_pve2;
filename_pve2 = NULL;
} else {
// neither file exists, check for directories to decide and create file
char *dir_pve2 = g_strdup_printf(RRDDIR "/pve2-storage");
char *dir_pve90 = g_strdup_printf(RRDDIR "/pve-storage-9.0");
if (g_file_test(dir_pve90, G_FILE_TEST_IS_DIR)) {
if (g_file_test(RRDDIR "/pve-storage-9.0", G_FILE_TEST_IS_DIR)) {
char *dir = g_path_get_dirname(filename);
checked_mkdir(dir, 0755);
g_free(dir);
int argcount = sizeof(rrd_def_storage_pve9_0) / sizeof(void *) - 1;
create_rrd_file(filename, argcount, rrd_def_storage_pve9_0);
} else if (g_file_test(dir_pve2, G_FILE_TEST_IS_DIR)) {
} else if (g_file_test(RRDDIR "/pve2-storage", G_FILE_TEST_IS_DIR)) {
g_free(filename);
filename = g_strdup_printf("%s", filename_pve2);
filename = filename_pve2;
filename_pve2 = NULL;
char *dir = g_path_get_dirname(filename);
checked_mkdir(dir, 0755);
@ -1549,8 +1545,6 @@ static void update_rrd_data(const char *key, gconstpointer data, size_t len) {
int argcount = sizeof(rrd_def_storage_pve9_0) / sizeof(void *) - 1;
create_rrd_file(filename, argcount, rrd_def_storage_pve9_0);
}
g_free(dir_pve2);
g_free(dir_pve90);
}
// actual data columns didn't change between pve2-storage and pve-storage-9.0