Signed-off-by: Thomas Lamprecht <t.lampre...@proxmox.com>
---
 src/PVE/HA/Resources/PVEVM.pm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/PVE/HA/Resources/PVEVM.pm b/src/PVE/HA/Resources/PVEVM.pm
index c5276dc..d07d5c9 100644
--- a/src/PVE/HA/Resources/PVEVM.pm
+++ b/src/PVE/HA/Resources/PVEVM.pm
@@ -124,8 +124,12 @@ sub check_running {
        # do not count VMs which are suspended for a backup job as running
        my $conf = PVE::QemuConfig->load_config($vmid, $nodename);
        if (defined($conf->{lock}) && $conf->{lock} eq 'backup') {
-           my $qmpstatus = PVE::QemuServer::vm_qmp_command($vmid, {execute => 
'query-status'});
-           return 0 if $qmpstatus->{status} eq 'prelaunch';
+           my $qmpstatus = eval {
+               PVE::QemuServer::vm_qmp_command($vmid, { execute => 
'query-status' })
+           };
+           warn "$@\n" if $@;
+
+           return 0 if defined($qmpstatus) && $qmpstatus->{status} eq 
'prelaunch';
        }
 
        return 1;
-- 
2.20.1


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to