Blame SOURCES/021-rhbz1872376.patch

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