From: "Michael Köppl" <m.koeppl@proxmox.com>
To: "Daniel Kral" <d.kral@proxmox.com>, <pve-devel@lists.proxmox.com>
Subject: Re: [PATCH ha-manager 7/7] manager: try multiple priority classes when applying negative resource affinity
Date: Wed, 29 Apr 2026 18:58:25 +0200 [thread overview]
Message-ID: <DI5SQYNCLBM8.1E3JM6DDFLP69@proxmox.com> (raw)
In-Reply-To: <20260422100035.232716-8-d.kral@proxmox.com>
On Wed Apr 22, 2026 at 12:00 PM CEST, Daniel Kral wrote:
[snip]
> @@ -354,7 +363,15 @@ sub select_service_node {
> }
> }
>
> - apply_negative_resource_affinity($separate, $pri_nodes);
> + # do not consider nodes where HA resources from a possible negative resource
> + # affinity rule are running on.
> + # as such a negative resource affinity could end up emptying the current
> + # priority class, try the succeeding priority classes which result in a
> + # non-empty node set or else end up with an empty set.
> + do {
> + apply_negative_resource_affinity($separate, $pri_nodes);
> + } while (keys %$pri_nodes < 1 && ($pri_nodes = shift @$priority_classes));
> + $pri_nodes = {} if !defined($pri_nodes);
Just above this, $tried_nodes is removed from $pri_nodes. If the
$tried_nodes are not also removed from other priority classes, couldn't
this run into a migration loop where it tries again and again to migrate
to a failed node from a lower priority class? I'm not entirely sure
about this, it just seemed a bit odd to me at first glance. The only
scenario I can think of is one where you have vm:100, vm:101 with a
non-strict node affinity rule for vm:100 (so you'd have 2 priority
classes. don't think it's possible otherwise because you cannot combine
negative resource affinity rule and node affinity rule with priorities.)
and a negative resource affinity rule that keeps vm:100 and vm:101 apart
and then migrating vm:100 to the other available node (one not in the
node affinity rule, so with prio -1 and therefore lower prio class)
fails.
>
> # fallback to the previous maintenance node if it is available again.
> #
> diff --git a/src/test/test-resource-affinity-with-node-affinity-maintenance-strict-negative1/README b/src/test/test-resource-affinity-with-node-affinity-maintenance-strict-negative1/README
> index c6a11cec..e1fc0d04 100644
> --- a/src/test/test-resource-affinity-with-node-affinity-maintenance-strict-negative1/README
> +++ b/src/test/test-resource-affinity-with-node-affinity-maintenance-strict-negative1/README
> @@ -4,5 +4,6 @@
> - in a non-strict node affinity rule to node2 and node3 (equal priority), and
> - in a strict negative resource affinity rule with each other.
[snip]
prev parent reply other threads:[~2026-04-29 16:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-22 10:00 [PATCH-SERIES ha-manager 0/7] improve handling of maintenance nodes Daniel Kral
2026-04-22 10:00 ` [PATCH ha-manager 1/7] manager: warn if HA resources cannot be moved away from maintenance node Daniel Kral
2026-04-22 10:00 ` [PATCH ha-manager 2/7] test: add test casses for node affinity rules with maintenance mode Daniel Kral
2026-04-22 10:00 ` [PATCH ha-manager 3/7] test: add test cases for resource " Daniel Kral
2026-04-22 10:00 ` [PATCH ha-manager 4/7] manager: make HA resources without failback move back to maintenance node Daniel Kral
2026-04-22 10:00 ` [PATCH ha-manager 5/7] manager: make HA resource bundles " Daniel Kral
2026-04-22 10:00 ` [PATCH ha-manager 6/7] make get_node_affinity return all priority classes sorted in descending order Daniel Kral
2026-04-22 10:00 ` [PATCH ha-manager 7/7] manager: try multiple priority classes when applying negative resource affinity Daniel Kral
2026-04-29 16:58 ` 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=DI5SQYNCLBM8.1E3JM6DDFLP69@proxmox.com \
--to=m.koeppl@proxmox.com \
--cc=d.kral@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox