all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: "Daniel Kral" <d.kral@proxmox.com>
To: "Thomas Lamprecht" <t.lamprecht@proxmox.com>,
	<pve-devel@lists.proxmox.com>
Subject: Re: [PATCH] lrm: refuse targets dropping the guest identity before stopping guests
Date: Fri, 20 Nov 2026 14:21:31 +0100	[thread overview]
Message-ID: <DN02IKNXDMOL.1C7I1M7NN7BL6@proxmox.com> (raw)
In-Reply-To: <20261120025517.3031086-1-t.lamprecht@proxmox.com>

On Fri Nov 20, 2026 at 3:54 AM CET, Thomas Lamprecht wrote:
> The guest migration APIs reject nodes that would drop guest identities,
> but HA resource plugins can stop a container or shut down a VM for
> relocation before calling those APIs. A refused requested relocation
> therefore causes an unnecessary stop and restart.
>
> For automatic moves, including maintenance, shutdown with the 'migrate'
> policy, failback, and affinity rules, the CRM can select the same target
> again before restarting the guest. The guest then stays stopped while
> relocation is retried. Automatic rebalancing can repeatedly restart a
> container instead.
>
> Have the resource plugins check identity support before the LRM calls
> migrate, and treat a refusal as a migration error. A running guest then
> stays running on its source node.
>
> Guest API requests already fail before reaching HA. Direct ha-manager
> requests report the refusal in the LRM log. The CRM still retries
> automatic moves to unsupported targets, so maintenance or shutdown
> with the 'migrate' policy remains blocked until the selected targets
> are upgraded, even if other nodes already support identities.
>
> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
> ---
>
> I'm a bit torn here about the specific check employed, but the overal
> mechanism is simple enough and could be reused for other migration
> blockers in HA.

I guess it would be more generic to check whether the
`not_allowed_nodes` hash (or `not-allowed-nodes` for pve-container) from
the migrate_vm_precondition API does not contain the target node and
otherwise fail, to prevent the relocate's stop when we already know that
the migrate will fail afterwards...

However, if we want to give users a reason to why the migration wasn't
done, then the migrate_vm_precondition API does not assert but only
gives structured information, which would need to be parsed here again,
similar how it's done in the web interface... So also not that ideal.

So I think this is fine for now and the patch looks good to me and can
be made more generic in the future, so consider as:

Reviewed-by: Daniel Kral <d.kral@proxmox.com>



For a more general approach to acknowledge the migration blockers (that
I'm working on), I think it's better for the HA Manager to already know
in advance whether an HA resource can be moved and if so where it can go
and doesn't issue migrations to nodes where it cannot go at all.

This gives the HA Manager some temporal information when the migration
blocker exists, because the LRM can only respond whether it didn't work
now (return ERROR), but the migration could have been successful just
before or right after, so we can only guess from there.

And the HA Manager would then also try not to issue migrations at all,
that are guaranteed to fail when the LRM will try them some moments
later.

Even though we cannot derive everything (at least from the config alone,
and to minimize too big of an overhead) and there's still the time
window where the HA Manager derived the migration blockers and the LRM
actually trying out the migration (where the preconditions could have
changed in between), it should cover the most obvious cases and reduces
the amount of times where the HA Manager (automatically) issues a
migration, that then fails for the LRM, which is of course not desirable
if we can prevent it.




      parent reply	other threads:[~2026-11-20 13:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20  2:54 [PATCH] lrm: refuse targets dropping the guest identity before stopping guests Thomas Lamprecht
2026-11-20 12:31 ` Dominik Csapak
2026-11-20 13:21 ` Daniel Kral [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=DN02IKNXDMOL.1C7I1M7NN7BL6@proxmox.com \
    --to=d.kral@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 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