all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: "Michael Köppl" <m.koeppl@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH qemu-server v2 1/2] create_vm: assume HA state 'started' when live-restoring guests
Date: Thu, 27 Nov 2025 16:40:40 +0100	[thread overview]
Message-ID: <20251127154041.194423-2-m.koeppl@proxmox.com> (raw)
In-Reply-To: <20251127154041.194423-1-m.koeppl@proxmox.com>

To avoid shutting down the VM when performing a live-restore, consider
live-restore=1 to translate to a HA state of 'started', similar to
start=1.

Signed-off-by: Michael Köppl <m.koeppl@proxmox.com>
---
 src/PVE/API2/Qemu.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
index c580bf63..25b6529c 100644
--- a/src/PVE/API2/Qemu.pm
+++ b/src/PVE/API2/Qemu.pm
@@ -1418,7 +1418,7 @@ __PACKAGE__->register_method({
 
             if ($ha_managed) {
                 print "Add as HA resource\n";
-                my $state = $start_after_create ? 'started' : 'stopped';
+                my $state = $start_after_create || $live_restore ? 'started' : 'stopped';
                 my $cmd = ['ha-manager', 'add', "vm:$vmid", '--state', $state];
                 eval { PVE::Tools::run_command($cmd); };
                 warn $@ if $@;
-- 
2.47.3



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

  reply	other threads:[~2025-11-27 15:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-27 15:40 [pve-devel] [PATCH qemu-server v2 0/2] correctly set HA state then Michael Köppl
2025-11-27 15:40 ` Michael Köppl [this message]
2025-11-27 15:40 ` [pve-devel] [PATCH qemu-server v2 2/2] create_vm: set HA state when restoring VM if resource already exists Michael Köppl
2025-11-29 22:49 ` [pve-devel] applied: [PATCH qemu-server v2 0/2] correctly set HA state then Thomas Lamprecht

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=20251127154041.194423-2-m.koeppl@proxmox.com \
    --to=m.koeppl@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