[pve-devel] [PATCH manager 2/6] include if we have a successful rrd update for storage

Dominik Csapak d.csapak at proxmox.com
Thu Apr 27 12:17:30 CEST 2017


if we did not get rrd stats for a storage (not even 0/0 Bytes),
we can assume that this storage is not active

we can use this information for the tree

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/API2Tools.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/PVE/API2Tools.pm b/PVE/API2Tools.pm
index a92b99b3..59d0c3eb 100644
--- a/PVE/API2Tools.pm
+++ b/PVE/API2Tools.pm
@@ -119,6 +119,9 @@ sub extract_storage_stats {
     if (my $d = $rrd->{"pve2-storage/$node/$storeid"}) {
 	$entry->{maxdisk} = ($d->[1] || 0) + 0;
 	$entry->{disk} = ($d->[2] || 0) + 0;
+	$entry->{active} = 1;
+    } else {
+	$entry->{active} = 0;
     }
 
     return $entry;
-- 
2.11.0





More information about the pve-devel mailing list