[pve-devel] [PATCH manager] pve8to9: skip check for running guests if already upgraded

Fiona Ebner f.ebner at proxmox.com
Wed Aug 6 10:28:15 CEST 2025


If already upgraded, the suggestion to stop or migrate running guests
is wrong.

Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
 PVE/CLI/pve8to9.pm | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/PVE/CLI/pve8to9.pm b/PVE/CLI/pve8to9.pm
index 994189f1..35785891 100644
--- a/PVE/CLI/pve8to9.pm
+++ b/PVE/CLI/pve8to9.pm
@@ -1985,22 +1985,26 @@ sub check_rrd_migration {
 sub check_virtual_guests {
     print_header("VIRTUAL GUEST CHECKS");
 
-    log_info("Checking for running guests..");
-    my $running_guests = 0;
+    if (!$upgraded) {
+        log_info("Checking for running guests..");
+        my $running_guests = 0;
 
-    my $local_vms = eval { PVE::API2::Qemu->vmlist({ node => $nodename }) };
-    log_warn("Failed to retrieve information about this node's VMs - $@") if $@;
-    $running_guests += grep { $_->{status} eq 'running' } @$local_vms if defined($local_vms);
+        my $local_vms = eval { PVE::API2::Qemu->vmlist({ node => $nodename }) };
+        log_warn("Failed to retrieve information about this node's VMs - $@") if $@;
+        $running_guests += grep { $_->{status} eq 'running' } @$local_vms if defined($local_vms);
 
-    my $local_cts = eval { PVE::API2::LXC->vmlist({ node => $nodename }) };
-    log_warn("Failed to retrieve information about this node's CTs - $@") if $@;
-    $running_guests += grep { $_->{status} eq 'running' } @$local_cts if defined($local_cts);
+        my $local_cts = eval { PVE::API2::LXC->vmlist({ node => $nodename }) };
+        log_warn("Failed to retrieve information about this node's CTs - $@") if $@;
+        $running_guests += grep { $_->{status} eq 'running' } @$local_cts if defined($local_cts);
 
-    if ($running_guests > 0) {
-        log_warn(
-            "$running_guests running guest(s) detected - consider migrating or stopping them.");
+        if ($running_guests > 0) {
+            log_warn(
+                "$running_guests running guest(s) detected - consider migrating or stopping them.");
+        } else {
+            log_pass("no running guest detected.");
+        }
     } else {
-        log_pass("no running guest detected.");
+        log_skip("Skipping check for running guests - already upgraded.");
     }
 
     check_lxcfs_fuse_version();
-- 
2.47.2





More information about the pve-devel mailing list