all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] pve8to9: skip check for running guests if already upgraded
Date: Wed,  6 Aug 2025 10:28:15 +0200	[thread overview]
Message-ID: <20250806082926.15848-1-f.ebner@proxmox.com> (raw)

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

Signed-off-by: Fiona Ebner <f.ebner@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



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


             reply	other threads:[~2025-08-06  8:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-06  8:28 Fiona Ebner [this message]
2025-08-08  8:10 ` [pve-devel] applied: " Fabian Grünbichler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250806082926.15848-1-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal