From f6ffb93edb68fc20d9fb6a1324bc724ecb131617 Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Mon, 18 Jul 2016 14:55:12 -0500
Subject: [PATCH 1/4] Feature: libpengine: allow pe_order_same_node option for
constraints
With this option, a constraint between two actions applies only if they are
scheduled on the same node.
---
include/crm/pengine/status.h | 1 +
pengine/graph.c | 11 +++++++++++
2 files changed, 12 insertions(+)
diff --git a/include/crm/pengine/status.h b/include/crm/pengine/status.h
index d9f2ca5..94aa832 100644
--- a/include/crm/pengine/status.h
+++ b/include/crm/pengine/status.h
@@ -397,6 +397,7 @@ enum pe_ordering {
pe_order_restart = 0x1000, /* 'then' is runnable if 'first' is optional or runnable */
pe_order_stonith_stop = 0x2000, /* only applies if the action is non-pseudo */
pe_order_serialize_only = 0x4000, /* serialize */
+ pe_order_same_node = 0x8000, /* applies only if 'first' and 'then' are on same node */
pe_order_implies_first_printed = 0x10000, /* Like ..implies_first but only ensures 'first' is printed, not mandatory */
pe_order_implies_then_printed = 0x20000, /* Like ..implies_then but only ensures 'then' is printed, not mandatory */
diff --git a/pengine/graph.c b/pengine/graph.c
index 0b7252d..9bc6731 100644
--- a/pengine/graph.c
+++ b/pengine/graph.c
@@ -509,6 +509,17 @@ update_action(action_t * then)
}
}
+ /* Disable constraint if it only applies when on same node, but isn't */
+ if (is_set(other->type, pe_order_same_node)
+ && (first_node->details != then_node->details)) {
+
+ crm_trace("Disabled constraint %s on %s -> %s on %s",
+ other->action->uuid, first_node->details->uname,
+ then->uuid, then_node->details->uname);
+ other->type = pe_order_none;
+ continue;
+ }
+
clear_bit(changed, pe_graph_updated_first);
if (first->rsc != then->rsc
--
1.8.3.1
From 48622e7462f8a9bbb94d9cc925133f3afaa52629 Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Mon, 18 Jul 2016 16:25:56 -0500
Subject: [PATCH 2/4] Fix: pengine: avoid transition loop for start-then-stop +
unfencing
Partial fix
---
include/crm/pengine/status.h | 2 +-
pengine/native.c | 37 ++++++++++++++++++++++++-------------
2 files changed, 25 insertions(+), 14 deletions(-)
diff --git a/include/crm/pengine/status.h b/include/crm/pengine/status.h
index 94aa832..c376c73 100644
--- a/include/crm/pengine/status.h
+++ b/include/crm/pengine/status.h
@@ -206,7 +206,7 @@ struct node_s {
# define pe_rsc_needs_quorum 0x10000000ULL
# define pe_rsc_needs_fencing 0x20000000ULL
# define pe_rsc_needs_unfencing 0x40000000ULL
-# define pe_rsc_have_unfencing 0x80000000ULL
+# define pe_rsc_have_unfencing 0x80000000ULL /* obsolete (not set or used by cluster) */
enum pe_graph_flags {
pe_graph_none = 0x00000,
diff --git a/pengine/native.c b/pengine/native.c
index 9f659ef..9d9a2da 100644
--- a/pengine/native.c
+++ b/pengine/native.c
@@ -1342,30 +1342,41 @@ native_internal_constraints(resource_t * rsc, pe_working_set_t * data_set)
if (is_stonith == FALSE
&& is_set(data_set->flags, pe_flag_enable_unfencing)
- && is_set(rsc->flags, pe_rsc_needs_unfencing)
- && is_not_set(rsc->flags, pe_rsc_have_unfencing)) {
+ && is_set(rsc->flags, pe_rsc_needs_unfencing)) {
/* Check if the node needs to be unfenced first */
node_t *node = NULL;
GHashTableIter iter;
- if(rsc != top) {
- /* Only create these constraints once, rsc is almost certainly cloned */
- set_bit_recursive(top, pe_rsc_have_unfencing);
- }
-
g_hash_table_iter_init(&iter, rsc->allowed_nodes);
while (g_hash_table_iter_next(&iter, NULL, (void **)&node)) {
action_t *unfence = pe_fence_op(node, "on", TRUE, data_set);
- custom_action_order(top, generate_op_key(top->id, top == rsc?RSC_STOP:RSC_STOPPED, 0), NULL,
- NULL, strdup(unfence->uuid), unfence,
- pe_order_optional, data_set);
+ crm_debug("Ordering any stops of %s before %s, and any starts after",
+ rsc->id, unfence->uuid);
- crm_debug("Stopping %s prior to unfencing %s", top->id, unfence->uuid);
+ /*
+ * It would be more efficient to order clone resources once,
+ * rather than order each instance, but ordering the instance
+ * allows us to avoid unnecessary dependencies that might conflict
+ * with user constraints.
+ *
+ * @TODO: This constraint can still produce a transition loop if the
+ * resource has a stop scheduled on the node being unfenced, and
+ * there is a user ordering constraint to start some other resource
+ * (which will be ordered after the unfence) before stopping this
+ * resource. An example is "start some slow-starting cloned service
+ * before stopping an associated virtual IP that may be moving to
+ * it":
+ * stop this -> unfencing -> start that -> stop this
+ */
+ custom_action_order(rsc, stop_key(rsc), NULL,
+ NULL, strdup(unfence->uuid), unfence,
+ pe_order_optional|pe_order_same_node, data_set);
custom_action_order(NULL, strdup(unfence->uuid), unfence,
- top, generate_op_key(top->id, RSC_START, 0), NULL,
- pe_order_implies_then_on_node, data_set);
+ rsc, start_key(rsc), NULL,
+ pe_order_implies_then_on_node|pe_order_same_node,
+ data_set);
}
}
--
1.8.3.1
From 1122b1866f496124b346b75ff955be240553d28c Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Tue, 19 Jul 2016 15:10:27 -0500
Subject: [PATCH 3/4] Test: pengine: update regression tests for new unfence
ordering
---
pengine/test10/unfence-definition.dot | 14 ++++-----
pengine/test10/unfence-definition.exp | 34 +++++++++------------
pengine/test10/unfence-definition.summary | 12 ++++----
pengine/test10/unfence-parameters.dot | 21 ++++++-------
pengine/test10/unfence-parameters.exp | 51 +++++++++++++------------------
pengine/test10/unfence-parameters.summary | 14 ++++-----
pengine/test10/unfence-startup.dot | 4 +--
pengine/test10/unfence-startup.exp | 12 ++++----
pengine/test10/unfence-startup.summary | 2 +-
9 files changed, 72 insertions(+), 92 deletions(-)
diff --git a/pengine/test10/unfence-definition.dot b/pengine/test10/unfence-definition.dot
index 1ae2367..a9e7e6b 100644
--- a/pengine/test10/unfence-definition.dot
+++ b/pengine/test10/unfence-definition.dot
@@ -12,8 +12,6 @@ digraph "g" {
"clvmd-clone_stop_0" [ style=bold color="green" fontcolor="orange"]
"clvmd-clone_stopped_0" -> "clvmd-clone_start_0" [ style = bold]
"clvmd-clone_stopped_0" -> "dlm-clone_stop_0" [ style = bold]
-"clvmd-clone_stopped_0" -> "stonith 'on' virt-1" [ style = bold]
-"clvmd-clone_stopped_0" -> "stonith 'on' virt-3" [ style = bold]
"clvmd-clone_stopped_0" [ style=bold color="green" fontcolor="orange"]
"clvmd:1_monitor_0 virt-2" -> "clvmd-clone_start_0" [ style = bold]
"clvmd:1_monitor_0 virt-2" [ style=bold color="green" fontcolor="black"]
@@ -32,6 +30,7 @@ digraph "g" {
"clvmd_stop_0 virt-1" -> "clvmd-clone_stopped_0" [ style = bold]
"clvmd_stop_0 virt-1" -> "clvmd_start_0 virt-1" [ style = bold]
"clvmd_stop_0 virt-1" -> "dlm_stop_0 virt-1" [ style = bold]
+"clvmd_stop_0 virt-1" -> "stonith 'on' virt-1" [ style = bold]
"clvmd_stop_0 virt-1" [ style=bold color="green" fontcolor="black"]
"dlm-clone_running_0" -> "clvmd-clone_start_0" [ style = bold]
"dlm-clone_running_0" [ style=bold color="green" fontcolor="orange"]
@@ -43,8 +42,6 @@ digraph "g" {
"dlm-clone_stop_0" -> "dlm_stop_0 virt-1" [ style = bold]
"dlm-clone_stop_0" [ style=bold color="green" fontcolor="orange"]
"dlm-clone_stopped_0" -> "dlm-clone_start_0" [ style = bold]
-"dlm-clone_stopped_0" -> "stonith 'on' virt-1" [ style = bold]
-"dlm-clone_stopped_0" -> "stonith 'on' virt-3" [ style = bold]
"dlm-clone_stopped_0" [ style=bold color="green" fontcolor="orange"]
"dlm:2_monitor_0 virt-3" -> "dlm-clone_start_0" [ style = bold]
"dlm:2_monitor_0 virt-3" -> "stonith 'on' virt-3" [ style = bold]
@@ -58,6 +55,7 @@ digraph "g" {
"dlm_stop_0 virt-1" -> "all_stopped" [ style = bold]
"dlm_stop_0 virt-1" -> "dlm-clone_stopped_0" [ style = bold]
"dlm_stop_0 virt-1" -> "dlm_start_0 virt-1" [ style = bold]
+"dlm_stop_0 virt-1" -> "stonith 'on' virt-1" [ style = bold]
"dlm_stop_0 virt-1" [ style=bold color="green" fontcolor="black"]
"fencing_delete_0 virt-1" -> "fencing_start_0 virt-1" [ style = bold]
"fencing_delete_0 virt-1" [ style=bold color="green" fontcolor="black"]
@@ -69,11 +67,11 @@ digraph "g" {
"fencing_stop_0 virt-1" -> "fencing_delete_0 virt-1" [ style = bold]
"fencing_stop_0 virt-1" -> "fencing_start_0 virt-1" [ style = bold]
"fencing_stop_0 virt-1" [ style=bold color="green" fontcolor="black"]
-"stonith 'on' virt-1" -> "clvmd-clone_start_0" [ style = bold]
-"stonith 'on' virt-1" -> "dlm-clone_start_0" [ style = bold]
+"stonith 'on' virt-1" -> "clvmd_start_0 virt-1" [ style = bold]
+"stonith 'on' virt-1" -> "dlm_start_0 virt-1" [ style = bold]
"stonith 'on' virt-1" [ style=bold color="green" fontcolor="black"]
-"stonith 'on' virt-3" -> "clvmd-clone_start_0" [ style = bold]
-"stonith 'on' virt-3" -> "dlm-clone_start_0" [ style = bold]
+"stonith 'on' virt-3" -> "clvmd:2_start_0 virt-3" [ style = bold]
+"stonith 'on' virt-3" -> "dlm:2_start_0 virt-3" [ style = bold]
"stonith 'on' virt-3" -> "fencing_monitor_0 virt-3" [ style = bold]
"stonith 'on' virt-3" [ style=bold color="green" fontcolor="black"]
"stonith 'reboot' virt-4" -> "stonith_complete" [ style = bold]
diff --git a/pengine/test10/unfence-definition.exp b/pengine/test10/unfence-definition.exp
index 9d23a2a..64b9735 100644
--- a/pengine/test10/unfence-definition.exp
+++ b/pengine/test10/unfence-definition.exp
@@ -69,6 +69,9 @@
</action_set>
<inputs>
<trigger>
+ <crm_event id="2" operation="stonith" operation_key="stonith-virt-1-on" on_node="virt-1" on_node_uuid="1"/>
+ </trigger>
+ <trigger>
<rsc_op id="13" operation="stop" operation_key="dlm_stop_0" internal_operation_key="dlm:0_stop_0" on_node="virt-1" on_node_uuid="1"/>
</trigger>
<trigger>
@@ -104,6 +107,9 @@
</action_set>
<inputs>
<trigger>
+ <crm_event id="4" operation="stonith" operation_key="stonith-virt-3-on" on_node="virt-3" on_node_uuid="3"/>
+ </trigger>
+ <trigger>
<pseudo_event id="18" operation="start" operation_key="dlm-clone_start_0"/>
</trigger>
<trigger>
@@ -173,12 +179,6 @@
</action_set>
<inputs>
<trigger>
- <crm_event id="2" operation="stonith" operation_key="stonith-virt-1-on" on_node="virt-1" on_node_uuid="1"/>
- </trigger>
- <trigger>
- <crm_event id="4" operation="stonith" operation_key="stonith-virt-3-on" on_node="virt-3" on_node_uuid="3"/>
- </trigger>
- <trigger>
<rsc_op id="10" operation="monitor" operation_key="dlm:2_monitor_0" on_node="virt-3" on_node_uuid="3"/>
</trigger>
<trigger>
@@ -195,6 +195,9 @@
</action_set>
<inputs>
<trigger>
+ <crm_event id="2" operation="stonith" operation_key="stonith-virt-1-on" on_node="virt-1" on_node_uuid="1"/>
+ </trigger>
+ <trigger>
<rsc_op id="14" operation="start" operation_key="dlm_start_0" internal_operation_key="dlm:0_start_0" on_node="virt-1" on_node_uuid="1"/>
</trigger>
<trigger>
@@ -258,6 +261,9 @@
</action_set>
<inputs>
<trigger>
+ <crm_event id="4" operation="stonith" operation_key="stonith-virt-3-on" on_node="virt-3" on_node_uuid="3"/>
+ </trigger>
+ <trigger>
<rsc_op id="17" operation="start" operation_key="dlm:2_start_0" on_node="virt-3" on_node_uuid="3"/>
</trigger>
<trigger>
@@ -332,12 +338,6 @@
</action_set>
<inputs>
<trigger>
- <crm_event id="2" operation="stonith" operation_key="stonith-virt-1-on" on_node="virt-1" on_node_uuid="1"/>
- </trigger>
- <trigger>
- <crm_event id="4" operation="stonith" operation_key="stonith-virt-3-on" on_node="virt-3" on_node_uuid="3"/>
- </trigger>
- <trigger>
<rsc_op id="8" operation="monitor" operation_key="clvmd:1_monitor_0" on_node="virt-2" on_node_uuid="2"/>
</trigger>
<trigger>
@@ -387,12 +387,6 @@
<trigger>
<rsc_op id="11" operation="monitor" operation_key="clvmd:2_monitor_0" on_node="virt-3" on_node_uuid="3"/>
</trigger>
- <trigger>
- <pseudo_event id="21" operation="stopped" operation_key="dlm-clone_stopped_0"/>
- </trigger>
- <trigger>
- <pseudo_event id="29" operation="stopped" operation_key="clvmd-clone_stopped_0"/>
- </trigger>
</inputs>
</synapse>
<synapse id="25">
@@ -403,10 +397,10 @@
</action_set>
<inputs>
<trigger>
- <pseudo_event id="21" operation="stopped" operation_key="dlm-clone_stopped_0"/>
+ <rsc_op id="13" operation="stop" operation_key="dlm_stop_0" internal_operation_key="dlm:0_stop_0" on_node="virt-1" on_node_uuid="1"/>
</trigger>
<trigger>
- <pseudo_event id="29" operation="stopped" operation_key="clvmd-clone_stopped_0"/>
+ <rsc_op id="22" operation="stop" operation_key="clvmd_stop_0" internal_operation_key="clvmd:0_stop_0" on_node="virt-1" on_node_uuid="1"/>
</trigger>
</inputs>
</synapse>
diff --git a/pengine/test10/unfence-definition.summary b/pengine/test10/unfence-definition.summary
index a317807..05f8003 100644
--- a/pengine/test10/unfence-definition.summary
+++ b/pengine/test10/unfence-definition.summary
@@ -26,23 +26,23 @@ Executing cluster transition:
* Pseudo action: clvmd-clone_stop_0
* Fencing virt-4 (reboot)
* Pseudo action: stonith_complete
+ * Fencing virt-3 (on)
+ * Resource action: fencing monitor on virt-3
+ * Resource action: fencing stop on virt-1
* Resource action: clvmd stop on virt-1
* Pseudo action: clvmd-clone_stopped_0
+ * Resource action: fencing delete on virt-1
* Pseudo action: dlm-clone_stop_0
* Resource action: dlm stop on virt-1
* Pseudo action: dlm-clone_stopped_0
- * Fencing virt-3 (on)
- * Fencing virt-1 (on)
- * Resource action: fencing monitor on virt-3
- * Resource action: fencing stop on virt-1
* Pseudo action: dlm-clone_start_0
+ * Fencing virt-1 (on)
* Pseudo action: all_stopped
- * Resource action: fencing delete on virt-1
+ * Resource action: fencing start on virt-1
* Resource action: dlm start on virt-1
* Resource action: dlm start on virt-3
* Pseudo action: dlm-clone_running_0
* Pseudo action: clvmd-clone_start_0
- * Resource action: fencing start on virt-1
* Resource action: clvmd start on virt-1
* Resource action: clvmd start on virt-2
* Resource action: clvmd start on virt-3
diff --git a/pengine/test10/unfence-parameters.dot b/pengine/test10/unfence-parameters.dot
index 6b23965..c96d314 100644
--- a/pengine/test10/unfence-parameters.dot
+++ b/pengine/test10/unfence-parameters.dot
@@ -12,9 +12,6 @@ digraph "g" {
"clvmd-clone_stop_0" [ style=bold color="green" fontcolor="orange"]
"clvmd-clone_stopped_0" -> "clvmd-clone_start_0" [ style = bold]
"clvmd-clone_stopped_0" -> "dlm-clone_stop_0" [ style = bold]
-"clvmd-clone_stopped_0" -> "stonith 'on' virt-1" [ style = bold]
-"clvmd-clone_stopped_0" -> "stonith 'on' virt-2" [ style = bold]
-"clvmd-clone_stopped_0" -> "stonith 'on' virt-3" [ style = bold]
"clvmd-clone_stopped_0" [ style=bold color="green" fontcolor="orange"]
"clvmd:1_monitor_0 virt-2" -> "clvmd-clone_start_0" [ style = bold]
"clvmd:1_monitor_0 virt-2" -> "stonith 'on' virt-2" [ style = bold]
@@ -37,6 +34,7 @@ digraph "g" {
"clvmd_stop_0 virt-1" -> "clvmd-clone_stopped_0" [ style = bold]
"clvmd_stop_0 virt-1" -> "clvmd_start_0 virt-1" [ style = bold]
"clvmd_stop_0 virt-1" -> "dlm_stop_0 virt-1" [ style = bold]
+"clvmd_stop_0 virt-1" -> "stonith 'on' virt-1" [ style = bold]
"clvmd_stop_0 virt-1" [ style=bold color="green" fontcolor="black"]
"dlm-clone_running_0" -> "clvmd-clone_start_0" [ style = bold]
"dlm-clone_running_0" [ style=bold color="green" fontcolor="orange"]
@@ -50,9 +48,6 @@ digraph "g" {
"dlm-clone_stop_0" -> "dlm_stop_0 virt-2" [ style = bold]
"dlm-clone_stop_0" [ style=bold color="green" fontcolor="orange"]
"dlm-clone_stopped_0" -> "dlm-clone_start_0" [ style = bold]
-"dlm-clone_stopped_0" -> "stonith 'on' virt-1" [ style = bold]
-"dlm-clone_stopped_0" -> "stonith 'on' virt-2" [ style = bold]
-"dlm-clone_stopped_0" -> "stonith 'on' virt-3" [ style = bold]
"dlm-clone_stopped_0" [ style=bold color="green" fontcolor="orange"]
"dlm:2_monitor_0 virt-3" -> "dlm-clone_start_0" [ style = bold]
"dlm:2_monitor_0 virt-3" -> "stonith 'on' virt-3" [ style = bold]
@@ -72,11 +67,13 @@ digraph "g" {
"dlm_stop_0 virt-1" -> "all_stopped" [ style = bold]
"dlm_stop_0 virt-1" -> "dlm-clone_stopped_0" [ style = bold]
"dlm_stop_0 virt-1" -> "dlm_start_0 virt-1" [ style = bold]
+"dlm_stop_0 virt-1" -> "stonith 'on' virt-1" [ style = bold]
"dlm_stop_0 virt-1" [ style=bold color="green" fontcolor="black"]
"dlm_stop_0 virt-2" -> "all_stopped" [ style = bold]
"dlm_stop_0 virt-2" -> "dlm-clone_stopped_0" [ style = bold]
"dlm_stop_0 virt-2" -> "dlm_start_0 virt-2" [ style = bold]
"dlm_stop_0 virt-2" -> "dlm_stop_0 virt-1" [ style = bold]
+"dlm_stop_0 virt-2" -> "stonith 'on' virt-2" [ style = bold]
"dlm_stop_0 virt-2" [ style=bold color="green" fontcolor="black"]
"fencing_monitor_0 virt-3" -> "fencing_start_0 virt-1" [ style = bold]
"fencing_monitor_0 virt-3" -> "fencing_stop_0 virt-1" [ style = bold]
@@ -85,14 +82,14 @@ digraph "g" {
"fencing_stop_0 virt-1" -> "all_stopped" [ style = bold]
"fencing_stop_0 virt-1" -> "fencing_start_0 virt-1" [ style = bold]
"fencing_stop_0 virt-1" [ style=bold color="green" fontcolor="black"]
-"stonith 'on' virt-1" -> "clvmd-clone_start_0" [ style = bold]
-"stonith 'on' virt-1" -> "dlm-clone_start_0" [ style = bold]
+"stonith 'on' virt-1" -> "clvmd_start_0 virt-1" [ style = bold]
+"stonith 'on' virt-1" -> "dlm_start_0 virt-1" [ style = bold]
"stonith 'on' virt-1" [ style=bold color="green" fontcolor="black"]
-"stonith 'on' virt-2" -> "clvmd-clone_start_0" [ style = bold]
-"stonith 'on' virt-2" -> "dlm-clone_start_0" [ style = bold]
+"stonith 'on' virt-2" -> "clvmd:1_start_0 virt-2" [ style = bold]
+"stonith 'on' virt-2" -> "dlm_start_0 virt-2" [ style = bold]
"stonith 'on' virt-2" [ style=bold color="green" fontcolor="black"]
-"stonith 'on' virt-3" -> "clvmd-clone_start_0" [ style = bold]
-"stonith 'on' virt-3" -> "dlm-clone_start_0" [ style = bold]
+"stonith 'on' virt-3" -> "clvmd:2_start_0 virt-3" [ style = bold]
+"stonith 'on' virt-3" -> "dlm:2_start_0 virt-3" [ style = bold]
"stonith 'on' virt-3" -> "fencing_monitor_0 virt-3" [ style = bold]
"stonith 'on' virt-3" [ style=bold color="green" fontcolor="black"]
"stonith 'reboot' virt-4" -> "stonith_complete" [ style = bold]
diff --git a/pengine/test10/unfence-parameters.exp b/pengine/test10/unfence-parameters.exp
index 48ef3bc..16aa30d 100644
--- a/pengine/test10/unfence-parameters.exp
+++ b/pengine/test10/unfence-parameters.exp
@@ -53,6 +53,9 @@
</action_set>
<inputs>
<trigger>
+ <crm_event id="2" operation="stonith" operation_key="stonith-virt-1-on" on_node="virt-1" on_node_uuid="1"/>
+ </trigger>
+ <trigger>
<rsc_op id="12" operation="stop" operation_key="dlm_stop_0" internal_operation_key="dlm:0_stop_0" on_node="virt-1" on_node_uuid="1"/>
</trigger>
<trigger>
@@ -91,6 +94,9 @@
</action_set>
<inputs>
<trigger>
+ <crm_event id="3" operation="stonith" operation_key="stonith-virt-2-on" on_node="virt-2" on_node_uuid="2"/>
+ </trigger>
+ <trigger>
<rsc_op id="13" operation="start" operation_key="dlm_start_0" internal_operation_key="dlm:0_start_0" on_node="virt-1" on_node_uuid="1"/>
</trigger>
<trigger>
@@ -126,6 +132,9 @@
</action_set>
<inputs>
<trigger>
+ <crm_event id="4" operation="stonith" operation_key="stonith-virt-3-on" on_node="virt-3" on_node_uuid="3"/>
+ </trigger>
+ <trigger>
<rsc_op id="15" operation="start" operation_key="dlm_start_0" internal_operation_key="dlm:1_start_0" on_node="virt-2" on_node_uuid="2"/>
</trigger>
<trigger>
@@ -204,15 +213,6 @@
</action_set>
<inputs>
<trigger>
- <crm_event id="2" operation="stonith" operation_key="stonith-virt-1-on" on_node="virt-1" on_node_uuid="1"/>
- </trigger>
- <trigger>
- <crm_event id="3" operation="stonith" operation_key="stonith-virt-2-on" on_node="virt-2" on_node_uuid="2"/>
- </trigger>
- <trigger>
- <crm_event id="4" operation="stonith" operation_key="stonith-virt-3-on" on_node="virt-3" on_node_uuid="3"/>
- </trigger>
- <trigger>
<rsc_op id="9" operation="monitor" operation_key="dlm:2_monitor_0" on_node="virt-3" on_node_uuid="3"/>
</trigger>
<trigger>
@@ -229,6 +229,9 @@
</action_set>
<inputs>
<trigger>
+ <crm_event id="2" operation="stonith" operation_key="stonith-virt-1-on" on_node="virt-1" on_node_uuid="1"/>
+ </trigger>
+ <trigger>
<rsc_op id="13" operation="start" operation_key="dlm_start_0" internal_operation_key="dlm:0_start_0" on_node="virt-1" on_node_uuid="1"/>
</trigger>
<trigger>
@@ -264,6 +267,9 @@
</action_set>
<inputs>
<trigger>
+ <crm_event id="3" operation="stonith" operation_key="stonith-virt-2-on" on_node="virt-2" on_node_uuid="2"/>
+ </trigger>
+ <trigger>
<rsc_op id="15" operation="start" operation_key="dlm_start_0" internal_operation_key="dlm:1_start_0" on_node="virt-2" on_node_uuid="2"/>
</trigger>
<trigger>
@@ -295,6 +301,9 @@
</action_set>
<inputs>
<trigger>
+ <crm_event id="4" operation="stonith" operation_key="stonith-virt-3-on" on_node="virt-3" on_node_uuid="3"/>
+ </trigger>
+ <trigger>
<rsc_op id="16" operation="start" operation_key="dlm:2_start_0" on_node="virt-3" on_node_uuid="3"/>
</trigger>
<trigger>
@@ -369,15 +378,6 @@
</action_set>
<inputs>
<trigger>
- <crm_event id="2" operation="stonith" operation_key="stonith-virt-1-on" on_node="virt-1" on_node_uuid="1"/>
- </trigger>
- <trigger>
- <crm_event id="3" operation="stonith" operation_key="stonith-virt-2-on" on_node="virt-2" on_node_uuid="2"/>
- </trigger>
- <trigger>
- <crm_event id="4" operation="stonith" operation_key="stonith-virt-3-on" on_node="virt-3" on_node_uuid="3"/>
- </trigger>
- <trigger>
<rsc_op id="7" operation="monitor" operation_key="clvmd:1_monitor_0" on_node="virt-2" on_node_uuid="2"/>
</trigger>
<trigger>
@@ -427,12 +427,6 @@
<trigger>
<rsc_op id="10" operation="monitor" operation_key="clvmd:2_monitor_0" on_node="virt-3" on_node_uuid="3"/>
</trigger>
- <trigger>
- <pseudo_event id="20" operation="stopped" operation_key="dlm-clone_stopped_0"/>
- </trigger>
- <trigger>
- <pseudo_event id="28" operation="stopped" operation_key="clvmd-clone_stopped_0"/>
- </trigger>
</inputs>
</synapse>
<synapse id="26">
@@ -446,10 +440,7 @@
<rsc_op id="7" operation="monitor" operation_key="clvmd:1_monitor_0" on_node="virt-2" on_node_uuid="2"/>
</trigger>
<trigger>
- <pseudo_event id="20" operation="stopped" operation_key="dlm-clone_stopped_0"/>
- </trigger>
- <trigger>
- <pseudo_event id="28" operation="stopped" operation_key="clvmd-clone_stopped_0"/>
+ <rsc_op id="14" operation="stop" operation_key="dlm_stop_0" internal_operation_key="dlm:1_stop_0" on_node="virt-2" on_node_uuid="2"/>
</trigger>
</inputs>
</synapse>
@@ -461,10 +452,10 @@
</action_set>
<inputs>
<trigger>
- <pseudo_event id="20" operation="stopped" operation_key="dlm-clone_stopped_0"/>
+ <rsc_op id="12" operation="stop" operation_key="dlm_stop_0" internal_operation_key="dlm:0_stop_0" on_node="virt-1" on_node_uuid="1"/>
</trigger>
<trigger>
- <pseudo_event id="28" operation="stopped" operation_key="clvmd-clone_stopped_0"/>
+ <rsc_op id="21" operation="stop" operation_key="clvmd_stop_0" internal_operation_key="clvmd:0_stop_0" on_node="virt-1" on_node_uuid="1"/>
</trigger>
</inputs>
</synapse>
diff --git a/pengine/test10/unfence-parameters.summary b/pengine/test10/unfence-parameters.summary
index bca4f96..41fed90 100644
--- a/pengine/test10/unfence-parameters.summary
+++ b/pengine/test10/unfence-parameters.summary
@@ -27,25 +27,25 @@ Executing cluster transition:
* Pseudo action: clvmd-clone_stop_0
* Fencing virt-4 (reboot)
* Pseudo action: stonith_complete
+ * Fencing virt-3 (on)
+ * Resource action: fencing monitor on virt-3
* Resource action: clvmd stop on virt-1
* Pseudo action: clvmd-clone_stopped_0
+ * Resource action: fencing stop on virt-1
* Pseudo action: dlm-clone_stop_0
* Resource action: dlm stop on virt-2
+ * Fencing virt-2 (on)
* Resource action: dlm stop on virt-1
* Pseudo action: dlm-clone_stopped_0
- * Fencing virt-3 (on)
- * Fencing virt-2 (on)
- * Fencing virt-1 (on)
- * Resource action: fencing monitor on virt-3
* Pseudo action: dlm-clone_start_0
- * Resource action: fencing stop on virt-1
+ * Fencing virt-1 (on)
+ * Pseudo action: all_stopped
+ * Resource action: fencing start on virt-1
* Resource action: dlm start on virt-1
* Resource action: dlm start on virt-2
* Resource action: dlm start on virt-3
* Pseudo action: dlm-clone_running_0
* Pseudo action: clvmd-clone_start_0
- * Pseudo action: all_stopped
- * Resource action: fencing start on virt-1
* Resource action: clvmd start on virt-1
* Resource action: clvmd start on virt-2
* Resource action: clvmd start on virt-3
diff --git a/pengine/test10/unfence-startup.dot b/pengine/test10/unfence-startup.dot
index 97eba4a..20f1367 100644
--- a/pengine/test10/unfence-startup.dot
+++ b/pengine/test10/unfence-startup.dot
@@ -27,8 +27,8 @@ digraph "g" {
"dlm:2_start_0 virt-3" -> "dlm-clone_running_0" [ style = bold]
"dlm:2_start_0 virt-3" [ style=bold color="green" fontcolor="black"]
"fencing_monitor_0 virt-3" [ style=bold color="green" fontcolor="black"]
-"stonith 'on' virt-3" -> "clvmd-clone_start_0" [ style = bold]
-"stonith 'on' virt-3" -> "dlm-clone_start_0" [ style = bold]
+"stonith 'on' virt-3" -> "clvmd:2_start_0 virt-3" [ style = bold]
+"stonith 'on' virt-3" -> "dlm:2_start_0 virt-3" [ style = bold]
"stonith 'on' virt-3" -> "fencing_monitor_0 virt-3" [ style = bold]
"stonith 'on' virt-3" [ style=bold color="green" fontcolor="black"]
"stonith 'reboot' virt-4" -> "stonith_complete" [ style = bold]
diff --git a/pengine/test10/unfence-startup.exp b/pengine/test10/unfence-startup.exp
index 7595cf3..569fd12 100644
--- a/pengine/test10/unfence-startup.exp
+++ b/pengine/test10/unfence-startup.exp
@@ -21,6 +21,9 @@
</action_set>
<inputs>
<trigger>
+ <crm_event id="4" operation="stonith" operation_key="stonith-virt-3-on" on_node="virt-3" on_node_uuid="3"/>
+ </trigger>
+ <trigger>
<pseudo_event id="17" operation="start" operation_key="dlm-clone_start_0"/>
</trigger>
<trigger>
@@ -60,9 +63,6 @@
</action_set>
<inputs>
<trigger>
- <crm_event id="4" operation="stonith" operation_key="stonith-virt-3-on" on_node="virt-3" on_node_uuid="3"/>
- </trigger>
- <trigger>
<rsc_op id="8" operation="monitor" operation_key="dlm:2_monitor_0" on_node="virt-3" on_node_uuid="3"/>
</trigger>
</inputs>
@@ -101,6 +101,9 @@
</action_set>
<inputs>
<trigger>
+ <crm_event id="4" operation="stonith" operation_key="stonith-virt-3-on" on_node="virt-3" on_node_uuid="3"/>
+ </trigger>
+ <trigger>
<rsc_op id="16" operation="start" operation_key="dlm:2_start_0" on_node="virt-3" on_node_uuid="3"/>
</trigger>
<trigger>
@@ -149,9 +152,6 @@
</action_set>
<inputs>
<trigger>
- <crm_event id="4" operation="stonith" operation_key="stonith-virt-3-on" on_node="virt-3" on_node_uuid="3"/>
- </trigger>
- <trigger>
<rsc_op id="6" operation="monitor" operation_key="clvmd:1_monitor_0" on_node="virt-2" on_node_uuid="2"/>
</trigger>
<trigger>
diff --git a/pengine/test10/unfence-startup.summary b/pengine/test10/unfence-startup.summary
index db0f307..76bc0fc 100644
--- a/pengine/test10/unfence-startup.summary
+++ b/pengine/test10/unfence-startup.summary
@@ -18,6 +18,7 @@ Transition Summary:
Executing cluster transition:
* Resource action: dlm monitor on virt-3
+ * Pseudo action: dlm-clone_start_0
* Resource action: clvmd monitor on virt-2
* Resource action: clvmd monitor on virt-3
* Fencing virt-4 (reboot)
@@ -25,7 +26,6 @@ Executing cluster transition:
* Fencing virt-3 (on)
* Pseudo action: all_stopped
* Resource action: fencing monitor on virt-3
- * Pseudo action: dlm-clone_start_0
* Resource action: dlm start on virt-3
* Pseudo action: dlm-clone_running_0
* Pseudo action: clvmd-clone_start_0
--
1.8.3.1
From 4a95897ab5b668f35a64e5d3818046adcafd3897 Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Thu, 16 Jun 2016 13:49:40 -0500
Subject: [PATCH 4/4] Test: pengine: add regression test for start-then-stop +
unfencing
---
pengine/regression.sh | 1 +
pengine/test10/start-then-stop-with-unfence.dot | 29 ++++
pengine/test10/start-then-stop-with-unfence.exp | 168 +++++++++++++++++++++
pengine/test10/start-then-stop-with-unfence.scores | 19 +++
.../test10/start-then-stop-with-unfence.summary | 42 ++++++
pengine/test10/start-then-stop-with-unfence.xml | 149 ++++++++++++++++++
6 files changed, 408 insertions(+)
create mode 100644 pengine/test10/start-then-stop-with-unfence.dot
create mode 100644 pengine/test10/start-then-stop-with-unfence.exp
create mode 100644 pengine/test10/start-then-stop-with-unfence.scores
create mode 100644 pengine/test10/start-then-stop-with-unfence.summary
create mode 100644 pengine/test10/start-then-stop-with-unfence.xml
diff --git a/pengine/regression.sh b/pengine/regression.sh
index f86d0f1..22ad3bf 100755
--- a/pengine/regression.sh
+++ b/pengine/regression.sh
@@ -534,6 +534,7 @@ do_test bug-5069-op-disabled "Test on-fail-ignore with failure when monitor is d
do_test obsolete-lrm-resource "cl#5115 - Do not use obsolete lrm_resource sections"
do_test expire-non-blocked-failure "Ignore failure-timeout only if the failed operation has on-fail=block"
do_test asymmetrical-order-move "Respect asymmetrical ordering when trying to move resources"
+do_test start-then-stop-with-unfence "Avoid graph loop with start-then-stop constraint plus unfencing"
do_test ignore_stonith_rsc_order1 "cl#5056- Ignore order constraint between stonith and non-stonith rsc."
do_test ignore_stonith_rsc_order2 "cl#5056- Ignore order constraint with group rsc containing mixed stonith and non-stonith."
diff --git a/pengine/test10/start-then-stop-with-unfence.dot b/pengine/test10/start-then-stop-with-unfence.dot
new file mode 100644
index 0000000..d8f7a71
--- /dev/null
+++ b/pengine/test10/start-then-stop-with-unfence.dot
@@ -0,0 +1,29 @@
+digraph "g" {
+"all_stopped" [ style=bold color="green" fontcolor="orange"]
+"ip1_monitor_10000 rhel7-node1.example.com" [ style=bold color="green" fontcolor="black"]
+"ip1_start_0 rhel7-node1.example.com" -> "ip1_monitor_10000 rhel7-node1.example.com" [ style = bold]
+"ip1_start_0 rhel7-node1.example.com" [ style=bold color="green" fontcolor="black"]
+"ip1_stop_0 rhel7-node2.example.com" -> "all_stopped" [ style = bold]
+"ip1_stop_0 rhel7-node2.example.com" -> "ip1_start_0 rhel7-node1.example.com" [ style = bold]
+"ip1_stop_0 rhel7-node2.example.com" [ style=bold color="green" fontcolor="black"]
+"jrummy-clone_running_0" -> "ip1_stop_0 rhel7-node2.example.com" [ style = bold]
+"jrummy-clone_running_0" [ style=bold color="green" fontcolor="orange"]
+"jrummy-clone_start_0" -> "jrummy-clone_running_0" [ style = bold]
+"jrummy-clone_start_0" -> "jrummy_start_0 rhel7-node1.example.com" [ style = bold]
+"jrummy-clone_start_0" [ style=bold color="green" fontcolor="orange"]
+"jrummy_monitor_10000 rhel7-node1.example.com" [ style=bold color="green" fontcolor="black"]
+"jrummy_start_0 rhel7-node1.example.com" -> "jrummy-clone_running_0" [ style = bold]
+"jrummy_start_0 rhel7-node1.example.com" -> "jrummy_monitor_10000 rhel7-node1.example.com" [ style = bold]
+"jrummy_start_0 rhel7-node1.example.com" [ style=bold color="green" fontcolor="black"]
+"mpath-node1_monitor_0 rhel7-node1.example.com" -> "mpath-node1_start_0 rhel7-node1.example.com" [ style = bold]
+"mpath-node1_monitor_0 rhel7-node1.example.com" [ style=bold color="green" fontcolor="black"]
+"mpath-node1_monitor_60000 rhel7-node1.example.com" [ style=bold color="green" fontcolor="black"]
+"mpath-node1_start_0 rhel7-node1.example.com" -> "mpath-node1_monitor_60000 rhel7-node1.example.com" [ style = bold]
+"mpath-node1_start_0 rhel7-node1.example.com" [ style=bold color="green" fontcolor="black"]
+"mpath-node2_monitor_0 rhel7-node1.example.com" [ style=bold color="green" fontcolor="black"]
+"stonith 'on' rhel7-node1.example.com" -> "ip1_start_0 rhel7-node1.example.com" [ style = bold]
+"stonith 'on' rhel7-node1.example.com" -> "jrummy_start_0 rhel7-node1.example.com" [ style = bold]
+"stonith 'on' rhel7-node1.example.com" -> "mpath-node1_monitor_0 rhel7-node1.example.com" [ style = bold]
+"stonith 'on' rhel7-node1.example.com" -> "mpath-node2_monitor_0 rhel7-node1.example.com" [ style = bold]
+"stonith 'on' rhel7-node1.example.com" [ style=bold color="green" fontcolor="black"]
+}
diff --git a/pengine/test10/start-then-stop-with-unfence.exp b/pengine/test10/start-then-stop-with-unfence.exp
new file mode 100644
index 0000000..aeee1fc
--- /dev/null
+++ b/pengine/test10/start-then-stop-with-unfence.exp
@@ -0,0 +1,168 @@
+<transition_graph cluster-delay="60s" stonith-timeout="60s" failed-stop-offset="INFINITY" failed-start-offset="INFINITY" transition_id="0">
+ <synapse id="0" priority="1000000">
+ <action_set>
+ <rsc_op id="8" operation="monitor" operation_key="mpath-node2_monitor_0" on_node="rhel7-node1.example.com" on_node_uuid="1">
+ <primitive id="mpath-node2" class="stonith" type="fence_mpath"/>
+ <attributes CRM_meta_op_target_rc="7" CRM_meta_timeout="20000" devices="/dev/mapper/clustPVa" key="1234" pcmk_host_list="rhel7-node2.example.com"/>
+ </rsc_op>
+ </action_set>
+ <inputs>
+ <trigger>
+ <crm_event id="6" operation="stonith" operation_key="stonith-rhel7-node1.example.com-on" on_node="rhel7-node1.example.com" on_node_uuid="1"/>
+ </trigger>
+ </inputs>
+ </synapse>
+ <synapse id="1">
+ <action_set>
+ <rsc_op id="13" operation="monitor" operation_key="mpath-node1_monitor_60000" on_node="rhel7-node1.example.com" on_node_uuid="1">
+ <primitive id="mpath-node1" class="stonith" type="fence_mpath"/>
+ <attributes CRM_meta_interval="60000" CRM_meta_name="monitor" CRM_meta_timeout="20000" devices="/dev/mapper/clustPVa" key="1233" pcmk_host_list="rhel7-node1.example.com"/>
+ </rsc_op>
+ </action_set>
+ <inputs>
+ <trigger>
+ <rsc_op id="12" operation="start" operation_key="mpath-node1_start_0" on_node="rhel7-node1.example.com" on_node_uuid="1"/>
+ </trigger>
+ </inputs>
+ </synapse>
+ <synapse id="2">
+ <action_set>
+ <rsc_op id="12" operation="start" operation_key="mpath-node1_start_0" on_node="rhel7-node1.example.com" on_node_uuid="1">
+ <primitive id="mpath-node1" class="stonith" type="fence_mpath"/>
+ <attributes CRM_meta_timeout="20000" devices="/dev/mapper/clustPVa" key="1233" pcmk_host_list="rhel7-node1.example.com"/>
+ </rsc_op>
+ </action_set>
+ <inputs>
+ <trigger>
+ <rsc_op id="9" operation="monitor" operation_key="mpath-node1_monitor_0" on_node="rhel7-node1.example.com" on_node_uuid="1"/>
+ </trigger>
+ </inputs>
+ </synapse>
+ <synapse id="3" priority="1000000">
+ <action_set>
+ <rsc_op id="9" operation="monitor" operation_key="mpath-node1_monitor_0" on_node="rhel7-node1.example.com" on_node_uuid="1">
+ <primitive id="mpath-node1" class="stonith" type="fence_mpath"/>
+ <attributes CRM_meta_op_target_rc="7" CRM_meta_timeout="20000" devices="/dev/mapper/clustPVa" key="1233" pcmk_host_list="rhel7-node1.example.com"/>
+ </rsc_op>
+ </action_set>
+ <inputs>
+ <trigger>
+ <crm_event id="6" operation="stonith" operation_key="stonith-rhel7-node1.example.com-on" on_node="rhel7-node1.example.com" on_node_uuid="1"/>
+ </trigger>
+ </inputs>
+ </synapse>
+ <synapse id="4">
+ <action_set>
+ <rsc_op id="16" operation="monitor" operation_key="ip1_monitor_10000" on_node="rhel7-node1.example.com" on_node_uuid="1">
+ <primitive id="ip1" class="ocf" provider="heartbeat" type="IPaddr2"/>
+ <attributes CRM_meta_interval="10000" CRM_meta_name="monitor" CRM_meta_timeout="20000" cidr_netmask="24" ip="192.168.143.161"/>
+ </rsc_op>
+ </action_set>
+ <inputs>
+ <trigger>
+ <rsc_op id="15" operation="start" operation_key="ip1_start_0" on_node="rhel7-node1.example.com" on_node_uuid="1"/>
+ </trigger>
+ </inputs>
+ </synapse>
+ <synapse id="5">
+ <action_set>
+ <rsc_op id="15" operation="start" operation_key="ip1_start_0" on_node="rhel7-node1.example.com" on_node_uuid="1">
+ <primitive id="ip1" class="ocf" provider="heartbeat" type="IPaddr2"/>
+ <attributes CRM_meta_name="start" CRM_meta_timeout="20000" cidr_netmask="24" ip="192.168.143.161"/>
+ </rsc_op>
+ </action_set>
+ <inputs>
+ <trigger>
+ <crm_event id="6" operation="stonith" operation_key="stonith-rhel7-node1.example.com-on" on_node="rhel7-node1.example.com" on_node_uuid="1"/>
+ </trigger>
+ <trigger>
+ <rsc_op id="14" operation="stop" operation_key="ip1_stop_0" on_node="rhel7-node2.example.com" on_node_uuid="2"/>
+ </trigger>
+ </inputs>
+ </synapse>
+ <synapse id="6">
+ <action_set>
+ <rsc_op id="14" operation="stop" operation_key="ip1_stop_0" on_node="rhel7-node2.example.com" on_node_uuid="2">
+ <primitive id="ip1" class="ocf" provider="heartbeat" type="IPaddr2"/>
+ <attributes CRM_meta_name="stop" CRM_meta_timeout="20000" cidr_netmask="24" ip="192.168.143.161"/>
+ </rsc_op>
+ </action_set>
+ <inputs>
+ <trigger>
+ <pseudo_event id="24" operation="running" operation_key="jrummy-clone_running_0"/>
+ </trigger>
+ </inputs>
+ </synapse>
+ <synapse id="7">
+ <action_set>
+ <rsc_op id="22" operation="monitor" operation_key="jrummy_monitor_10000" internal_operation_key="jrummy:1_monitor_10000" on_node="rhel7-node1.example.com" on_node_uuid="1">
+ <primitive id="jrummy" long-id="jrummy:1" class="ocf" provider="heartbeat" type="jrummyRA"/>
+ <attributes CRM_meta_clone="1" CRM_meta_clone_max="2" CRM_meta_clone_node_max="1" CRM_meta_globally_unique="false" CRM_meta_interval="10000" CRM_meta_name="monitor" CRM_meta_notify="false" CRM_meta_timeout="30000" />
+ </rsc_op>
+ </action_set>
+ <inputs>
+ <trigger>
+ <rsc_op id="21" operation="start" operation_key="jrummy_start_0" internal_operation_key="jrummy:1_start_0" on_node="rhel7-node1.example.com" on_node_uuid="1"/>
+ </trigger>
+ </inputs>
+ </synapse>
+ <synapse id="8">
+ <action_set>
+ <rsc_op id="21" operation="start" operation_key="jrummy_start_0" internal_operation_key="jrummy:1_start_0" on_node="rhel7-node1.example.com" on_node_uuid="1">
+ <primitive id="jrummy" long-id="jrummy:1" class="ocf" provider="heartbeat" type="jrummyRA"/>
+ <attributes CRM_meta_clone="1" CRM_meta_clone_max="2" CRM_meta_clone_node_max="1" CRM_meta_globally_unique="false" CRM_meta_name="start" CRM_meta_notify="false" CRM_meta_timeout="300000" />
+ </rsc_op>
+ </action_set>
+ <inputs>
+ <trigger>
+ <crm_event id="6" operation="stonith" operation_key="stonith-rhel7-node1.example.com-on" on_node="rhel7-node1.example.com" on_node_uuid="1"/>
+ </trigger>
+ <trigger>
+ <pseudo_event id="23" operation="start" operation_key="jrummy-clone_start_0"/>
+ </trigger>
+ </inputs>
+ </synapse>
+ <synapse id="9" priority="1000000">
+ <action_set>
+ <pseudo_event id="24" operation="running" operation_key="jrummy-clone_running_0">
+ <attributes CRM_meta_clone_max="2" CRM_meta_clone_node_max="1" CRM_meta_globally_unique="false" CRM_meta_notify="false" CRM_meta_timeout="20000" />
+ </pseudo_event>
+ </action_set>
+ <inputs>
+ <trigger>
+ <rsc_op id="21" operation="start" operation_key="jrummy_start_0" internal_operation_key="jrummy:1_start_0" on_node="rhel7-node1.example.com" on_node_uuid="1"/>
+ </trigger>
+ <trigger>
+ <pseudo_event id="23" operation="start" operation_key="jrummy-clone_start_0"/>
+ </trigger>
+ </inputs>
+ </synapse>
+ <synapse id="10">
+ <action_set>
+ <pseudo_event id="23" operation="start" operation_key="jrummy-clone_start_0">
+ <attributes CRM_meta_clone_max="2" CRM_meta_clone_node_max="1" CRM_meta_globally_unique="false" CRM_meta_notify="false" CRM_meta_timeout="20000" />
+ </pseudo_event>
+ </action_set>
+ <inputs/>
+ </synapse>
+ <synapse id="11">
+ <action_set>
+ <crm_event id="6" 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" />
+ </crm_event>
+ </action_set>
+ <inputs/>
+ </synapse>
+ <synapse id="12">
+ <action_set>
+ <pseudo_event id="5" operation="all_stopped" operation_key="all_stopped">
+ <attributes />
+ </pseudo_event>
+ </action_set>
+ <inputs>
+ <trigger>
+ <rsc_op id="14" operation="stop" operation_key="ip1_stop_0" on_node="rhel7-node2.example.com" on_node_uuid="2"/>
+ </trigger>
+ </inputs>
+ </synapse>
+</transition_graph>
diff --git a/pengine/test10/start-then-stop-with-unfence.scores b/pengine/test10/start-then-stop-with-unfence.scores
new file mode 100644
index 0000000..d353bef
--- /dev/null
+++ b/pengine/test10/start-then-stop-with-unfence.scores
@@ -0,0 +1,19 @@
+Allocation scores:
+clone_color: jrummy-clone allocation score on rhel7-node1.example.com: 500
+clone_color: jrummy-clone allocation score on rhel7-node2.example.com: 500
+clone_color: jrummy:0 allocation score on rhel7-node1.example.com: 0
+clone_color: jrummy:0 allocation score on rhel7-node2.example.com: 1
+clone_color: jrummy:1 allocation score on rhel7-node1.example.com: 0
+clone_color: jrummy:1 allocation score on rhel7-node2.example.com: 0
+native_color: ip1 allocation score on rhel7-node1.example.com: 500
+native_color: ip1 allocation score on rhel7-node2.example.com: 0
+native_color: ip2 allocation score on rhel7-node1.example.com: 0
+native_color: ip2 allocation score on rhel7-node2.example.com: 500
+native_color: jrummy:0 allocation score on rhel7-node1.example.com: 0
+native_color: jrummy:0 allocation score on rhel7-node2.example.com: 1
+native_color: jrummy:1 allocation score on rhel7-node1.example.com: 0
+native_color: jrummy:1 allocation score on rhel7-node2.example.com: -INFINITY
+native_color: mpath-node1 allocation score on rhel7-node1.example.com: 0
+native_color: mpath-node1 allocation score on rhel7-node2.example.com: 0
+native_color: mpath-node2 allocation score on rhel7-node1.example.com: 0
+native_color: mpath-node2 allocation score on rhel7-node2.example.com: 0
diff --git a/pengine/test10/start-then-stop-with-unfence.summary b/pengine/test10/start-then-stop-with-unfence.summary
new file mode 100644
index 0000000..df7d9e3
--- /dev/null
+++ b/pengine/test10/start-then-stop-with-unfence.summary
@@ -0,0 +1,42 @@
+
+Current cluster status:
+Online: [ rhel7-node1.example.com rhel7-node2.example.com ]
+
+ mpath-node2 (stonith:fence_mpath): Started rhel7-node2.example.com
+ mpath-node1 (stonith:fence_mpath): Stopped
+ ip1 (ocf::heartbeat:IPaddr2): Started rhel7-node2.example.com
+ ip2 (ocf::heartbeat:IPaddr2): Started rhel7-node2.example.com
+ Clone Set: jrummy-clone [jrummy]
+ Started: [ rhel7-node2.example.com ]
+ Stopped: [ rhel7-node1.example.com ]
+
+Transition Summary:
+ * Start mpath-node1 (rhel7-node1.example.com)
+ * Move ip1 (Started rhel7-node2.example.com -> rhel7-node1.example.com)
+ * Start jrummy:1 (rhel7-node1.example.com)
+
+Executing cluster transition:
+ * Pseudo action: jrummy-clone_start_0
+ * Fencing rhel7-node1.example.com (on)
+ * Resource action: mpath-node2 monitor on rhel7-node1.example.com
+ * Resource action: mpath-node1 monitor on rhel7-node1.example.com
+ * Resource action: jrummy start on rhel7-node1.example.com
+ * Pseudo action: jrummy-clone_running_0
+ * Resource action: mpath-node1 start on rhel7-node1.example.com
+ * Resource action: ip1 stop on rhel7-node2.example.com
+ * Resource action: jrummy monitor=10000 on rhel7-node1.example.com
+ * Pseudo action: all_stopped
+ * Resource action: mpath-node1 monitor=60000 on rhel7-node1.example.com
+ * Resource action: ip1 start on rhel7-node1.example.com
+ * Resource action: ip1 monitor=10000 on rhel7-node1.example.com
+
+Revised cluster status:
+Online: [ rhel7-node1.example.com rhel7-node2.example.com ]
+
+ mpath-node2 (stonith:fence_mpath): Started rhel7-node2.example.com
+ mpath-node1 (stonith:fence_mpath): Started rhel7-node1.example.com
+ ip1 (ocf::heartbeat:IPaddr2): Started rhel7-node1.example.com
+ ip2 (ocf::heartbeat:IPaddr2): Started rhel7-node2.example.com
+ Clone Set: jrummy-clone [jrummy]
+ Started: [ rhel7-node1.example.com rhel7-node2.example.com ]
+
diff --git a/pengine/test10/start-then-stop-with-unfence.xml b/pengine/test10/start-then-stop-with-unfence.xml
new file mode 100644
index 0000000..499022e
--- /dev/null
+++ b/pengine/test10/start-then-stop-with-unfence.xml
@@ -0,0 +1,149 @@
+<cib crm_feature_set="3.0.10" validate-with="pacemaker-2.3" epoch="152" num_updates="27" admin_epoch="0" cib-last-written="Thu Dec 10 15:33:54 2015" update-origin="rhel7-node2.example.com" update-client="cibadmin" update-user="root" have-quorum="1" dc-uuid="2">
+ <configuration>
+ <crm_config>
+ <cluster_property_set id="cib-bootstrap-options">
+ <nvpair id="cib-bootstrap-options-have-watchdog" name="have-watchdog" value="false"/>
+ <nvpair id="cib-bootstrap-options-dc-version" name="dc-version" value="1.1.13-10.el7-44eb2dd"/>
+ <nvpair id="cib-bootstrap-options-cluster-infrastructure" name="cluster-infrastructure" value="corosync"/>
+ <nvpair id="cib-bootstrap-options-cluster-name" name="cluster-name" value="rhel7-cluster"/>
+ <nvpair id="cib-bootstrap-options-last-lrm-refresh" name="last-lrm-refresh" value="1449777402"/>
+ </cluster_property_set>
+ </crm_config>
+ <nodes>
+ <node id="1" uname="rhel7-node1.example.com">
+ <instance_attributes id="nodes-1"/>
+ </node>
+ <node id="2" uname="rhel7-node2.example.com">
+ <instance_attributes id="nodes-2"/>
+ </node>
+ </nodes>
+ <resources>
+ <primitive class="stonith" id="mpath-node2" type="fence_mpath">
+ <instance_attributes id="mpath-node2-instance_attributes">
+ <nvpair id="mpath-node2-instance_attributes-key" name="key" value="1234"/>
+ <nvpair id="mpath-node2-instance_attributes-pcmk_host_list" name="pcmk_host_list" value="rhel7-node2.example.com"/>
+ <nvpair id="mpath-node2-instance_attributes-devices" name="devices" value="/dev/mapper/clustPVa"/>
+ </instance_attributes>
+ <operations>
+ <op id="mpath-node2-monitor-interval-60s" interval="60s" name="monitor"/>
+ </operations>
+ <meta_attributes id="mpath-node2-meta_attributes">
+ <nvpair id="mpath-node2-meta_attributes-provides" name="provides" value="unfencing"/>
+ </meta_attributes>
+ </primitive>
+ <primitive class="stonith" id="mpath-node1" type="fence_mpath">
+ <instance_attributes id="mpath-node1-instance_attributes">
+ <nvpair id="mpath-node1-instance_attributes-key" name="key" value="1233"/>
+ <nvpair id="mpath-node1-instance_attributes-pcmk_host_list" name="pcmk_host_list" value="rhel7-node1.example.com"/>
+ <nvpair id="mpath-node1-instance_attributes-devices" name="devices" value="/dev/mapper/clustPVa"/>
+ </instance_attributes>
+ <operations>
+ <op id="mpath-node1-monitor-interval-60s" interval="60s" name="monitor"/>
+ </operations>
+ <meta_attributes id="mpath-node1-meta_attributes">
+ <nvpair id="mpath-node1-meta_attributes-provides" name="provides" value="unfencing"/>
+ </meta_attributes>
+ </primitive>
+ <primitive class="ocf" id="ip1" provider="heartbeat" type="IPaddr2">
+ <instance_attributes id="ip1-instance_attributes">
+ <nvpair id="ip1-instance_attributes-ip" name="ip" value="192.168.143.161"/>
+ <nvpair id="ip1-instance_attributes-cidr_netmask" name="cidr_netmask" value="24"/>
+ </instance_attributes>
+ <operations>
+ <op id="ip1-start-interval-0s" interval="0s" name="start" timeout="20s"/>
+ <op id="ip1-stop-interval-0s" interval="0s" name="stop" timeout="20s"/>
+ <op id="ip1-monitor-interval-10s" interval="10s" name="monitor" timeout="20s"/>
+ </operations>
+ </primitive>
+ <primitive class="ocf" id="ip2" provider="heartbeat" type="IPaddr2">
+ <instance_attributes id="ip2-instance_attributes">
+ <nvpair id="ip2-instance_attributes-ip" name="ip" value="192.168.143.162"/>
+ <nvpair id="ip2-instance_attributes-cidr_netmask" name="cidr_netmask" value="24"/>
+ </instance_attributes>
+ <operations>
+ <op id="ip2-start-interval-0s" interval="0s" name="start" timeout="20s"/>
+ <op id="ip2-stop-interval-0s" interval="0s" name="stop" timeout="20s"/>
+ <op id="ip2-monitor-interval-10s" interval="10s" name="monitor" timeout="20s"/>
+ </operations>
+ </primitive>
+ <clone id="jrummy-clone">
+ <primitive class="ocf" id="jrummy" provider="heartbeat" type="jrummyRA">
+ <operations>
+ <op id="jrummy-start-timeout-300" interval="0s" name="start" timeout="300"/>
+ <op id="jrummy-stop-interval-0s" interval="0s" name="stop" timeout="30"/>
+ <op id="jrummy-monitor-interval-10" interval="10" name="monitor" timeout="30"/>
+ <op id="jrummy-promote-interval-0s" interval="0s" name="promote" timeout="120"/>
+ <op id="jrummy-demote-interval-0s" interval="0s" name="demote" timeout="120"/>
+ </operations>
+ <meta_attributes id="jrummy-meta_attributes"/>
+ </primitive>
+ <meta_attributes id="jrummy-clone-meta_attributes"/>
+ </clone>
+ </resources>
+ <constraints>
+ <rsc_colocation id="colocation-ip1-jrummy-clone-INFINITY" rsc="ip1" score="INFINITY" with-rsc="jrummy-clone"/>
+ <rsc_colocation id="colocation-ip2-jrummy-clone-INFINITY" rsc="ip2" score="INFINITY" with-rsc="jrummy-clone"/>
+ <rsc_location id="location-ip1-rhel7-node1.example.com-500" node="rhel7-node1.example.com" rsc="ip1" score="500"/>
+ <rsc_location id="location-ip2-rhel7-node2.example.com-500" node="rhel7-node2.example.com" rsc="ip2" score="500"/>
+ <rsc_order first="jrummy-clone" first-action="start" id="order-jrummy-clone-ip1-Optional" kind="Optional" symmetrical="false" then="ip1" then-action="stop"/>
+ <rsc_order first="jrummy-clone" first-action="start" id="order-jrummy-clone-ip2-Optional" kind="Optional" symmetrical="false" then="ip2" then-action="stop"/>
+ </constraints>
+ </configuration>
+ <status>
+ <node_state id="2" uname="rhel7-node2.example.com" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" join="member" expected="member">
+ <transient_attributes id="2">
+ <instance_attributes id="status-2">
+ <nvpair id="status-2-shutdown" name="shutdown" value="0"/>
+ <nvpair id="status-2-probe_complete" name="probe_complete" value="true"/>
+ </instance_attributes>
+ </transient_attributes>
+ <lrm id="2">
+ <lrm_resources>
+ <lrm_resource id="jrummy" type="jrummyRA" class="ocf" provider="heartbeat">
+ <lrm_rsc_op id="jrummy_last_failure_0" operation_key="jrummy_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.0.10" transition-key="15:44:7:3a75519c-468d-4424-8222-0a5d6dd23eb9" transition-magic="0:0;15:44:7:3a75519c-468d-4424-8222-0a5d6dd23eb9" on_node="rhel7-node2.example.com" call-id="136" rc-code="0" op-status="0" interval="0" last-run="1449777312" last-rc-change="1449777312" exec-time="22" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+ <lrm_rsc_op id="jrummy_last_0" operation_key="jrummy_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.0.10" transition-key="15:44:7:3a75519c-468d-4424-8222-0a5d6dd23eb9" transition-magic="0:0;15:44:7:3a75519c-468d-4424-8222-0a5d6dd23eb9" on_node="rhel7-node2.example.com" call-id="136" rc-code="0" op-status="0" interval="0" last-run="1449777312" last-rc-change="1449777312" exec-time="22" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+ <lrm_rsc_op id="jrummy_monitor_10000" operation_key="jrummy_monitor_10000" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.0.10" transition-key="35:45:0:3a75519c-468d-4424-8222-0a5d6dd23eb9" transition-magic="0:0;35:45:0:3a75519c-468d-4424-8222-0a5d6dd23eb9" on_node="rhel7-node2.example.com" call-id="139" rc-code="0" op-status="0" interval="10000" last-rc-change="1449777312" exec-time="21" queue-time="0" op-digest="02a5bcf940fc8d3239701acb11438d6a"/>
+ </lrm_resource>
+ <lrm_resource id="mpath-node2" type="fence_mpath" class="stonith">
+ <lrm_rsc_op id="mpath-node2_last_0" operation_key="mpath-node2_start_0" operation="start" crm-debug-origin="build_active_RAs" crm_feature_set="3.0.10" transition-key="17:1:0:dfd424e5-7b69-4529-8d63-544eff51d0e7" transition-magic="0:0;17:1:0:dfd424e5-7b69-4529-8d63-544eff51d0e7" on_node="rhel7-node2.example.com" call-id="27" rc-code="0" op-status="0" interval="0" last-run="1448401384" last-rc-change="1448401384" exec-time="185" queue-time="0" op-digest="b97ef86afabe0426040d1bef247023ee"/>
+ <lrm_rsc_op id="mpath-node2_monitor_60000" operation_key="mpath-node2_monitor_60000" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.0.10" transition-key="22:2:0:dfd424e5-7b69-4529-8d63-544eff51d0e7" transition-magic="0:0;22:2:0:dfd424e5-7b69-4529-8d63-544eff51d0e7" on_node="rhel7-node2.example.com" call-id="30" rc-code="0" op-status="0" interval="60000" last-rc-change="1448401385" exec-time="187" queue-time="0" op-digest="08e7f91df6cfd3e64e4e273877cae3b2"/>
+ </lrm_resource>
+ <lrm_resource id="ip1" type="IPaddr2" class="ocf" provider="heartbeat">
+ <lrm_rsc_op id="ip1_last_0" operation_key="ip1_start_0" operation="start" crm-debug-origin="build_active_RAs" crm_feature_set="3.0.10" transition-key="26:81:0:3a75519c-468d-4424-8222-0a5d6dd23eb9" transition-magic="0:0;26:81:0:3a75519c-468d-4424-8222-0a5d6dd23eb9" on_node="rhel7-node2.example.com" call-id="176" rc-code="0" op-status="0" interval="0" last-run="1449779587" last-rc-change="1449779587" exec-time="91" queue-time="0" op-digest="b6f4b45133b07648d423c37bde6306fc"/>
+ <lrm_rsc_op id="ip1_monitor_10000" operation_key="ip1_monitor_10000" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.0.10" transition-key="27:81:0:3a75519c-468d-4424-8222-0a5d6dd23eb9" transition-magic="0:0;27:81:0:3a75519c-468d-4424-8222-0a5d6dd23eb9" on_node="rhel7-node2.example.com" call-id="179" rc-code="0" op-status="0" interval="10000" last-rc-change="1449779587" exec-time="58" queue-time="0" op-digest="febe1be7eb0e5c0ccbae163040822b24"/>
+ </lrm_resource>
+ <lrm_resource id="ip2" type="IPaddr2" class="ocf" provider="heartbeat">
+ <lrm_rsc_op id="ip2_last_0" operation_key="ip2_start_0" operation="start" crm-debug-origin="build_active_RAs" crm_feature_set="3.0.10" transition-key="30:77:0:3a75519c-468d-4424-8222-0a5d6dd23eb9" transition-magic="0:0;30:77:0:3a75519c-468d-4424-8222-0a5d6dd23eb9" on_node="rhel7-node2.example.com" call-id="172" rc-code="0" op-status="0" interval="0" last-run="1449779478" last-rc-change="1449779478" exec-time="76" queue-time="0" op-digest="fceb53b1a753418193d6b0c6858d8aef"/>
+ <lrm_rsc_op id="ip2_monitor_10000" operation_key="ip2_monitor_10000" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.0.10" transition-key="3:77:0:3a75519c-468d-4424-8222-0a5d6dd23eb9" transition-magic="0:0;3:77:0:3a75519c-468d-4424-8222-0a5d6dd23eb9" on_node="rhel7-node2.example.com" call-id="173" rc-code="0" op-status="0" interval="10000" last-rc-change="1449779478" exec-time="48" queue-time="0" op-digest="4c2054a6edf1762d819eae38fa63f861"/>
+ </lrm_resource>
+ <lrm_resource id="mpath-node1" type="fence_mpath" class="stonith">
+ <lrm_rsc_op id="mpath-node1_last_0" operation_key="mpath-node1_stop_0" operation="stop" crm-debug-origin="do_update_resource" crm_feature_set="3.0.10" transition-key="16:93:0:3a75519c-468d-4424-8222-0a5d6dd23eb9" transition-magic="0:0;16:93:0:3a75519c-468d-4424-8222-0a5d6dd23eb9" on_node="rhel7-node2.example.com" call-id="187" rc-code="0" op-status="0" interval="0" last-run="1449779653" last-rc-change="1449779653" exec-time="1" queue-time="0" op-digest="019ed48e26413030411da3ae8888a649"/>
+ <lrm_rsc_op id="mpath-node1_monitor_60000" operation_key="mpath-node1_monitor_60000" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.0.10" transition-key="21:81:0:3a75519c-468d-4424-8222-0a5d6dd23eb9" transition-magic="0:0;21:81:0:3a75519c-468d-4424-8222-0a5d6dd23eb9" on_node="rhel7-node2.example.com" call-id="177" rc-code="0" op-status="0" interval="60000" last-rc-change="1449779587" exec-time="231" queue-time="0" op-digest="e66cba21113eb0e7f835fa12c375178c"/>
+ </lrm_resource>
+ </lrm_resources>
+ </lrm>
+ </node_state>
+ <node_state id="1" uname="rhel7-node1.example.com" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" join="member" expected="member">
+ <lrm id="1">
+ <lrm_resources>
+ <lrm_resource id="jrummy" type="jrummyRA" class="ocf" provider="heartbeat">
+ <lrm_rsc_op id="jrummy_last_failure_0" operation_key="jrummy_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.0.10" transition-key="15:91:7:3a75519c-468d-4424-8222-0a5d6dd23eb9" transition-magic="0:0;15:91:7:3a75519c-468d-4424-8222-0a5d6dd23eb9" on_node="rhel7-node1.example.com" call-id="14" rc-code="0" op-status="0" interval="0" last-run="1449779745" last-rc-change="1449779745" exec-time="118" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+ <lrm_rsc_op id="jrummy_last_0" operation_key="jrummy_stop_0" operation="stop" crm-debug-origin="do_update_resource" crm_feature_set="3.0.10" transition-key="26:93:0:3a75519c-468d-4424-8222-0a5d6dd23eb9" transition-magic="0:0;26:93:0:3a75519c-468d-4424-8222-0a5d6dd23eb9" on_node="rhel7-node1.example.com" call-id="15" rc-code="0" op-status="0" interval="0" last-run="1449779745" last-rc-change="1449779745" exec-time="17" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
+ </lrm_resource>
+ <lrm_resource id="ip1" type="IPaddr2" class="ocf" provider="heartbeat">
+ <lrm_rsc_op id="ip1_last_0" operation_key="ip1_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.0.10" transition-key="13:91:7:3a75519c-468d-4424-8222-0a5d6dd23eb9" transition-magic="0:7;13:91:7:3a75519c-468d-4424-8222-0a5d6dd23eb9" on_node="rhel7-node1.example.com" call-id="5" rc-code="7" op-status="0" interval="0" last-run="1449779745" last-rc-change="1449779745" exec-time="155" queue-time="1" op-digest="b6f4b45133b07648d423c37bde6306fc"/>
+ </lrm_resource>
+ <lrm_resource id="ip2" type="IPaddr2" class="ocf" provider="heartbeat">
+ <lrm_rsc_op id="ip2_last_0" operation_key="ip2_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.0.10" transition-key="14:91:7:3a75519c-468d-4424-8222-0a5d6dd23eb9" transition-magic="0:7;14:91:7:3a75519c-468d-4424-8222-0a5d6dd23eb9" on_node="rhel7-node1.example.com" call-id="9" rc-code="7" op-status="0" interval="0" last-run="1449779745" last-rc-change="1449779745" exec-time="149" queue-time="0" op-digest="fceb53b1a753418193d6b0c6858d8aef"/>
+ </lrm_resource>
+ </lrm_resources>
+ </lrm>
+ <transient_attributes id="1">
+ <instance_attributes id="status-1">
+ <nvpair id="status-1-shutdown" name="shutdown" value="0"/>
+ <nvpair id="status-1-probe_complete" name="probe_complete" value="true"/>
+ </instance_attributes>
+ </transient_attributes>
+ </node_state>
+ </status>
+</cib>
--
1.8.3.1