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 EB8C11FF138 for ; Wed, 22 Jul 2026 10:50:33 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 75B2B2153E; Wed, 22 Jul 2026 10:49:05 +0200 (CEST) From: Daniel Kral To: pve-devel@lists.proxmox.com Subject: [PATCH-SERIES docs/ha-manager/manager v3 00/16] Negative Node Affinity Rules Date: Wed, 22 Jul 2026 10:48:08 +0200 Message-ID: <20260722084824.108350-1-d.kral@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1784710082280 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.135 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) 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: Z2EY5ZSAUZVOBPRYKPO5TZV6T7U2JB67 X-Message-ID-Hash: Z2EY5ZSAUZVOBPRYKPO5TZV6T7U2JB67 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: v2: https://lore.proxmox.com/pve-devel/20260602100226.180071-1-d.kral@proxmox.com/ RFC v1: https://lore.proxmox.com/pve-devel/20251219133643.295514-1-d.kral@proxmox.com/ Thanks to @David for reviewing the patches in v2! changes since v2: - rebase on master - add ha patch to convert PVE::HA::HashTools to use v5.36 - make set_difference() use signatures instead of prototypes - add ui patch to handle empty node priority list string - use store.{begin,end}Update() when setting node priorities - clean up NodePrioritySelector component - fix being able to send node priorities again (forgot adding the change listener on the proxmoxintegerfield in the priority column) - add link between config value and descriptive text for node affinity and resource affinity rules in the web interface - fix some typos in the doc patches 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 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 The web interface does allow switching between positive and negative node affinity rules at any time to make it convenient when one representation is easier to read than the other. The node selection is just the complement set and the node priority class field is not shown for negative node affinity rules. ha-manager: Daniel Kral (4): rules: node affinity: add affinity property to node affinity rules rules: rename ambiguous argument nodes to cluster nodes hash-tools: use v5.36 and signatures in module rules: node affinity: implement negative node affinity rules src/PVE/HA/Groups.pm | 1 + src/PVE/HA/HashTools.pm | 33 ++-- src/PVE/HA/Rules.pm | 39 ++-- src/PVE/HA/Rules/NodeAffinity.pm | 171 +++++++++++++++++- src/PVE/HA/Rules/ResourceAffinity.pm | 17 +- .../defaults-for-node-affinity-rules.cfg | 23 ++- ...efaults-for-node-affinity-rules.cfg.expect | 62 ++++++- ...nt-node-resource-affinity-rules.cfg.expect | 3 + ...effective-negative-node-affinity-rules.cfg | 12 ++ ...ve-negative-node-affinity-rules.cfg.expect | 17 ++ ...ositive-resource-affinity-rules.cfg.expect | 4 + ...ty-with-resource-affinity-rules.cfg.expect | 2 + ...rce-refs-in-node-affinity-rules.cfg.expect | 3 + ...iority-in-negative-node-affinity-rules.cfg | 11 ++ ...in-negative-node-affinity-rules.cfg.expect | 45 +++++ 15 files changed, 399 insertions(+), 44 deletions(-) create mode 100644 src/test/rules_cfgs/ineffective-negative-node-affinity-rules.cfg create mode 100644 src/test/rules_cfgs/ineffective-negative-node-affinity-rules.cfg.expect create mode 100644 src/test/rules_cfgs/node-priority-in-negative-node-affinity-rules.cfg create mode 100644 src/test/rules_cfgs/node-priority-in-negative-node-affinity-rules.cfg.expect manager: Daniel Kral (8): ui: ha: node affinity: handle empty node priority list string ui: ha: node affinity: handle non-existent nodes ui: ha: node affinity: do update node selection all at once ui: ha: node affinity: commit node priority store all at once ui: ha: node affinity: move node priority selector into separate component ui: ha: resource affinity: add hint for affinity type config value ui: ha: node affinity: allow setting affinity for node affinity rules ui: ha: node affinity: do not send default node affinity rule values www/manager6/Makefile | 1 + www/manager6/ha/NodePrioritySelector.js | 237 ++++++++++++++++++ www/manager6/ha/rules/NodeAffinityRuleEdit.js | 157 +++--------- www/manager6/ha/rules/NodeAffinityRules.js | 5 + .../ha/rules/ResourceAffinityRuleEdit.js | 4 +- 5 files changed, 284 insertions(+), 120 deletions(-) create mode 100644 www/manager6/ha/NodePrioritySelector.js docs: Daniel Kral (4): ha-manager: rules: use the correct article for terms starting with HA ha-manager: rules: improve resource affinity rule short description ha-manager: rules: adapt rule configuration examples ha-manager: rules: add negative node affinity rule descriptions ha-manager.adoc | 77 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 53 insertions(+), 24 deletions(-) Summary over all repositories: 21 files changed, 736 insertions(+), 188 deletions(-) -- Generated by murpp 0.12.0