[pve-devel] [PATCH ha-manager v2 06/12] rules: resource affinity: make message in inter-consistency check clearer

Daniel Kral d.kral at proxmox.com
Fri Aug 1 18:22:21 CEST 2025


Most users will likely interact with the HA rules through the web
interface, where the HA rule ids are not shown in the rules view.

Error messages with direct references to these rule ids will seem
confusing to users, so replace them with a more generic name.

Reported-by: Fiona Ebner <f.ebner at proxmox.com>
Signed-off-by: Daniel Kral <d.kral at proxmox.com>
---
 src/PVE/HA/Rules/ResourceAffinity.pm                      | 4 ++--
 .../inconsistent-resource-affinity-rules.cfg.expect       | 8 ++++----
 ...r-implicit-negative-resource-affinity-rules.cfg.expect | 4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/PVE/HA/Rules/ResourceAffinity.pm b/src/PVE/HA/Rules/ResourceAffinity.pm
index 1d2ed1ed..7327ee08 100644
--- a/src/PVE/HA/Rules/ResourceAffinity.pm
+++ b/src/PVE/HA/Rules/ResourceAffinity.pm
@@ -236,9 +236,9 @@ __PACKAGE__->register_check(
             my ($positiveid, $negativeid) = @$conflict;
 
             push $errors->{$positiveid}->{resources}->@*,
-                "rule shares two or more resources with '$negativeid'";
+                "rule shares two or more resources with a negative resource affinity rule";
             push $errors->{$negativeid}->{resources}->@*,
-                "rule shares two or more resources with '$positiveid'";
+                "rule shares two or more resources with a positive resource affinity rule";
         }
     },
 );
diff --git a/src/test/rules_cfgs/inconsistent-resource-affinity-rules.cfg.expect b/src/test/rules_cfgs/inconsistent-resource-affinity-rules.cfg.expect
index b0cde0f8..d4a2d7b2 100644
--- a/src/test/rules_cfgs/inconsistent-resource-affinity-rules.cfg.expect
+++ b/src/test/rules_cfgs/inconsistent-resource-affinity-rules.cfg.expect
@@ -1,8 +1,8 @@
 --- Log ---
-Drop rule 'keep-apart1', because rule shares two or more resources with 'stick-together1'.
-Drop rule 'keep-apart2', because rule shares two or more resources with 'stick-together1'.
-Drop rule 'stick-together1', because rule shares two or more resources with 'keep-apart1'.
-Drop rule 'stick-together1', because rule shares two or more resources with 'keep-apart2'.
+Drop rule 'keep-apart1', because rule shares two or more resources with a positive resource affinity rule.
+Drop rule 'keep-apart2', because rule shares two or more resources with a positive resource affinity rule.
+Drop rule 'stick-together1', because rule shares two or more resources with a negative resource affinity rule.
+Drop rule 'stick-together1', because rule shares two or more resources with a negative resource affinity rule.
 --- Config ---
 $VAR1 = {
           'digest' => '50875b320034d8ac7dded185e590f5f87c4e2bb6',
diff --git a/src/test/rules_cfgs/infer-implicit-negative-resource-affinity-rules.cfg.expect b/src/test/rules_cfgs/infer-implicit-negative-resource-affinity-rules.cfg.expect
index bcd368ab..09364d41 100644
--- a/src/test/rules_cfgs/infer-implicit-negative-resource-affinity-rules.cfg.expect
+++ b/src/test/rules_cfgs/infer-implicit-negative-resource-affinity-rules.cfg.expect
@@ -1,6 +1,6 @@
 --- Log ---
-Drop rule 'do-not-infer-inconsistent-negative2', because rule shares two or more resources with 'do-not-infer-inconsistent-positive1'.
-Drop rule 'do-not-infer-inconsistent-positive1', because rule shares two or more resources with 'do-not-infer-inconsistent-negative2'.
+Drop rule 'do-not-infer-inconsistent-negative2', because rule shares two or more resources with a positive resource affinity rule.
+Drop rule 'do-not-infer-inconsistent-positive1', because rule shares two or more resources with a negative resource affinity rule.
 --- Config ---
 $VAR1 = {
           'digest' => 'd8724dfe2130bb642b98e021da973aa0ec0695f0',
-- 
2.47.2





More information about the pve-devel mailing list