public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Daniel Kral <d.kral@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [RFC PATCH-SERIES ha-manager 0/2] Negative Node Affinity Rules
Date: Fri, 19 Dec 2025 14:35:45 +0100	[thread overview]
Message-ID: <20251219133643.295514-1-d.kral@proxmox.com> (raw)

For larger HA clusters, specifying the nodes in simple* node affinity
rules as opt-out (negative) instead of opt-in (positive) can make the
rule set easier to follow and implement by users.

* simple = without priority groups


There's no web interface integration yet, because I'm not entirely sure
yet how to integrate it with the concept of priority groups for positive
node affinity rules, which do not make sense in this context as the
specified nodes will be removed from the effective node set.

As the conversion is pretty straightforward, we could even allow users
to convert between positive and negative node affinity rules (e.g. when
switching the affinity type in the web interface?).


Negative node affinity rules can be declared manually in the rules.cfg
now with these two small patches:


node-affinity: ha-rule-name
	affinity negative
	nodes node1,node2
	resources vm:100,vm:101

In a cluster with node1,...,node5 this will result in the identical
positive node affinity rule:

node-affinity: ha-rule-name-dual
	affinity positive
	nodes node3,node4,node5
	resources vm:100,vm:101


Daniel Kral (2):
  rules: node affinity: add affinity property to node affinity rules
  rules: node affinity: implement negative node affinity rules

 src/PVE/HA/Groups.pm                          |  1 +
 src/PVE/HA/HashTools.pm                       | 20 ++++++
 src/PVE/HA/Rules.pm                           |  2 +
 src/PVE/HA/Rules/NodeAffinity.pm              | 64 +++++++++++++++++++
 .../defaults-for-node-affinity-rules.cfg      | 23 +++++--
 ...efaults-for-node-affinity-rules.cfg.expect | 62 +++++++++++++++++-
 ...nt-node-resource-affinity-rules.cfg.expect |  3 +
 ...ositive-resource-affinity-rules.cfg.expect |  4 ++
 ...ty-with-resource-affinity-rules.cfg.expect |  2 +
 ...rce-refs-in-node-affinity-rules.cfg.expect |  3 +
 10 files changed, 179 insertions(+), 5 deletions(-)

-- 
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-12-19 13:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-19 13:35 Daniel Kral [this message]
2025-12-19 13:35 ` [pve-devel] [RFC PATCH ha-manager 1/2] rules: node affinity: add affinity property to node affinity rules Daniel Kral
2025-12-19 13:35 ` [pve-devel] [RFC PATCH ha-manager 2/2] rules: node affinity: implement negative " Daniel Kral

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=20251219133643.295514-1-d.kral@proxmox.com \
    --to=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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal