From 3625a0913752f278d51a3e1acfe90bd8dfdad0e0 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 19 Oct 2015 18:02:47 +0200 Subject: [PATCH] Fix check if vm is ha managed in get_start_stop_list The check used was completely wrong and so the startall and stopall API calls touched HA managed service, which they shouldn't. Using the vm_is_ha_managed call from the HA stack fixes that. Signed-off-by: Thomas Lamprecht --- PVE/API2/Nodes.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm index 8a8a7c1b..41baca0a 100644 --- a/PVE/API2/Nodes.pm +++ b/PVE/API2/Nodes.pm @@ -1132,7 +1132,6 @@ __PACKAGE__->register_method({ my $get_start_stop_list = sub { my ($nodename, $autostart) = @_; - my $haconf = PVE::HA::Config::read_resources_config(); my $vmlist = PVE::Cluster::get_vmlist(); my $resList = {}; @@ -1164,8 +1163,8 @@ my $get_start_stop_list = sub { } # skip ha managed VMs (started by pve-ha-manager) - return if defined($haconf->{ids}->{"pvevm:$vmid"}); - + return if PVE::HA::Config::vm_is_ha_managed($vmid); + $resList->{$startup->{order}}->{$vmid} = $startup; $resList->{$startup->{order}}->{$vmid}->{type} = $d->{type}; };