[pve-devel] [RFC ha-manager v2 2/2] status: show added but not yet active services

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Mar 14 14:34:45 CET 2016


If the CRM is dead or not active yet and we add a new service, we do
not see it in the HA status. This can be confusing for the user as
it is queued for adding but does not shows up, so lets show those
services also.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 src/PVE/API2/HA/Status.pm | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/PVE/API2/HA/Status.pm b/src/PVE/API2/HA/Status.pm
index 252cd78..2f6be3f 100644
--- a/src/PVE/API2/HA/Status.pm
+++ b/src/PVE/API2/HA/Status.pm
@@ -151,10 +151,18 @@ __PACKAGE__->register_method ({
 
 	foreach my $sid (sort keys %{$status->{service_status}}) {
 	    my $d = $status->{service_status}->{$sid};
-	    push @$res, { id => "service:$sid", type => 'service', sid => $sid, 
+	    push @$res, { id => "service:$sid", type => 'service', sid => $sid,
 			  node => $d->{node}, status => "$sid ($d->{node}, $d->{state})" };
+	    delete $service_config->{$sid};
 	}
-		
+
+	foreach my $sid (sort keys %$service_config) {
+	    my $d = $service_config->{$sid};
+	    push @$res, { id => "service:$sid", type => 'service', sid => $sid,
+			  status => "$sid ($d->{node}, queued)",
+			  node => $d->{node} };
+	}
+
 	return $res;
     }});
 
-- 
2.1.4





More information about the pve-devel mailing list