public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Michael Köppl" <m.koeppl@proxmox.com>
To: "Thomas Lamprecht" <t.lamprecht@proxmox.com>,
	"Proxmox VE development discussion" <pve-devel@lists.proxmox.com>,
	"Fiona Ebner" <f.ebner@proxmox.com>,
	"Michael Köppl" <m.koeppl@proxmox.com>
Subject: Re: [pve-devel] [PATCH qemu-server 1/1] create_vm: assume HA state 'started' when live-restoring guests
Date: Tue, 25 Nov 2025 14:44:36 +0100	[thread overview]
Message-ID: <DEHTK4KAX02T.Y4WJLGQV41XU@proxmox.com> (raw)
In-Reply-To: <1750f651-02da-4dab-ac97-edd016fb2ae7@proxmox.com>

On Fri Nov 21, 2025 at 11:05 AM CET, Thomas Lamprecht wrote:
> Am 21.11.25 um 10:45 schrieb Fiona Ebner:
>> Am 20.11.25 um 5:34 PM schrieb Michael Köppl:
>>> 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.
>>>
>>> Reported-by: Fiona Ebner <f.ebner@proxmox.com>
>>> Signed-off-by: Michael Köppl <m.koeppl@proxmox.com>
>>> ---
>>> Used defined-or since in pve-manager, we only ever set one of the two
>>> values and in any other case I'd give precedence to the 'start'
>>> parameter if it is explicitly set.
>> 
>> This could be part of the commit message. But from looking at the code,
>> it seems like the actual behavior if start=0 and live-restore=1 is still
>> doing a live restore, so the HA state should still be started in that case.
>> 
>>>
>>>  src/PVE/API2/Qemu.pm | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm
>>> index c580bf63..33427ca7 100644
>>> --- a/src/PVE/API2/Qemu.pm
>>> +++ b/src/PVE/API2/Qemu.pm
>>> @@ -1237,7 +1237,8 @@ __PACKAGE__->register_method({
>>>          my $bwlimit = extract_param($param, 'bwlimit');
>>>          my $force = extract_param($param, 'force');
>>>          my $pool = extract_param($param, 'pool');
>>> -        my $start_after_create = extract_param($param, 'start');
>>> +        my $start_after_create = extract_param($param, 'start')
>>> +            // extract_param($param, 'live-restore');
>> 
>> It's already started during create, so using the $start_after_create
>> variable seems like a slight misfit. Why not just also check for
>> $live_restore when setting the HA state when the resource is added?
>> 
>
> We lock the config on restore, or?
> If so, couldn't we handle this in the HA stack and do not shutdown if a
> restore lock is present in the config?

Thought a bit about this for my approach for v2. I implemented v2 like
@Fiona suggested ($start_after_create || $live_restore), but also added
a check that only sets the status of an existing resource instead of
trying to add one when restoring over an existing VM that already is a
HA resource. I'm not sure I understand why this would instead be handled
in the HA stack depending on the existence of the lock, though. Setting
the state correctly should already be enough, no? Or am I missing
something?



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

      parent reply	other threads:[~2025-11-25 13:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20 16:34 Michael Köppl
2025-11-21  9:45 ` Fiona Ebner
2025-11-21 10:05   ` Thomas Lamprecht
2025-11-21 10:15     ` Fiona Ebner
2025-11-21 10:24       ` Thomas Lamprecht
2025-11-21 10:32         ` Fiona Ebner
2025-11-21 11:13           ` Thomas Lamprecht
2025-11-25 13:44     ` Michael Köppl [this message]

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=DEHTK4KAX02T.Y4WJLGQV41XU@proxmox.com \
    --to=m.koeppl@proxmox.com \
    --cc=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=t.lamprecht@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal