Blame SOURCES/021-rhbz1872376.patch

23c78e
From 4521f547457af1201442e072d426fdf89de1150e Mon Sep 17 00:00:00 2001
23c78e
From: Ken Gaillot <kgaillot@redhat.com>
23c78e
Date: Mon, 9 Nov 2020 18:09:54 -0600
23c78e
Subject: [PATCH 01/13] API: libpe_status: add pe_rsc_params() and new
23c78e
 pe_resource_t member
23c78e
23c78e
Instead of a single parameters table for a resource, this allows the
23c78e
possibility of a parameter table per node for the resource, since
23c78e
rule-based parameters may evaluate differently on different nodes.
23c78e
---
23c78e
 include/crm/pengine/complex.h  |  5 +++-
23c78e
 include/crm/pengine/pe_types.h |  8 +++++-
23c78e
 lib/pengine/complex.c          | 61 +++++++++++++++++++++++++++++++++++++++++-
23c78e
 3 files changed, 71 insertions(+), 3 deletions(-)
23c78e
23c78e
diff --git a/include/crm/pengine/complex.h b/include/crm/pengine/complex.h
23c78e
index effa44f..1d010f4 100644
23c78e
--- a/include/crm/pengine/complex.h
23c78e
+++ b/include/crm/pengine/complex.h
23c78e
@@ -1,5 +1,5 @@
23c78e
 /*
23c78e
- * Copyright 2004-2019 the Pacemaker project contributors
23c78e
+ * Copyright 2004-2020 the Pacemaker project contributors
23c78e
  *
23c78e
  * The version control history for this file may have further details.
23c78e
  *
23c78e
@@ -19,6 +19,9 @@ extern "C" {
23c78e
 #include <crm/pengine/pe_types.h>   // pe_node_t, pe_resource_t, etc.
23c78e
 
23c78e
 extern resource_object_functions_t resource_class_functions[];
23c78e
+
23c78e
+GHashTable *pe_rsc_params(pe_resource_t *rsc, pe_node_t *node,
23c78e
+                          pe_working_set_t *data_set);
23c78e
 void get_meta_attributes(GHashTable * meta_hash, pe_resource_t *rsc,
23c78e
                          pe_node_t *node, pe_working_set_t *data_set);
23c78e
 void get_rsc_attributes(GHashTable *meta_hash, pe_resource_t *rsc,
23c78e
diff --git a/include/crm/pengine/pe_types.h b/include/crm/pengine/pe_types.h
23c78e
index 59d5ce8..5529714 100644
23c78e
--- a/include/crm/pengine/pe_types.h
23c78e
+++ b/include/crm/pengine/pe_types.h
23c78e
@@ -1,5 +1,5 @@
23c78e
 /*
23c78e
- * Copyright 2004-2020 the Pacemaker project contributors
23c78e
+ * Copyright 2004-2021 the Pacemaker project contributors
23c78e
  *
23c78e
  * The version control history for this file may have further details.
23c78e
  *
23c78e
@@ -371,6 +371,12 @@ struct pe_resource_s {
23c78e
     pe_node_t *lock_node;       // Resource is shutdown-locked to this node
23c78e
     time_t lock_time;           // When shutdown lock started
23c78e
 
23c78e
+    /* Resource parameters may have node-attribute-based rules, which means the
23c78e
+     * values can vary by node. This table is a cache of parameter name/value
23c78e
+     * tables for each node (as needed). Use pe_rsc_params() to get the table
23c78e
+     * for a given node.
23c78e
+     */
23c78e
+    GHashTable *parameter_cache; // Key = node name, value = parameters table
23c78e
 #if ENABLE_VERSIONED_ATTRS
23c78e
     xmlNode *versioned_parameters;
23c78e
 #endif
23c78e
diff --git a/lib/pengine/complex.c b/lib/pengine/complex.c
23c78e
index 5f484ad..7037ca1 100644
23c78e
--- a/lib/pengine/complex.c
23c78e
+++ b/lib/pengine/complex.c
23c78e
@@ -1,5 +1,5 @@
23c78e
 /*
23c78e
- * Copyright 2004-2020 the Pacemaker project contributors
23c78e
+ * Copyright 2004-2021 the Pacemaker project contributors
23c78e
  *
23c78e
  * The version control history for this file may have further details.
23c78e
  *
23c78e
@@ -435,6 +435,62 @@ detect_promotable(pe_resource_t *rsc)
23c78e
     return FALSE;
23c78e
 }
23c78e
 
23c78e
+static void
23c78e
+free_params_table(gpointer data)
23c78e
+{
23c78e
+    g_hash_table_destroy((GHashTable *) data);
23c78e
+}
23c78e
+
23c78e
+/*!
23c78e
+ * \brief Get a table of resource parameters
23c78e
+ *
23c78e
+ * \param[in] rsc       Resource to query
23c78e
+ * \param[in] node      Node for evaluating rules (NULL for defaults)
23c78e
+ * \param[in] data_set  Cluster working set
23c78e
+ *
23c78e
+ * \return Hash table containing resource parameter names and values
23c78e
+ *         (or NULL if \p rsc or \p data_set is NULL)
23c78e
+ * \note The returned table will be destroyed when the resource is freed, so
23c78e
+ *       callers should not destroy it.
23c78e
+ */
23c78e
+GHashTable *
23c78e
+pe_rsc_params(pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set)
23c78e
+{
23c78e
+    GHashTable *params_on_node = NULL;
23c78e
+
23c78e
+    /* A NULL node is used to request the resource's default parameters
23c78e
+     * (not evaluated for node), but we always want something non-NULL
23c78e
+     * as a hash table key.
23c78e
+     */
23c78e
+    const char *node_name = "";
23c78e
+
23c78e
+    // Sanity check
23c78e
+    if ((rsc == NULL) || (data_set == NULL)) {
23c78e
+        return NULL;
23c78e
+    }
23c78e
+    if ((node != NULL) && (node->details->uname != NULL)) {
23c78e
+        node_name = node->details->uname;
23c78e
+    }
23c78e
+
23c78e
+    // Find the parameter table for given node
23c78e
+    if (rsc->parameter_cache == NULL) {
23c78e
+        rsc->parameter_cache = g_hash_table_new_full(crm_strcase_hash,
23c78e
+                                                     crm_strcase_equal, free,
23c78e
+                                                     free_params_table);
23c78e
+    } else {
23c78e
+        params_on_node = g_hash_table_lookup(rsc->parameter_cache, node_name);
23c78e
+    }
23c78e
+
23c78e
+    // If none exists yet, create one with parameters evaluated for node
23c78e
+    if (params_on_node == NULL) {
23c78e
+        params_on_node = crm_str_table_new();
23c78e
+        get_rsc_attributes(params_on_node, rsc, node, data_set);
23c78e
+        g_hash_table_insert(rsc->parameter_cache, strdup(node_name),
23c78e
+                            params_on_node);
23c78e
+    }
23c78e
+    return params_on_node;
23c78e
+}
23c78e
+
23c78e
 gboolean
23c78e
 common_unpack(xmlNode * xml_obj, pe_resource_t ** rsc,
23c78e
               pe_resource_t * parent, pe_working_set_t * data_set)
23c78e
@@ -869,6 +925,9 @@ common_free(pe_resource_t * rsc)
23c78e
     if (rsc->parameters != NULL) {
23c78e
         g_hash_table_destroy(rsc->parameters);
23c78e
     }
23c78e
+    if (rsc->parameter_cache != NULL) {
23c78e
+        g_hash_table_destroy(rsc->parameter_cache);
23c78e
+    }
23c78e
 #if ENABLE_VERSIONED_ATTRS
23c78e
     if (rsc->versioned_parameters != NULL) {
23c78e
         free_xml(rsc->versioned_parameters);
23c78e
-- 
23c78e
1.8.3.1
23c78e
23c78e
23c78e
From d5075f64c5fff1f037ee8dbca2ad6268bce15681 Mon Sep 17 00:00:00 2001
23c78e
From: Ken Gaillot <kgaillot@redhat.com>
23c78e
Date: Wed, 11 Nov 2020 13:03:50 -0600
23c78e
Subject: [PATCH 02/13] API: libpe_status: ignore ->parameter() resource object
23c78e
 function's create argument
23c78e
23c78e
This uses the new resource parameter function to implement ->parameter().
23c78e
That means the parameter table will always be created if not already existent.
23c78e
23c78e
->parameter() is not called internally.
23c78e
---
23c78e
 lib/pengine/native.c | 28 ++++------------------------
23c78e
 1 file changed, 4 insertions(+), 24 deletions(-)
23c78e
23c78e
diff --git a/lib/pengine/native.c b/lib/pengine/native.c
23c78e
index 193be17..95c3da9 100644
23c78e
--- a/lib/pengine/native.c
23c78e
+++ b/lib/pengine/native.c
23c78e
@@ -312,48 +312,28 @@ native_find_rsc(pe_resource_t * rsc, const char *id, const pe_node_t *on_node,
23c78e
     return NULL;
23c78e
 }
23c78e
 
23c78e
+// create is ignored
23c78e
 char *
23c78e
 native_parameter(pe_resource_t * rsc, pe_node_t * node, gboolean create, const char *name,
23c78e
                  pe_working_set_t * data_set)
23c78e
 {
23c78e
     char *value_copy = NULL;
23c78e
     const char *value = NULL;
23c78e
-    GHashTable *hash = NULL;
23c78e
-    GHashTable *local_hash = NULL;
23c78e
+    GHashTable *params = NULL;
23c78e
 
23c78e
     CRM_CHECK(rsc != NULL, return NULL);
23c78e
     CRM_CHECK(name != NULL && strlen(name) != 0, return NULL);
23c78e
 
23c78e
     pe_rsc_trace(rsc, "Looking up %s in %s", name, rsc->id);
23c78e
-
23c78e
-    if (create || g_hash_table_size(rsc->parameters) == 0) {
23c78e
-        if (node != NULL) {
23c78e
-            pe_rsc_trace(rsc, "Creating hash with node %s", node->details->uname);
23c78e
-        } else {
23c78e
-            pe_rsc_trace(rsc, "Creating default hash");
23c78e
-        }
23c78e
-
23c78e
-        local_hash = crm_str_table_new();
23c78e
-
23c78e
-        get_rsc_attributes(local_hash, rsc, node, data_set);
23c78e
-
23c78e
-        hash = local_hash;
23c78e
-    } else {
23c78e
-        hash = rsc->parameters;
23c78e
-    }
23c78e
-
23c78e
-    value = g_hash_table_lookup(hash, name);
23c78e
+    params = pe_rsc_params(rsc, node, data_set);
23c78e
+    value = g_hash_table_lookup(params, name);
23c78e
     if (value == NULL) {
23c78e
         /* try meta attributes instead */
23c78e
         value = g_hash_table_lookup(rsc->meta, name);
23c78e
     }
23c78e
-
23c78e
     if (value != NULL) {
23c78e
         value_copy = strdup(value);
23c78e
     }
23c78e
-    if (local_hash != NULL) {
23c78e
-        g_hash_table_destroy(local_hash);
23c78e
-    }
23c78e
     return value_copy;
23c78e
 }
23c78e
 
23c78e
-- 
23c78e
1.8.3.1
23c78e
23c78e
23c78e
From 7089c19d1a1a79dd353ade0002ba6ed3321145ca Mon Sep 17 00:00:00 2001
23c78e
From: Ken Gaillot <kgaillot@redhat.com>
23c78e
Date: Mon, 9 Nov 2020 18:15:56 -0600
23c78e
Subject: [PATCH 03/13] Refactor: fencer: use new resource parameters function
23c78e
23c78e
---
23c78e
 daemons/fenced/pacemaker-fenced.c | 5 +++--
23c78e
 1 file changed, 3 insertions(+), 2 deletions(-)
23c78e
23c78e
diff --git a/daemons/fenced/pacemaker-fenced.c b/daemons/fenced/pacemaker-fenced.c
23c78e
index 69c29a7..5390d66 100644
23c78e
--- a/daemons/fenced/pacemaker-fenced.c
23c78e
+++ b/daemons/fenced/pacemaker-fenced.c
23c78e
@@ -643,6 +643,7 @@ static void cib_device_update(pe_resource_t *rsc, pe_working_set_t *data_set)
23c78e
         /* Our node is allowed, so update the device information */
23c78e
         int rc;
23c78e
         xmlNode *data;
23c78e
+        GHashTable *rsc_params = NULL;
23c78e
         GHashTableIter gIter;
23c78e
         stonith_key_value_t *params = NULL;
23c78e
 
23c78e
@@ -651,12 +652,12 @@ static void cib_device_update(pe_resource_t *rsc, pe_working_set_t *data_set)
23c78e
         const char *rsc_provides = NULL;
23c78e
 
23c78e
         crm_debug("Device %s is allowed on %s: score=%d", rsc->id, stonith_our_uname, node->weight);
23c78e
-        get_rsc_attributes(rsc->parameters, rsc, node, data_set);
23c78e
+        rsc_params = pe_rsc_params(rsc, node, data_set);
23c78e
         get_meta_attributes(rsc->meta, rsc, node, data_set);
23c78e
 
23c78e
         rsc_provides = g_hash_table_lookup(rsc->meta, PCMK_STONITH_PROVIDES);
23c78e
 
23c78e
-        g_hash_table_iter_init(&gIter, rsc->parameters);
23c78e
+        g_hash_table_iter_init(&gIter, rsc_params);
23c78e
         while (g_hash_table_iter_next(&gIter, (gpointer *) & name, (gpointer *) & value)) {
23c78e
             if (!name || !value) {
23c78e
                 continue;
23c78e
-- 
23c78e
1.8.3.1
23c78e
23c78e
23c78e
From ae0a2f26891b30a7bcf09467dac461a17d071cd9 Mon Sep 17 00:00:00 2001
23c78e
From: Ken Gaillot <kgaillot@redhat.com>
23c78e
Date: Mon, 9 Nov 2020 18:35:08 -0600
23c78e
Subject: [PATCH 04/13] Refactor: scheduler: use new resource parameter
23c78e
 function when getting fence action timeout
23c78e
23c78e
This means that the fence device's active node is used to evaluate the
23c78e
parameters, which will be of use if we ever support rules in fence device
23c78e
configuration.
23c78e
---
23c78e
 lib/pengine/utils.c | 10 +++++-----
23c78e
 1 file changed, 5 insertions(+), 5 deletions(-)
23c78e
23c78e
diff --git a/lib/pengine/utils.c b/lib/pengine/utils.c
23c78e
index b07afbe..831f890 100644
23c78e
--- a/lib/pengine/utils.c
23c78e
+++ b/lib/pengine/utils.c
23c78e
@@ -1099,12 +1099,12 @@ unpack_operation(pe_action_t * action, xmlNode * xml_obj, pe_resource_t * contai
23c78e
      */
23c78e
     if (pcmk_is_set(pcmk_get_ra_caps(rsc_rule_data.standard),
23c78e
                     pcmk_ra_cap_fence_params)
23c78e
-            && (pcmk__str_eq(action->task, RSC_START, pcmk__str_casei)
23c78e
-                || is_probe)
23c78e
-            && action->rsc->parameters) {
23c78e
+        && (pcmk__str_eq(action->task, RSC_START, pcmk__str_casei)
23c78e
+            || is_probe)) {
23c78e
 
23c78e
-        value = g_hash_table_lookup(action->rsc->parameters,
23c78e
-                                    "pcmk_monitor_timeout");
23c78e
+        GHashTable *params = pe_rsc_params(action->rsc, action->node, data_set);
23c78e
+
23c78e
+        value = g_hash_table_lookup(params, "pcmk_monitor_timeout");
23c78e
 
23c78e
         if (value) {
23c78e
             crm_trace("\t%s: Setting timeout to pcmk_monitor_timeout '%s', "
23c78e
-- 
23c78e
1.8.3.1
23c78e
23c78e
23c78e
From 25cf7f5e0f6e3a22000fcaa4f4492fe1c086252b Mon Sep 17 00:00:00 2001
23c78e
From: Ken Gaillot <kgaillot@redhat.com>
23c78e
Date: Fri, 13 Nov 2020 09:27:43 -0600
23c78e
Subject: [PATCH 05/13] Refactor: scheduler: use new resource parameter
23c78e
 function when replacing bundle #uname
23c78e
23c78e
---
23c78e
 include/crm/pengine/internal.h      |  8 +++++---
23c78e
 lib/pacemaker/pcmk_sched_allocate.c |  2 +-
23c78e
 lib/pacemaker/pcmk_sched_bundle.c   | 14 ++++++++++++--
23c78e
 lib/pengine/bundle.c                | 12 ++++++++----
23c78e
 lib/pengine/pe_digest.c             |  2 +-
23c78e
 lib/pengine/unpack.c                |  2 +-
23c78e
 6 files changed, 28 insertions(+), 12 deletions(-)
23c78e
23c78e
diff --git a/include/crm/pengine/internal.h b/include/crm/pengine/internal.h
23c78e
index 1e5aee1..9f4e28a 100644
23c78e
--- a/include/crm/pengine/internal.h
23c78e
+++ b/include/crm/pengine/internal.h
23c78e
@@ -545,9 +545,11 @@ int pe__common_output_text(pcmk__output_t *out, pe_resource_t * rsc, const char
23c78e
 int pe__common_output_html(pcmk__output_t *out, pe_resource_t * rsc, const char *name, pe_node_t *node, long options);
23c78e
 pe_resource_t *pe__find_bundle_replica(const pe_resource_t *bundle,
23c78e
                                        const pe_node_t *node);
23c78e
-bool pe__bundle_needs_remote_name(pe_resource_t *rsc);
23c78e
-const char *pe__add_bundle_remote_name(pe_resource_t *rsc, xmlNode *xml,
23c78e
-                                       const char *field);
23c78e
+bool pe__bundle_needs_remote_name(pe_resource_t *rsc,
23c78e
+                                  pe_working_set_t *data_set);
23c78e
+const char *pe__add_bundle_remote_name(pe_resource_t *rsc,
23c78e
+                                       pe_working_set_t *data_set,
23c78e
+                                       xmlNode *xml, const char *field);
23c78e
 const char *pe_node_attribute_calculated(const pe_node_t *node,
23c78e
                                          const char *name,
23c78e
                                          const pe_resource_t *rsc);
23c78e
diff --git a/lib/pacemaker/pcmk_sched_allocate.c b/lib/pacemaker/pcmk_sched_allocate.c
23c78e
index a0fb5ab..22f284a 100644
23c78e
--- a/lib/pacemaker/pcmk_sched_allocate.c
23c78e
+++ b/lib/pacemaker/pcmk_sched_allocate.c
23c78e
@@ -470,7 +470,7 @@ check_actions_for(xmlNode * rsc_entry, pe_resource_t * rsc, pe_node_t * node, pe
23c78e
              * has changed, clear any fail count so they can be retried fresh.
23c78e
              */
23c78e
 
23c78e
-            if (pe__bundle_needs_remote_name(rsc)) {
23c78e
+            if (pe__bundle_needs_remote_name(rsc, data_set)) {
23c78e
                 /* We haven't allocated resources to nodes yet, so if the
23c78e
                  * REMOTE_CONTAINER_HACK is used, we may calculate the digest
23c78e
                  * based on the literal "#uname" value rather than the properly
23c78e
diff --git a/lib/pacemaker/pcmk_sched_bundle.c b/lib/pacemaker/pcmk_sched_bundle.c
23c78e
index ac9219c..4f41b70 100644
23c78e
--- a/lib/pacemaker/pcmk_sched_bundle.c
23c78e
+++ b/lib/pacemaker/pcmk_sched_bundle.c
23c78e
@@ -911,7 +911,7 @@ pcmk__bundle_expand(pe_resource_t *rsc, pe_working_set_t * data_set)
23c78e
 
23c78e
         CRM_ASSERT(replica);
23c78e
         if (replica->remote && replica->container
23c78e
-            && pe__bundle_needs_remote_name(replica->remote)) {
23c78e
+            && pe__bundle_needs_remote_name(replica->remote, data_set)) {
23c78e
 
23c78e
             /* REMOTE_CONTAINER_HACK: Allow remote nodes to run containers that
23c78e
              * run pacemaker-remoted inside, without needing a separate IP for
23c78e
@@ -923,12 +923,22 @@ pcmk__bundle_expand(pe_resource_t *rsc, pe_working_set_t * data_set)
23c78e
                                                replica->remote->xml, LOG_ERR);
23c78e
             const char *calculated_addr = NULL;
23c78e
 
23c78e
+            // Replace the value in replica->remote->xml (if appropriate)
23c78e
             calculated_addr = pe__add_bundle_remote_name(replica->remote,
23c78e
+                                                         data_set,
23c78e
                                                          nvpair, "value");
23c78e
             if (calculated_addr) {
23c78e
+                /* Since this is for the bundle as a resource, and not any
23c78e
+                 * particular action, replace the value in the default
23c78e
+                 * parameters (not evaluated for node). action2xml() will grab
23c78e
+                 * it from there to replace it in node-evaluated parameters.
23c78e
+                 */
23c78e
+                GHashTable *params = pe_rsc_params(replica->remote,
23c78e
+                                                   NULL, data_set);
23c78e
+
23c78e
                 crm_trace("Set address for bundle connection %s to bundle host %s",
23c78e
                           replica->remote->id, calculated_addr);
23c78e
-                g_hash_table_replace(replica->remote->parameters,
23c78e
+                g_hash_table_replace(params,
23c78e
                                      strdup(XML_RSC_ATTR_REMOTE_RA_ADDR),
23c78e
                                      strdup(calculated_addr));
23c78e
             } else {
23c78e
diff --git a/lib/pengine/bundle.c b/lib/pengine/bundle.c
23c78e
index 7b326e9..615a35a 100644
23c78e
--- a/lib/pengine/bundle.c
23c78e
+++ b/lib/pengine/bundle.c
23c78e
@@ -948,29 +948,33 @@ replica_for_remote(pe_resource_t *remote)
23c78e
 }
23c78e
 
23c78e
 bool
23c78e
-pe__bundle_needs_remote_name(pe_resource_t *rsc)
23c78e
+pe__bundle_needs_remote_name(pe_resource_t *rsc, pe_working_set_t *data_set)
23c78e
 {
23c78e
     const char *value;
23c78e
+    GHashTable *params = NULL;
23c78e
 
23c78e
     if (rsc == NULL) {
23c78e
         return false;
23c78e
     }
23c78e
 
23c78e
-    value = g_hash_table_lookup(rsc->parameters, XML_RSC_ATTR_REMOTE_RA_ADDR);
23c78e
+    // Use NULL node since pcmk__bundle_expand() uses that to set value
23c78e
+    params = pe_rsc_params(rsc, NULL, data_set);
23c78e
+    value = g_hash_table_lookup(params, XML_RSC_ATTR_REMOTE_RA_ADDR);
23c78e
 
23c78e
     return pcmk__str_eq(value, "#uname", pcmk__str_casei)
23c78e
            && xml_contains_remote_node(rsc->xml);
23c78e
 }
23c78e
 
23c78e
 const char *
23c78e
-pe__add_bundle_remote_name(pe_resource_t *rsc, xmlNode *xml, const char *field)
23c78e
+pe__add_bundle_remote_name(pe_resource_t *rsc, pe_working_set_t *data_set,
23c78e
+                           xmlNode *xml, const char *field)
23c78e
 {
23c78e
     // REMOTE_CONTAINER_HACK: Allow remote nodes that start containers with pacemaker remote inside
23c78e
 
23c78e
     pe_node_t *node = NULL;
23c78e
     pe__bundle_replica_t *replica = NULL;
23c78e
 
23c78e
-    if (!pe__bundle_needs_remote_name(rsc)) {
23c78e
+    if (!pe__bundle_needs_remote_name(rsc, data_set)) {
23c78e
         return NULL;
23c78e
     }
23c78e
 
23c78e
diff --git a/lib/pengine/pe_digest.c b/lib/pengine/pe_digest.c
23c78e
index f55c896..f6e41e9 100644
23c78e
--- a/lib/pengine/pe_digest.c
23c78e
+++ b/lib/pengine/pe_digest.c
23c78e
@@ -147,7 +147,7 @@ calculate_main_digest(op_digest_cache_t *data, pe_resource_t *rsc,
23c78e
     /* REMOTE_CONTAINER_HACK: Allow Pacemaker Remote nodes to run containers
23c78e
      * that themselves are Pacemaker Remote nodes
23c78e
      */
23c78e
-    if (pe__add_bundle_remote_name(rsc, data->params_all,
23c78e
+    if (pe__add_bundle_remote_name(rsc, data_set, data->params_all,
23c78e
                                    XML_RSC_ATTR_REMOTE_RA_ADDR)) {
23c78e
         crm_trace("Set address for bundle connection %s (on %s)",
23c78e
                   rsc->id, node->details->uname);
23c78e
diff --git a/lib/pengine/unpack.c b/lib/pengine/unpack.c
23c78e
index a15bb92..281bc88 100644
23c78e
--- a/lib/pengine/unpack.c
23c78e
+++ b/lib/pengine/unpack.c
23c78e
@@ -3182,7 +3182,7 @@ should_clear_for_param_change(xmlNode *xml_op, const char *task,
23c78e
 {
23c78e
     if (!strcmp(task, "start") || !strcmp(task, "monitor")) {
23c78e
 
23c78e
-        if (pe__bundle_needs_remote_name(rsc)) {
23c78e
+        if (pe__bundle_needs_remote_name(rsc, data_set)) {
23c78e
             /* We haven't allocated resources yet, so we can't reliably
23c78e
              * substitute addr parameters for the REMOTE_CONTAINER_HACK.
23c78e
              * When that's needed, defer the check until later.
23c78e
-- 
23c78e
1.8.3.1
23c78e
23c78e
23c78e
From 992b2edfe573a2bfd510090b37a8a1b355ad3c44 Mon Sep 17 00:00:00 2001
23c78e
From: Ken Gaillot <kgaillot@redhat.com>
23c78e
Date: Tue, 10 Nov 2020 15:32:29 -0600
23c78e
Subject: [PATCH 06/13] Refactor: scheduler: use new resource parameter
23c78e
 function when creating graph
23c78e
23c78e
---
23c78e
 lib/pacemaker/pcmk_sched_graph.c | 30 +++++++++++++++++++++++++-----
23c78e
 1 file changed, 25 insertions(+), 5 deletions(-)
23c78e
23c78e
diff --git a/lib/pacemaker/pcmk_sched_graph.c b/lib/pacemaker/pcmk_sched_graph.c
23c78e
index c012d23..f0d1f47 100644
23c78e
--- a/lib/pacemaker/pcmk_sched_graph.c
23c78e
+++ b/lib/pacemaker/pcmk_sched_graph.c
23c78e
@@ -1210,11 +1210,29 @@ action2xml(pe_action_t * action, gboolean as_input, pe_working_set_t *data_set)
23c78e
 
23c78e
     g_hash_table_foreach(action->extra, hash2field, args_xml);
23c78e
     if (action->rsc != NULL && action->node) {
23c78e
-        GHashTable *p = crm_str_table_new();
23c78e
+        // Get the resource instance attributes, evaluated properly for node
23c78e
+        GHashTable *params = pe_rsc_params(action->rsc, action->node, data_set);
23c78e
 
23c78e
-        get_rsc_attributes(p, action->rsc, action->node, data_set);
23c78e
-        g_hash_table_foreach(p, hash2smartfield, args_xml);
23c78e
-        g_hash_table_destroy(p);
23c78e
+        /* REMOTE_CONTAINER_HACK: If this is a remote connection resource with
23c78e
+         * addr="#uname", pull the actual value from the parameters evaluated
23c78e
+         * without a node (which was put there earlier in stage8() when the
23c78e
+         * bundle's expand() method was called).
23c78e
+         */
23c78e
+        const char *remote_addr = g_hash_table_lookup(params,
23c78e
+                                                      XML_RSC_ATTR_REMOTE_RA_ADDR);
23c78e
+
23c78e
+        if (pcmk__str_eq(remote_addr, "#uname", pcmk__str_none)) {
23c78e
+            GHashTable *base = pe_rsc_params(action->rsc, NULL, data_set);
23c78e
+
23c78e
+            remote_addr = g_hash_table_lookup(base,
23c78e
+                                              XML_RSC_ATTR_REMOTE_RA_ADDR);
23c78e
+            if (remote_addr != NULL) {
23c78e
+                g_hash_table_insert(params, strdup(XML_RSC_ATTR_REMOTE_RA_ADDR),
23c78e
+                                    strdup(remote_addr));
23c78e
+            }
23c78e
+        }
23c78e
+
23c78e
+        g_hash_table_foreach(params, hash2smartfield, args_xml);
23c78e
 
23c78e
 #if ENABLE_VERSIONED_ATTRS
23c78e
         {
23c78e
@@ -1230,7 +1248,9 @@ action2xml(pe_action_t * action, gboolean as_input, pe_working_set_t *data_set)
23c78e
 #endif
23c78e
 
23c78e
     } else if(action->rsc && action->rsc->variant <= pe_native) {
23c78e
-        g_hash_table_foreach(action->rsc->parameters, hash2smartfield, args_xml);
23c78e
+        GHashTable *params = pe_rsc_params(action->rsc, NULL, data_set);
23c78e
+
23c78e
+        g_hash_table_foreach(params, hash2smartfield, args_xml);
23c78e
 
23c78e
 #if ENABLE_VERSIONED_ATTRS
23c78e
         if (xml_has_children(action->rsc->versioned_parameters)) {
23c78e
-- 
23c78e
1.8.3.1
23c78e
23c78e
23c78e
From 94316455ceead6f466e901d38e421f6116cf22d3 Mon Sep 17 00:00:00 2001
23c78e
From: Ken Gaillot <kgaillot@redhat.com>
23c78e
Date: Mon, 9 Nov 2020 16:04:23 -0600
23c78e
Subject: [PATCH 07/13] Low: scheduler: calculate secure digest properly for
23c78e
 node attribute rules
23c78e
23c78e
6830621 corrected secure digest calculation in most cases, but did not work
23c78e
properly when non-sensitive parameters depended on node attribute-based rules
23c78e
(since it used rsc->parameters, which is not evaluated for node).
23c78e
23c78e
This fixes it by using the new resource parameters function (which is the
23c78e
equivalent of what calculate_main_digest() already was doing, so it is now
23c78e
exposed earlier for use by both digest functions).
23c78e
---
23c78e
 lib/pengine/pe_digest.c | 28 +++++++++++++---------------
23c78e
 1 file changed, 13 insertions(+), 15 deletions(-)
23c78e
23c78e
diff --git a/lib/pengine/pe_digest.c b/lib/pengine/pe_digest.c
23c78e
index f6e41e9..2066a53 100644
23c78e
--- a/lib/pengine/pe_digest.c
23c78e
+++ b/lib/pengine/pe_digest.c
23c78e
@@ -124,6 +124,7 @@ append_all_versioned_params(pe_resource_t *rsc, pe_node_t *node,
23c78e
  * \param[out]    data         Digest cache entry to modify
23c78e
  * \param[in]     rsc          Resource that action was for
23c78e
  * \param[in]     node         Node action was performed on
23c78e
+ * \param[in]     params       Resource parameters evaluated for node
23c78e
  * \param[in]     task         Name of action performed
23c78e
  * \param[in,out] interval_ms  Action's interval (will be reset if in overrides)
23c78e
  * \param[in]     xml_op       XML of operation in CIB status (if available)
23c78e
@@ -133,14 +134,12 @@ append_all_versioned_params(pe_resource_t *rsc, pe_node_t *node,
23c78e
  */
23c78e
 static void
23c78e
 calculate_main_digest(op_digest_cache_t *data, pe_resource_t *rsc,
23c78e
-                      pe_node_t *node, const char *task, guint *interval_ms,
23c78e
+                      pe_node_t *node, GHashTable *params,
23c78e
+                      const char *task, guint *interval_ms,
23c78e
                       xmlNode *xml_op, const char *op_version,
23c78e
                       GHashTable *overrides, pe_working_set_t *data_set)
23c78e
 {
23c78e
     pe_action_t *action = NULL;
23c78e
-    GHashTable *local_rsc_params = crm_str_table_new();
23c78e
-
23c78e
-    get_rsc_attributes(local_rsc_params, rsc, node, data_set);
23c78e
 
23c78e
     data->params_all = create_xml_node(NULL, XML_TAG_PARAMS);
23c78e
 
23c78e
@@ -174,7 +173,7 @@ calculate_main_digest(op_digest_cache_t *data, pe_resource_t *rsc,
23c78e
     if (overrides != NULL) {
23c78e
         g_hash_table_foreach(overrides, hash2field, data->params_all);
23c78e
     }
23c78e
-    g_hash_table_foreach(local_rsc_params, hash2field, data->params_all);
23c78e
+    g_hash_table_foreach(params, hash2field, data->params_all);
23c78e
     g_hash_table_foreach(action->extra, hash2field, data->params_all);
23c78e
     g_hash_table_foreach(action->meta, hash2metafield, data->params_all);
23c78e
 
23c78e
@@ -184,7 +183,6 @@ calculate_main_digest(op_digest_cache_t *data, pe_resource_t *rsc,
23c78e
 
23c78e
     pcmk__filter_op_for_digest(data->params_all);
23c78e
 
23c78e
-    g_hash_table_destroy(local_rsc_params);
23c78e
     pe_free_action(action);
23c78e
 
23c78e
     data->digest_all_calc = calculate_operation_digest(data->params_all,
23c78e
@@ -204,14 +202,15 @@ is_fence_param(xmlAttrPtr attr, void *user_data)
23c78e
  *
23c78e
  * \param[out] data        Digest cache entry to modify
23c78e
  * \param[in]  rsc         Resource that action was for
23c78e
+ * \param[in]  params      Resource parameters evaluated for node
23c78e
  * \param[in]  xml_op      XML of operation in CIB status (if available)
23c78e
  * \param[in]  op_version  CRM feature set to use for digest calculation
23c78e
  * \param[in]  overrides   Key/value hash table to override resource parameters
23c78e
  */
23c78e
 static void
23c78e
 calculate_secure_digest(op_digest_cache_t *data, pe_resource_t *rsc,
23c78e
-                        xmlNode *xml_op, const char *op_version,
23c78e
-                        GHashTable *overrides)
23c78e
+                        GHashTable *params, xmlNode *xml_op,
23c78e
+                        const char *op_version, GHashTable *overrides)
23c78e
 {
23c78e
     const char *class = crm_element_value(rsc->xml, XML_AGENT_ATTR_CLASS);
23c78e
     const char *secure_list = NULL;
23c78e
@@ -222,16 +221,12 @@ calculate_secure_digest(op_digest_cache_t *data, pe_resource_t *rsc,
23c78e
         secure_list = crm_element_value(xml_op, XML_LRM_ATTR_OP_SECURE);
23c78e
     }
23c78e
 
23c78e
-    /* The controller doesn't create a digest of *all* non-sensitive
23c78e
-     * parameters, only those listed in resource agent meta-data. The
23c78e
-     * equivalent here is rsc->parameters.
23c78e
-     */
23c78e
     data->params_secure = create_xml_node(NULL, XML_TAG_PARAMS);
23c78e
     if (overrides != NULL) {
23c78e
         g_hash_table_foreach(overrides, hash2field, data->params_secure);
23c78e
     }
23c78e
 
23c78e
-    g_hash_table_foreach(rsc->parameters, hash2field, data->params_secure);
23c78e
+    g_hash_table_foreach(params, hash2field, data->params_secure);
23c78e
     if (secure_list != NULL) {
23c78e
         pcmk__xe_remove_matching_attrs(data->params_secure, attr_not_in_string,
23c78e
                                        (void *) secure_list);
23c78e
@@ -328,6 +323,7 @@ pe__calculate_digests(pe_resource_t *rsc, const char *task, guint *interval_ms,
23c78e
 {
23c78e
     op_digest_cache_t *data = calloc(1, sizeof(op_digest_cache_t));
23c78e
     const char *op_version = CRM_FEATURE_SET;
23c78e
+    GHashTable *params = NULL;
23c78e
 
23c78e
     if (data == NULL) {
23c78e
         return NULL;
23c78e
@@ -336,10 +332,12 @@ pe__calculate_digests(pe_resource_t *rsc, const char *task, guint *interval_ms,
23c78e
         op_version = crm_element_value(xml_op, XML_ATTR_CRM_VERSION);
23c78e
     }
23c78e
 
23c78e
-    calculate_main_digest(data, rsc, node, task, interval_ms, xml_op,
23c78e
+    params = pe_rsc_params(rsc, node, data_set);
23c78e
+    calculate_main_digest(data, rsc, node, params, task, interval_ms, xml_op,
23c78e
                           op_version, overrides, data_set);
23c78e
     if (calc_secure) {
23c78e
-        calculate_secure_digest(data, rsc, xml_op, op_version, overrides);
23c78e
+        calculate_secure_digest(data, rsc, params, xml_op, op_version,
23c78e
+                                overrides);
23c78e
     }
23c78e
     calculate_restart_digest(data, xml_op, op_version);
23c78e
     return data;
23c78e
-- 
23c78e
1.8.3.1
23c78e
23c78e
23c78e
From f546d0125b6f39fae744f43dad752089648e3f1f Mon Sep 17 00:00:00 2001
23c78e
From: Ken Gaillot <kgaillot@redhat.com>
23c78e
Date: Tue, 10 Nov 2020 16:01:32 -0600
23c78e
Subject: [PATCH 08/13] Fix: tools: respect rules when showing node attributes
23c78e
 in crm_mon
23c78e
23c78e
Previously, crm_mon checked rsc->parameters for ocf:pacemaker:ping parameter
23c78e
values. However that is not evaluated for node attribute rules. It also called
23c78e
get_rsc_attributes() for all resources unnecessarily, since that's part of
23c78e
common_unpack().
23c78e
23c78e
Now, use pe_rsc_params() to get the right values per node.
23c78e
---
23c78e
 tools/crm_mon.h         |  1 -
23c78e
 tools/crm_mon_print.c   | 28 ++++++++++++++--------------
23c78e
 tools/crm_mon_runtime.c | 15 +--------------
23c78e
 3 files changed, 15 insertions(+), 29 deletions(-)
23c78e
23c78e
diff --git a/tools/crm_mon.h b/tools/crm_mon.h
23c78e
index 143e8d8..f746507 100644
23c78e
--- a/tools/crm_mon.h
23c78e
+++ b/tools/crm_mon.h
23c78e
@@ -109,7 +109,6 @@ int print_html_status(pcmk__output_t *out, pe_working_set_t *data_set,
23c78e
 
23c78e
 GList *append_attr_list(GList *attr_list, char *name);
23c78e
 void blank_screen(void);
23c78e
-void crm_mon_get_parameters(pe_resource_t *rsc, pe_working_set_t *data_set);
23c78e
 unsigned int get_resource_display_options(unsigned int mon_ops);
23c78e
 
23c78e
 void crm_mon_register_messages(pcmk__output_t *out);
23c78e
diff --git a/tools/crm_mon_print.c b/tools/crm_mon_print.c
23c78e
index cc3efb0..8ae11bf 100644
23c78e
--- a/tools/crm_mon_print.c
23c78e
+++ b/tools/crm_mon_print.c
23c78e
@@ -38,7 +38,8 @@ static int print_rsc_history(pcmk__output_t *out, pe_working_set_t *data_set,
23c78e
 static int print_node_history(pcmk__output_t *out, pe_working_set_t *data_set,
23c78e
                               pe_node_t *node, xmlNode *node_state, gboolean operations,
23c78e
                               unsigned int mon_ops, GListPtr only_node, GListPtr only_rsc);
23c78e
-static gboolean add_extra_info(pcmk__output_t *out, pe_node_t * node, GListPtr rsc_list,
23c78e
+static gboolean add_extra_info(pcmk__output_t *out, pe_node_t *node,
23c78e
+                               GListPtr rsc_list, pe_working_set_t *data_set,
23c78e
                                const char *attrname, int *expected_score);
23c78e
 static void print_node_attribute(gpointer name, gpointer user_data);
23c78e
 static int print_node_summary(pcmk__output_t *out, pe_working_set_t * data_set,
23c78e
@@ -330,7 +331,8 @@ print_node_history(pcmk__output_t *out, pe_working_set_t *data_set,
23c78e
  */
23c78e
 static gboolean
23c78e
 add_extra_info(pcmk__output_t *out, pe_node_t *node, GListPtr rsc_list,
23c78e
-               const char *attrname, int *expected_score)
23c78e
+               pe_working_set_t *data_set, const char *attrname,
23c78e
+               int *expected_score)
23c78e
 {
23c78e
     GListPtr gIter = NULL;
23c78e
 
23c78e
@@ -338,9 +340,11 @@ add_extra_info(pcmk__output_t *out, pe_node_t *node, GListPtr rsc_list,
23c78e
         pe_resource_t *rsc = (pe_resource_t *) gIter->data;
23c78e
         const char *type = g_hash_table_lookup(rsc->meta, "type");
23c78e
         const char *name = NULL;
23c78e
+        GHashTable *params = NULL;
23c78e
 
23c78e
         if (rsc->children != NULL) {
23c78e
-            if (add_extra_info(out, node, rsc->children, attrname, expected_score)) {
23c78e
+            if (add_extra_info(out, node, rsc->children, data_set, attrname,
23c78e
+                               expected_score)) {
23c78e
                 return TRUE;
23c78e
             }
23c78e
         }
23c78e
@@ -349,7 +353,8 @@ add_extra_info(pcmk__output_t *out, pe_node_t *node, GListPtr rsc_list,
23c78e
             continue;
23c78e
         }
23c78e
 
23c78e
-        name = g_hash_table_lookup(rsc->parameters, "name");
23c78e
+        params = pe_rsc_params(rsc, node, data_set);
23c78e
+        name = g_hash_table_lookup(params, "name");
23c78e
 
23c78e
         if (name == NULL) {
23c78e
             name = "pingd";
23c78e
@@ -359,8 +364,8 @@ add_extra_info(pcmk__output_t *out, pe_node_t *node, GListPtr rsc_list,
23c78e
         if (pcmk__str_eq(name, attrname, pcmk__str_casei)) {
23c78e
             int host_list_num = 0;
23c78e
             /* int value = crm_parse_int(attrvalue, "0"); */
23c78e
-            const char *hosts = g_hash_table_lookup(rsc->parameters, "host_list");
23c78e
-            const char *multiplier = g_hash_table_lookup(rsc->parameters, "multiplier");
23c78e
+            const char *hosts = g_hash_table_lookup(params, "host_list");
23c78e
+            const char *multiplier = g_hash_table_lookup(params, "multiplier");
23c78e
 
23c78e
             if (hosts) {
23c78e
                 char **host_list = g_strsplit(hosts, " ", 0);
23c78e
@@ -381,6 +386,7 @@ add_extra_info(pcmk__output_t *out, pe_node_t *node, GListPtr rsc_list,
23c78e
 struct mon_attr_data {
23c78e
     pcmk__output_t *out;
23c78e
     pe_node_t *node;
23c78e
+    pe_working_set_t *data_set;
23c78e
 };
23c78e
 
23c78e
 static void
23c78e
@@ -394,7 +400,7 @@ print_node_attribute(gpointer name, gpointer user_data)
23c78e
     value = pe_node_attribute_raw(data->node, name);
23c78e
 
23c78e
     add_extra = add_extra_info(data->out, data->node, data->node->details->running_rsc,
23c78e
-                               name, &expected_score);
23c78e
+                               data->data_set, name, &expected_score);
23c78e
 
23c78e
     /* Print attribute name and value */
23c78e
     data->out->message(data->out, "node-attribute", name, value, add_extra,
23c78e
@@ -547,19 +553,13 @@ print_node_attributes(pcmk__output_t *out, pe_working_set_t *data_set,
23c78e
     GListPtr gIter = NULL;
23c78e
     int rc = pcmk_rc_no_output;
23c78e
 
23c78e
-    /* Unpack all resource parameters (it would be more efficient to do this
23c78e
-     * only when needed for the first time in add_extra_info())
23c78e
-     */
23c78e
-    for (gIter = data_set->resources; gIter != NULL; gIter = gIter->next) {
23c78e
-        crm_mon_get_parameters(gIter->data, data_set);
23c78e
-    }
23c78e
-
23c78e
     /* Display each node's attributes */
23c78e
     for (gIter = data_set->nodes; gIter != NULL; gIter = gIter->next) {
23c78e
         struct mon_attr_data data;
23c78e
 
23c78e
         data.out = out;
23c78e
         data.node = (pe_node_t *) gIter->data;
23c78e
+        data.data_set = data_set;
23c78e
 
23c78e
         if (data.node && data.node->details && data.node->details->online) {
23c78e
             GList *attr_list = NULL;
23c78e
diff --git a/tools/crm_mon_runtime.c b/tools/crm_mon_runtime.c
23c78e
index ce31559..43152ce 100644
23c78e
--- a/tools/crm_mon_runtime.c
23c78e
+++ b/tools/crm_mon_runtime.c
23c78e
@@ -1,5 +1,5 @@
23c78e
 /*
23c78e
- * Copyright 2019 the Pacemaker project contributors
23c78e
+ * Copyright 2019-2020 the Pacemaker project contributors
23c78e
  *
23c78e
  * The version control history for this file may have further details.
23c78e
  *
23c78e
@@ -66,19 +66,6 @@ append_attr_list(GList *attr_list, char *name)
23c78e
     return g_list_insert_sorted(attr_list, name, compare_attribute);
23c78e
 }
23c78e
 
23c78e
-void
23c78e
-crm_mon_get_parameters(pe_resource_t *rsc, pe_working_set_t * data_set)
23c78e
-{
23c78e
-    get_rsc_attributes(rsc->parameters, rsc, NULL, data_set);
23c78e
-    if(rsc->children) {
23c78e
-        GListPtr gIter = NULL;
23c78e
-
23c78e
-        for (gIter = rsc->children; gIter != NULL; gIter = gIter->next) {
23c78e
-            crm_mon_get_parameters(gIter->data, data_set);
23c78e
-        }
23c78e
-    }
23c78e
-}
23c78e
-
23c78e
 /*!
23c78e
  * \internal
23c78e
  * \brief Return resource display options corresponding to command-line choices
23c78e
-- 
23c78e
1.8.3.1
23c78e
23c78e
23c78e
From 397ad868d464a0ffd14ed527a97010e141ac60b3 Mon Sep 17 00:00:00 2001
23c78e
From: Ken Gaillot <kgaillot@redhat.com>
23c78e
Date: Wed, 11 Nov 2020 12:59:34 -0600
23c78e
Subject: [PATCH 09/13] Fix: scheduler: multiple issues with value-source in
23c78e
 location rules
23c78e
23c78e
Delay creating rule match data for location constraints until the node is
23c78e
known, and evaluate the rules using that node (using the new resource
23c78e
parameter function). This fixes multiple issues:
23c78e
23c78e
* Previously, match data using resource parameters was created only when
23c78e
  rsc-pattern was specified and a resource positively matched. This meant that
23c78e
  a node attribute rule expression with a value-source of "param" or "meta"
23c78e
  would only work in that case, and not when rsc was specified instead,
23c78e
  or when rsc-pattern was specified with an inverted match ("!pattern"),
23c78e
  or when a rule was used in a constraint with a resource set.
23c78e
23c78e
* Previously, with rsc-pattern, the match data used the resource's default
23c78e
  parameters (not evaluated by node). This meant that a location rule that used
23c78e
  a node attribute expression with a value-source of "param" could not be
23c78e
  used with a resource parameter that itself was determined by a rule
23c78e
  using a node attribute expression.
23c78e
---
23c78e
 lib/pacemaker/pcmk_sched_constraints.c | 40 ++++++++++++++++++----------------
23c78e
 1 file changed, 21 insertions(+), 19 deletions(-)
23c78e
23c78e
diff --git a/lib/pacemaker/pcmk_sched_constraints.c b/lib/pacemaker/pcmk_sched_constraints.c
23c78e
index 0029ad7..92b9740 100644
23c78e
--- a/lib/pacemaker/pcmk_sched_constraints.c
23c78e
+++ b/lib/pacemaker/pcmk_sched_constraints.c
23c78e
@@ -47,7 +47,7 @@ static pe__location_t *generate_location_rule(pe_resource_t *rsc,
23c78e
                                               const char *discovery,
23c78e
                                               crm_time_t *next_change,
23c78e
                                               pe_working_set_t *data_set,
23c78e
-                                              pe_match_data_t *match_data);
23c78e
+                                              pe_re_match_data_t *match_data);
23c78e
 static void unpack_location(xmlNode *xml_obj, pe_working_set_t *data_set);
23c78e
 static void unpack_rsc_colocation(xmlNode *xml_obj, pe_working_set_t *data_set);
23c78e
 
23c78e
@@ -714,7 +714,7 @@ tag_to_set(xmlNode * xml_obj, xmlNode ** rsc_set, const char * attr,
23c78e
 static void unpack_rsc_location(xmlNode *xml_obj, pe_resource_t *rsc_lh,
23c78e
                                 const char *role, const char *score,
23c78e
                                 pe_working_set_t *data_set,
23c78e
-                                pe_match_data_t *match_data);
23c78e
+                                pe_re_match_data_t *match_data);
23c78e
 
23c78e
 static void
23c78e
 unpack_simple_location(xmlNode *xml_obj, pe_working_set_t *data_set)
23c78e
@@ -769,13 +769,9 @@ unpack_simple_location(xmlNode *xml_obj, pe_working_set_t *data_set)
23c78e
                                                 .nregs = nregs,
23c78e
                                                 .pmatch = pmatch
23c78e
                                                };
23c78e
-                pe_match_data_t match_data = {
23c78e
-                                                .re = &re_match_data,
23c78e
-                                                .params = r->parameters,
23c78e
-                                                .meta = r->meta,
23c78e
-                                             };
23c78e
+
23c78e
                 crm_debug("'%s' matched '%s' for %s", r->id, value, id);
23c78e
-                unpack_rsc_location(xml_obj, r, NULL, NULL, data_set, &match_data);
23c78e
+                unpack_rsc_location(xml_obj, r, NULL, NULL, data_set, &re_match_data);
23c78e
 
23c78e
             } else if (invert && (status != 0)) {
23c78e
                 crm_debug("'%s' is an inverted match of '%s' for %s", r->id, value, id);
23c78e
@@ -796,7 +792,7 @@ unpack_simple_location(xmlNode *xml_obj, pe_working_set_t *data_set)
23c78e
 static void
23c78e
 unpack_rsc_location(xmlNode *xml_obj, pe_resource_t *rsc_lh, const char *role,
23c78e
                     const char *score, pe_working_set_t *data_set,
23c78e
-                    pe_match_data_t *match_data)
23c78e
+                    pe_re_match_data_t *re_match_data)
23c78e
 {
23c78e
     pe__location_t *location = NULL;
23c78e
     const char *id_lh = crm_element_value(xml_obj, XML_LOC_ATTR_SOURCE);
23c78e
@@ -836,7 +832,7 @@ unpack_rsc_location(xmlNode *xml_obj, pe_resource_t *rsc_lh, const char *role,
23c78e
             empty = FALSE;
23c78e
             crm_trace("Unpacking %s/%s", id, ID(rule_xml));
23c78e
             generate_location_rule(rsc_lh, rule_xml, discovery, next_change,
23c78e
-                                   data_set, match_data);
23c78e
+                                   data_set, re_match_data);
23c78e
         }
23c78e
 
23c78e
         if (empty) {
23c78e
@@ -1067,7 +1063,8 @@ get_node_score(const char *rule, const char *score, gboolean raw, pe_node_t * no
23c78e
 static pe__location_t *
23c78e
 generate_location_rule(pe_resource_t *rsc, xmlNode *rule_xml,
23c78e
                        const char *discovery, crm_time_t *next_change,
23c78e
-                       pe_working_set_t *data_set, pe_match_data_t *match_data)
23c78e
+                       pe_working_set_t *data_set,
23c78e
+                       pe_re_match_data_t *re_match_data)
23c78e
 {
23c78e
     const char *rule_id = NULL;
23c78e
     const char *score = NULL;
23c78e
@@ -1113,14 +1110,14 @@ generate_location_rule(pe_resource_t *rsc, xmlNode *rule_xml,
23c78e
         return NULL;
23c78e
     }
23c78e
 
23c78e
-    if (match_data && match_data->re && match_data->re->nregs > 0 && match_data->re->pmatch[0].rm_so != -1) {
23c78e
-        if (raw_score == FALSE) {
23c78e
-            char *result = pe_expand_re_matches(score, match_data->re);
23c78e
+    if ((re_match_data != NULL) && (re_match_data->nregs > 0)
23c78e
+        && (re_match_data->pmatch[0].rm_so != -1) && !raw_score) {
23c78e
 
23c78e
-            if (result) {
23c78e
-                score = (const char *) result;
23c78e
-                score_allocated = TRUE;
23c78e
-            }
23c78e
+        char *result = pe_expand_re_matches(score, re_match_data);
23c78e
+
23c78e
+        if (result != NULL) {
23c78e
+            score = result;
23c78e
+            score_allocated = TRUE;
23c78e
         }
23c78e
     }
23c78e
 
23c78e
@@ -1148,9 +1145,14 @@ generate_location_rule(pe_resource_t *rsc, xmlNode *rule_xml,
23c78e
     for (gIter = data_set->nodes; gIter != NULL; gIter = gIter->next) {
23c78e
         int score_f = 0;
23c78e
         pe_node_t *node = (pe_node_t *) gIter->data;
23c78e
+        pe_match_data_t match_data = {
23c78e
+            .re = re_match_data,
23c78e
+            .params = pe_rsc_params(rsc, node, data_set),
23c78e
+            .meta = rsc->meta,
23c78e
+        };
23c78e
 
23c78e
         accept = pe_test_rule(rule_xml, node->details->attrs, RSC_ROLE_UNKNOWN,
23c78e
-                              data_set->now, next_change, match_data);
23c78e
+                              data_set->now, next_change, &match_data);
23c78e
 
23c78e
         crm_trace("Rule %s %s on %s", ID(rule_xml), accept ? "passed" : "failed",
23c78e
                   node->details->uname);
23c78e
-- 
23c78e
1.8.3.1
23c78e
23c78e
23c78e
From 40383ae2e2796b1bcbdb86bdd9cdc93c117eb69f Mon Sep 17 00:00:00 2001
23c78e
From: Ken Gaillot <kgaillot@redhat.com>
23c78e
Date: Thu, 12 Nov 2020 15:32:47 -0600
23c78e
Subject: [PATCH 10/13] Test: scheduler: add regression test for rules using
23c78e
 value-source
23c78e
23c78e
---
23c78e
 cts/cts-scheduler.in               |   1 +
23c78e
 cts/scheduler/value-source.dot     |  29 +++
23c78e
 cts/scheduler/value-source.exp     | 200 ++++++++++++++++
23c78e
 cts/scheduler/value-source.scores  |  47 ++++
23c78e
 cts/scheduler/value-source.summary |  60 +++++
23c78e
 cts/scheduler/value-source.xml     | 463 +++++++++++++++++++++++++++++++++++++
23c78e
 6 files changed, 800 insertions(+)
23c78e
 create mode 100644 cts/scheduler/value-source.dot
23c78e
 create mode 100644 cts/scheduler/value-source.exp
23c78e
 create mode 100644 cts/scheduler/value-source.scores
23c78e
 create mode 100644 cts/scheduler/value-source.summary
23c78e
 create mode 100644 cts/scheduler/value-source.xml
23c78e
23c78e
diff --git a/cts/cts-scheduler.in b/cts/cts-scheduler.in
23c78e
index 23e6a91..939f8c8 100644
23c78e
--- a/cts/cts-scheduler.in
23c78e
+++ b/cts/cts-scheduler.in
23c78e
@@ -145,6 +145,7 @@ TESTS = [
23c78e
         [ "location-date-rules-1", "Use location constraints with ineffective date-based rules" ],
23c78e
         [ "location-date-rules-2", "Use location constraints with effective date-based rules" ],
23c78e
         [ "nvpair-date-rules-1", "Use nvpair blocks with a variety of date-based rules" ],
23c78e
+        [ "value-source", "Use location constraints with node attribute expressions using value-source" ],
23c78e
         [ "rule-dbl-as-auto-number-match",
23c78e
           "Floating-point rule values default to number comparison: match" ],
23c78e
         [ "rule-dbl-as-auto-number-no-match",
23c78e
diff --git a/cts/scheduler/value-source.dot b/cts/scheduler/value-source.dot
23c78e
new file mode 100644
23c78e
index 0000000..dfb61e9
23c78e
--- /dev/null
23c78e
+++ b/cts/scheduler/value-source.dot
23c78e
@@ -0,0 +1,29 @@
23c78e
+ digraph "g" {
23c78e
+"Fencing_monitor_120000 rhel7-1" [ style=bold color="green" fontcolor="black"]
23c78e
+"Fencing_start_0 rhel7-1" -> "Fencing_monitor_120000 rhel7-1" [ style = bold]
23c78e
+"Fencing_start_0 rhel7-1" [ style=bold color="green" fontcolor="black"]
23c78e
+"insane-rsc_monitor_10000 rhel7-4" [ style=bold color="green" fontcolor="black"]
23c78e
+"insane-rsc_start_0 rhel7-4" -> "insane-rsc_monitor_10000 rhel7-4" [ style = bold]
23c78e
+"insane-rsc_start_0 rhel7-4" [ style=bold color="green" fontcolor="black"]
23c78e
+"invert-match_monitor_10000 rhel7-1" [ style=bold color="green" fontcolor="black"]
23c78e
+"invert-match_start_0 rhel7-1" -> "invert-match_monitor_10000 rhel7-1" [ style = bold]
23c78e
+"invert-match_start_0 rhel7-1" [ style=bold color="green" fontcolor="black"]
23c78e
+"meta-rsc_monitor_10000 rhel7-5" [ style=bold color="green" fontcolor="black"]
23c78e
+"meta-rsc_start_0 rhel7-5" -> "meta-rsc_monitor_10000 rhel7-5" [ style = bold]
23c78e
+"meta-rsc_start_0 rhel7-5" [ style=bold color="green" fontcolor="black"]
23c78e
+"rsc1_monitor_10000 rhel7-4" [ style=bold color="green" fontcolor="black"]
23c78e
+"rsc1_start_0 rhel7-4" -> "rsc1_monitor_10000 rhel7-4" [ style = bold]
23c78e
+"rsc1_start_0 rhel7-4" [ style=bold color="green" fontcolor="black"]
23c78e
+"rsc2_monitor_10000 rhel7-5" [ style=bold color="green" fontcolor="black"]
23c78e
+"rsc2_start_0 rhel7-5" -> "rsc2_monitor_10000 rhel7-5" [ style = bold]
23c78e
+"rsc2_start_0 rhel7-5" [ style=bold color="green" fontcolor="black"]
23c78e
+"set-rsc1_monitor_10000 rhel7-3" [ style=bold color="green" fontcolor="black"]
23c78e
+"set-rsc1_start_0 rhel7-3" -> "set-rsc1_monitor_10000 rhel7-3" [ style = bold]
23c78e
+"set-rsc1_start_0 rhel7-3" [ style=bold color="green" fontcolor="black"]
23c78e
+"set-rsc2_monitor_10000 rhel7-4" [ style=bold color="green" fontcolor="black"]
23c78e
+"set-rsc2_start_0 rhel7-4" -> "set-rsc2_monitor_10000 rhel7-4" [ style = bold]
23c78e
+"set-rsc2_start_0 rhel7-4" [ style=bold color="green" fontcolor="black"]
23c78e
+"single-rsc_monitor_10000 rhel7-2" [ style=bold color="green" fontcolor="black"]
23c78e
+"single-rsc_start_0 rhel7-2" -> "single-rsc_monitor_10000 rhel7-2" [ style = bold]
23c78e
+"single-rsc_start_0 rhel7-2" [ style=bold color="green" fontcolor="black"]
23c78e
+}
23c78e
diff --git a/cts/scheduler/value-source.exp b/cts/scheduler/value-source.exp
23c78e
new file mode 100644
23c78e
index 0000000..4bf469f
23c78e
--- /dev/null
23c78e
+++ b/cts/scheduler/value-source.exp
23c78e
@@ -0,0 +1,200 @@
23c78e
+<transition_graph cluster-delay="60s" stonith-timeout="60s" failed-stop-offset="INFINITY" failed-start-offset="1"  transition_id="0">
23c78e
+  <synapse id="0">
23c78e
+    <action_set>
23c78e
+      <rsc_op id="2" operation="monitor" operation_key="Fencing_monitor_120000" on_node="rhel7-1" on_node_uuid="1">
23c78e
+        <primitive id="Fencing" class="stonith" type="fence_xvm"/>
23c78e
+        <attributes CRM_meta_interval="120000" CRM_meta_name="monitor" CRM_meta_on_node="rhel7-1" CRM_meta_on_node_uuid="1" CRM_meta_timeout="120000"  key_file="/etc/pacemaker/fence_xvm.key" multicast_address="239.255.100.100" pcmk_host_list="rhel7-1 rhel7-2 rhel7-3 rhel7-4 rhel7-5"/>
23c78e
+      </rsc_op>
23c78e
+    </action_set>
23c78e
+    <inputs>
23c78e
+      <trigger>
23c78e
+        <rsc_op id="1" operation="start" operation_key="Fencing_start_0" on_node="rhel7-1" on_node_uuid="1"/>
23c78e
+      </trigger>
23c78e
+    </inputs>
23c78e
+  </synapse>
23c78e
+  <synapse id="1">
23c78e
+    <action_set>
23c78e
+      <rsc_op id="1" operation="start" operation_key="Fencing_start_0" on_node="rhel7-1" on_node_uuid="1">
23c78e
+        <primitive id="Fencing" class="stonith" type="fence_xvm"/>
23c78e
+        <attributes CRM_meta_on_node="rhel7-1" CRM_meta_on_node_uuid="1" CRM_meta_timeout="90000"  key_file="/etc/pacemaker/fence_xvm.key" multicast_address="239.255.100.100" pcmk_host_list="rhel7-1 rhel7-2 rhel7-3 rhel7-4 rhel7-5"/>
23c78e
+      </rsc_op>
23c78e
+    </action_set>
23c78e
+    <inputs/>
23c78e
+  </synapse>
23c78e
+  <synapse id="2">
23c78e
+    <action_set>
23c78e
+      <rsc_op id="4" operation="monitor" operation_key="rsc1_monitor_10000" on_node="rhel7-4" on_node_uuid="4">
23c78e
+        <primitive id="rsc1" class="ocf" provider="pacemaker" type="Dummy"/>
23c78e
+        <attributes CRM_meta_interval="10000" CRM_meta_name="monitor" CRM_meta_on_node="rhel7-4" CRM_meta_on_node_uuid="4" CRM_meta_timeout="20000"  fake="300"/>
23c78e
+      </rsc_op>
23c78e
+    </action_set>
23c78e
+    <inputs>
23c78e
+      <trigger>
23c78e
+        <rsc_op id="3" operation="start" operation_key="rsc1_start_0" on_node="rhel7-4" on_node_uuid="4"/>
23c78e
+      </trigger>
23c78e
+    </inputs>
23c78e
+  </synapse>
23c78e
+  <synapse id="3">
23c78e
+    <action_set>
23c78e
+      <rsc_op id="3" operation="start" operation_key="rsc1_start_0" on_node="rhel7-4" on_node_uuid="4">
23c78e
+        <primitive id="rsc1" class="ocf" provider="pacemaker" type="Dummy"/>
23c78e
+        <attributes CRM_meta_name="start" CRM_meta_on_node="rhel7-4" CRM_meta_on_node_uuid="4" CRM_meta_timeout="20000"  fake="300"/>
23c78e
+      </rsc_op>
23c78e
+    </action_set>
23c78e
+    <inputs/>
23c78e
+  </synapse>
23c78e
+  <synapse id="4">
23c78e
+    <action_set>
23c78e
+      <rsc_op id="6" operation="monitor" operation_key="rsc2_monitor_10000" on_node="rhel7-5" on_node_uuid="5">
23c78e
+        <primitive id="rsc2" class="ocf" provider="pacemaker" type="Dummy"/>
23c78e
+        <attributes CRM_meta_interval="10000" CRM_meta_name="monitor" CRM_meta_on_node="rhel7-5" CRM_meta_on_node_uuid="5" CRM_meta_timeout="20000"  fake="400"/>
23c78e
+      </rsc_op>
23c78e
+    </action_set>
23c78e
+    <inputs>
23c78e
+      <trigger>
23c78e
+        <rsc_op id="5" operation="start" operation_key="rsc2_start_0" on_node="rhel7-5" on_node_uuid="5"/>
23c78e
+      </trigger>
23c78e
+    </inputs>
23c78e
+  </synapse>
23c78e
+  <synapse id="5">
23c78e
+    <action_set>
23c78e
+      <rsc_op id="5" operation="start" operation_key="rsc2_start_0" on_node="rhel7-5" on_node_uuid="5">
23c78e
+        <primitive id="rsc2" class="ocf" provider="pacemaker" type="Dummy"/>
23c78e
+        <attributes CRM_meta_name="start" CRM_meta_on_node="rhel7-5" CRM_meta_on_node_uuid="5" CRM_meta_timeout="20000"  fake="400"/>
23c78e
+      </rsc_op>
23c78e
+    </action_set>
23c78e
+    <inputs/>
23c78e
+  </synapse>
23c78e
+  <synapse id="6">
23c78e
+    <action_set>
23c78e
+      <rsc_op id="8" operation="monitor" operation_key="invert-match_monitor_10000" on_node="rhel7-1" on_node_uuid="1">
23c78e
+        <primitive id="invert-match" class="ocf" provider="pacemaker" type="Dummy"/>
23c78e
+        <attributes CRM_meta_interval="10000" CRM_meta_name="monitor" CRM_meta_on_node="rhel7-1" CRM_meta_on_node_uuid="1" CRM_meta_timeout="20000"  fake="200"/>
23c78e
+      </rsc_op>
23c78e
+    </action_set>
23c78e
+    <inputs>
23c78e
+      <trigger>
23c78e
+        <rsc_op id="7" operation="start" operation_key="invert-match_start_0" on_node="rhel7-1" on_node_uuid="1"/>
23c78e
+      </trigger>
23c78e
+    </inputs>
23c78e
+  </synapse>
23c78e
+  <synapse id="7">
23c78e
+    <action_set>
23c78e
+      <rsc_op id="7" operation="start" operation_key="invert-match_start_0" on_node="rhel7-1" on_node_uuid="1">
23c78e
+        <primitive id="invert-match" class="ocf" provider="pacemaker" type="Dummy"/>
23c78e
+        <attributes CRM_meta_name="start" CRM_meta_on_node="rhel7-1" CRM_meta_on_node_uuid="1" CRM_meta_timeout="20000"  fake="200"/>
23c78e
+      </rsc_op>
23c78e
+    </action_set>
23c78e
+    <inputs/>
23c78e
+  </synapse>
23c78e
+  <synapse id="8">
23c78e
+    <action_set>
23c78e
+      <rsc_op id="10" operation="monitor" operation_key="single-rsc_monitor_10000" on_node="rhel7-2" on_node_uuid="2">
23c78e
+        <primitive id="single-rsc" class="ocf" provider="pacemaker" type="Dummy"/>
23c78e
+        <attributes CRM_meta_interval="10000" CRM_meta_name="monitor" CRM_meta_on_node="rhel7-2" CRM_meta_on_node_uuid="2" CRM_meta_timeout="20000"  fake="200"/>
23c78e
+      </rsc_op>
23c78e
+    </action_set>
23c78e
+    <inputs>
23c78e
+      <trigger>
23c78e
+        <rsc_op id="9" operation="start" operation_key="single-rsc_start_0" on_node="rhel7-2" on_node_uuid="2"/>
23c78e
+      </trigger>
23c78e
+    </inputs>
23c78e
+  </synapse>
23c78e
+  <synapse id="9">
23c78e
+    <action_set>
23c78e
+      <rsc_op id="9" operation="start" operation_key="single-rsc_start_0" on_node="rhel7-2" on_node_uuid="2">
23c78e
+        <primitive id="single-rsc" class="ocf" provider="pacemaker" type="Dummy"/>
23c78e
+        <attributes CRM_meta_name="start" CRM_meta_on_node="rhel7-2" CRM_meta_on_node_uuid="2" CRM_meta_timeout="20000"  fake="200"/>
23c78e
+      </rsc_op>
23c78e
+    </action_set>
23c78e
+    <inputs/>
23c78e
+  </synapse>
23c78e
+  <synapse id="10">
23c78e
+    <action_set>
23c78e
+      <rsc_op id="12" operation="monitor" operation_key="set-rsc1_monitor_10000" on_node="rhel7-3" on_node_uuid="3">
23c78e
+        <primitive id="set-rsc1" class="ocf" provider="pacemaker" type="Dummy"/>
23c78e
+        <attributes CRM_meta_interval="10000" CRM_meta_name="monitor" CRM_meta_on_node="rhel7-3" CRM_meta_on_node_uuid="3" CRM_meta_timeout="20000"  fake="300"/>
23c78e
+      </rsc_op>
23c78e
+    </action_set>
23c78e
+    <inputs>
23c78e
+      <trigger>
23c78e
+        <rsc_op id="11" operation="start" operation_key="set-rsc1_start_0" on_node="rhel7-3" on_node_uuid="3"/>
23c78e
+      </trigger>
23c78e
+    </inputs>
23c78e
+  </synapse>
23c78e
+  <synapse id="11">
23c78e
+    <action_set>
23c78e
+      <rsc_op id="11" operation="start" operation_key="set-rsc1_start_0" on_node="rhel7-3" on_node_uuid="3">
23c78e
+        <primitive id="set-rsc1" class="ocf" provider="pacemaker" type="Dummy"/>
23c78e
+        <attributes CRM_meta_name="start" CRM_meta_on_node="rhel7-3" CRM_meta_on_node_uuid="3" CRM_meta_timeout="20000"  fake="300"/>
23c78e
+      </rsc_op>
23c78e
+    </action_set>
23c78e
+    <inputs/>
23c78e
+  </synapse>
23c78e
+  <synapse id="12">
23c78e
+    <action_set>
23c78e
+      <rsc_op id="14" operation="monitor" operation_key="set-rsc2_monitor_10000" on_node="rhel7-4" on_node_uuid="4">
23c78e
+        <primitive id="set-rsc2" class="ocf" provider="pacemaker" type="Dummy"/>
23c78e
+        <attributes CRM_meta_interval="10000" CRM_meta_name="monitor" CRM_meta_on_node="rhel7-4" CRM_meta_on_node_uuid="4" CRM_meta_timeout="20000"  fake="400"/>
23c78e
+      </rsc_op>
23c78e
+    </action_set>
23c78e
+    <inputs>
23c78e
+      <trigger>
23c78e
+        <rsc_op id="13" operation="start" operation_key="set-rsc2_start_0" on_node="rhel7-4" on_node_uuid="4"/>
23c78e
+      </trigger>
23c78e
+    </inputs>
23c78e
+  </synapse>
23c78e
+  <synapse id="13">
23c78e
+    <action_set>
23c78e
+      <rsc_op id="13" operation="start" operation_key="set-rsc2_start_0" on_node="rhel7-4" on_node_uuid="4">
23c78e
+        <primitive id="set-rsc2" class="ocf" provider="pacemaker" type="Dummy"/>
23c78e
+        <attributes CRM_meta_name="start" CRM_meta_on_node="rhel7-4" CRM_meta_on_node_uuid="4" CRM_meta_timeout="20000"  fake="400"/>
23c78e
+      </rsc_op>
23c78e
+    </action_set>
23c78e
+    <inputs/>
23c78e
+  </synapse>
23c78e
+  <synapse id="14">
23c78e
+    <action_set>
23c78e
+      <rsc_op id="16" operation="monitor" operation_key="meta-rsc_monitor_10000" on_node="rhel7-5" on_node_uuid="5">
23c78e
+        <primitive id="meta-rsc" class="ocf" provider="pacemaker" type="Dummy"/>
23c78e
+        <attributes CRM_meta_interval="10000" CRM_meta_name="monitor" CRM_meta_on_node="rhel7-5" CRM_meta_on_node_uuid="5" CRM_meta_timeout="20000"  fake="500"/>
23c78e
+      </rsc_op>
23c78e
+    </action_set>
23c78e
+    <inputs>
23c78e
+      <trigger>
23c78e
+        <rsc_op id="15" operation="start" operation_key="meta-rsc_start_0" on_node="rhel7-5" on_node_uuid="5"/>
23c78e
+      </trigger>
23c78e
+    </inputs>
23c78e
+  </synapse>
23c78e
+  <synapse id="15">
23c78e
+    <action_set>
23c78e
+      <rsc_op id="15" operation="start" operation_key="meta-rsc_start_0" on_node="rhel7-5" on_node_uuid="5">
23c78e
+        <primitive id="meta-rsc" class="ocf" provider="pacemaker" type="Dummy"/>
23c78e
+        <attributes CRM_meta_name="start" CRM_meta_on_node="rhel7-5" CRM_meta_on_node_uuid="5" CRM_meta_timeout="20000"  fake="500"/>
23c78e
+      </rsc_op>
23c78e
+    </action_set>
23c78e
+    <inputs/>
23c78e
+  </synapse>
23c78e
+  <synapse id="16">
23c78e
+    <action_set>
23c78e
+      <rsc_op id="18" operation="monitor" operation_key="insane-rsc_monitor_10000" on_node="rhel7-4" on_node_uuid="4">
23c78e
+        <primitive id="insane-rsc" class="ocf" provider="pacemaker" type="Dummy"/>
23c78e
+        <attributes CRM_meta_interval="10000" CRM_meta_name="monitor" CRM_meta_on_node="rhel7-4" CRM_meta_on_node_uuid="4" CRM_meta_timeout="20000"  fake="400"/>
23c78e
+      </rsc_op>
23c78e
+    </action_set>
23c78e
+    <inputs>
23c78e
+      <trigger>
23c78e
+        <rsc_op id="17" operation="start" operation_key="insane-rsc_start_0" on_node="rhel7-4" on_node_uuid="4"/>
23c78e
+      </trigger>
23c78e
+    </inputs>
23c78e
+  </synapse>
23c78e
+  <synapse id="17">
23c78e
+    <action_set>
23c78e
+      <rsc_op id="17" operation="start" operation_key="insane-rsc_start_0" on_node="rhel7-4" on_node_uuid="4">
23c78e
+        <primitive id="insane-rsc" class="ocf" provider="pacemaker" type="Dummy"/>
23c78e
+        <attributes CRM_meta_name="start" CRM_meta_on_node="rhel7-4" CRM_meta_on_node_uuid="4" CRM_meta_timeout="20000"  fake="400"/>
23c78e
+      </rsc_op>
23c78e
+    </action_set>
23c78e
+    <inputs/>
23c78e
+  </synapse>
23c78e
+</transition_graph>
23c78e
diff --git a/cts/scheduler/value-source.scores b/cts/scheduler/value-source.scores
23c78e
new file mode 100644
23c78e
index 0000000..1f781c4
23c78e
--- /dev/null
23c78e
+++ b/cts/scheduler/value-source.scores
23c78e
@@ -0,0 +1,47 @@
23c78e
+Allocation scores:
23c78e
+Using the original execution date of: 2020-11-12 21:28:08Z
23c78e
+pcmk__native_allocate: Fencing allocation score on rhel7-1: 0
23c78e
+pcmk__native_allocate: Fencing allocation score on rhel7-2: 0
23c78e
+pcmk__native_allocate: Fencing allocation score on rhel7-3: 0
23c78e
+pcmk__native_allocate: Fencing allocation score on rhel7-4: 0
23c78e
+pcmk__native_allocate: Fencing allocation score on rhel7-5: 0
23c78e
+pcmk__native_allocate: insane-rsc allocation score on rhel7-1: 0
23c78e
+pcmk__native_allocate: insane-rsc allocation score on rhel7-2: 0
23c78e
+pcmk__native_allocate: insane-rsc allocation score on rhel7-3: 0
23c78e
+pcmk__native_allocate: insane-rsc allocation score on rhel7-4: INFINITY
23c78e
+pcmk__native_allocate: insane-rsc allocation score on rhel7-5: 0
23c78e
+pcmk__native_allocate: invert-match allocation score on rhel7-1: INFINITY
23c78e
+pcmk__native_allocate: invert-match allocation score on rhel7-2: 0
23c78e
+pcmk__native_allocate: invert-match allocation score on rhel7-3: 0
23c78e
+pcmk__native_allocate: invert-match allocation score on rhel7-4: 0
23c78e
+pcmk__native_allocate: invert-match allocation score on rhel7-5: 0
23c78e
+pcmk__native_allocate: meta-rsc allocation score on rhel7-1: 0
23c78e
+pcmk__native_allocate: meta-rsc allocation score on rhel7-2: 0
23c78e
+pcmk__native_allocate: meta-rsc allocation score on rhel7-3: 0
23c78e
+pcmk__native_allocate: meta-rsc allocation score on rhel7-4: INFINITY
23c78e
+pcmk__native_allocate: meta-rsc allocation score on rhel7-5: INFINITY
23c78e
+pcmk__native_allocate: rsc1 allocation score on rhel7-1: 0
23c78e
+pcmk__native_allocate: rsc1 allocation score on rhel7-2: 0
23c78e
+pcmk__native_allocate: rsc1 allocation score on rhel7-3: 0
23c78e
+pcmk__native_allocate: rsc1 allocation score on rhel7-4: INFINITY
23c78e
+pcmk__native_allocate: rsc1 allocation score on rhel7-5: INFINITY
23c78e
+pcmk__native_allocate: rsc2 allocation score on rhel7-1: 0
23c78e
+pcmk__native_allocate: rsc2 allocation score on rhel7-2: 0
23c78e
+pcmk__native_allocate: rsc2 allocation score on rhel7-3: 0
23c78e
+pcmk__native_allocate: rsc2 allocation score on rhel7-4: 0
23c78e
+pcmk__native_allocate: rsc2 allocation score on rhel7-5: INFINITY
23c78e
+pcmk__native_allocate: set-rsc1 allocation score on rhel7-1: 0
23c78e
+pcmk__native_allocate: set-rsc1 allocation score on rhel7-2: 0
23c78e
+pcmk__native_allocate: set-rsc1 allocation score on rhel7-3: INFINITY
23c78e
+pcmk__native_allocate: set-rsc1 allocation score on rhel7-4: 0
23c78e
+pcmk__native_allocate: set-rsc1 allocation score on rhel7-5: 0
23c78e
+pcmk__native_allocate: set-rsc2 allocation score on rhel7-1: 0
23c78e
+pcmk__native_allocate: set-rsc2 allocation score on rhel7-2: 0
23c78e
+pcmk__native_allocate: set-rsc2 allocation score on rhel7-3: 0
23c78e
+pcmk__native_allocate: set-rsc2 allocation score on rhel7-4: INFINITY
23c78e
+pcmk__native_allocate: set-rsc2 allocation score on rhel7-5: 0
23c78e
+pcmk__native_allocate: single-rsc allocation score on rhel7-1: 0
23c78e
+pcmk__native_allocate: single-rsc allocation score on rhel7-2: INFINITY
23c78e
+pcmk__native_allocate: single-rsc allocation score on rhel7-3: 0
23c78e
+pcmk__native_allocate: single-rsc allocation score on rhel7-4: 0
23c78e
+pcmk__native_allocate: single-rsc allocation score on rhel7-5: 0
23c78e
diff --git a/cts/scheduler/value-source.summary b/cts/scheduler/value-source.summary
23c78e
new file mode 100644
23c78e
index 0000000..a9b0392
23c78e
--- /dev/null
23c78e
+++ b/cts/scheduler/value-source.summary
23c78e
@@ -0,0 +1,60 @@
23c78e
+Using the original execution date of: 2020-11-12 21:28:08Z
23c78e
+
23c78e
+Current cluster status:
23c78e
+Online: [ rhel7-1 rhel7-2 rhel7-3 rhel7-4 rhel7-5 ]
23c78e
+
23c78e
+ Fencing	(stonith:fence_xvm):	 Stopped
23c78e
+ rsc1	(ocf::pacemaker:Dummy):	 Stopped
23c78e
+ rsc2	(ocf::pacemaker:Dummy):	 Stopped
23c78e
+ invert-match	(ocf::pacemaker:Dummy):	 Stopped
23c78e
+ single-rsc	(ocf::pacemaker:Dummy):	 Stopped
23c78e
+ set-rsc1	(ocf::pacemaker:Dummy):	 Stopped
23c78e
+ set-rsc2	(ocf::pacemaker:Dummy):	 Stopped
23c78e
+ meta-rsc	(ocf::pacemaker:Dummy):	 Stopped
23c78e
+ insane-rsc	(ocf::pacemaker:Dummy):	 Stopped
23c78e
+
23c78e
+Transition Summary:
23c78e
+ * Start      Fencing          ( rhel7-1 )  
23c78e
+ * Start      rsc1             ( rhel7-4 )  
23c78e
+ * Start      rsc2             ( rhel7-5 )  
23c78e
+ * Start      invert-match     ( rhel7-1 )  
23c78e
+ * Start      single-rsc       ( rhel7-2 )  
23c78e
+ * Start      set-rsc1         ( rhel7-3 )  
23c78e
+ * Start      set-rsc2         ( rhel7-4 )  
23c78e
+ * Start      meta-rsc         ( rhel7-5 )  
23c78e
+ * Start      insane-rsc       ( rhel7-4 )  
23c78e
+
23c78e
+Executing cluster transition:
23c78e
+ * Resource action: Fencing         start on rhel7-1
23c78e
+ * Resource action: rsc1            start on rhel7-4
23c78e
+ * Resource action: rsc2            start on rhel7-5
23c78e
+ * Resource action: invert-match    start on rhel7-1
23c78e
+ * Resource action: single-rsc      start on rhel7-2
23c78e
+ * Resource action: set-rsc1        start on rhel7-3
23c78e
+ * Resource action: set-rsc2        start on rhel7-4
23c78e
+ * Resource action: meta-rsc        start on rhel7-5
23c78e
+ * Resource action: insane-rsc      start on rhel7-4
23c78e
+ * Resource action: Fencing         monitor=120000 on rhel7-1
23c78e
+ * Resource action: rsc1            monitor=10000 on rhel7-4
23c78e
+ * Resource action: rsc2            monitor=10000 on rhel7-5
23c78e
+ * Resource action: invert-match    monitor=10000 on rhel7-1
23c78e
+ * Resource action: single-rsc      monitor=10000 on rhel7-2
23c78e
+ * Resource action: set-rsc1        monitor=10000 on rhel7-3
23c78e
+ * Resource action: set-rsc2        monitor=10000 on rhel7-4
23c78e
+ * Resource action: meta-rsc        monitor=10000 on rhel7-5
23c78e
+ * Resource action: insane-rsc      monitor=10000 on rhel7-4
23c78e
+Using the original execution date of: 2020-11-12 21:28:08Z
23c78e
+
23c78e
+Revised cluster status:
23c78e
+Online: [ rhel7-1 rhel7-2 rhel7-3 rhel7-4 rhel7-5 ]
23c78e
+
23c78e
+ Fencing	(stonith:fence_xvm):	 Started rhel7-1
23c78e
+ rsc1	(ocf::pacemaker:Dummy):	 Started rhel7-4
23c78e
+ rsc2	(ocf::pacemaker:Dummy):	 Started rhel7-5
23c78e
+ invert-match	(ocf::pacemaker:Dummy):	 Started rhel7-1
23c78e
+ single-rsc	(ocf::pacemaker:Dummy):	 Started rhel7-2
23c78e
+ set-rsc1	(ocf::pacemaker:Dummy):	 Started rhel7-3
23c78e
+ set-rsc2	(ocf::pacemaker:Dummy):	 Started rhel7-4
23c78e
+ meta-rsc	(ocf::pacemaker:Dummy):	 Started rhel7-5
23c78e
+ insane-rsc	(ocf::pacemaker:Dummy):	 Started rhel7-4
23c78e
+
23c78e
diff --git a/cts/scheduler/value-source.xml b/cts/scheduler/value-source.xml
23c78e
new file mode 100644
23c78e
index 0000000..95e7d57
23c78e
--- /dev/null
23c78e
+++ b/cts/scheduler/value-source.xml
23c78e
@@ -0,0 +1,463 @@
23c78e
+<cib crm_feature_set="3.6.3" validate-with="pacemaker-3.5" epoch="96" num_updates="0" admin_epoch="1" cib-last-written="Thu Nov 12 15:28:08 2020" update-origin="rhel7-2" update-client="cibadmin" update-user="root" have-quorum="1" dc-uuid="3" execution-date="1605216488">
23c78e
+  
23c78e
+       expressions using a value-source of "param" or "meta". The non-fencing
23c78e
+       resources are all Dummy resources, and their resource parameter "fake"
23c78e
+       is used in the rules, along with a node attribute also named "fake".
23c78e
+
23c78e
+       There are the following 5 nodes with these node attribute values:
23c78e
+
23c78e
+        rhel7-1 fake=100 rack=1
23c78e
+        rhel7-2 fake=200 rack=1
23c78e
+        rhel7-3 fake=300 rack=1
23c78e
+        rhel7-4 fake=400 rack=2
23c78e
+        rhel7-5 fake=500 rack=2
23c78e
+
23c78e
+       A location constraint with a rsc-pattern of "^rsc[0-9]$" matches the
23c78e
+       following resources, and uses a +INFINITY expression where
23c78e
+       node fake > resource fake:
23c78e
+         rsc1 fake=300
23c78e
+         rsc2 fake=400
23c78e
+       Thus rsc1 should prefer node rhel7-4 or rhel7-5, and rsc2 should
23c78e
+       prefer rhel7-5.
23c78e
+
23c78e
+       A location constraint with an inverted rsc-pattern of "!rsc" matches
23c78e
+       the following resource, and uses a +INFINITY expression where
23c78e
+       node fake < resource fake:
23c78e
+         invert-match fake=200
23c78e
+       Thus invert-match should prefer rhel7-1.
23c78e
+
23c78e
+       A location constraint with rsc="single-rsc" uses a +INFINITY expression
23c78e
+       where node fake == resource fake, and the resource is:
23c78e
+         single-rsc fake=200
23c78e
+       Thus single-rsc should prefer rhel7-2.
23c78e
+
23c78e
+       A location constraint with a resource set uses a +INFINITY expression
23c78e
+       where node fake == resource fake, and the resources in the set are:
23c78e
+         set-rsc1 fake=300
23c78e
+         set-rsc2 fake=400
23c78e
+       Thus set-rsc1 should prefer rhel7-3, and set-rsc2 should prefer rhel7-4.
23c78e
+
23c78e
+       To test value-source="meta", a location constraint with a rsc-pattern of
23c78e
+       "meta-" uses a +INFINITY expression where node rack == resource meta rack,
23c78e
+       and there is a resource:
23c78e
+         meta-rsc fake=500 rack=2
23c78e
+       Thus meta-rsc should prefer rhel7-4 or rhel7-5.
23c78e
+
23c78e
+       Finally there is a configuration that is useful solely for verifying
23c78e
+       that the code can handle it. A location constraint with rsc="insane-rsc"
23c78e
+       uses a +INFINITY expression where node fake == resource fake. However
23c78e
+       the resource parameter itself uses a rule with a node attribute
23c78e
+       expression such that it is 200 on rhel7-1, 400 on rhel7-4, and 100
23c78e
+       everywhere else. Thus insane-rsc will prefer rhel7-4.
23c78e
+    -->
23c78e
+  <configuration>
23c78e
+    <crm_config>
23c78e
+      <cluster_property_set id="cib-bootstrap-options">
23c78e
+        <nvpair id="cts-stonith-enabled" name="stonith-enabled" value="1"/>
23c78e
+        <nvpair id="cts-start-failure-is-fatal" name="start-failure-is-fatal" value="false"/>
23c78e
+        <nvpair id="cts-pe-input-series-max" name="pe-input-series-max" value="5000"/>
23c78e
+        <nvpair id="cts-shutdown-escalation" name="shutdown-escalation" value="5min"/>
23c78e
+        <nvpair id="cts-batch-limit" name="batch-limit" value="10"/>
23c78e
+        <nvpair id="cts-dc-deadtime" name="dc-deadtime" value="5s"/>
23c78e
+        <nvpair id="cts-no-quorum-policy" name="no-quorum-policy" value="stop"/>
23c78e
+        <nvpair id="cib-bootstrap-options-have-watchdog" name="have-watchdog" value="false"/>
23c78e
+        <nvpair id="cib-bootstrap-options-dc-version" name="dc-version" value="2.0.5-650.0cdd837.git.el7_9-0cdd837"/>
23c78e
+        <nvpair id="cib-bootstrap-options-cluster-infrastructure" name="cluster-infrastructure" value="corosync"/>
23c78e
+        <nvpair id="cib-bootstrap-options-cluster-name" name="cluster-name" value="mycluster"/>
23c78e
+        <nvpair id="cib-bootstrap-options-last-lrm-refresh" name="last-lrm-refresh" value="1604951742"/>
23c78e
+      </cluster_property_set>
23c78e
+    </crm_config>
23c78e
+    <nodes>
23c78e
+      <node id="1" uname="rhel7-1">
23c78e
+        <instance_attributes id="nodes-1">
23c78e
+          <nvpair id="nodes-1-fake" name="fake" value="100"/>
23c78e
+          <nvpair id="nodes-1-rack" name="rack" value="1"/>
23c78e
+        </instance_attributes>
23c78e
+      </node>
23c78e
+      <node id="2" uname="rhel7-2">
23c78e
+        <instance_attributes id="nodes-2">
23c78e
+          <nvpair id="nodes-2-fake" name="fake" value="200"/>
23c78e
+          <nvpair id="nodes-2-rack" name="rack" value="1"/>
23c78e
+        </instance_attributes>
23c78e
+      </node>
23c78e
+      <node id="3" uname="rhel7-3">
23c78e
+        <instance_attributes id="nodes-3">
23c78e
+          <nvpair id="nodes-3-fake" name="fake" value="300"/>
23c78e
+          <nvpair id="nodes-3-rack" name="rack" value="1"/>
23c78e
+        </instance_attributes>
23c78e
+      </node>
23c78e
+      <node id="4" uname="rhel7-4">
23c78e
+        <instance_attributes id="nodes-4">
23c78e
+          <nvpair id="nodes-4-fake" name="fake" value="400"/>
23c78e
+          <nvpair id="nodes-4-rack" name="rack" value="2"/>
23c78e
+        </instance_attributes>
23c78e
+      </node>
23c78e
+      <node id="5" uname="rhel7-5">
23c78e
+        <instance_attributes id="nodes-5">
23c78e
+          <nvpair id="nodes-5-fake" name="fake" value="500"/>
23c78e
+          <nvpair id="nodes-5-rack" name="rack" value="2"/>
23c78e
+        </instance_attributes>
23c78e
+      </node>
23c78e
+    </nodes>
23c78e
+    <resources>
23c78e
+      <primitive class="stonith" id="Fencing" type="fence_xvm">
23c78e
+        <instance_attributes id="Fencing-params">
23c78e
+          <nvpair id="Fencing-key_file" name="key_file" value="/etc/pacemaker/fence_xvm.key"/>
23c78e
+          <nvpair id="Fencing-multicast_address" name="multicast_address" value="239.255.100.100"/>
23c78e
+          <nvpair id="Fencing-pcmk_host_list" name="pcmk_host_list" value="rhel7-1 rhel7-2 rhel7-3 rhel7-4 rhel7-5"/>
23c78e
+        </instance_attributes>
23c78e
+        <operations>
23c78e
+          <op id="Fencing-monitor-120s" interval="120s" name="monitor" timeout="120s"/>
23c78e
+        </operations>
23c78e
+      </primitive>
23c78e
+      <primitive class="ocf" id="rsc1" provider="pacemaker" type="Dummy">
23c78e
+        <instance_attributes id="rsc1-instance_attributes" score="10">
23c78e
+          <nvpair id="rsc1-instance_attributes-fake" name="fake" value="300"/>
23c78e
+        </instance_attributes>
23c78e
+        <operations>
23c78e
+          <op id="rsc1-migrate_from-interval-0s" interval="0s" name="migrate_from" timeout="20s"/>
23c78e
+          <op id="rsc1-migrate_to-interval-0s" interval="0s" name="migrate_to" timeout="20s"/>
23c78e
+          <op id="rsc1-monitor-interval-10s" interval="10s" name="monitor" timeout="20s"/>
23c78e
+          <op id="rsc1-reload-interval-0s" interval="0s" name="reload" timeout="20s"/>
23c78e
+          <op id="rsc1-start-interval-0s" interval="0s" name="start" timeout="20s"/>
23c78e
+          <op id="rsc1-stop-interval-0s" interval="0s" name="stop" timeout="20s"/>
23c78e
+        </operations>
23c78e
+      </primitive>
23c78e
+      <primitive class="ocf" id="rsc2" provider="pacemaker" type="Dummy">
23c78e
+        <instance_attributes id="rsc2-instance_attributes" score="10">
23c78e
+          <nvpair id="rsc2-instance_attributes-fake" name="fake" value="400"/>
23c78e
+        </instance_attributes>
23c78e
+        <operations>
23c78e
+          <op id="rsc2-migrate_from-interval-0s" interval="0s" name="migrate_from" timeout="20s"/>
23c78e
+          <op id="rsc2-migrate_to-interval-0s" interval="0s" name="migrate_to" timeout="20s"/>
23c78e
+          <op id="rsc2-monitor-interval-10s" interval="10s" name="monitor" timeout="20s"/>
23c78e
+          <op id="rsc2-reload-interval-0s" interval="0s" name="reload" timeout="20s"/>
23c78e
+          <op id="rsc2-start-interval-0s" interval="0s" name="start" timeout="20s"/>
23c78e
+          <op id="rsc2-stop-interval-0s" interval="0s" name="stop" timeout="20s"/>
23c78e
+        </operations>
23c78e
+      </primitive>
23c78e
+      <primitive class="ocf" id="invert-match" provider="pacemaker" type="Dummy">
23c78e
+        <instance_attributes id="invert-match-instance_attributes" score="10">
23c78e
+          <nvpair id="invert-match-instance_attributes-fake" name="fake" value="200"/>
23c78e
+        </instance_attributes>
23c78e
+        <operations>
23c78e
+          <op id="invert-match-migrate_from-interval-0s" interval="0s" name="migrate_from" timeout="20s"/>
23c78e
+          <op id="invert-match-migrate_to-interval-0s" interval="0s" name="migrate_to" timeout="20s"/>
23c78e
+          <op id="invert-match-monitor-interval-10s" interval="10s" name="monitor" timeout="20s"/>
23c78e
+          <op id="invert-match-reload-interval-0s" interval="0s" name="reload" timeout="20s"/>
23c78e
+          <op id="invert-match-start-interval-0s" interval="0s" name="start" timeout="20s"/>
23c78e
+          <op id="invert-match-stop-interval-0s" interval="0s" name="stop" timeout="20s"/>
23c78e
+        </operations>
23c78e
+      </primitive>
23c78e
+      <primitive class="ocf" id="single-rsc" provider="pacemaker" type="Dummy">
23c78e
+        <instance_attributes id="single-rsc-instance_attributes" score="10">
23c78e
+          <nvpair id="single-rsc-instance_attributes-fake" name="fake" value="200"/>
23c78e
+        </instance_attributes>
23c78e
+        <operations>
23c78e
+          <op id="single-rsc-migrate_from-interval-0s" interval="0s" name="migrate_from" timeout="20s"/>
23c78e
+          <op id="single-rsc-migrate_to-interval-0s" interval="0s" name="migrate_to" timeout="20s"/>
23c78e
+          <op id="single-rsc-monitor-interval-10s" interval="10s" name="monitor" timeout="20s"/>
23c78e
+          <op id="single-rsc-reload-interval-0s" interval="0s" name="reload" timeout="20s"/>
23c78e
+          <op id="single-rsc-start-interval-0s" interval="0s" name="start" timeout="20s"/>
23c78e
+          <op id="single-rsc-stop-interval-0s" interval="0s" name="stop" timeout="20s"/>
23c78e
+        </operations>
23c78e
+      </primitive>
23c78e
+      <primitive class="ocf" id="set-rsc1" provider="pacemaker" type="Dummy">
23c78e
+        <instance_attributes id="set-rsc1-instance_attributes" score="10">
23c78e
+          <nvpair id="set-rsc1-instance_attributes-fake" name="fake" value="300"/>
23c78e
+        </instance_attributes>
23c78e
+        <operations>
23c78e
+          <op id="set-rsc1-migrate_from-interval-0s" interval="0s" name="migrate_from" timeout="20s"/>
23c78e
+          <op id="set-rsc1-migrate_to-interval-0s" interval="0s" name="migrate_to" timeout="20s"/>
23c78e
+          <op id="set-rsc1-monitor-interval-10s" interval="10s" name="monitor" timeout="20s"/>
23c78e
+          <op id="set-rsc1-reload-interval-0s" interval="0s" name="reload" timeout="20s"/>
23c78e
+          <op id="set-rsc1-start-interval-0s" interval="0s" name="start" timeout="20s"/>
23c78e
+          <op id="set-rsc1-stop-interval-0s" interval="0s" name="stop" timeout="20s"/>
23c78e
+        </operations>
23c78e
+      </primitive>
23c78e
+      <primitive class="ocf" id="set-rsc2" provider="pacemaker" type="Dummy">
23c78e
+        <instance_attributes id="set-rsc2-instance_attributes" score="10">
23c78e
+          <nvpair id="set-rsc2-instance_attributes-fake" name="fake" value="400"/>
23c78e
+        </instance_attributes>
23c78e
+        <operations>
23c78e
+          <op id="set-rsc2-migrate_from-interval-0s" interval="0s" name="migrate_from" timeout="20s"/>
23c78e
+          <op id="set-rsc2-migrate_to-interval-0s" interval="0s" name="migrate_to" timeout="20s"/>
23c78e
+          <op id="set-rsc2-monitor-interval-10s" interval="10s" name="monitor" timeout="20s"/>
23c78e
+          <op id="set-rsc2-reload-interval-0s" interval="0s" name="reload" timeout="20s"/>
23c78e
+          <op id="set-rsc2-start-interval-0s" interval="0s" name="start" timeout="20s"/>
23c78e
+          <op id="set-rsc2-stop-interval-0s" interval="0s" name="stop" timeout="20s"/>
23c78e
+        </operations>
23c78e
+      </primitive>
23c78e
+      <primitive class="ocf" id="meta-rsc" provider="pacemaker" type="Dummy">
23c78e
+        <meta_attributes id="meta-rsc-meta_attributes">
23c78e
+          <nvpair id="meta-rsc-meta_attributes-rack" name="rack" value="2"/>
23c78e
+        </meta_attributes>
23c78e
+        <instance_attributes id="meta-rsc-instance_attributes" score="10">
23c78e
+          <nvpair id="meta-rsc-instance_attributes-fake" name="fake" value="500"/>
23c78e
+        </instance_attributes>
23c78e
+        <operations>
23c78e
+          <op id="meta-rsc-migrate_from-interval-0s" interval="0s" name="migrate_from" timeout="20s"/>
23c78e
+          <op id="meta-rsc-migrate_to-interval-0s" interval="0s" name="migrate_to" timeout="20s"/>
23c78e
+          <op id="meta-rsc-monitor-interval-10s" interval="10s" name="monitor" timeout="20s"/>
23c78e
+          <op id="meta-rsc-reload-interval-0s" interval="0s" name="reload" timeout="20s"/>
23c78e
+          <op id="meta-rsc-start-interval-0s" interval="0s" name="start" timeout="20s"/>
23c78e
+          <op id="meta-rsc-stop-interval-0s" interval="0s" name="stop" timeout="20s"/>
23c78e
+        </operations>
23c78e
+      </primitive>
23c78e
+      <primitive class="ocf" id="insane-rsc" provider="pacemaker" type="Dummy">
23c78e
+        <instance_attributes id="insane-rsc-instance_attributes" score="10">
23c78e
+          <nvpair id="insane-rsc-instance_attributes-fake" name="fake" value="100"/>
23c78e
+        </instance_attributes>
23c78e
+        <instance_attributes id="insane-rsc-instance_attributes2" score="20">
23c78e
+          <rule id="insane-rsc-rule1" score="INFINITY">
23c78e
+            <expression id="insane-rsc-rule1-expr1" attribute="#uname" operation="eq" value="rhel7-1"/>
23c78e
+          </rule>
23c78e
+          <nvpair id="insane-rsc-instance_attributes2-fake" name="fake" value="200"/>
23c78e
+        </instance_attributes>
23c78e
+        <instance_attributes id="insane-rsc-instance_attributes3" score="20">
23c78e
+          <rule id="insane-rsc-rule2" score="INFINITY">
23c78e
+            <expression id="insane-rsc-rule2-expr1" attribute="#uname" operation="eq" value="rhel7-4"/>
23c78e
+          </rule>
23c78e
+          <nvpair id="insane-rsc-instance_attributes23fake" name="fake" value="400"/>
23c78e
+        </instance_attributes>
23c78e
+        <operations>
23c78e
+          <op id="insane-rsc-migrate_from-interval-0s" interval="0s" name="migrate_from" timeout="20s"/>
23c78e
+          <op id="insane-rsc-migrate_to-interval-0s" interval="0s" name="migrate_to" timeout="20s"/>
23c78e
+          <op id="insane-rsc-monitor-interval-10s" interval="10s" name="monitor" timeout="20s"/>
23c78e
+          <op id="insane-rsc-reload-interval-0s" interval="0s" name="reload" timeout="20s"/>
23c78e
+          <op id="insane-rsc-start-interval-0s" interval="0s" name="start" timeout="20s"/>
23c78e
+          <op id="insane-rsc-stop-interval-0s" interval="0s" name="stop" timeout="20s"/>
23c78e
+        </operations>
23c78e
+      </primitive>
23c78e
+    </resources>
23c78e
+    <constraints>
23c78e
+      <rsc_location id="location-rscN" rsc-pattern="^rsc[0-9]$">
23c78e
+        <rule id="location-rule1" score="INFINITY">
23c78e
+          <expression id="location-rule1-expr1" attribute="fake" operation="gt" value="fake" value-source="param"/>
23c78e
+        </rule>
23c78e
+      </rsc_location>
23c78e
+      <rsc_location id="location-not-rsc" rsc-pattern="!rsc">
23c78e
+        <rule id="location-rule2" score="INFINITY">
23c78e
+          <expression id="location-rule2-expr1" attribute="fake" operation="lt" value="fake" value-source="param"/>
23c78e
+        </rule>
23c78e
+      </rsc_location>
23c78e
+      <rsc_location id="location-single-rsc" rsc="single-rsc">
23c78e
+        <rule id="location-rule3" score="INFINITY">
23c78e
+          <expression id="location-rule3-expr1" attribute="fake" operation="eq" value="fake" value-source="param"/>
23c78e
+        </rule>
23c78e
+      </rsc_location>
23c78e
+      <rsc_location id="location-set">
23c78e
+        <resource_set id="resource-set1">
23c78e
+          <resource_ref id="set-rsc1"/>
23c78e
+          <resource_ref id="set-rsc2"/>
23c78e
+        </resource_set>
23c78e
+        <rule id="location-rule4" score="INFINITY">
23c78e
+          <expression id="location-rule4-expr1" attribute="fake" operation="eq" value="fake" value-source="param"/>
23c78e
+        </rule>
23c78e
+      </rsc_location>
23c78e
+      <rsc_location id="location-meta" rsc-pattern="meta-">
23c78e
+        <rule id="location-rule5" score="INFINITY">
23c78e
+          <expression id="location-rule5-expr1" attribute="rack" operation="eq" value="rack" value-source="meta"/>
23c78e
+        </rule>
23c78e
+      </rsc_location>
23c78e
+      <rsc_location id="location-insane-rsc" rsc="insane-rsc">
23c78e
+        <rule id="location-rule6" score="INFINITY">
23c78e
+          <expression id="location-rule6-expr1" attribute="fake" operation="eq" value="fake" value-source="param"/>
23c78e
+        </rule>
23c78e
+      </rsc_location>
23c78e
+    </constraints>
23c78e
+    <fencing-topology/>
23c78e
+    <op_defaults>
23c78e
+      <meta_attributes id="cts-op_defaults-meta">
23c78e
+        <nvpair id="cts-op_defaults-timeout" name="timeout" value="90s"/>
23c78e
+      </meta_attributes>
23c78e
+    </op_defaults>
23c78e
+    <alerts>
23c78e
+      <alert id="alert-1" path="/var/lib/pacemaker/notify.sh">
23c78e
+        <recipient id="alert-1-recipient-1" value="/run/crm/alert.log"/>
23c78e
+      </alert>
23c78e
+    </alerts>
23c78e
+    <rsc_defaults>
23c78e
+      <meta_attributes id="rsc_defaults-options">
23c78e
+        <nvpair id="rsc_defaults-options-target-role" name="target-role" value="Started"/>
23c78e
+      </meta_attributes>
23c78e
+    </rsc_defaults>
23c78e
+  </configuration>
23c78e
+  <status>
23c78e
+    <node_state id="1" uname="rhel7-1" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" join="member" expected="member">
23c78e
+      <lrm id="1">
23c78e
+        <lrm_resources>
23c78e
+          <lrm_resource id="Fencing" type="fence_xvm" class="stonith">
23c78e
+            <lrm_rsc_op id="Fencing_last_0" operation_key="Fencing_stop_0" operation="stop" crm-debug-origin="do_update_resource" crm_feature_set="3.6.3" transition-key="10:33:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;10:33:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-1" call-id="63" rc-code="0" op-status="0" interval="0" last-rc-change="1605216481" last-run="1605216481" exec-time="1" queue-time="0" op-digest="422e90c96b7732222706b322138f43c8"/>
23c78e
+            <lrm_rsc_op id="Fencing_monitor_120000" operation_key="Fencing_monitor_120000" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="2:15:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;2:15:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-1" call-id="49" rc-code="0" op-status="0" interval="120000" last-rc-change="1605212720" exec-time="75" queue-time="0" op-digest="75eb18cbd607b3b4911f723ab1c89388"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="meta-rsc" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="meta-rsc_last_0" operation_key="meta-rsc_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="8:23:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;8:23:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-1" call-id="57" rc-code="7" op-status="0" interval="0" last-rc-change="1605215239" last-run="1605215239" exec-time="34" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="rsc1" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="rsc1_last_0" operation_key="rsc1_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="2:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;2:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-1" call-id="13" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="21" queue-time="0" op-digest="740d07f67c20fca411b03996e601119e" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="740d07f67c20fca411b03996e601119e"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="rsc2" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="rsc2_last_0" operation_key="rsc2_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="3:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;3:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-1" call-id="17" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="26" queue-time="0" op-digest="e4a0cc96ccaaaa02bea1e0be9c4dee84" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="e4a0cc96ccaaaa02bea1e0be9c4dee84"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="invert-match" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="invert-match_last_0" operation_key="invert-match_stop_0" operation="stop" crm-debug-origin="do_update_resource" crm_feature_set="3.6.3" transition-key="13:33:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;13:33:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-1" call-id="67" rc-code="0" op-status="0" interval="0" last-rc-change="1605216481" last-run="1605216481" exec-time="59" queue-time="0" op-digest="1bd01c2c51e0e8a776ac0e84d5715d70" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="1bd01c2c51e0e8a776ac0e84d5715d70"/>
23c78e
+            <lrm_rsc_op id="invert-match_monitor_10000" operation_key="invert-match_monitor_10000" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="8:15:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;8:15:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-1" call-id="51" rc-code="0" op-status="0" interval="10000" last-rc-change="1605212720" exec-time="52" queue-time="3" op-digest="53e49b6c90e7e71546c273e0f220a321" op-secure-params="  passwd  " op-secure-digest="1bd01c2c51e0e8a776ac0e84d5715d70"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="single-rsc" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="single-rsc_last_0" operation_key="single-rsc_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="5:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;5:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-1" call-id="29" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="25" queue-time="0" op-digest="1bd01c2c51e0e8a776ac0e84d5715d70" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="1bd01c2c51e0e8a776ac0e84d5715d70"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="insane-rsc" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="insane-rsc_last_0" operation_key="insane-rsc_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="9:29:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;9:29:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-1" call-id="61" rc-code="7" op-status="0" interval="0" last-rc-change="1605216014" last-run="1605216014" exec-time="33" queue-time="0" op-digest="1905d2bf96a4b1c41f38dff8c7b84308" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="1905d2bf96a4b1c41f38dff8c7b84308"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="set-rsc1" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="set-rsc1_last_0" operation_key="set-rsc1_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="6:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;6:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-1" call-id="33" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="20" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="set-rsc2" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="set-rsc2_last_0" operation_key="set-rsc2_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="7:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;7:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-1" call-id="37" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="20" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
23c78e
+          </lrm_resource>
23c78e
+        </lrm_resources>
23c78e
+      </lrm>
23c78e
+    </node_state>
23c78e
+    <node_state id="2" uname="rhel7-2" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" join="member" expected="member">
23c78e
+      <lrm id="2">
23c78e
+        <lrm_resources>
23c78e
+          <lrm_resource id="Fencing" type="fence_xvm" class="stonith">
23c78e
+            <lrm_rsc_op id="Fencing_last_0" operation_key="Fencing_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="8:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;8:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-2" call-id="5" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="5" queue-time="0" op-digest="422e90c96b7732222706b322138f43c8"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="meta-rsc" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="meta-rsc_last_0" operation_key="meta-rsc_stop_0" operation="stop" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="23:27:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;23:27:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-2" call-id="57" rc-code="0" op-status="0" interval="0" last-rc-change="1605215447" last-run="1605215447" exec-time="24" queue-time="0" op-digest="4269017c9755b64d3c5687024693ab8d"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="rsc1" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="rsc1_last_0" operation_key="rsc1_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="9:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;9:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-2" call-id="9" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="24" queue-time="0" op-digest="740d07f67c20fca411b03996e601119e" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="740d07f67c20fca411b03996e601119e"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="rsc2" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="rsc2_last_0" operation_key="rsc2_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="10:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;10:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-2" call-id="13" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="35" queue-time="0" op-digest="e4a0cc96ccaaaa02bea1e0be9c4dee84" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="e4a0cc96ccaaaa02bea1e0be9c4dee84"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="invert-match" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="invert-match_last_0" operation_key="invert-match_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="11:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;11:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-2" call-id="17" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="29" queue-time="0" op-digest="1bd01c2c51e0e8a776ac0e84d5715d70" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="1bd01c2c51e0e8a776ac0e84d5715d70"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="single-rsc" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="single-rsc_last_0" operation_key="single-rsc_stop_0" operation="stop" crm-debug-origin="do_update_resource" crm_feature_set="3.6.3" transition-key="14:33:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;14:33:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-2" call-id="73" rc-code="0" op-status="0" interval="0" last-rc-change="1605216481" last-run="1605216481" exec-time="70" queue-time="0" op-digest="1bd01c2c51e0e8a776ac0e84d5715d70" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="1bd01c2c51e0e8a776ac0e84d5715d70"/>
23c78e
+            <lrm_rsc_op id="single-rsc_monitor_10000" operation_key="single-rsc_monitor_10000" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="10:15:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;10:15:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-2" call-id="40" rc-code="0" op-status="0" interval="10000" last-rc-change="1605212720" exec-time="32" queue-time="0" op-digest="53e49b6c90e7e71546c273e0f220a321" op-secure-params="  passwd  " op-secure-digest="1bd01c2c51e0e8a776ac0e84d5715d70"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="insane-rsc" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="insane-rsc_last_0" operation_key="insane-rsc_stop_0" operation="stop" crm-debug-origin="do_update_resource" crm_feature_set="3.6.3" transition-key="26:32:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;26:32:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-2" call-id="69" rc-code="0" op-status="0" interval="0" last-rc-change="1605216258" last-run="1605216258" exec-time="27" queue-time="0" op-digest="1905d2bf96a4b1c41f38dff8c7b84308" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="1905d2bf96a4b1c41f38dff8c7b84308"/>
23c78e
+            <lrm_rsc_op id="insane-rsc_monitor_10000" operation_key="insane-rsc_monitor_10000" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="31:29:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;31:29:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-2" call-id="66" rc-code="0" op-status="0" interval="10000" last-rc-change="1605216014" exec-time="21" queue-time="0" op-digest="b87d7fef533f90972e41fe89986ae9ff" op-secure-params="  passwd  " op-secure-digest="1905d2bf96a4b1c41f38dff8c7b84308"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="set-rsc1" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="set-rsc1_last_0" operation_key="set-rsc1_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="13:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;13:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-2" call-id="25" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="28" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="set-rsc2" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="set-rsc2_last_0" operation_key="set-rsc2_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="14:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;14:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-2" call-id="29" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="18" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
23c78e
+          </lrm_resource>
23c78e
+        </lrm_resources>
23c78e
+      </lrm>
23c78e
+    </node_state>
23c78e
+    <node_state id="5" uname="rhel7-5" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" join="member" expected="member">
23c78e
+      <lrm id="5">
23c78e
+        <lrm_resources>
23c78e
+          <lrm_resource id="Fencing" type="fence_xvm" class="stonith">
23c78e
+            <lrm_rsc_op id="Fencing_last_0" operation_key="Fencing_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="29:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;29:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-5" call-id="5" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="1" queue-time="0" op-digest="422e90c96b7732222706b322138f43c8"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="meta-rsc" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="meta-rsc_last_0" operation_key="meta-rsc_stop_0" operation="stop" crm-debug-origin="do_update_resource" crm_feature_set="3.6.3" transition-key="17:33:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;17:33:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-5" call-id="72" rc-code="0" op-status="0" interval="0" last-rc-change="1605216481" last-run="1605216481" exec-time="78" queue-time="0" op-digest="4269017c9755b64d3c5687024693ab8d" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="4269017c9755b64d3c5687024693ab8d"/>
23c78e
+            <lrm_rsc_op id="meta-rsc_monitor_10000" operation_key="meta-rsc_monitor_10000" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="25:27:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;25:27:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-5" call-id="62" rc-code="0" op-status="0" interval="10000" last-rc-change="1605215447" exec-time="20" queue-time="0" op-digest="ce835727a24a9c27be80f53be9716835" op-secure-params="  passwd  " op-secure-digest="4269017c9755b64d3c5687024693ab8d"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="rsc1" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="rsc1_last_0" operation_key="rsc1_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="30:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;30:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-5" call-id="9" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="27" queue-time="0" op-digest="740d07f67c20fca411b03996e601119e" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="740d07f67c20fca411b03996e601119e"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="rsc2" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="rsc2_last_0" operation_key="rsc2_stop_0" operation="stop" crm-debug-origin="do_update_resource" crm_feature_set="3.6.3" transition-key="12:33:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;12:33:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-5" call-id="69" rc-code="0" op-status="0" interval="0" last-rc-change="1605216481" last-run="1605216481" exec-time="85" queue-time="0" op-digest="e4a0cc96ccaaaa02bea1e0be9c4dee84" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="e4a0cc96ccaaaa02bea1e0be9c4dee84"/>
23c78e
+            <lrm_rsc_op id="rsc2_monitor_10000" operation_key="rsc2_monitor_10000" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="14:18:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;14:18:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-5" call-id="50" rc-code="0" op-status="0" interval="10000" last-rc-change="1605214609" exec-time="19" queue-time="0" op-digest="86322d62158bad207944738f0a1bac13" op-secure-params="  passwd  " op-secure-digest="e4a0cc96ccaaaa02bea1e0be9c4dee84"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="invert-match" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="invert-match_last_0" operation_key="invert-match_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="32:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;32:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-5" call-id="17" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="29" queue-time="0" op-digest="1bd01c2c51e0e8a776ac0e84d5715d70" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="1bd01c2c51e0e8a776ac0e84d5715d70"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="single-rsc" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="single-rsc_last_0" operation_key="single-rsc_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="33:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;33:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-5" call-id="21" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="28" queue-time="0" op-digest="1bd01c2c51e0e8a776ac0e84d5715d70" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="1bd01c2c51e0e8a776ac0e84d5715d70"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="insane-rsc" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="insane-rsc_last_0" operation_key="insane-rsc_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="13:29:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;13:29:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-5" call-id="67" rc-code="7" op-status="0" interval="0" last-rc-change="1605216014" last-run="1605216014" exec-time="32" queue-time="0" op-digest="1905d2bf96a4b1c41f38dff8c7b84308" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="1905d2bf96a4b1c41f38dff8c7b84308"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="set-rsc1" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="set-rsc1_last_0" operation_key="set-rsc1_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="34:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;34:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-5" call-id="25" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="35" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="set-rsc2" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="set-rsc2_last_0" operation_key="set-rsc2_stop_0" operation="stop" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="20:19:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;20:19:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-5" call-id="53" rc-code="0" op-status="0" interval="0" last-rc-change="1605214850" last-run="1605214850" exec-time="22" queue-time="0" op-digest="e4a0cc96ccaaaa02bea1e0be9c4dee84"/>
23c78e
+          </lrm_resource>
23c78e
+        </lrm_resources>
23c78e
+      </lrm>
23c78e
+    </node_state>
23c78e
+    <node_state id="3" uname="rhel7-3" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" join="member" expected="member">
23c78e
+      <lrm id="3">
23c78e
+        <lrm_resources>
23c78e
+          <lrm_resource id="Fencing" type="fence_xvm" class="stonith">
23c78e
+            <lrm_rsc_op id="Fencing_last_0" operation_key="Fencing_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="15:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;15:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-3" call-id="5" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="9" queue-time="0" op-digest="422e90c96b7732222706b322138f43c8"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="meta-rsc" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="meta-rsc_last_0" operation_key="meta-rsc_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="10:23:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;10:23:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-3" call-id="51" rc-code="7" op-status="0" interval="0" last-rc-change="1605215239" last-run="1605215239" exec-time="68" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="rsc1" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="rsc1_last_0" operation_key="rsc1_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="16:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;16:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-3" call-id="9" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="32" queue-time="0" op-digest="740d07f67c20fca411b03996e601119e" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="740d07f67c20fca411b03996e601119e"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="rsc2" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="rsc2_last_0" operation_key="rsc2_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="17:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;17:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-3" call-id="13" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="20" queue-time="0" op-digest="e4a0cc96ccaaaa02bea1e0be9c4dee84" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="e4a0cc96ccaaaa02bea1e0be9c4dee84"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="invert-match" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="invert-match_last_0" operation_key="invert-match_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="18:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;18:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-3" call-id="17" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="33" queue-time="0" op-digest="1bd01c2c51e0e8a776ac0e84d5715d70" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="1bd01c2c51e0e8a776ac0e84d5715d70"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="single-rsc" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="single-rsc_last_0" operation_key="single-rsc_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="19:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;19:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-3" call-id="21" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="31" queue-time="0" op-digest="1bd01c2c51e0e8a776ac0e84d5715d70" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="1bd01c2c51e0e8a776ac0e84d5715d70"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="insane-rsc" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="insane-rsc_last_0" operation_key="insane-rsc_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="11:29:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;11:29:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-3" call-id="55" rc-code="7" op-status="0" interval="0" last-rc-change="1605216014" last-run="1605216014" exec-time="46" queue-time="0" op-digest="1905d2bf96a4b1c41f38dff8c7b84308" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="1905d2bf96a4b1c41f38dff8c7b84308"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="set-rsc1" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="set-rsc1_last_0" operation_key="set-rsc1_stop_0" operation="stop" crm-debug-origin="do_update_resource" crm_feature_set="3.6.3" transition-key="15:33:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;15:33:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-3" call-id="57" rc-code="0" op-status="0" interval="0" last-rc-change="1605216481" last-run="1605216481" exec-time="110" queue-time="0" op-digest="740d07f67c20fca411b03996e601119e" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="740d07f67c20fca411b03996e601119e"/>
23c78e
+            <lrm_rsc_op id="set-rsc1_monitor_10000" operation_key="set-rsc1_monitor_10000" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="12:15:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;12:15:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-3" call-id="46" rc-code="0" op-status="0" interval="10000" last-rc-change="1605212720" exec-time="34" queue-time="0" op-digest="72d8b1ceea915fac5b98d7c16b3cb81a" op-secure-params="  passwd  " op-secure-digest="740d07f67c20fca411b03996e601119e"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="set-rsc2" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="set-rsc2_last_0" operation_key="set-rsc2_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="21:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;21:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-3" call-id="29" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="33" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
23c78e
+          </lrm_resource>
23c78e
+        </lrm_resources>
23c78e
+      </lrm>
23c78e
+    </node_state>
23c78e
+    <node_state id="4" uname="rhel7-4" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" join="member" expected="member">
23c78e
+      <lrm id="4">
23c78e
+        <lrm_resources>
23c78e
+          <lrm_resource id="Fencing" type="fence_xvm" class="stonith">
23c78e
+            <lrm_rsc_op id="Fencing_last_0" operation_key="Fencing_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="22:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;22:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-4" call-id="10" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="7" queue-time="0" op-digest="422e90c96b7732222706b322138f43c8"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="meta-rsc" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="meta-rsc_last_0" operation_key="meta-rsc_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="11:23:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;11:23:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-4" call-id="70" rc-code="7" op-status="0" interval="0" last-rc-change="1605215239" last-run="1605215239" exec-time="36" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="rsc1" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="rsc1_last_0" operation_key="rsc1_stop_0" operation="stop" crm-debug-origin="do_update_resource" crm_feature_set="3.6.3" transition-key="11:33:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;11:33:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-4" call-id="80" rc-code="0" op-status="0" interval="0" last-rc-change="1605216481" last-run="1605216481" exec-time="77" queue-time="0" op-digest="740d07f67c20fca411b03996e601119e" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="740d07f67c20fca411b03996e601119e"/>
23c78e
+            <lrm_rsc_op id="rsc1_monitor_10000" operation_key="rsc1_monitor_10000" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="4:15:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;4:15:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-4" call-id="54" rc-code="0" op-status="0" interval="10000" last-rc-change="1605212720" exec-time="56" queue-time="0" op-digest="72d8b1ceea915fac5b98d7c16b3cb81a" op-secure-params="  passwd  " op-secure-digest="740d07f67c20fca411b03996e601119e"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="rsc2" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="rsc2_last_0" operation_key="rsc2_stop_0" operation="stop" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="12:18:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;12:18:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-4" call-id="60" rc-code="0" op-status="0" interval="0" last-rc-change="1605214609" last-run="1605214609" exec-time="29" queue-time="0" op-digest="e4a0cc96ccaaaa02bea1e0be9c4dee84"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="invert-match" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="invert-match_last_0" operation_key="invert-match_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="25:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;25:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-4" call-id="22" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="69" queue-time="0" op-digest="1bd01c2c51e0e8a776ac0e84d5715d70" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="1bd01c2c51e0e8a776ac0e84d5715d70"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="single-rsc" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="single-rsc_last_0" operation_key="single-rsc_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="26:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;26:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-4" call-id="26" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="39" queue-time="0" op-digest="1bd01c2c51e0e8a776ac0e84d5715d70" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="1bd01c2c51e0e8a776ac0e84d5715d70"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="insane-rsc" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="insane-rsc_last_0" operation_key="insane-rsc_stop_0" operation="stop" crm-debug-origin="do_update_resource" crm_feature_set="3.6.3" transition-key="18:33:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;18:33:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-4" call-id="88" rc-code="0" op-status="0" interval="0" last-rc-change="1605216481" last-run="1605216481" exec-time="39" queue-time="0" op-digest="e4a0cc96ccaaaa02bea1e0be9c4dee84" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="e4a0cc96ccaaaa02bea1e0be9c4dee84"/>
23c78e
+            <lrm_rsc_op id="insane-rsc_monitor_10000" operation_key="insane-rsc_monitor_10000" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.6.3" transition-key="28:32:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;28:32:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-4" call-id="77" rc-code="0" op-status="0" interval="10000" last-rc-change="1605216258" exec-time="21" queue-time="0" op-digest="86322d62158bad207944738f0a1bac13" op-secure-params="  passwd  " op-secure-digest="e4a0cc96ccaaaa02bea1e0be9c4dee84"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="set-rsc1" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="set-rsc1_last_0" operation_key="set-rsc1_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="27:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:7;27:0:7:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-4" call-id="30" rc-code="7" op-status="0" interval="0" last-rc-change="1605205770" last-run="1605205770" exec-time="28" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
23c78e
+          </lrm_resource>
23c78e
+          <lrm_resource id="set-rsc2" type="Dummy" class="ocf" provider="pacemaker">
23c78e
+            <lrm_rsc_op id="set-rsc2_last_0" operation_key="set-rsc2_stop_0" operation="stop" crm-debug-origin="do_update_resource" crm_feature_set="3.6.3" transition-key="16:33:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;16:33:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-4" call-id="83" rc-code="0" op-status="0" interval="0" last-rc-change="1605216481" last-run="1605216481" exec-time="71" queue-time="0" op-digest="e4a0cc96ccaaaa02bea1e0be9c4dee84" op-force-restart="  envfile op_sleep passwd state  " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-secure-params="  passwd  " op-secure-digest="e4a0cc96ccaaaa02bea1e0be9c4dee84"/>
23c78e
+            <lrm_rsc_op id="set-rsc2_monitor_10000" operation_key="set-rsc2_monitor_10000" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.6.3" transition-key="22:19:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" transition-magic="0:0;22:19:0:2b51cdb9-fb8b-43dd-905e-e7c0472fdaca" exit-reason="" on_node="rhel7-4" call-id="65" rc-code="0" op-status="0" interval="10000" last-rc-change="1605214850" exec-time="19" queue-time="0" op-digest="86322d62158bad207944738f0a1bac13" op-secure-params="  passwd  " op-secure-digest="e4a0cc96ccaaaa02bea1e0be9c4dee84"/>
23c78e
+          </lrm_resource>
23c78e
+        </lrm_resources>
23c78e
+      </lrm>
23c78e
+    </node_state>
23c78e
+  </status>
23c78e
+</cib>
23c78e
-- 
23c78e
1.8.3.1
23c78e
23c78e
23c78e
From f678813f9054e2eb80a04796b8d35214269cd352 Mon Sep 17 00:00:00 2001
23c78e
From: Ken Gaillot <kgaillot@redhat.com>
23c78e
Date: Mon, 9 Nov 2020 18:13:04 -0600
23c78e
Subject: [PATCH 11/13] API: libpe_status: deprecate pe_resource_t parameters
23c78e
 member
23c78e
23c78e
Instead, pe_rsc_params() should be used.
23c78e
23c78e
Also, define the parameters member using such a pe_rsc_params() call.
23c78e
---
23c78e
 include/crm/pengine/pe_types.h |  2 +-
23c78e
 lib/pengine/complex.c          | 17 ++++++++++-------
23c78e
 2 files changed, 11 insertions(+), 8 deletions(-)
23c78e
23c78e
diff --git a/include/crm/pengine/pe_types.h b/include/crm/pengine/pe_types.h
23c78e
index 5529714..1416cee 100644
23c78e
--- a/include/crm/pengine/pe_types.h
23c78e
+++ b/include/crm/pengine/pe_types.h
23c78e
@@ -358,7 +358,7 @@ struct pe_resource_s {
23c78e
     enum rsc_role_e next_role;
23c78e
 
23c78e
     GHashTable *meta;
23c78e
-    GHashTable *parameters;
23c78e
+    GHashTable *parameters; //! \deprecated Use pe_rsc_params() instead
23c78e
     GHashTable *utilization;
23c78e
 
23c78e
     GListPtr children;          /* pe_resource_t*   */
23c78e
diff --git a/lib/pengine/complex.c b/lib/pengine/complex.c
23c78e
index 7037ca1..60199c7 100644
23c78e
--- a/lib/pengine/complex.c
23c78e
+++ b/lib/pengine/complex.c
23c78e
@@ -557,8 +557,6 @@ common_unpack(xmlNode * xml_obj, pe_resource_t ** rsc,
23c78e
         return FALSE;
23c78e
     }
23c78e
 
23c78e
-    (*rsc)->parameters = crm_str_table_new();
23c78e
-
23c78e
 #if ENABLE_VERSIONED_ATTRS
23c78e
     (*rsc)->versioned_parameters = create_xml_node(NULL, XML_TAG_RSC_VER_ATTRS);
23c78e
 #endif
23c78e
@@ -584,7 +582,7 @@ common_unpack(xmlNode * xml_obj, pe_resource_t ** rsc,
23c78e
     pe_rsc_trace((*rsc), "Unpacking resource...");
23c78e
 
23c78e
     get_meta_attributes((*rsc)->meta, *rsc, NULL, data_set);
23c78e
-    get_rsc_attributes((*rsc)->parameters, *rsc, NULL, data_set);
23c78e
+    (*rsc)->parameters = pe_rsc_params(*rsc, NULL, data_set); // \deprecated
23c78e
 #if ENABLE_VERSIONED_ATTRS
23c78e
     pe_get_versioned_attributes((*rsc)->versioned_parameters, *rsc, NULL, data_set);
23c78e
 #endif
23c78e
@@ -808,7 +806,15 @@ common_unpack(xmlNode * xml_obj, pe_resource_t ** rsc,
23c78e
     }
23c78e
 
23c78e
     if (remote_node) {
23c78e
-        value = g_hash_table_lookup((*rsc)->parameters, XML_REMOTE_ATTR_RECONNECT_INTERVAL);
23c78e
+        GHashTable *params = pe_rsc_params(*rsc, NULL, data_set);
23c78e
+
23c78e
+        /* Grabbing the value now means that any rules based on node attributes
23c78e
+         * will evaluate to false, so such rules should not be used with
23c78e
+         * reconnect_interval.
23c78e
+         *
23c78e
+         * @TODO Evaluate per node before using
23c78e
+         */
23c78e
+        value = g_hash_table_lookup(params, XML_REMOTE_ATTR_RECONNECT_INTERVAL);
23c78e
         if (value) {
23c78e
             /* reconnect delay works by setting failure_timeout and preventing the
23c78e
              * connection from starting until the failure is cleared. */
23c78e
@@ -922,9 +928,6 @@ common_free(pe_resource_t * rsc)
23c78e
     g_list_free(rsc->rsc_tickets);
23c78e
     g_list_free(rsc->dangling_migrations);
23c78e
 
23c78e
-    if (rsc->parameters != NULL) {
23c78e
-        g_hash_table_destroy(rsc->parameters);
23c78e
-    }
23c78e
     if (rsc->parameter_cache != NULL) {
23c78e
         g_hash_table_destroy(rsc->parameter_cache);
23c78e
     }
23c78e
-- 
23c78e
1.8.3.1
23c78e
23c78e
23c78e
From 267d0cc44e94d6963fe13974f83b2fc845b0c431 Mon Sep 17 00:00:00 2001
23c78e
From: Ken Gaillot <kgaillot@redhat.com>
23c78e
Date: Tue, 17 Nov 2020 15:45:35 -0600
23c78e
Subject: [PATCH 12/13] Test: execd: use new resource parameter function in
23c78e
 cts-exec-helper
23c78e
23c78e
---
23c78e
 daemons/execd/cts-exec-helper.c | 6 ++----
23c78e
 1 file changed, 2 insertions(+), 4 deletions(-)
23c78e
23c78e
diff --git a/daemons/execd/cts-exec-helper.c b/daemons/execd/cts-exec-helper.c
23c78e
index 8be8e18..423b54d 100644
23c78e
--- a/daemons/execd/cts-exec-helper.c
23c78e
+++ b/daemons/execd/cts-exec-helper.c
23c78e
@@ -482,13 +482,12 @@ generate_params(void)
23c78e
         goto param_gen_bail;
23c78e
     }
23c78e
 
23c78e
-    params = crm_str_table_new();
23c78e
+    params = pe_rsc_params(rsc, NULL, data_set);
23c78e
     meta = crm_str_table_new();
23c78e
 
23c78e
-    get_rsc_attributes(params, rsc, NULL, data_set);
23c78e
     get_meta_attributes(meta, rsc, NULL, data_set);
23c78e
 
23c78e
-    if (params) {
23c78e
+    if (params != NULL) {
23c78e
         char *key = NULL;
23c78e
         char *value = NULL;
23c78e
 
23c78e
@@ -496,7 +495,6 @@ generate_params(void)
23c78e
         while (g_hash_table_iter_next(&iter, (gpointer *) & key, (gpointer *) & value)) {
23c78e
             options.params = lrmd_key_value_add(options.params, key, value);
23c78e
         }
23c78e
-        g_hash_table_destroy(params);
23c78e
     }
23c78e
 
23c78e
     if (meta) {
23c78e
-- 
23c78e
1.8.3.1
23c78e
23c78e
23c78e
From b10c86bf785beccef147b702366607cc4ead0f79 Mon Sep 17 00:00:00 2001
23c78e
From: Ken Gaillot <kgaillot@redhat.com>
23c78e
Date: Tue, 17 Nov 2020 16:01:12 -0600
23c78e
Subject: [PATCH 13/13] Refactor: tools: use new resource parameter function in
23c78e
 crm_resource
23c78e
23c78e
---
23c78e
 tools/crm_resource.c         | 14 +++++++++-----
23c78e
 tools/crm_resource_print.c   | 10 ++++++++--
23c78e
 tools/crm_resource_runtime.c | 32 +++++++++++---------------------
23c78e
 3 files changed, 28 insertions(+), 28 deletions(-)
23c78e
23c78e
diff --git a/tools/crm_resource.c b/tools/crm_resource.c
23c78e
index b028c40..9663e68 100644
23c78e
--- a/tools/crm_resource.c
23c78e
+++ b/tools/crm_resource.c
23c78e
@@ -1902,6 +1902,7 @@ main(int argc, char **argv)
23c78e
             unsigned int count = 0;
23c78e
             GHashTable *params = NULL;
23c78e
             pe_node_t *current = pe__find_active_on(rsc, &count, NULL);
23c78e
+            bool free_params = true;
23c78e
 
23c78e
             if (count > 1) {
23c78e
                 out->err(out, "%s is active on more than one node,"
23c78e
@@ -1909,23 +1910,26 @@ main(int argc, char **argv)
23c78e
                 current = NULL;
23c78e
             }
23c78e
 
23c78e
-            params = crm_str_table_new();
23c78e
+            crm_debug("Looking up %s in %s", options.prop_name, rsc->id);
23c78e
 
23c78e
             if (pcmk__str_eq(options.attr_set_type, XML_TAG_ATTR_SETS, pcmk__str_casei)) {
23c78e
-                get_rsc_attributes(params, rsc, current, data_set);
23c78e
+                params = pe_rsc_params(rsc, current, data_set);
23c78e
+                free_params = false;
23c78e
 
23c78e
             } else if (pcmk__str_eq(options.attr_set_type, XML_TAG_META_SETS, pcmk__str_casei)) {
23c78e
-                /* No need to redirect to the parent */
23c78e
+                params = crm_str_table_new();
23c78e
                 get_meta_attributes(params, rsc, current, data_set);
23c78e
 
23c78e
             } else {
23c78e
+                params = crm_str_table_new();
23c78e
                 pe__unpack_dataset_nvpairs(rsc->xml, XML_TAG_UTILIZATION, NULL, params,
23c78e
                                            NULL, FALSE, data_set);
23c78e
             }
23c78e
 
23c78e
-            crm_debug("Looking up %s in %s", options.prop_name, rsc->id);
23c78e
             rc = out->message(out, "attribute-list", rsc, options.prop_name, params);
23c78e
-            g_hash_table_destroy(params);
23c78e
+            if (free_params) {
23c78e
+                g_hash_table_destroy(params);
23c78e
+            }
23c78e
             break;
23c78e
         }
23c78e
 
23c78e
diff --git a/tools/crm_resource_print.c b/tools/crm_resource_print.c
23c78e
index 89d6172..398fef0 100644
23c78e
--- a/tools/crm_resource_print.c
23c78e
+++ b/tools/crm_resource_print.c
23c78e
@@ -134,8 +134,11 @@ attribute_list_default(pcmk__output_t *out, va_list args) {
23c78e
     char *attr = va_arg(args, char *);
23c78e
     GHashTable *params = va_arg(args, GHashTable *);
23c78e
 
23c78e
-    const char *value = g_hash_table_lookup(params, attr);
23c78e
+    const char *value = NULL;
23c78e
 
23c78e
+    if (params != NULL) {
23c78e
+        value = g_hash_table_lookup(params, attr);
23c78e
+    }
23c78e
     if (value != NULL) {
23c78e
         out->begin_list(out, NULL, NULL, "Attributes");
23c78e
         out->list_item(out, attr, "%s", value);
23c78e
@@ -154,8 +157,11 @@ attribute_list_text(pcmk__output_t *out, va_list args) {
23c78e
     char *attr = va_arg(args, char *);
23c78e
     GHashTable *params = va_arg(args, GHashTable *);
23c78e
 
23c78e
-    const char *value = g_hash_table_lookup(params, attr);
23c78e
+    const char *value = NULL;
23c78e
 
23c78e
+    if (params != NULL) {
23c78e
+        value = g_hash_table_lookup(params, attr);
23c78e
+    }
23c78e
     if (value != NULL) {
23c78e
         out->info(out, "%s", value);
23c78e
     } else {
23c78e
diff --git a/tools/crm_resource_runtime.c b/tools/crm_resource_runtime.c
23c78e
index e0804fc..9ff9e96 100644
23c78e
--- a/tools/crm_resource_runtime.c
23c78e
+++ b/tools/crm_resource_runtime.c
23c78e
@@ -916,40 +916,29 @@ cli_resource_fail(pcmk__output_t *out, pcmk_ipc_api_t *controld_api,
23c78e
 }
23c78e
 
23c78e
 static GHashTable *
23c78e
-generate_resource_params(pe_resource_t * rsc, pe_working_set_t * data_set)
23c78e
+generate_resource_params(pe_resource_t *rsc, pe_node_t *node,
23c78e
+                         pe_working_set_t *data_set)
23c78e
 {
23c78e
     GHashTable *params = NULL;
23c78e
     GHashTable *meta = NULL;
23c78e
     GHashTable *combined = NULL;
23c78e
     GHashTableIter iter;
23c78e
+    char *key = NULL;
23c78e
+    char *value = NULL;
23c78e
 
23c78e
-    if (!rsc) {
23c78e
-        crm_err("Resource does not exist in config");
23c78e
-        return NULL;
23c78e
-    }
23c78e
-
23c78e
-    params = crm_str_table_new();
23c78e
-    meta = crm_str_table_new();
23c78e
     combined = crm_str_table_new();
23c78e
 
23c78e
-    get_rsc_attributes(params, rsc, NULL /* TODO: Pass in local node */ , data_set);
23c78e
-    get_meta_attributes(meta, rsc, NULL /* TODO: Pass in local node */ , data_set);
23c78e
-
23c78e
-    if (params) {
23c78e
-        char *key = NULL;
23c78e
-        char *value = NULL;
23c78e
-
23c78e
+    params = pe_rsc_params(rsc, node, data_set);
23c78e
+    if (params != NULL) {
23c78e
         g_hash_table_iter_init(&iter, params);
23c78e
         while (g_hash_table_iter_next(&iter, (gpointer *) & key, (gpointer *) & value)) {
23c78e
             g_hash_table_insert(combined, strdup(key), strdup(value));
23c78e
         }
23c78e
-        g_hash_table_destroy(params);
23c78e
     }
23c78e
 
23c78e
-    if (meta) {
23c78e
-        char *key = NULL;
23c78e
-        char *value = NULL;
23c78e
-
23c78e
+    meta = crm_str_table_new();
23c78e
+    get_meta_attributes(meta, rsc, node, data_set);
23c78e
+    if (meta != NULL) {
23c78e
         g_hash_table_iter_init(&iter, meta);
23c78e
         while (g_hash_table_iter_next(&iter, (gpointer *) & key, (gpointer *) & value)) {
23c78e
             char *crm_name = crm_meta_name(key);
23c78e
@@ -1827,7 +1816,8 @@ cli_resource_execute(pcmk__output_t *out, pe_resource_t *rsc,
23c78e
     rprov = crm_element_value(rsc->xml, XML_AGENT_ATTR_PROVIDER);
23c78e
     rtype = crm_element_value(rsc->xml, XML_ATTR_TYPE);
23c78e
 
23c78e
-    params = generate_resource_params(rsc, data_set);
23c78e
+    params = generate_resource_params(rsc, NULL /* @TODO use local node */,
23c78e
+                                      data_set);
23c78e
 
23c78e
     if (timeout_ms == 0) {
23c78e
         timeout_ms = pe_get_configured_timeout(rsc, action, data_set);
23c78e
-- 
23c78e
1.8.3.1
23c78e