]> git.proxmox.com Git - pve-manager.git/commitdiff
api: bulk suspension: log if VMs are skipped due to not running
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 13 Nov 2023 13:12:16 +0000 (14:12 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 13 Nov 2023 13:14:08 +0000 (14:14 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/API2/Nodes.pm

index 39b049d891d25cb68e715b4c5503ebb23cc35b5e..be000d945e5577fa5465d6632bc80e1ab40854a1 100644 (file)
@@ -2015,7 +2015,10 @@ __PACKAGE__->register_method ({
 
 my $create_suspend_worker = sub {
     my ($nodename, $vmid) = @_;
-    return if !PVE::QemuServer::check_running($vmid, 1);
+    if (!PVE::QemuServer::check_running($vmid, 1)) {
+       print "VM $vmid not running, skipping suspension\n";
+       return;
+    }
     print STDERR "Suspending VM $vmid\n";
     return PVE::API2::Qemu->vm_suspend(
        { node => $nodename, vmid => $vmid, todisk => 1 }