Blob Blame History Raw
From b1094468ab0f7c6d2f5b457b721f3a852a9cae2c Mon Sep 17 00:00:00 2001
From: Klaus Wenninger <klaus.wenninger@aon.at>
Date: Thu, 14 Jul 2022 13:09:51 +0200
Subject: [PATCH 1/2] Fix: do unfencing equally for cluster-nodes & remotes

Fixes T28
---
 lib/pengine/utils.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/lib/pengine/utils.c b/lib/pengine/utils.c
index 0c2eb3c16..83f76cccf 100644
--- a/lib/pengine/utils.c
+++ b/lib/pengine/utils.c
@@ -1201,12 +1201,8 @@ pe_fence_op(pe_node_t * node, const char *op, bool optional, const char *reason,
         add_hash_param(stonith_op->meta, XML_LRM_ATTR_TARGET_UUID, node->details->id);
         add_hash_param(stonith_op->meta, "stonith_action", op);
 
-        if (pe__is_guest_or_remote_node(node)
-            && pcmk_is_set(data_set->flags, pe_flag_enable_unfencing)) {
-            /* Extra work to detect device changes on remotes
-             *
-             * We may do this for all nodes in the future, but for now
-             * the pcmk__check_action_config() based stuff works fine.
+        if (pcmk_is_set(data_set->flags, pe_flag_enable_unfencing)) {
+            /* Extra work to detect device changes
              */
             long max = 1024;
             long digests_all_offset = 0;
-- 
2.31.1


From f5db6e2c94273623a49f36f1bdb6c39315c53cab Mon Sep 17 00:00:00 2001
From: Klaus Wenninger <klaus.wenninger@aon.at>
Date: Thu, 14 Jul 2022 11:29:05 +0200
Subject: [PATCH 2/2] Test: cts-scheduler: update expected output for changes
 in unfencing

---
 cts/scheduler/exp/start-then-stop-with-unfence.exp | 2 +-
 cts/scheduler/exp/unfence-definition.exp           | 6 +++---
 cts/scheduler/exp/unfence-device.exp               | 6 +++---
 cts/scheduler/exp/unfence-parameters.exp           | 6 +++---
 cts/scheduler/exp/unfence-startup.exp              | 4 ++--
 5 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/cts/scheduler/exp/start-then-stop-with-unfence.exp b/cts/scheduler/exp/start-then-stop-with-unfence.exp
index b1868586f..69cfb63de 100644
--- a/cts/scheduler/exp/start-then-stop-with-unfence.exp
+++ b/cts/scheduler/exp/start-then-stop-with-unfence.exp
@@ -151,7 +151,7 @@
   <synapse id="11">
     <action_set>
       <crm_event id="5" operation="stonith" operation_key="stonith-rhel7-node1.example.com-on" on_node="rhel7-node1.example.com" on_node_uuid="1">
-        <attributes CRM_meta_on_node="rhel7-node1.example.com" CRM_meta_on_node_uuid="1" CRM_meta_probe_complete="true" CRM_meta_shutdown="0" CRM_meta_stonith_action="on" />
+        <attributes CRM_meta_digests_all="mpath-node1:fence_mpath:019ed48e26413030411da3ae8888a649,mpath-node2:fence_mpath:b97ef86afabe0426040d1bef247023ee," CRM_meta_digests_secure="mpath-node1:fence_mpath:21f9562fe6837f7357aab98ba69f71fb,mpath-node2:fence_mpath:563e5d6a67b7dcdb65d2f0325aed9fc1," CRM_meta_on_node="rhel7-node1.example.com" CRM_meta_on_node_uuid="1" CRM_meta_probe_complete="true" CRM_meta_shutdown="0" CRM_meta_stonith_action="on" />
       </crm_event>
     </action_set>
     <inputs/>
diff --git a/cts/scheduler/exp/unfence-definition.exp b/cts/scheduler/exp/unfence-definition.exp
index 840a8d212..6a098ed3c 100644
--- a/cts/scheduler/exp/unfence-definition.exp
+++ b/cts/scheduler/exp/unfence-definition.exp
@@ -373,7 +373,7 @@
   <synapse id="22">
     <action_set>
       <crm_event id="29" operation="stonith" operation_key="stonith-virt-4-reboot" on_node="virt-4" on_node_uuid="4">
-        <attributes CRM_meta_on_node="virt-4" CRM_meta_on_node_uuid="4" CRM_meta_stonith_action="reboot" />
+        <attributes CRM_meta_digests_all="fencing:fence_scsi:f2317cad3d54cec5d7d7aa7d0bf35cf8," CRM_meta_digests_secure="fencing:fence_scsi:f2317cad3d54cec5d7d7aa7d0bf35cf8," CRM_meta_on_node="virt-4" CRM_meta_on_node_uuid="4" CRM_meta_stonith_action="reboot" />
         <downed>
           <node id="4"/>
         </downed>
@@ -384,7 +384,7 @@
   <synapse id="23">
     <action_set>
       <crm_event id="3" operation="stonith" operation_key="stonith-virt-3-on" on_node="virt-3" on_node_uuid="3">
-        <attributes CRM_meta_on_node="virt-3" CRM_meta_on_node_uuid="3" CRM_meta_stonith_action="on" />
+        <attributes CRM_meta_digests_all="fencing:fence_scsi:f2317cad3d54cec5d7d7aa7d0bf35cf8," CRM_meta_digests_secure="fencing:fence_scsi:f2317cad3d54cec5d7d7aa7d0bf35cf8," CRM_meta_on_node="virt-3" CRM_meta_on_node_uuid="3" CRM_meta_stonith_action="on" />
       </crm_event>
     </action_set>
     <inputs/>
@@ -392,7 +392,7 @@
   <synapse id="24">
     <action_set>
       <crm_event id="1" operation="stonith" operation_key="stonith-virt-1-on" on_node="virt-1" on_node_uuid="1">
-        <attributes CRM_meta_on_node="virt-1" CRM_meta_on_node_uuid="1" CRM_meta_stonith_action="on" />
+        <attributes CRM_meta_digests_all="fencing:fence_scsi:f2317cad3d54cec5d7d7aa7d0bf35cf8," CRM_meta_digests_secure="fencing:fence_scsi:f2317cad3d54cec5d7d7aa7d0bf35cf8," CRM_meta_on_node="virt-1" CRM_meta_on_node_uuid="1" CRM_meta_stonith_action="on" />
       </crm_event>
     </action_set>
     <inputs>
diff --git a/cts/scheduler/exp/unfence-device.exp b/cts/scheduler/exp/unfence-device.exp
index a39fc758f..452351d98 100644
--- a/cts/scheduler/exp/unfence-device.exp
+++ b/cts/scheduler/exp/unfence-device.exp
@@ -76,7 +76,7 @@
   <synapse id="5">
     <action_set>
       <crm_event id="6" operation="stonith" operation_key="stonith-virt-013-on" on_node="virt-013" on_node_uuid="3">
-        <attributes CRM_meta_on_node="virt-013" CRM_meta_on_node_uuid="3" CRM_meta_shutdown="0" CRM_meta_stonith_action="on" />
+        <attributes CRM_meta_digests_all="fence_scsi:fence_scsi:5950f402238c1e5058a556fe39bb09de," CRM_meta_digests_secure="fence_scsi:fence_scsi:a911b9a554cdc5844d863a91b1ef283a," CRM_meta_on_node="virt-013" CRM_meta_on_node_uuid="3" CRM_meta_shutdown="0" CRM_meta_stonith_action="on" />
       </crm_event>
     </action_set>
     <inputs/>
@@ -84,7 +84,7 @@
   <synapse id="6">
     <action_set>
       <crm_event id="4" operation="stonith" operation_key="stonith-virt-009-on" on_node="virt-009" on_node_uuid="2">
-        <attributes CRM_meta_on_node="virt-009" CRM_meta_on_node_uuid="2" CRM_meta_shutdown="0" CRM_meta_stonith_action="on" />
+        <attributes CRM_meta_digests_all="fence_scsi:fence_scsi:5950f402238c1e5058a556fe39bb09de," CRM_meta_digests_secure="fence_scsi:fence_scsi:a911b9a554cdc5844d863a91b1ef283a," CRM_meta_on_node="virt-009" CRM_meta_on_node_uuid="2" CRM_meta_shutdown="0" CRM_meta_stonith_action="on" />
       </crm_event>
     </action_set>
     <inputs/>
@@ -92,7 +92,7 @@
   <synapse id="7">
     <action_set>
       <crm_event id="2" operation="stonith" operation_key="stonith-virt-008-on" on_node="virt-008" on_node_uuid="1">
-        <attributes CRM_meta_on_node="virt-008" CRM_meta_on_node_uuid="1" CRM_meta_shutdown="0" CRM_meta_stonith_action="on" />
+        <attributes CRM_meta_digests_all="fence_scsi:fence_scsi:5950f402238c1e5058a556fe39bb09de," CRM_meta_digests_secure="fence_scsi:fence_scsi:a911b9a554cdc5844d863a91b1ef283a," CRM_meta_on_node="virt-008" CRM_meta_on_node_uuid="1" CRM_meta_shutdown="0" CRM_meta_stonith_action="on" />
       </crm_event>
     </action_set>
     <inputs/>
diff --git a/cts/scheduler/exp/unfence-parameters.exp b/cts/scheduler/exp/unfence-parameters.exp
index 3e70cb8e9..268bf008e 100644
--- a/cts/scheduler/exp/unfence-parameters.exp
+++ b/cts/scheduler/exp/unfence-parameters.exp
@@ -357,7 +357,7 @@
   <synapse id="21">
     <action_set>
       <crm_event id="28" operation="stonith" operation_key="stonith-virt-4-reboot" on_node="virt-4" on_node_uuid="4">
-        <attributes CRM_meta_on_node="virt-4" CRM_meta_on_node_uuid="4" CRM_meta_stonith_action="reboot" />
+        <attributes CRM_meta_digests_all="fencing:fence_scsi:f2317cad3d54cec5d7d7aa7d0bf35cf8," CRM_meta_digests_secure="fencing:fence_scsi:f2317cad3d54cec5d7d7aa7d0bf35cf8," CRM_meta_on_node="virt-4" CRM_meta_on_node_uuid="4" CRM_meta_stonith_action="reboot" />
         <downed>
           <node id="4"/>
         </downed>
@@ -368,7 +368,7 @@
   <synapse id="22">
     <action_set>
       <crm_event id="3" operation="stonith" operation_key="stonith-virt-3-on" on_node="virt-3" on_node_uuid="3">
-        <attributes CRM_meta_on_node="virt-3" CRM_meta_on_node_uuid="3" CRM_meta_stonith_action="on" />
+        <attributes CRM_meta_digests_all="fencing:fence_scsi:f2317cad3d54cec5d7d7aa7d0bf35cf8," CRM_meta_digests_secure="fencing:fence_scsi:f2317cad3d54cec5d7d7aa7d0bf35cf8," CRM_meta_on_node="virt-3" CRM_meta_on_node_uuid="3" CRM_meta_stonith_action="on" />
       </crm_event>
     </action_set>
     <inputs/>
@@ -376,7 +376,7 @@
   <synapse id="23">
     <action_set>
       <crm_event id="1" operation="stonith" operation_key="stonith-virt-1-on" on_node="virt-1" on_node_uuid="1">
-        <attributes CRM_meta_on_node="virt-1" CRM_meta_on_node_uuid="1" CRM_meta_stonith_action="on" />
+        <attributes CRM_meta_digests_all="fencing:fence_scsi:f2317cad3d54cec5d7d7aa7d0bf35cf8," CRM_meta_digests_secure="fencing:fence_scsi:f2317cad3d54cec5d7d7aa7d0bf35cf8," CRM_meta_on_node="virt-1" CRM_meta_on_node_uuid="1" CRM_meta_stonith_action="on" />
       </crm_event>
     </action_set>
     <inputs>
diff --git a/cts/scheduler/exp/unfence-startup.exp b/cts/scheduler/exp/unfence-startup.exp
index 6745bff4b..f2d38e80c 100644
--- a/cts/scheduler/exp/unfence-startup.exp
+++ b/cts/scheduler/exp/unfence-startup.exp
@@ -173,7 +173,7 @@
   <synapse id="11">
     <action_set>
       <crm_event id="28" operation="stonith" operation_key="stonith-virt-4-reboot" on_node="virt-4" on_node_uuid="4">
-        <attributes CRM_meta_on_node="virt-4" CRM_meta_on_node_uuid="4" CRM_meta_stonith_action="reboot" />
+        <attributes CRM_meta_digests_all="fencing:fence_scsi:f2317cad3d54cec5d7d7aa7d0bf35cf8," CRM_meta_digests_secure="fencing:fence_scsi:f2317cad3d54cec5d7d7aa7d0bf35cf8," CRM_meta_on_node="virt-4" CRM_meta_on_node_uuid="4" CRM_meta_stonith_action="reboot" />
         <downed>
           <node id="4"/>
         </downed>
@@ -184,7 +184,7 @@
   <synapse id="12">
     <action_set>
       <crm_event id="3" operation="stonith" operation_key="stonith-virt-3-on" on_node="virt-3" on_node_uuid="3">
-        <attributes CRM_meta_on_node="virt-3" CRM_meta_on_node_uuid="3" CRM_meta_stonith_action="on" />
+        <attributes CRM_meta_digests_all="fencing:fence_scsi:f2317cad3d54cec5d7d7aa7d0bf35cf8," CRM_meta_digests_secure="fencing:fence_scsi:f2317cad3d54cec5d7d7aa7d0bf35cf8," CRM_meta_on_node="virt-3" CRM_meta_on_node_uuid="3" CRM_meta_stonith_action="on" />
       </crm_event>
     </action_set>
     <inputs/>
-- 
2.31.1