[pve-devel] [PATCH manager v3 14/14] fix #6068: ui: utils: calculate and render host memory usage correctly

Aaron Lauterer a.lauterer at proxmox.com
Tue Jul 15 16:32:11 CEST 2025


First by using the new memhost field if guest is of type qemu and the field is
numerical.
Second by checking in the render function against the 'value' that has
been calculated if we have percentages or bytes. Previously we always
checked the raw record mem data.

As a result, if the cluster is in a mixed PVE8 / PVE9 situation, for
example during a migration, we will not report any host memory usage, in
numbers or percent, as we don't get the memhost metric from the older
PVE8 hosts.

Fixes: #6068 (Node Search tab incorrect Host memory usage %)
Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---
 www/manager6/Utils.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index 29334111..ed41714a 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -1166,6 +1166,9 @@ Ext.define('PVE.Utils', {
                 return -1;
             }
 
+            if (data.type === 'qemu' && Ext.isNumeric(data.memhost)) {
+                return data.memhost / maxmem;
+            }
             return data.mem / maxmem;
         },
 
@@ -1206,9 +1209,12 @@ Ext.define('PVE.Utils', {
             var node = PVE.data.ResourceStore.getAt(index);
             var maxmem = node.data.maxmem || 0;
 
-            if (record.data.mem > 1) {
+            if (value > 1) {
                 // we got no percentage but bytes
                 let mem = record.data.mem;
+                if (record.data.type === 'qemu' && Ext.isNumeric(record.data.memhost)) {
+                    mem = record.data.memhost;
+                }
                 if (!record.data.uptime || maxmem === 0 || !Ext.isNumeric(mem)) {
                     return '';
                 }
-- 
2.39.5





More information about the pve-devel mailing list