]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: dc summary: fix calculation of storage size
authorIgor Thaller <igor.thaller@aon.at>
Wed, 31 Jul 2024 12:14:09 +0000 (14:14 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 31 Jul 2024 15:33:03 +0000 (17:33 +0200)
The issue is related to the 'Summary' tab under 'Datacenter' inside a
cluster. To get a steady reading of the storage size data, the
frontend requests the '/api2/json/cluster/resources' every three
seconds to retrieve the necessary data to calculate the used and total
storage size.

The problem occurs when a shared storage is defined and a node goes
offline. As the node is not online, it cannot report the shared
storage size (both used and total) back to the other nodes. The order
of the JSON response is not always the same, so it is possible that
the offline node will appear first. Consequently, the frontend will
display the wrong total and used storage. This is because the shared
storage data has both the maximum disk size and the used disk set to
zero when the node is offline. This causes the total and used space
data to be calculated and displayed incorrectly, leading to
fluctuations in the displayed percentage of used disk space.

To fix this, add a conditional check to skip the storage report if its
status is 'unknown' (regardless of if the storage is local or shared).
This prevents the unreliable data from being processed.

Reported-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Igor Thaller <igor.thaller@aon.at>
www/manager6/dc/Summary.js

index efb44daed990ce9b28fd0eef7081bf3ae2391e4c..ae3f9566135be5c3b256a0fbc3b62ffa52462dcd 100644 (file)
@@ -170,6 +170,11 @@ Ext.define('PVE.dc.Summary', {
                        } else if (countedStorage[sid]) {
                            break;
                        }
+
+                       if (data.status === "unknown") {
+                           break;
+                       }
+
                        used += data.disk;
                        total += data.maxdisk;
                        countedStorage[sid] = true;