pacemaker 2.1.5-a3f44794f94
Scalable High-Availability cluster resource manager
complex.c
Go to the documentation of this file.
1/*
2 * Copyright 2004-2022 the Pacemaker project contributors
3 *
4 * The version control history for this file may have further details.
5 *
6 * This source code is licensed under the GNU Lesser General Public License
7 * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8 */
9
10#include <crm_internal.h>
11
12#include <crm/pengine/rules.h>
14#include <crm/msg_xml.h>
16
17#include "pe_status_private.h"
18
19void populate_hash(xmlNode * nvpair_list, GHashTable * hash, const char **attrs, int attrs_length);
20
22 {
33 },
34 {
45 },
46 {
57 },
58 {
69 }
70};
71
72static enum pe_obj_types
73get_resource_type(const char *name)
74{
75 if (pcmk__str_eq(name, XML_CIB_TAG_RESOURCE, pcmk__str_casei)) {
76 return pe_native;
77
78 } else if (pcmk__str_eq(name, XML_CIB_TAG_GROUP, pcmk__str_casei)) {
79 return pe_group;
80
81 } else if (pcmk__str_eq(name, XML_CIB_TAG_INCARNATION, pcmk__str_casei)) {
82 return pe_clone;
83
84 } else if (pcmk__str_eq(name, PCMK_XE_PROMOTABLE_LEGACY, pcmk__str_casei)) {
85 // @COMPAT deprecated since 2.0.0
86 return pe_clone;
87
88 } else if (pcmk__str_eq(name, XML_CIB_TAG_CONTAINER, pcmk__str_casei)) {
89 return pe_container;
90 }
91
92 return pe_unknown;
93}
94
95static void
96dup_attr(gpointer key, gpointer value, gpointer user_data)
97{
98 add_hash_param(user_data, key, value);
99}
100
101static void
102expand_parents_fixed_nvpairs(pe_resource_t * rsc, pe_rule_eval_data_t * rule_data, GHashTable * meta_hash, pe_working_set_t * data_set)
103{
104 GHashTable *parent_orig_meta = pcmk__strkey_table(free, free);
105 pe_resource_t *p = rsc->parent;
106
107 if (p == NULL) {
108 return ;
109 }
110
111 /* Search all parent resources, get the fixed value of "meta_attributes" set only in the original xml, and stack it in the hash table. */
112 /* The fixed value of the lower parent resource takes precedence and is not overwritten. */
113 while(p != NULL) {
114 /* A hash table for comparison is generated, including the id-ref. */
116 rule_data, parent_orig_meta, NULL, FALSE, data_set);
117 p = p->parent;
118 }
119
120 /* If there is a fixed value of "meta_attributes" of the parent resource, it will be processed. */
121 if (parent_orig_meta != NULL) {
122 GHashTableIter iter;
123 char *key = NULL;
124 char *value = NULL;
125
126 g_hash_table_iter_init(&iter, parent_orig_meta);
127 while (g_hash_table_iter_next(&iter, (gpointer *) &key, (gpointer *) &value)) {
128 /* Parameters set in the original xml of the parent resource will also try to overwrite the child resource. */
129 /* Attributes that already exist in the child lease are not updated. */
130 dup_attr(key, value, meta_hash);
131 }
132 }
133
134 if (parent_orig_meta != NULL) {
135 g_hash_table_destroy(parent_orig_meta);
136 }
137
138 return ;
139
140}
141void
142get_meta_attributes(GHashTable * meta_hash, pe_resource_t * rsc,
144{
145 pe_rsc_eval_data_t rsc_rule_data = {
149 };
150
151 pe_rule_eval_data_t rule_data = {
152 .node_hash = NULL,
153 .role = RSC_ROLE_UNKNOWN,
154 .now = data_set->now,
155 .match_data = NULL,
156 .rsc_data = &rsc_rule_data,
157 .op_data = NULL
158 };
159
160 if (node) {
161 rule_data.node_hash = node->details->attrs;
162 }
163
164 for (xmlAttrPtr a = pcmk__xe_first_attr(rsc->xml); a != NULL; a = a->next) {
165 const char *prop_name = (const char *) a->name;
166 const char *prop_value = crm_element_value(rsc->xml, prop_name);
167
168 add_hash_param(meta_hash, prop_name, prop_value);
169 }
170
172 meta_hash, NULL, FALSE, data_set);
173
174 /* Set the "meta_attributes" explicitly set in the parent resource to the hash table of the child resource. */
175 /* If it is already explicitly set as a child, it will not be overwritten. */
176 if (rsc->parent != NULL) {
177 expand_parents_fixed_nvpairs(rsc, &rule_data, meta_hash, data_set);
178 }
179
180 /* check the defaults */
182 &rule_data, meta_hash, NULL, FALSE, data_set);
183
184 /* If there is "meta_attributes" that the parent resource has not explicitly set, set a value that is not set from rsc_default either. */
185 /* The values already set up to this point will not be overwritten. */
186 if (rsc->parent) {
187 g_hash_table_foreach(rsc->parent->meta, dup_attr, meta_hash);
188 }
189}
190
191void
192get_rsc_attributes(GHashTable *meta_hash, const pe_resource_t *rsc,
193 const pe_node_t *node, pe_working_set_t *data_set)
194{
195 pe_rule_eval_data_t rule_data = {
196 .node_hash = NULL,
197 .role = RSC_ROLE_UNKNOWN,
198 .now = data_set->now,
199 .match_data = NULL,
200 .rsc_data = NULL,
201 .op_data = NULL
202 };
203
204 if (node) {
205 rule_data.node_hash = node->details->attrs;
206 }
207
209 meta_hash, NULL, FALSE, data_set);
210
211 /* set anything else based on the parent */
212 if (rsc->parent != NULL) {
213 get_rsc_attributes(meta_hash, rsc->parent, node, data_set);
214
215 } else {
216 /* and finally check the defaults */
218 &rule_data, meta_hash, NULL, FALSE, data_set);
219 }
220}
221
222static char *
223template_op_key(xmlNode * op)
224{
225 const char *name = crm_element_value(op, "name");
226 const char *role = crm_element_value(op, "role");
227 char *key = NULL;
228
229 if ((role == NULL)
232 role = RSC_ROLE_UNKNOWN_S;
233 }
234
235 key = crm_strdup_printf("%s-%s", name, role);
236 return key;
237}
238
239static gboolean
240unpack_template(xmlNode * xml_obj, xmlNode ** expanded_xml, pe_working_set_t * data_set)
241{
242 xmlNode *cib_resources = NULL;
243 xmlNode *template = NULL;
244 xmlNode *new_xml = NULL;
245 xmlNode *child_xml = NULL;
246 xmlNode *rsc_ops = NULL;
247 xmlNode *template_ops = NULL;
248 const char *template_ref = NULL;
249 const char *clone = NULL;
250 const char *id = NULL;
251
252 if (xml_obj == NULL) {
253 pe_err("No resource object for template unpacking");
254 return FALSE;
255 }
256
257 template_ref = crm_element_value(xml_obj, XML_CIB_TAG_RSC_TEMPLATE);
258 if (template_ref == NULL) {
259 return TRUE;
260 }
261
262 id = ID(xml_obj);
263 if (id == NULL) {
264 pe_err("'%s' object must have a id", crm_element_name(xml_obj));
265 return FALSE;
266 }
267
268 if (pcmk__str_eq(template_ref, id, pcmk__str_none)) {
269 pe_err("The resource object '%s' should not reference itself", id);
270 return FALSE;
271 }
272
274 if (cib_resources == NULL) {
275 pe_err("No resources configured");
276 return FALSE;
277 }
278
279 template = pcmk__xe_match(cib_resources, XML_CIB_TAG_RSC_TEMPLATE,
280 XML_ATTR_ID, template_ref);
281 if (template == NULL) {
282 pe_err("No template named '%s'", template_ref);
283 return FALSE;
284 }
285
286 new_xml = copy_xml(template);
287 xmlNodeSetName(new_xml, xml_obj->name);
288 crm_xml_replace(new_xml, XML_ATTR_ID, id);
289
291 if(clone) {
292 crm_xml_add(new_xml, XML_RSC_ATTR_INCARNATION, clone);
293 }
294
295 template_ops = find_xml_node(new_xml, "operations", FALSE);
296
297 for (child_xml = pcmk__xe_first_child(xml_obj); child_xml != NULL;
298 child_xml = pcmk__xe_next(child_xml)) {
299 xmlNode *new_child = NULL;
300
301 new_child = add_node_copy(new_xml, child_xml);
302
303 if (pcmk__str_eq((const char *)new_child->name, "operations", pcmk__str_none)) {
304 rsc_ops = new_child;
305 }
306 }
307
308 if (template_ops && rsc_ops) {
309 xmlNode *op = NULL;
310 GHashTable *rsc_ops_hash = pcmk__strkey_table(free, NULL);
311
312 for (op = pcmk__xe_first_child(rsc_ops); op != NULL;
313 op = pcmk__xe_next(op)) {
314
315 char *key = template_op_key(op);
316
317 g_hash_table_insert(rsc_ops_hash, key, op);
318 }
319
320 for (op = pcmk__xe_first_child(template_ops); op != NULL;
321 op = pcmk__xe_next(op)) {
322
323 char *key = template_op_key(op);
324
325 if (g_hash_table_lookup(rsc_ops_hash, key) == NULL) {
326 add_node_copy(rsc_ops, op);
327 }
328
329 free(key);
330 }
331
332 if (rsc_ops_hash) {
333 g_hash_table_destroy(rsc_ops_hash);
334 }
335
336 free_xml(template_ops);
337 }
338
339 /*free_xml(*expanded_xml); */
340 *expanded_xml = new_xml;
341
342 /* Disable multi-level templates for now */
343 /*if(unpack_template(new_xml, expanded_xml, data_set) == FALSE) {
344 free_xml(*expanded_xml);
345 *expanded_xml = NULL;
346
347 return FALSE;
348 } */
349
350 return TRUE;
351}
352
353static gboolean
354add_template_rsc(xmlNode * xml_obj, pe_working_set_t * data_set)
355{
356 const char *template_ref = NULL;
357 const char *id = NULL;
358
359 if (xml_obj == NULL) {
360 pe_err("No resource object for processing resource list of template");
361 return FALSE;
362 }
363
364 template_ref = crm_element_value(xml_obj, XML_CIB_TAG_RSC_TEMPLATE);
365 if (template_ref == NULL) {
366 return TRUE;
367 }
368
369 id = ID(xml_obj);
370 if (id == NULL) {
371 pe_err("'%s' object must have a id", crm_element_name(xml_obj));
372 return FALSE;
373 }
374
375 if (pcmk__str_eq(template_ref, id, pcmk__str_none)) {
376 pe_err("The resource object '%s' should not reference itself", id);
377 return FALSE;
378 }
379
380 if (add_tag_ref(data_set->template_rsc_sets, template_ref, id) == FALSE) {
381 return FALSE;
382 }
383
384 return TRUE;
385}
386
387static bool
388detect_promotable(pe_resource_t *rsc)
389{
390 const char *promotable = g_hash_table_lookup(rsc->meta,
392
393 if (crm_is_true(promotable)) {
394 return TRUE;
395 }
396
397 // @COMPAT deprecated since 2.0.0
398 if (pcmk__str_eq(crm_element_name(rsc->xml), PCMK_XE_PROMOTABLE_LEGACY,
400 /* @TODO in some future version, pe_warn_once() here,
401 * then drop support in even later version
402 */
403 g_hash_table_insert(rsc->meta, strdup(XML_RSC_ATTR_PROMOTABLE),
404 strdup(XML_BOOLEAN_TRUE));
405 return TRUE;
406 }
407 return FALSE;
408}
409
410static void
411free_params_table(gpointer data)
412{
413 g_hash_table_destroy((GHashTable *) data);
414}
415
428GHashTable *
431{
432 GHashTable *params_on_node = NULL;
433
434 /* A NULL node is used to request the resource's default parameters
435 * (not evaluated for node), but we always want something non-NULL
436 * as a hash table key.
437 */
438 const char *node_name = "";
439
440 // Sanity check
441 if ((rsc == NULL) || (data_set == NULL)) {
442 return NULL;
443 }
444 if ((node != NULL) && (node->details->uname != NULL)) {
445 node_name = node->details->uname;
446 }
447
448 // Find the parameter table for given node
449 if (rsc->parameter_cache == NULL) {
450 rsc->parameter_cache = pcmk__strikey_table(free, free_params_table);
451 } else {
452 params_on_node = g_hash_table_lookup(rsc->parameter_cache, node_name);
453 }
454
455 // If none exists yet, create one with parameters evaluated for node
456 if (params_on_node == NULL) {
457 params_on_node = pcmk__strkey_table(free, free);
458 get_rsc_attributes(params_on_node, rsc, node, data_set);
459 g_hash_table_insert(rsc->parameter_cache, strdup(node_name),
460 params_on_node);
461 }
462 return params_on_node;
463}
464
473static void
474unpack_requires(pe_resource_t *rsc, const char *value, bool is_default)
475{
476 if (pcmk__str_eq(value, PCMK__VALUE_NOTHING, pcmk__str_casei)) {
477
478 } else if (pcmk__str_eq(value, PCMK__VALUE_QUORUM, pcmk__str_casei)) {
480
481 } else if (pcmk__str_eq(value, PCMK__VALUE_FENCING, pcmk__str_casei)) {
484 pcmk__config_warn("%s requires fencing but fencing is disabled",
485 rsc->id);
486 }
487
488 } else if (pcmk__str_eq(value, PCMK__VALUE_UNFENCING, pcmk__str_casei)) {
490 pcmk__config_warn("Resetting \"" XML_RSC_ATTR_REQUIRES "\" for %s "
491 "to \"" PCMK__VALUE_QUORUM "\" because fencing "
492 "devices cannot require unfencing", rsc->id);
493 unpack_requires(rsc, PCMK__VALUE_QUORUM, true);
494 return;
495
496 } else if (!pcmk_is_set(rsc->cluster->flags, pe_flag_stonith_enabled)) {
497 pcmk__config_warn("Resetting \"" XML_RSC_ATTR_REQUIRES "\" for %s "
498 "to \"" PCMK__VALUE_QUORUM "\" because fencing "
499 "is disabled", rsc->id);
500 unpack_requires(rsc, PCMK__VALUE_QUORUM, true);
501 return;
502
503 } else {
506 }
507
508 } else {
509 const char *orig_value = value;
510
512 value = PCMK__VALUE_QUORUM;
513
514 } else if ((rsc->variant == pe_native)
515 && xml_contains_remote_node(rsc->xml)) {
516 value = PCMK__VALUE_QUORUM;
517
519 value = PCMK__VALUE_UNFENCING;
520
522 value = PCMK__VALUE_FENCING;
523
524 } else if (rsc->cluster->no_quorum_policy == no_quorum_ignore) {
525 value = PCMK__VALUE_NOTHING;
526
527 } else {
528 value = PCMK__VALUE_QUORUM;
529 }
530
531 if (orig_value != NULL) {
532 pcmk__config_err("Resetting '" XML_RSC_ATTR_REQUIRES "' for %s "
533 "to '%s' because '%s' is not valid",
534 rsc->id, value, orig_value);
535 }
536 unpack_requires(rsc, value, true);
537 return;
538 }
539
540 pe_rsc_trace(rsc, "\tRequired to start: %s%s", value,
541 (is_default? " (default)" : ""));
542}
543
561int
562pe__unpack_resource(xmlNode *xml_obj, pe_resource_t **rsc,
564{
565 xmlNode *expanded_xml = NULL;
566 xmlNode *ops = NULL;
567 const char *value = NULL;
568 const char *id = NULL;
569 bool guest_node = false;
570 bool remote_node = false;
571
572 pe_rule_eval_data_t rule_data = {
573 .node_hash = NULL,
574 .role = RSC_ROLE_UNKNOWN,
575 .now = NULL,
576 .match_data = NULL,
577 .rsc_data = NULL,
578 .op_data = NULL
579 };
580
581 CRM_CHECK(rsc != NULL, return EINVAL);
582 CRM_CHECK((xml_obj != NULL) && (data_set != NULL),
583 *rsc = NULL;
584 return EINVAL);
585
586 rule_data.now = data_set->now;
587
588 crm_log_xml_trace(xml_obj, "[raw XML]");
589
590 id = crm_element_value(xml_obj, XML_ATTR_ID);
591 if (id == NULL) {
592 pe_err("Ignoring <%s> configuration without " XML_ATTR_ID,
593 crm_element_name(xml_obj));
595 }
596
597 if (unpack_template(xml_obj, &expanded_xml, data_set) == FALSE) {
599 }
600
601 *rsc = calloc(1, sizeof(pe_resource_t));
602 if (*rsc == NULL) {
603 crm_crit("Unable to allocate memory for resource '%s'", id);
604 return ENOMEM;
605 }
606 (*rsc)->cluster = data_set;
607
608 if (expanded_xml) {
609 crm_log_xml_trace(expanded_xml, "[expanded XML]");
610 (*rsc)->xml = expanded_xml;
611 (*rsc)->orig_xml = xml_obj;
612
613 } else {
614 (*rsc)->xml = xml_obj;
615 (*rsc)->orig_xml = NULL;
616 }
617
618 /* Do not use xml_obj from here on, use (*rsc)->xml in case templates are involved */
619
620 (*rsc)->parent = parent;
621
622 ops = find_xml_node((*rsc)->xml, "operations", FALSE);
623 (*rsc)->ops_xml = expand_idref(ops, data_set->input);
624
625 (*rsc)->variant = get_resource_type(crm_element_name((*rsc)->xml));
626 if ((*rsc)->variant == pe_unknown) {
627 pe_err("Ignoring resource '%s' of unknown type '%s'",
628 id, crm_element_name((*rsc)->xml));
629 common_free(*rsc);
630 *rsc = NULL;
632 }
633
634 (*rsc)->meta = pcmk__strkey_table(free, free);
635 (*rsc)->allowed_nodes = pcmk__strkey_table(NULL, free);
636 (*rsc)->known_on = pcmk__strkey_table(NULL, free);
637
638 value = crm_element_value((*rsc)->xml, XML_RSC_ATTR_INCARNATION);
639 if (value) {
640 (*rsc)->id = crm_strdup_printf("%s:%s", id, value);
641 add_hash_param((*rsc)->meta, XML_RSC_ATTR_INCARNATION, value);
642
643 } else {
644 (*rsc)->id = strdup(id);
645 }
646
647 (*rsc)->fns = &resource_class_functions[(*rsc)->variant];
648
649 get_meta_attributes((*rsc)->meta, *rsc, NULL, data_set);
650 (*rsc)->parameters = pe_rsc_params(*rsc, NULL, data_set); // \deprecated
651
652 (*rsc)->flags = 0;
654
657 }
658
659 (*rsc)->rsc_cons = NULL;
660 (*rsc)->rsc_tickets = NULL;
661 (*rsc)->actions = NULL;
662 (*rsc)->role = RSC_ROLE_STOPPED;
663 (*rsc)->next_role = RSC_ROLE_UNKNOWN;
664
665 (*rsc)->recovery_type = recovery_stop_start;
666 (*rsc)->stickiness = 0;
667 (*rsc)->migration_threshold = INFINITY;
668 (*rsc)->failure_timeout = 0;
669
670 value = g_hash_table_lookup((*rsc)->meta, XML_CIB_ATTR_PRIORITY);
671 (*rsc)->priority = char2score(value);
672
673 value = g_hash_table_lookup((*rsc)->meta, XML_RSC_ATTR_CRITICAL);
674 if ((value == NULL) || crm_is_true(value)) {
676 }
677
678 value = g_hash_table_lookup((*rsc)->meta, XML_RSC_ATTR_NOTIFY);
679 if (crm_is_true(value)) {
681 }
682
683 if (xml_contains_remote_node((*rsc)->xml)) {
684 (*rsc)->is_remote_node = TRUE;
685 if (g_hash_table_lookup((*rsc)->meta, XML_RSC_ATTR_CONTAINER)) {
686 guest_node = true;
687 } else {
688 remote_node = true;
689 }
690 }
691
692 value = g_hash_table_lookup((*rsc)->meta, XML_OP_ATTR_ALLOW_MIGRATE);
693 if (crm_is_true(value)) {
695 } else if ((value == NULL) && remote_node) {
696 /* By default, we want remote nodes to be able
697 * to float around the cluster without having to stop all the
698 * resources within the remote-node before moving. Allowing
699 * migration support enables this feature. If this ever causes
700 * problems, migration support can be explicitly turned off with
701 * allow-migrate=false.
702 */
704 }
705
706 value = g_hash_table_lookup((*rsc)->meta, XML_RSC_ATTR_MANAGED);
707 if (value != NULL && !pcmk__str_eq("default", value, pcmk__str_casei)) {
708 if (crm_is_true(value)) {
710 } else {
712 }
713 }
714
715 value = g_hash_table_lookup((*rsc)->meta, XML_RSC_ATTR_MAINTENANCE);
716 if (crm_is_true(value)) {
719 }
723 }
724
725 if (pe_rsc_is_clone(uber_parent(*rsc))) {
726 value = g_hash_table_lookup((*rsc)->meta, XML_RSC_ATTR_UNIQUE);
727 if (crm_is_true(value)) {
729 }
730 if (detect_promotable(*rsc)) {
732 }
733 } else {
735 }
736
737 value = g_hash_table_lookup((*rsc)->meta, XML_RSC_ATTR_RESTART);
738 if (pcmk__str_eq(value, "restart", pcmk__str_casei)) {
739 (*rsc)->restart_type = pe_restart_restart;
740 pe_rsc_trace((*rsc), "%s dependency restart handling: restart",
741 (*rsc)->id);
743 "Support for restart-type is deprecated and will be removed in a future release");
744
745 } else {
746 (*rsc)->restart_type = pe_restart_ignore;
747 pe_rsc_trace((*rsc), "%s dependency restart handling: ignore",
748 (*rsc)->id);
749 }
750
751 value = g_hash_table_lookup((*rsc)->meta, XML_RSC_ATTR_MULTIPLE);
752 if (pcmk__str_eq(value, "stop_only", pcmk__str_casei)) {
753 (*rsc)->recovery_type = recovery_stop_only;
754 pe_rsc_trace((*rsc), "%s multiple running resource recovery: stop only",
755 (*rsc)->id);
756
757 } else if (pcmk__str_eq(value, "block", pcmk__str_casei)) {
758 (*rsc)->recovery_type = recovery_block;
759 pe_rsc_trace((*rsc), "%s multiple running resource recovery: block",
760 (*rsc)->id);
761
762 } else if (pcmk__str_eq(value, "stop_unexpected", pcmk__str_casei)) {
763 (*rsc)->recovery_type = recovery_stop_unexpected;
764 pe_rsc_trace((*rsc), "%s multiple running resource recovery: "
765 "stop unexpected instances",
766 (*rsc)->id);
767
768 } else { // "stop_start"
769 if (!pcmk__str_eq(value, "stop_start",
771 pe_warn("%s is not a valid value for " XML_RSC_ATTR_MULTIPLE
772 ", using default of \"stop_start\"", value);
773 }
774 (*rsc)->recovery_type = recovery_stop_start;
775 pe_rsc_trace((*rsc), "%s multiple running resource recovery: "
776 "stop/start", (*rsc)->id);
777 }
778
779 value = g_hash_table_lookup((*rsc)->meta, XML_RSC_ATTR_STICKINESS);
780 if (value != NULL && !pcmk__str_eq("default", value, pcmk__str_casei)) {
781 (*rsc)->stickiness = char2score(value);
782 }
783
784 value = g_hash_table_lookup((*rsc)->meta, XML_RSC_ATTR_FAIL_STICKINESS);
785 if (value != NULL && !pcmk__str_eq("default", value, pcmk__str_casei)) {
786 (*rsc)->migration_threshold = char2score(value);
787 if ((*rsc)->migration_threshold < 0) {
788 /* @TODO We use 1 here to preserve previous behavior, but this
789 * should probably use the default (INFINITY) or 0 (to disable)
790 * instead.
791 */
794 " must be non-negative, using 1 instead");
795 (*rsc)->migration_threshold = 1;
796 }
797 }
798
799 if (pcmk__str_eq(crm_element_value((*rsc)->xml, XML_AGENT_ATTR_CLASS),
803 }
804
805 value = g_hash_table_lookup((*rsc)->meta, XML_RSC_ATTR_REQUIRES);
806 unpack_requires(*rsc, value, false);
807
808 value = g_hash_table_lookup((*rsc)->meta, XML_RSC_ATTR_FAIL_TIMEOUT);
809 if (value != NULL) {
810 // Stored as seconds
811 (*rsc)->failure_timeout = (int) (crm_parse_interval_spec(value) / 1000);
812 }
813
814 if (remote_node) {
815 GHashTable *params = pe_rsc_params(*rsc, NULL, data_set);
816
817 /* Grabbing the value now means that any rules based on node attributes
818 * will evaluate to false, so such rules should not be used with
819 * reconnect_interval.
820 *
821 * @TODO Evaluate per node before using
822 */
823 value = g_hash_table_lookup(params, XML_REMOTE_ATTR_RECONNECT_INTERVAL);
824 if (value) {
825 /* reconnect delay works by setting failure_timeout and preventing the
826 * connection from starting until the failure is cleared. */
827 (*rsc)->remote_reconnect_ms = crm_parse_interval_spec(value);
828 /* we want to override any default failure_timeout in use when remote
829 * reconnect_interval is in use. */
830 (*rsc)->failure_timeout = (*rsc)->remote_reconnect_ms / 1000;
831 }
832 }
833
834 get_target_role(*rsc, &((*rsc)->next_role));
835 pe_rsc_trace((*rsc), "%s desired next state: %s", (*rsc)->id,
836 (*rsc)->next_role != RSC_ROLE_UNKNOWN ? role2text((*rsc)->next_role) : "default");
837
838 if ((*rsc)->fns->unpack(*rsc, data_set) == FALSE) {
839 (*rsc)->fns->free(*rsc);
840 *rsc = NULL;
842 }
843
845 // This tag must stay exactly the same because it is tested elsewhere
846 resource_location(*rsc, NULL, 0, "symmetric_default", data_set);
847 } else if (guest_node) {
848 /* remote resources tied to a container resource must always be allowed
849 * to opt-in to the cluster. Whether the connection resource is actually
850 * allowed to be placed on a node is dependent on the container resource */
851 resource_location(*rsc, NULL, 0, "remote_connection_default", data_set);
852 }
853
854 pe_rsc_trace((*rsc), "%s action notification: %s", (*rsc)->id,
855 pcmk_is_set((*rsc)->flags, pe_rsc_notify)? "required" : "not required");
856
857 (*rsc)->utilization = pcmk__strkey_table(free, free);
858
859 pe__unpack_dataset_nvpairs((*rsc)->xml, XML_TAG_UTILIZATION, &rule_data,
860 (*rsc)->utilization, NULL, FALSE, data_set);
861
862 if (expanded_xml) {
863 if (add_template_rsc(xml_obj, data_set) == FALSE) {
864 (*rsc)->fns->free(*rsc);
865 *rsc = NULL;
867 }
868 }
869 return pcmk_rc_ok;
870}
871
872void
873common_update_score(pe_resource_t * rsc, const char *id, int score)
874{
875 pe_node_t *node = NULL;
876
877 node = pe_hash_table_lookup(rsc->allowed_nodes, id);
878 if (node != NULL) {
879 pe_rsc_trace(rsc, "Updating score for %s on %s: %d + %d", rsc->id, id, node->weight, score);
880 node->weight = pcmk__add_scores(node->weight, score);
881 }
882
883 if (rsc->children) {
884 GList *gIter = rsc->children;
885
886 for (; gIter != NULL; gIter = gIter->next) {
887 pe_resource_t *child_rsc = (pe_resource_t *) gIter->data;
888
889 common_update_score(child_rsc, id, score);
890 }
891 }
892}
893
894gboolean
896{
897 pe_resource_t *parent = child;
898
899 if (parent == NULL || rsc == NULL) {
900 return FALSE;
901 }
902 while (parent->parent != NULL) {
903 if (parent->parent == rsc) {
904 return TRUE;
905 }
906 parent = parent->parent;
907 }
908 return FALSE;
909}
910
913{
914 pe_resource_t *parent = rsc;
915
916 if (parent == NULL) {
917 return NULL;
918 }
919 while (parent->parent != NULL && parent->parent->variant != pe_container) {
920 parent = parent->parent;
921 }
922 return parent;
923}
924
925void
927{
928 if (rsc == NULL) {
929 return;
930 }
931
932 pe_rsc_trace(rsc, "Freeing %s %d", rsc->id, rsc->variant);
933
934 g_list_free(rsc->rsc_cons);
935 g_list_free(rsc->rsc_cons_lhs);
936 g_list_free(rsc->rsc_tickets);
937 g_list_free(rsc->dangling_migrations);
938
939 if (rsc->parameter_cache != NULL) {
940 g_hash_table_destroy(rsc->parameter_cache);
941 }
942 if (rsc->meta != NULL) {
943 g_hash_table_destroy(rsc->meta);
944 }
945 if (rsc->utilization != NULL) {
946 g_hash_table_destroy(rsc->utilization);
947 }
948
949 if ((rsc->parent == NULL) && pcmk_is_set(rsc->flags, pe_rsc_orphan)) {
950 free_xml(rsc->xml);
951 rsc->xml = NULL;
952 free_xml(rsc->orig_xml);
953 rsc->orig_xml = NULL;
954
955 /* if rsc->orig_xml, then rsc->xml is an expanded xml from a template */
956 } else if (rsc->orig_xml) {
957 free_xml(rsc->xml);
958 rsc->xml = NULL;
959 }
960 if (rsc->running_on) {
961 g_list_free(rsc->running_on);
962 rsc->running_on = NULL;
963 }
964 if (rsc->known_on) {
965 g_hash_table_destroy(rsc->known_on);
966 rsc->known_on = NULL;
967 }
968 if (rsc->actions) {
969 g_list_free(rsc->actions);
970 rsc->actions = NULL;
971 }
972 if (rsc->allowed_nodes) {
973 g_hash_table_destroy(rsc->allowed_nodes);
974 rsc->allowed_nodes = NULL;
975 }
976 g_list_free(rsc->fillers);
977 g_list_free(rsc->rsc_location);
978 pe_rsc_trace(rsc, "Resource freed");
979 free(rsc->id);
980 free(rsc->clone_name);
981 free(rsc->allocated_to);
982 free(rsc->variant_opaque);
983 free(rsc->pending_task);
984 free(rsc);
985}
986
1002pe_node_t *
1003pe__find_active_on(const pe_resource_t *rsc, unsigned int *count_all,
1004 unsigned int *count_clean)
1005{
1006 pe_node_t *active = NULL;
1007 pe_node_t *node = NULL;
1008 bool keep_looking = FALSE;
1009 bool is_happy = FALSE;
1010
1011 if (count_all) {
1012 *count_all = 0;
1013 }
1014 if (count_clean) {
1015 *count_clean = 0;
1016 }
1017 if (rsc == NULL) {
1018 return NULL;
1019 }
1020
1021 for (GList *node_iter = rsc->running_on; node_iter != NULL;
1022 node_iter = node_iter->next) {
1023
1024 node = node_iter->data;
1025 keep_looking = FALSE;
1026
1027 is_happy = node->details->online && !node->details->unclean;
1028
1029 if (count_all) {
1030 ++*count_all;
1031 }
1032 if (count_clean && is_happy) {
1033 ++*count_clean;
1034 }
1035 if (count_all || count_clean) {
1036 // If we're counting, we need to go through entire list
1037 keep_looking = TRUE;
1038 }
1039
1040 if (rsc->partial_migration_source != NULL) {
1041 if (node->details == rsc->partial_migration_source->details) {
1042 // This is the migration source
1043 active = node;
1044 } else {
1045 keep_looking = TRUE;
1046 }
1047 } else if (!pcmk_is_set(rsc->flags, pe_rsc_needs_fencing)) {
1048 if (is_happy && (!active || !active->details->online
1049 || active->details->unclean)) {
1050 // This is the first clean node
1051 active = node;
1052 } else {
1053 keep_looking = TRUE;
1054 }
1055 }
1056 if (active == NULL) {
1057 // This is first node in list
1058 active = node;
1059 }
1060
1061 if (keep_looking == FALSE) {
1062 // Don't waste time iterating if we don't have to
1063 break;
1064 }
1065 }
1066 return active;
1067}
1068
1082pe_node_t *
1083pe__find_active_requires(const pe_resource_t *rsc, unsigned int *count)
1084{
1085 if (rsc && !pcmk_is_set(rsc->flags, pe_rsc_needs_fencing)) {
1086 return pe__find_active_on(rsc, NULL, count);
1087 }
1088 return pe__find_active_on(rsc, count, NULL);
1089}
1090
1091void
1093{
1094 if (rsc->children != NULL) {
1095 for (GList *item = rsc->children; item != NULL; item = item->next) {
1096 ((pe_resource_t *) item->data)->fns->count(item->data);
1097 }
1098
1099 } else if (!pcmk_is_set(rsc->flags, pe_rsc_orphan)
1100 || (rsc->role > RSC_ROLE_STOPPED)) {
1101 rsc->cluster->ninstances++;
1102 if (pe__resource_is_disabled(rsc)) {
1104 }
1105 if (pcmk_is_set(rsc->flags, pe_rsc_block)) {
1106 rsc->cluster->blocked_resources++;
1107 }
1108 }
1109}
1110
1119void
1120pe__set_next_role(pe_resource_t *rsc, enum rsc_role_e role, const char *why)
1121{
1122 CRM_ASSERT((rsc != NULL) && (why != NULL));
1123 if (rsc->next_role != role) {
1124 pe_rsc_trace(rsc, "Resetting next role for %s from %s to %s (%s)",
1125 rsc->id, role2text(rsc->next_role), role2text(role), why);
1126 rsc->next_role = role;
1127 }
1128}
#define PCMK_RESOURCE_CLASS_STONITH
Definition: agents.h:33
const char * parent
Definition: cib.c:25
const char * name
Definition: cib.c:24
char guint crm_parse_interval_spec(const char *input)
Parse milliseconds from a Pacemaker interval specification.
Definition: utils.c:271
int pcmk__add_scores(int score1, int score2)
Definition: scores.c:113
int char2score(const char *score)
Get the integer value of a score string.
Definition: scores.c:36
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
gboolean crm_is_true(const char *s)
Definition: strings.c:416
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
Definition: util.h:121
#define RSC_ROLE_UNPROMOTED_S
Definition: common.h:113
#define RSC_ROLE_STARTED_S
Definition: common.h:112
#define RSC_ROLE_UNPROMOTED_LEGACY_S
Definition: common.h:115
@ recovery_stop_start
Definition: common.h:79
@ recovery_block
Definition: common.h:81
@ recovery_stop_only
Definition: common.h:80
@ recovery_stop_unexpected
Definition: common.h:82
const char * role2text(enum rsc_role_e role)
Definition: common.c:454
rsc_role_e
Possible roles that a resource can be in.
Definition: common.h:92
@ RSC_ROLE_STOPPED
Definition: common.h:94
@ RSC_ROLE_UNKNOWN
Definition: common.h:93
#define RSC_ROLE_UNKNOWN_S
Definition: common.h:110
pe_resource_t * uber_parent(pe_resource_t *rsc)
Definition: complex.c:912
pe_node_t * pe__find_active_on(const pe_resource_t *rsc, unsigned int *count_all, unsigned int *count_clean)
Definition: complex.c:1003
void pe__count_common(pe_resource_t *rsc)
Definition: complex.c:1092
int pe__unpack_resource(xmlNode *xml_obj, pe_resource_t **rsc, pe_resource_t *parent, pe_working_set_t *data_set)
Definition: complex.c:562
void get_rsc_attributes(GHashTable *meta_hash, const pe_resource_t *rsc, const pe_node_t *node, pe_working_set_t *data_set)
Definition: complex.c:192
GHashTable * pe_rsc_params(pe_resource_t *rsc, const pe_node_t *node, pe_working_set_t *data_set)
Get a table of resource parameters.
Definition: complex.c:429
void populate_hash(xmlNode *nvpair_list, GHashTable *hash, const char **attrs, int attrs_length)
void pe__set_next_role(pe_resource_t *rsc, enum rsc_role_e role, const char *why)
Definition: complex.c:1120
pe_node_t * pe__find_active_requires(const pe_resource_t *rsc, unsigned int *count)
Definition: complex.c:1083
void get_meta_attributes(GHashTable *meta_hash, pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set)
Definition: complex.c:142
void common_update_score(pe_resource_t *rsc, const char *id, int score)
Definition: complex.c:873
gboolean is_parent(pe_resource_t *child, pe_resource_t *rsc)
Definition: complex.c:895
void common_free(pe_resource_t *rsc)
Definition: complex.c:926
resource_object_functions_t resource_class_functions[]
Definition: complex.c:21
char data[0]
Definition: cpg.c:10
#define INFINITY
Definition: crm.h:99
#define crm_crit(fmt, args...)
Definition: logging.h:358
#define CRM_CHECK(expr, failure_action)
Definition: logging.h:227
#define crm_log_xml_trace(xml, text)
Definition: logging.h:373
#define LOG_TRACE
Definition: logging.h:37
#define pcmk__config_warn(fmt...)
#define pcmk__config_err(fmt...)
#define XML_CIB_TAG_RESOURCES
Definition: msg_xml.h:186
#define ID(x)
Definition: msg_xml.h:468
#define XML_BOOLEAN_TRUE
Definition: msg_xml.h:146
#define XML_EXPR_ATTR_TYPE
Definition: msg_xml.h:348
#define XML_CIB_TAG_CONTAINER
Definition: msg_xml.h:220
#define XML_CIB_ATTR_PRIORITY
Definition: msg_xml.h:275
#define XML_RSC_ATTR_MANAGED
Definition: msg_xml.h:235
#define XML_RSC_ATTR_REQUIRES
Definition: msg_xml.h:243
#define XML_RSC_ATTR_CONTAINER
Definition: msg_xml.h:244
#define XML_RSC_ATTR_NOTIFY
Definition: msg_xml.h:238
#define XML_RSC_ATTR_MAINTENANCE
Definition: msg_xml.h:246
#define PCMK_XE_PROMOTABLE_LEGACY
Definition: msg_xml.h:39
#define XML_RSC_ATTR_STICKINESS
Definition: msg_xml.h:239
#define XML_TAG_ATTR_SETS
Definition: msg_xml.h:209
#define XML_CIB_TAG_INCARNATION
Definition: msg_xml.h:219
#define XML_ATTR_ID
Definition: msg_xml.h:134
#define XML_RSC_ATTR_FAIL_STICKINESS
Definition: msg_xml.h:240
#define XML_RSC_ATTR_RESTART
Definition: msg_xml.h:225
#define XML_OP_ATTR_ALLOW_MIGRATE
Definition: msg_xml.h:259
#define XML_AGENT_ATTR_PROVIDER
Definition: msg_xml.h:270
#define XML_RSC_ATTR_INCARNATION
Definition: msg_xml.h:228
#define XML_AGENT_ATTR_CLASS
Definition: msg_xml.h:269
#define XML_TAG_META_SETS
Definition: msg_xml.h:210
#define XML_CIB_TAG_RSC_TEMPLATE
Definition: msg_xml.h:222
#define XML_RSC_ATTR_FAIL_TIMEOUT
Definition: msg_xml.h:241
#define XML_RSC_ATTR_MULTIPLE
Definition: msg_xml.h:242
#define XML_CIB_TAG_GROUP
Definition: msg_xml.h:218
#define XML_RSC_ATTR_UNIQUE
Definition: msg_xml.h:237
#define XML_TAG_UTILIZATION
Definition: msg_xml.h:214
#define XML_CIB_TAG_RESOURCE
Definition: msg_xml.h:217
#define XML_RSC_ATTR_CRITICAL
Definition: msg_xml.h:253
#define XML_RSC_ATTR_PROMOTABLE
Definition: msg_xml.h:232
#define XML_REMOTE_ATTR_RECONNECT_INTERVAL
Definition: msg_xml.h:255
pe_working_set_t * data_set
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
Definition: nvpair.c:517
const char * crm_xml_replace(xmlNode *node, const char *name, const char *value)
Replace an XML attribute with specified name and (possibly NULL) value.
Definition: nvpair.c:368
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
Definition: nvpair.c:323
#define PCMK__VALUE_UNFENCING
#define PCMK__VALUE_NOTHING
#define PCMK__VALUE_FENCING
#define PCMK__VALUE_QUORUM
@ no_quorum_ignore
Definition: pe_types.h:66
#define pe_rsc_notify
Definition: pe_types.h:261
#define pe_rsc_runnable
Definition: pe_types.h:277
#define pe_rsc_needs_quorum
Definition: pe_types.h:293
#define pe_rsc_fence_device
Definition: pe_types.h:263
#define pe_flag_have_stonith_resource
Definition: pe_types.h:100
#define pe_rsc_needs_unfencing
Definition: pe_types.h:295
#define pe_rsc_block
Definition: pe_types.h:258
#define pe_rsc_managed
Definition: pe_types.h:257
#define pe_flag_maintenance_mode
Definition: pe_types.h:97
#define pe_rsc_provisional
Definition: pe_types.h:266
#define pe_flag_enable_unfencing
Definition: pe_types.h:101
#define pe_flag_symmetric_cluster
Definition: pe_types.h:96
#define pe_rsc_unique
Definition: pe_types.h:262
#define pe_rsc_orphan
Definition: pe_types.h:256
#define pe_rsc_allow_migrate
Definition: pe_types.h:287
pe_obj_types
Definition: pe_types.h:36
@ pe_group
Definition: pe_types.h:39
@ pe_container
Definition: pe_types.h:41
@ pe_unknown
Definition: pe_types.h:37
@ pe_native
Definition: pe_types.h:38
@ pe_clone
Definition: pe_types.h:40
#define pe_flag_stonith_enabled
Definition: pe_types.h:99
#define pe_rsc_needs_fencing
Definition: pe_types.h:294
#define pe_rsc_maintenance
Definition: pe_types.h:290
#define pe_rsc_promotable
Definition: pe_types.h:264
#define pe_rsc_critical
Definition: pe_types.h:274
@ pe_restart_ignore
Definition: pe_types.h:80
@ pe_restart_restart
Definition: pe_types.h:79
pe_resource_t * native_find_rsc(pe_resource_t *rsc, const char *id, const pe_node_t *node, int flags)
Definition: native.c:264
#define pe_warn_once(pe_wo_bit, fmt...)
Definition: internal.h:172
void pe__free_bundle(pe_resource_t *rsc)
Definition: bundle.c:1714
gboolean pe__native_is_filtered(pe_resource_t *rsc, GList *only_rsc, gboolean check_parent)
Definition: native.c:1376
void clone_print(pe_resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: clone.c:531
gboolean group_active(pe_resource_t *rsc, gboolean all)
Definition: group.c:226
gboolean group_unpack(pe_resource_t *rsc, pe_working_set_t *data_set)
Definition: group.c:171
void pe__unpack_dataset_nvpairs(const xmlNode *xml_obj, const char *set_name, pe_rule_eval_data_t *rule_data, GHashTable *hash, const char *always_first, gboolean overwrite, pe_working_set_t *data_set)
Definition: utils.c:717
bool pe__resource_is_disabled(pe_resource_t *rsc)
Definition: utils.c:735
void pe__count_bundle(pe_resource_t *rsc)
Definition: bundle.c:1775
char * native_parameter(pe_resource_t *rsc, pe_node_t *node, gboolean create, const char *name, pe_working_set_t *data_set)
Definition: native.c:318
gboolean clone_active(pe_resource_t *rsc, gboolean all)
Definition: clone.c:383
enum rsc_role_e clone_resource_state(const pe_resource_t *rsc, gboolean current)
Definition: clone.c:1132
void clone_free(pe_resource_t *rsc)
Definition: clone.c:1098
gboolean get_target_role(pe_resource_t *rsc, enum rsc_role_e *role)
Definition: utils.c:436
gboolean pe__clone_is_filtered(pe_resource_t *rsc, GList *only_rsc, gboolean check_parent)
Definition: clone.c:1173
#define pe__clear_resource_flags(resource, flags_to_clear)
Definition: internal.h:80
gboolean pe__bundle_is_filtered(pe_resource_t *rsc, GList *only_rsc, gboolean check_parent)
Definition: bundle.c:1799
#define pe_warn(fmt...)
Definition: internal.h:54
@ pe_wo_neg_threshold
Definition: internal.h:161
@ pe_wo_restart_type
Definition: internal.h:156
gboolean clone_unpack(pe_resource_t *rsc, pe_working_set_t *data_set)
Definition: clone.c:236
#define pe_rsc_trace(rsc, fmt, args...)
Definition: internal.h:47
gboolean pe__group_is_filtered(pe_resource_t *rsc, GList *only_rsc, gboolean check_parent)
Definition: group.c:473
gboolean native_active(pe_resource_t *rsc, gboolean all)
Definition: native.c:340
void group_free(pe_resource_t *rsc)
Definition: group.c:433
pe_node_t * native_location(const pe_resource_t *rsc, GList **list, int current)
Definition: native.c:1068
void native_print(pe_resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: native.c:891
void resource_location(pe_resource_t *rsc, pe_node_t *node, int score, const char *tag, pe_working_set_t *data_set)
Definition: utils.c:385
#define pe__set_resource_flags(resource, flags_to_set)
Definition: internal.h:74
gboolean pe__bundle_active(pe_resource_t *rsc, gboolean all)
Definition: bundle.c:1092
gboolean native_unpack(pe_resource_t *rsc, pe_working_set_t *data_set)
Definition: native.c:198
void native_free(pe_resource_t *rsc)
Definition: native.c:1038
enum rsc_role_e native_resource_state(const pe_resource_t *rsc, gboolean current)
Definition: native.c:1045
enum rsc_role_e group_resource_state(const pe_resource_t *rsc, gboolean current)
Definition: group.c:454
enum rsc_role_e pe__bundle_resource_state(const pe_resource_t *rsc, gboolean current)
Definition: bundle.c:1748
gboolean pe__unpack_bundle(pe_resource_t *rsc, pe_working_set_t *data_set)
Definition: bundle.c:754
void group_print(pe_resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: group.c:280
void pe__print_bundle(pe_resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: bundle.c:1612
gboolean add_tag_ref(GHashTable *tags, const char *tag_name, const char *obj_ref)
Definition: utils.c:639
#define pe__set_working_set_flags(working_set, flags_to_set)
Definition: internal.h:62
#define pe_err(fmt...)
Definition: internal.h:49
void add_hash_param(GHashTable *hash, const char *name, const char *value)
Definition: common.c:504
bool xml_contains_remote_node(xmlNode *xml)
Definition: remote.c:84
#define CRM_ASSERT(expr)
Definition: results.h:42
@ pcmk_rc_ok
Definition: results.h:148
@ pcmk_rc_unpack_error
Definition: results.h:112
GHashTable * pcmk__strkey_table(GDestroyNotify key_destroy_func, GDestroyNotify value_destroy_func)
Definition: strings.c:611
bool pcmk__strcase_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
Definition: strings.c:928
@ pcmk__str_none
@ pcmk__str_null_matches
@ pcmk__str_casei
GHashTable * pcmk__strikey_table(GDestroyNotify key_destroy_func, GDestroyNotify value_destroy_func)
Definition: strings.c:649
int weight
Definition: pe_types.h:249
struct pe_node_shared_s * details
Definition: pe_types.h:252
GHashTable * attrs
Definition: pe_types.h:241
gboolean online
Definition: pe_types.h:220
const char * uname
Definition: pe_types.h:216
gboolean unclean
Definition: pe_types.h:224
GList * running_on
Definition: pe_types.h:373
GList * actions
Definition: pe_types.h:366
GList * rsc_location
Definition: pe_types.h:365
enum pe_obj_types variant
Definition: pe_types.h:338
GHashTable * meta
Definition: pe_types.h:380
GList * rsc_cons
Definition: pe_types.h:364
GList * rsc_cons_lhs
Definition: pe_types.h:363
GList * children
Definition: pe_types.h:384
GHashTable * known_on
Definition: pe_types.h:374
pe_working_set_t * cluster
Definition: pe_types.h:335
char * clone_name
Definition: pe_types.h:330
char * id
Definition: pe_types.h:329
xmlNode * xml
Definition: pe_types.h:331
GHashTable * utilization
Definition: pe_types.h:382
GHashTable * allowed_nodes
Definition: pe_types.h:375
GList * dangling_migrations
Definition: pe_types.h:385
GHashTable * parameter_cache
Definition: pe_types.h:399
pe_node_t * partial_migration_source
Definition: pe_types.h:372
GList * rsc_tickets
Definition: pe_types.h:367
pe_node_t * allocated_to
Definition: pe_types.h:370
void * variant_opaque
Definition: pe_types.h:339
unsigned long long flags
Definition: pe_types.h:355
char * pending_task
Definition: pe_types.h:353
pe_resource_t * parent
Definition: pe_types.h:336
GList * fillers
Definition: pe_types.h:388
xmlNode * orig_xml
Definition: pe_types.h:332
enum rsc_role_e next_role
Definition: pe_types.h:378
enum rsc_role_e role
Definition: pe_types.h:377
const char * standard
Definition: common.h:183
GHashTable * node_hash
Definition: common.h:194
crm_time_t * now
Definition: common.h:196
int blocked_resources
Definition: pe_types.h:189
GHashTable * template_rsc_sets
Definition: pe_types.h:185
xmlNode * input
Definition: pe_types.h:144
int disabled_resources
Definition: pe_types.h:190
unsigned long long flags
Definition: pe_types.h:153
xmlNode * rsc_defaults
Definition: pe_types.h:174
enum pe_quorum_policy no_quorum_policy
Definition: pe_types.h:156
crm_time_t * now
Definition: pe_types.h:145
xmlNode * expand_idref(xmlNode *input, xmlNode *top)
Definition: xml.c:3002
xmlNode * get_xpath_object(const char *xpath, xmlNode *xml_obj, int error_level)
Definition: xpath.c:214
void free_xml(xmlNode *child)
Definition: xml.c:885
xmlNode * find_xml_node(const xmlNode *root, const char *search_path, gboolean must_find)
Definition: xml.c:470
xmlNode * add_node_copy(xmlNode *new_parent, xmlNode *xml_node)
Definition: xml.c:727
xmlNode * copy_xml(xmlNode *src_node)
Definition: xml.c:891
xmlNode * pcmk__xe_match(const xmlNode *parent, const char *node_name, const char *attr_n, const char *attr_v)
Definition: xml.c:520