From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 266271FF0B0 for ; Fri, 09 Oct 2026 15:34:36 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 73DED2166F; Fri, 09 Oct 2026 15:34:34 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 09 Oct 2026 15:34:29 +0200 Message-Id: From: "Daniel Kral" To: "Fiona Ebner" , Subject: Re: [PATCH ha-manager v3 05/21] lrm: resource migration: support extra migration options X-Mailer: aerc 0.22.0-10-g6373ac9d2179-dirty References: <20260918160841.128088-1-f.ebner@proxmox.com> <20260918160841.128088-6-f.ebner@proxmox.com> In-Reply-To: <20260918160841.128088-6-f.ebner@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1791552869426 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.867 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: SZHRTUOKLLG2ZOIOD255NWTXIPHIXO7E X-Message-ID-Hash: SZHRTUOKLLG2ZOIOD255NWTXIPHIXO7E X-MailFrom: d.kral@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Fri Sep 18, 2026 at 6:08 PM CEST, Fiona Ebner wrote: > The options will be passed from the guest API endpoints through the HA > stack, all the way to the resource plugins. > > In a following commit, the resource plugins will forward parts of the > schema of the resource-specific migration endpoint to the HA resource > endpoint. In particular, forwarding the 'with-conntrack-state' option > will be used to fix bug #7053. > > Signed-off-by: Fiona Ebner > --- > > New in v3. > > src/PVE/HA/LRM.pm | 15 ++++++++++----- > src/PVE/HA/Resources.pm | 2 +- > src/PVE/HA/Resources/PVECT.pm | 5 ++++- > src/PVE/HA/Resources/PVEVM.pm | 5 ++++- > src/PVE/HA/Sim/Resources.pm | 2 +- > src/PVE/HA/Sim/Resources/VirtCT.pm | 2 +- > src/PVE/HA/Sim/Resources/VirtFail.pm | 2 +- > 7 files changed, 22 insertions(+), 11 deletions(-) > > diff --git a/src/PVE/HA/LRM.pm b/src/PVE/HA/LRM.pm > index 72e37e6..5fc66eb 100644 > --- a/src/PVE/HA/LRM.pm > +++ b/src/PVE/HA/LRM.pm > @@ -749,14 +749,19 @@ sub manage_resources { > # intermediate step for optional better node selection on stop -= > start request state change > next if $request_state eq 'request_start'; > =20 > + my $params =3D { > + 'target' =3D> $sd->{target}, > + 'timeout' =3D> $sd->{timeout}, > + }; > + if (defined($sd->{'migrate-options'})) { > + $params->{'migrate-options'} =3D $sd->{'migrate-options'}; > + } nit: pre-existing, but since 'target' and 'timeout' are set in the $params hash here unconditionally, couldn't we do the same for 'migrate-options' here as well, just for consistency/readability? $params would then just be the hash of $sd properties that can be passed through as LRM resource command properties, but need a definedness check before these are used in the LRM workers. > + > $self->queue_resource_command( > $sid, > $sd->{uid}, > $request_state, > - { > - 'target' =3D> $sd->{target}, > - 'timeout' =3D> $sd->{timeout}, > - }, > + $params, > ); > } > =20 > @@ -1040,7 +1045,7 @@ sub exec_resource_agent { > =20 > my $online =3D ($cmd eq 'migrate') ? 1 : 0; > =20 > - my $res =3D $plugin->migrate($haenv, $id, $target, $online); > + my $res =3D $plugin->migrate($haenv, $id, $target, $online, $par= ams->{'migrate-options'}); > =20 > # something went wrong if service is still on this node > if (!$res) { [ -->8- snip -8<-- ] > diff --git a/src/PVE/HA/Resources/PVECT.pm b/src/PVE/HA/Resources/PVECT.p= m > index 177b907..3d8a5b9 100644 > --- a/src/PVE/HA/Resources/PVECT.pm > +++ b/src/PVE/HA/Resources/PVECT.pm > @@ -106,7 +106,7 @@ sub shutdown { > } > =20 > sub migrate { > - my ($class, $haenv, $id, $target, $online) =3D @_; > + my ($class, $haenv, $id, $target, $online, $migrate_options) =3D @_; > =20 > my $nodename =3D $haenv->nodename(); > =20 > @@ -117,6 +117,9 @@ sub migrate { > online =3D> 0, # we cannot migrate CT (yet) online, only relocat= e > }; > =20 > + $migrate_options //=3D {}; > + $params->{$_} =3D $migrate_options->{$_} for sort keys $migrate_opti= ons->%*; nit: unnecessary sort here > + > # always relocate container for now > if ($class->check_running($haenv, $id)) { > $class->shutdown($haenv, $id); > diff --git a/src/PVE/HA/Resources/PVEVM.pm b/src/PVE/HA/Resources/PVEVM.p= m > index 8753271..964f374 100644 > --- a/src/PVE/HA/Resources/PVEVM.pm > +++ b/src/PVE/HA/Resources/PVEVM.pm > @@ -107,7 +107,7 @@ sub shutdown { > } > =20 > sub migrate { > - my ($class, $haenv, $id, $target, $online) =3D @_; > + my ($class, $haenv, $id, $target, $online, $migrate_options) =3D @_; > =20 > my $nodename =3D $haenv->nodename(); > =20 > @@ -123,6 +123,9 @@ sub migrate { > online =3D> $online, > }; > =20 > + $migrate_options //=3D {}; > + $params->{$_} =3D $migrate_options->{$_} for sort keys $migrate_opti= ons->%*; nit: unnecessary sort here > + > # explicitly shutdown if $online isn't true (relocate) > if (!$online && $class->check_running($haenv, $id)) { > $class->shutdown($haenv, $id); [ -->8- snip -8<-- ]