From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 9D23F1FF15C for ; Fri, 19 Sep 2025 16:08:48 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7C8B9186C5; Fri, 19 Sep 2025 16:09:03 +0200 (CEST) From: Daniel Kral To: pve-devel@lists.proxmox.com Date: Fri, 19 Sep 2025 16:08:08 +0200 Message-ID: <20250919140856.1361124-1-d.kral@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1758290929555 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.015 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH ha-manager 0/3] fix mixed resource affinity precedence X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" 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