From: Daniel Kral <d.kral@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH ha-manager 0/3] fix mixed resource affinity precedence
Date: Fri, 19 Sep 2025 16:08:08 +0200 [thread overview]
Message-ID: <20250919140856.1361124-1-d.kral@proxmox.com> (raw)
Some last-minute changes to the positive resource affinity's heuristic
(which is described in the next paragraph) in the initial implementation
broke the mixed usage of resource affinity rules.
Strict positive resource affinity rules narrow down the possible nodes
to a single candidate for a HA resource A, which is the node, where the
most of the HA resources in the positive affinity rule are already
running on and in case of a tie the alphabetically first node is chosen.
If the chosen node contains a HA resource B, which is in negative
affinity with the HA resource A, then there will be no possible node
left as it is removed now as well and won't resolve the incorrect node
placement (see the test cases for more details).
Overall, the guarantees of strict negative resource affinity rules (do
not put negative affinite resources on either the same current nor
migration target node) can become quite expensive/inefficient in the
case where two HA resources, which are in negative resource affinity,
are on the same node initially, because both need to be migrated away
from their current node. Even more so when there aren't enough nodes to
use as "spare" nodes (see the last patch for an example).
This could be resolved in a future patch series by either introducing
non-strict resource affinity rules or loosening that guarantee in the
case where only one HA resource is migrated away and the other stays
put.
Successfully ran `git rebase master --exec 'make clean && make deb'` on
the series before sending.
Daniel Kral (3):
tests: add regression tests for mixed resource affinity rules
manager: fix precedence in mixed resource affinity rules usage
test: add additional mixed resource affinity rule test cases
src/PVE/HA/Manager.pm | 2 +-
.../README | 16 ++++
.../cmdlist | 3 +
.../hardware_status | 5 +
.../log.expect | 50 ++++++++++
.../manager_status | 1 +
.../rules_config | 7 ++
.../service_config | 6 ++
.../README | 21 +++++
.../cmdlist | 3 +
.../hardware_status | 5 +
.../log.expect | 68 ++++++++++++++
.../manager_status | 1 +
.../rules_config | 11 +++
.../service_config | 8 ++
.../README | 20 ++++
.../cmdlist | 3 +
.../hardware_status | 5 +
.../log.expect | 92 +++++++++++++++++++
.../manager_status | 1 +
.../rules_config | 11 +++
.../service_config | 8 ++
.../README | 14 +++
.../cmdlist | 3 +
.../hardware_status | 6 ++
.../log.expect | 85 +++++++++++++++++
.../manager_status | 1 +
.../rules_config | 11 +++
.../service_config | 8 ++
29 files changed, 474 insertions(+), 1 deletion(-)
create mode 100644 src/test/test-resource-affinity-strict-mixed1/README
create mode 100644 src/test/test-resource-affinity-strict-mixed1/cmdlist
create mode 100644 src/test/test-resource-affinity-strict-mixed1/hardware_status
create mode 100644 src/test/test-resource-affinity-strict-mixed1/log.expect
create mode 100644 src/test/test-resource-affinity-strict-mixed1/manager_status
create mode 100644 src/test/test-resource-affinity-strict-mixed1/rules_config
create mode 100644 src/test/test-resource-affinity-strict-mixed1/service_config
create mode 100644 src/test/test-resource-affinity-strict-mixed2/README
create mode 100644 src/test/test-resource-affinity-strict-mixed2/cmdlist
create mode 100644 src/test/test-resource-affinity-strict-mixed2/hardware_status
create mode 100644 src/test/test-resource-affinity-strict-mixed2/log.expect
create mode 100644 src/test/test-resource-affinity-strict-mixed2/manager_status
create mode 100644 src/test/test-resource-affinity-strict-mixed2/rules_config
create mode 100644 src/test/test-resource-affinity-strict-mixed2/service_config
create mode 100644 src/test/test-resource-affinity-strict-mixed3/README
create mode 100644 src/test/test-resource-affinity-strict-mixed3/cmdlist
create mode 100644 src/test/test-resource-affinity-strict-mixed3/hardware_status
create mode 100644 src/test/test-resource-affinity-strict-mixed3/log.expect
create mode 100644 src/test/test-resource-affinity-strict-mixed3/manager_status
create mode 100644 src/test/test-resource-affinity-strict-mixed3/rules_config
create mode 100644 src/test/test-resource-affinity-strict-mixed3/service_config
create mode 100644 src/test/test-resource-affinity-strict-mixed4/README
create mode 100644 src/test/test-resource-affinity-strict-mixed4/cmdlist
create mode 100644 src/test/test-resource-affinity-strict-mixed4/hardware_status
create mode 100644 src/test/test-resource-affinity-strict-mixed4/log.expect
create mode 100644 src/test/test-resource-affinity-strict-mixed4/manager_status
create mode 100644 src/test/test-resource-affinity-strict-mixed4/rules_config
create mode 100644 src/test/test-resource-affinity-strict-mixed4/service_config
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next reply other threads:[~2025-09-19 14:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-19 14:08 Daniel Kral [this message]
2025-09-19 14:08 ` [pve-devel] [PATCH ha-manager 1/3] tests: add regression tests for mixed resource affinity rules Daniel Kral
2025-09-19 14:08 ` [pve-devel] [PATCH ha-manager 2/3] manager: fix precedence in mixed resource affinity rules usage Daniel Kral
2025-09-19 14:08 ` [pve-devel] [PATCH ha-manager 3/3] test: add additional mixed resource affinity rule test cases 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=20250919140856.1361124-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