35 #define set_config_flag(data_set, option, flag) do { \ 36 const char *scf_value = pe_pref((data_set)->config_hash, (option)); \ 37 if (scf_value != NULL) { \ 38 if (crm_is_true(scf_value)) { \ 39 (data_set)->flags = pcmk__set_flags_as(__func__, __LINE__, \ 40 LOG_TRACE, "Working set", \ 41 crm_system_name, (data_set)->flags, \ 44 (data_set)->flags = pcmk__clear_flags_as(__func__, __LINE__,\ 45 LOG_TRACE, "Working set", \ 46 crm_system_name, (data_set)->flags, \ 53 xmlNode **last_failure,
58 static void add_node_attrs(xmlNode *attrs,
pe_node_t *node,
bool overwrite,
60 static void determine_online_status(xmlNode *node_state,
pe_node_t *this_node,
63 static void unpack_lrm_resources(
pe_node_t *node, xmlNode *lrm_state,
98 const char *reason,
bool priority_delay)
109 "(otherwise would because %s): " 110 "its guest resource %s is unmanaged",
113 crm_warn(
"Guest node %s will be fenced " 114 "(by recovering its guest resource %s): %s",
126 }
else if (is_dangling_guest_node(node)) {
127 crm_info(
"Cleaning up dangling connection for guest node %s: " 128 "fencing was already done because %s, " 129 "and guest resource no longer exists",
139 "(otherwise would because %s): connection is unmanaged",
145 pe_can_fence(data_set, node)?
"will be fenced" :
"is unclean",
150 pe_fence_op(node, NULL, TRUE, reason, FALSE, data_set);
153 crm_trace(
"Cluster node %s %s because %s",
155 pe_can_fence(data_set, node)?
"would also be fenced" :
"also is unclean",
161 pe_can_fence(data_set, node)?
"will be fenced" :
"is unclean",
164 pe_fence_op(node, NULL, TRUE, reason, priority_delay, data_set);
171 #define XPATH_UNFENCING_NVPAIR XML_CIB_TAG_NVPAIR \ 172 "[(@" XML_NVPAIR_ATTR_NAME "='" XML_RSC_ATTR_PROVIDES "'" \ 173 "or @" XML_NVPAIR_ATTR_NAME "='" XML_RSC_ATTR_REQUIRES "') " \ 174 "and @" XML_NVPAIR_ATTR_VALUE "='unfencing']" 177 #define XPATH_ENABLE_UNFENCING \ 178 "/" XML_TAG_CIB "/" XML_CIB_TAG_CONFIGURATION "/" XML_CIB_TAG_RESOURCES \ 179 "//" XML_TAG_META_SETS "/" XPATH_UNFENCING_NVPAIR \ 180 "|/" XML_TAG_CIB "/" XML_CIB_TAG_CONFIGURATION "/" XML_CIB_TAG_RSCCONFIG \ 181 "/" XML_TAG_META_SETS "/" XPATH_UNFENCING_NVPAIR 186 xmlXPathObjectPtr result = NULL;
190 if (result && (numXpathResults(result) > 0)) {
200 const char *value = NULL;
201 GHashTable *config_hash = crm_str_table_new();
206 .now = data_set->
now,
221 crm_info(
"Startup probes: disabled (dangerous)");
226 crm_info(
"Watchdog-based self-fencing will be performed via SBD if " 227 "fencing is required and stonith-watchdog-timeout is nonzero");
241 crm_debug(
"STONITH of failed nodes is %s",
247 "Support for stonith-action of 'poweroff' is deprecated " 248 "and will be removed in a future release (use 'off' instead)");
265 crm_debug(
"Stop all active resources: %s",
270 crm_debug(
"Cluster is symmetric" " - resources can run anywhere by default");
293 crm_notice(
"Resetting no-quorum-policy to 'stop': cluster has never had quorum");
298 "fencing is disabled");
308 crm_debug(
"On loss of quorum: Freeze resources");
311 crm_debug(
"On loss of quorum: Stop ALL resources");
315 "Demote promotable resources and stop other resources");
318 crm_notice(
"On loss of quorum: Fence all remaining nodes");
330 crm_trace(
"Orphan resource actions are %s",
334 crm_trace(
"Stopped resources are removed from the status section: %s",
349 crm_trace(
"Unseen nodes will be fenced");
358 crm_debug(
"Node scores: 'red' = %s, 'yellow' = %s, 'green' = %s",
367 crm_trace(
"Resources will%s be locked to cleanly shut down nodes",
380 destroy_digest_cache(gpointer ptr)
388 free(
data->digest_all_calc);
389 free(
data->digest_restart_calc);
390 free(
data->digest_secure_calc);
406 if (new_node == NULL) {
411 new_node->
fixed = FALSE;
414 if (new_node->
details == NULL) {
449 destroy_digest_cache);
458 xmlNode *attr_set = NULL;
459 xmlNode *attr = NULL;
461 const char *container_id =
ID(xml_obj);
462 const char *remote_name = NULL;
463 const char *remote_server = NULL;
464 const char *remote_port = NULL;
465 const char *connect_timeout =
"60s";
466 const char *remote_allow_migrate=NULL;
467 const char *is_managed = NULL;
469 for (attr_set = pcmk__xe_first_child(xml_obj); attr_set != NULL;
470 attr_set = pcmk__xe_next(attr_set)) {
477 for (attr = pcmk__xe_first_child(attr_set); attr != NULL;
478 attr = pcmk__xe_next(attr)) {
485 remote_server = value;
489 connect_timeout = value;
491 remote_allow_migrate=value;
498 if (remote_name == NULL) {
507 remote_allow_migrate, is_managed,
508 connect_timeout, remote_server, remote_port);
540 xmlNode *xml_obj = NULL;
542 const char *
id = NULL;
543 const char *
uname = NULL;
544 const char *
type = NULL;
545 const char *score = NULL;
550 .now = data_set->
now,
556 for (xml_obj = pcmk__xe_first_child(xml_nodes); xml_obj != NULL;
557 xml_obj = pcmk__xe_next(xml_obj)) {
570 "> entry in configuration without id");
575 if (new_node == NULL) {
585 handle_startup_fencing(data_set, new_node);
587 add_node_attrs(xml_obj, new_node, FALSE, data_set);
597 crm_info(
"Creating a fake local node");
608 const char *container_id = NULL;
613 for (; gIter != NULL; gIter = gIter->next) {
616 setup_container(child_rsc, data_set);
629 pe_rsc_trace(rsc,
"Resource %s's container is %s", rsc->
id, container_id);
631 pe_err(
"Resource %s: Unknown resource container (%s)", rsc->
id, container_id);
639 xmlNode *xml_obj = NULL;
644 for (xml_obj = pcmk__xe_first_child(xml_resources); xml_obj != NULL;
645 xml_obj = pcmk__xe_next(xml_obj)) {
647 const char *new_node_id = NULL;
653 new_node_id =
ID(xml_obj);
657 crm_trace(
"Found remote node %s defined by resource %s",
658 new_node_id,
ID(xml_obj));
673 new_node_id = expand_remote_rsc_meta(xml_obj, xml_resources, data_set);
675 crm_trace(
"Found guest node %s in resource %s",
676 new_node_id,
ID(xml_obj));
687 xmlNode *xml_obj2 = NULL;
688 for (xml_obj2 = pcmk__xe_first_child(xml_obj); xml_obj2 != NULL;
689 xml_obj2 = pcmk__xe_next(xml_obj2)) {
691 new_node_id = expand_remote_rsc_meta(xml_obj2, xml_resources, data_set);
694 crm_trace(
"Found guest node %s in resource %s inside group %s",
695 new_node_id,
ID(xml_obj2),
ID(xml_obj));
730 pe_rsc_trace(new_rsc,
"Linking remote connection resource %s to node %s",
738 handle_startup_fencing(data_set, remote_node);
745 strdup(
"container"));
750 destroy_tag(gpointer
data)
756 g_list_free_full(tag->
refs, free);
776 xmlNode *xml_obj = NULL;
783 for (xml_obj = pcmk__xe_first_child(xml_resources); xml_obj != NULL;
784 xml_obj = pcmk__xe_next(xml_obj)) {
789 const char *template_id =
ID(xml_obj);
792 template_id, NULL, NULL) == FALSE) {
799 crm_trace(
"Beginning unpack... <%s id=%s... >", crm_element_name(xml_obj),
ID(xml_obj));
800 if (
common_unpack(xml_obj, &new_rsc, NULL, data_set) && (new_rsc != NULL)) {
806 "because configuration is invalid",
807 crm_element_name(xml_obj),
crm_str(
ID(xml_obj)));
808 if (new_rsc != NULL && new_rsc->
fns != NULL) {
814 for (gIter = data_set->
resources; gIter != NULL; gIter = gIter->next) {
817 setup_container(rsc, data_set);
818 link_rsc2remotenode(data_set, rsc);
828 pcmk__config_err(
"Resource start-up disabled since no STONITH resources have been defined");
829 pcmk__config_err(
"Either configure some or disable STONITH with the stonith-enabled option");
830 pcmk__config_err(
"NOTE: Clusters with shared data need STONITH to ensure data integrity");
839 xmlNode *xml_tag = NULL;
844 for (xml_tag = pcmk__xe_first_child(xml_tags); xml_tag != NULL;
845 xml_tag = pcmk__xe_next(xml_tag)) {
847 xmlNode *xml_obj_ref = NULL;
848 const char *tag_id =
ID(xml_tag);
854 if (tag_id == NULL) {
856 crm_element_name(xml_tag));
860 for (xml_obj_ref = pcmk__xe_first_child(xml_tag); xml_obj_ref != NULL;
861 xml_obj_ref = pcmk__xe_next(xml_obj_ref)) {
863 const char *obj_ref =
ID(xml_obj_ref);
869 if (obj_ref == NULL) {
871 crm_element_name(xml_obj_ref), tag_id);
889 const char *ticket_id = NULL;
890 const char *granted = NULL;
891 const char *last_granted = NULL;
892 const char *standby = NULL;
893 xmlAttrPtr xIter = NULL;
897 ticket_id =
ID(xml_ticket);
898 if (pcmk__str_empty(ticket_id)) {
902 crm_trace(
"Processing ticket state for %s", ticket_id);
904 ticket = g_hash_table_lookup(data_set->
tickets, ticket_id);
905 if (ticket == NULL) {
907 if (ticket == NULL) {
912 for (xIter = xml_ticket->properties; xIter; xIter = xIter->next) {
913 const char *prop_name = (
const char *)xIter->name;
919 g_hash_table_replace(ticket->
state, strdup(prop_name), strdup(prop_value));
922 granted = g_hash_table_lookup(ticket->
state,
"granted");
928 crm_info(
"We do not have ticket '%s'", ticket->
id);
931 last_granted = g_hash_table_lookup(ticket->
state,
"last-granted");
936 standby = g_hash_table_lookup(ticket->
state,
"standby");
940 crm_info(
"Granted ticket '%s' is in standby-mode", ticket->
id);
946 crm_trace(
"Done with ticket state for %s", ticket_id);
954 xmlNode *xml_obj = NULL;
956 for (xml_obj = pcmk__xe_first_child(xml_tickets); xml_obj != NULL;
957 xml_obj = pcmk__xe_next(xml_obj)) {
962 unpack_ticket_state(xml_obj, data_set);
971 const char *resource_discovery_enabled = NULL;
972 xmlNode *attrs = NULL;
993 add_node_attrs(attrs, this_node, TRUE, data_set);
1015 if (resource_discovery_enabled && !
crm_is_true(resource_discovery_enabled)) {
1018 crm_warn(
"Ignoring %s attribute on remote node %s because stonith is disabled",
1033 unpack_node_loop(xmlNode * status,
bool fence,
pe_working_set_t * data_set)
1035 bool changed =
false;
1036 xmlNode *lrm_rsc = NULL;
1038 for (xmlNode *state = pcmk__xe_first_child(status); state != NULL;
1039 state = pcmk__xe_next(state)) {
1041 const char *
id = NULL;
1042 const char *
uname = NULL;
1044 bool process = FALSE;
1054 if (this_node == NULL) {
1055 crm_info(
"Node %s is unknown",
id);
1059 crm_trace(
"Node %s was already processed",
id);
1074 }
else if(rsc == NULL) {
1094 determine_remote_online_status(data_set, this_node);
1095 unpack_handle_remote_attrs(this_node, state, data_set);
1110 crm_trace(
"Processing lrm resource entries on %shealthy%s node: %s",
1119 unpack_lrm_resources(this_node, lrm_rsc, data_set);
1131 const char *
id = NULL;
1132 const char *
uname = NULL;
1134 xmlNode *state = NULL;
1139 if (data_set->
tickets == NULL) {
1144 for (state = pcmk__xe_first_child(status); state != NULL;
1145 state = pcmk__xe_next(state)) {
1148 unpack_tickets_state((xmlNode *) state, data_set);
1151 xmlNode *attrs = NULL;
1152 const char *resource_discovery_enabled = NULL;
1158 if (
uname == NULL) {
1162 }
else if (this_node == NULL) {
1164 "because no longer in configuration",
uname);
1185 add_node_attrs(attrs, this_node, TRUE, data_set);
1198 if (resource_discovery_enabled && !
crm_is_true(resource_discovery_enabled)) {
1199 crm_warn(
"ignoring %s attribute on node %s, disabling resource discovery is not allowed on cluster nodes",
1204 determine_online_status(state, this_node, data_set);
1213 pe_fence_node(data_set, this_node,
"cluster does not have quorum", FALSE);
1219 while(unpack_node_loop(status, FALSE, data_set)) {
1224 unpack_node_loop(status,
1232 for (GList *item = data_set->
stop_needed; item; item = item->next) {
1234 pe_node_t *node = pe__current_node(container);
1244 for (
GListPtr gIter = data_set->
nodes; gIter != NULL; gIter = gIter->next) {
1247 if (this_node == NULL) {
1254 determine_remote_online_status(data_set, this_node);
1261 determine_online_status_no_fencing(
pe_working_set_t * data_set, xmlNode * node_state,
1264 gboolean online = FALSE;
1277 crm_debug(
"Node is not ready to run resources: %s", join);
1282 crm_trace(
"\tis_peer=%s, join=%s, expected=%s",
1287 pe_fence_node(data_set, this_node,
"peer is unexpectedly down", FALSE);
1288 crm_info(
"\tin_cluster=%s, is_peer=%s, join=%s, expected=%s",
1295 determine_online_status_fencing(
pe_working_set_t * data_set, xmlNode * node_state,
1298 gboolean online = FALSE;
1299 gboolean do_terminate = FALSE;
1300 bool crmd_online = FALSE;
1315 do_terminate = TRUE;
1317 }
else if (terminate != NULL && strlen(terminate) > 0) {
1319 char t = terminate[0];
1321 if (t !=
'0' && isdigit(t)) {
1322 do_terminate = TRUE;
1326 crm_trace(
"%s: in_cluster=%s, is_peer=%s, join=%s, expected=%s, term=%d",
1332 if (exp_state == NULL) {
1340 online = crmd_online;
1342 }
else if (in_cluster == NULL) {
1343 pe_fence_node(data_set, this_node,
"peer has not been seen by the cluster", FALSE);
1346 pe_fence_node(data_set, this_node,
"peer failed the pacemaker membership criteria", FALSE);
1360 &&
crm_is_true(in_cluster) == FALSE && !crmd_online) {
1366 pe_fence_node(data_set, this_node,
"peer is no longer part of the cluster", TRUE);
1368 }
else if (!crmd_online) {
1369 pe_fence_node(data_set, this_node,
"peer process is no longer available", FALSE);
1372 }
else if (do_terminate) {
1373 pe_fence_node(data_set, this_node,
"termination was requested", FALSE);
1384 pe_fence_node(data_set, this_node,
"peer was in an unknown state", FALSE);
1385 crm_warn(
"%s: in-cluster=%s, is-peer=%s, join=%s, expected=%s, term=%d, shutdown=%d",
1406 goto remote_online_done;
1411 if (container && pcmk__list_of_1(rsc->
running_on)) {
1417 crm_trace(
"%s node %s presumed ONLINE because connection resource is started",
1418 (container?
"Guest" :
"Remote"), this_node->
details->
id);
1424 crm_trace(
"%s node %s shutting down because connection resource is stopping",
1425 (container?
"Guest" :
"Remote"), this_node->
details->
id);
1431 crm_trace(
"Guest node %s UNCLEAN because guest resource failed",
1437 crm_trace(
"%s node %s OFFLINE because connection resource failed",
1438 (container?
"Guest" :
"Remote"), this_node->
details->
id);
1444 crm_trace(
"%s node %s OFFLINE because its resource is stopped",
1445 (container?
"Guest" :
"Remote"), this_node->
details->
id);
1449 }
else if (
host && (
host->details->online == FALSE)
1450 &&
host->details->unclean) {
1451 crm_trace(
"Guest node %s UNCLEAN because host is unclean",
1465 gboolean online = FALSE;
1488 online = determine_online_status_no_fencing(data_set, node_state, this_node);
1491 online = determine_online_status_fencing(data_set, node_state, this_node);
1499 this_node->
fixed = TRUE;
1505 this_node->
fixed = TRUE;
1538 if (!pcmk__str_empty(
id)) {
1539 const char *end =
id + strlen(
id) - 1;
1541 for (
const char *s = end; s >
id; --s) {
1555 return (s == end)? s : (s - 1);
1579 char *basename = NULL;
1582 basename =
strndup(last_rsc_id, end - last_rsc_id + 1);
1601 size_t base_name_len = end - last_rsc_id + 1;
1605 zero = calloc(base_name_len + 3,
sizeof(
char));
1607 memcpy(zero, last_rsc_id, base_name_len);
1608 zero[base_name_len] =
':';
1609 zero[base_name_len + 1] =
'0';
1614 create_fake_resource(
const char *rsc_id, xmlNode * rsc_entry,
pe_working_set_t * data_set)
1630 crm_debug(
"Detected orphaned remote node %s", rsc_id);
1635 link_rsc2remotenode(data_set, rsc);
1638 crm_trace(
"Setting node %s as shutting down due to orphaned connection resource", rsc_id);
1645 crm_trace(
"Detected orphaned container filler %s", rsc_id);
1658 create_anonymous_orphan(
pe_resource_t *parent,
const char *rsc_id,
1666 pe_rsc_debug(parent,
"Created orphan %s for %s: %s on %s",
1692 gboolean skip_inactive = FALSE;
1700 for (rIter = parent->
children; rsc == NULL && rIter; rIter = rIter->next) {
1745 crm_notice(
"Active (now-)anonymous clone %s has " 1746 "multiple (orphan) instance histories on %s",
1748 skip_inactive = TRUE;
1755 g_list_free(locations);
1759 if (!skip_inactive && !inactive_instance
1762 inactive_instance = parent->
fns->
find_rsc(child, rsc_id, NULL,
1768 if (inactive_instance && inactive_instance->
pending_node 1770 inactive_instance = NULL;
1776 if ((rsc == NULL) && !skip_inactive && (inactive_instance != NULL)) {
1777 pe_rsc_trace(parent,
"Resource %s, empty slot", inactive_instance->
id);
1778 rsc = inactive_instance;
1802 rsc = create_anonymous_orphan(parent, rsc_id, node, data_set);
1810 xmlNode * rsc_entry)
1829 crm_trace(
"%s found as %s (%s)", rsc_id, clone0_id, parent->
id);
1831 crm_trace(
"%s is not known as %s either (orphan)",
1837 crm_trace(
"Resource history for %s is orphaned because it is no longer primitive",
1845 if (pe_rsc_is_anon_clone(parent)) {
1847 if (pe_rsc_is_bundled(parent)) {
1852 rsc = find_anonymous_clone(data_set, node, parent, base);
1863 pe_rsc_debug(rsc,
"Internally renamed %s on %s to %s%s",
1877 rsc = create_fake_resource(rsc_id, rsc_entry, data_set);
1896 char *reason = NULL;
1899 pe_rsc_trace(rsc,
"Resource %s is %s on %s: on_fail=%s",
1927 gboolean should_fence = FALSE;
1938 should_fence = TRUE;
1952 " revoked if remote connection can " 1953 "be re-established elsewhere)",
1956 should_fence = TRUE;
1960 if (reason == NULL) {
2027 if (rsc->
container && pe_rsc_is_bundled(rsc)) {
2057 "remote connection is unrecoverable", FALSE);
2092 "%s because cluster is configured not to " 2093 "stop active orphans",
2124 for (; gIter != NULL; gIter = gIter->next) {
2130 g_list_free(possible_matches);
2137 int start_index,
int stop_index,
2141 const char *task = NULL;
2142 const char *status = NULL;
2146 pe_rsc_trace(rsc,
"%s: Start index %d, stop index = %d", rsc->
id, start_index, stop_index);
2148 for (; gIter != NULL; gIter = gIter->next) {
2149 xmlNode *rsc_op = (xmlNode *) gIter->data;
2151 guint interval_ms = 0;
2153 const char *
id =
ID(rsc_op);
2162 }
else if (start_index < stop_index && counter <= stop_index) {
2166 }
else if (counter < start_index) {
2172 if (interval_ms == 0) {
2194 int implied_monitor_start = -1;
2195 int implied_clone_start = -1;
2196 const char *task = NULL;
2197 const char *status = NULL;
2203 for (; gIter != NULL; gIter = gIter->next) {
2204 xmlNode *rsc_op = (xmlNode *) gIter->data;
2213 *stop_index = counter;
2216 *start_index = counter;
2222 implied_monitor_start = counter;
2225 implied_clone_start = counter;
2229 if (*start_index == -1) {
2230 if (implied_clone_start != -1) {
2231 *start_index = implied_clone_start;
2232 }
else if (implied_monitor_start != -1) {
2233 *start_index = implied_monitor_start;
2243 time_t lock_time = 0;
2246 &lock_time) ==
pcmk_ok) && (lock_time != 0)) {
2251 pe_rsc_info(rsc,
"Shutdown lock for %s on %s expired",
2265 int stop_index = -1;
2266 int start_index = -1;
2269 const char *task = NULL;
2276 xmlNode *migrate_op = NULL;
2277 xmlNode *rsc_op = NULL;
2278 xmlNode *last_failure = NULL;
2284 crm_element_name(rsc_entry), rsc_id, node->
details->
uname);
2288 sorted_op_list = NULL;
2290 for (rsc_op = pcmk__xe_first_child(rsc_entry); rsc_op != NULL;
2291 rsc_op = pcmk__xe_next(rsc_op)) {
2295 op_list = g_list_prepend(op_list, rsc_op);
2300 if (op_list == NULL) {
2307 rsc = unpack_find_resource(data_set, node, rsc_id, rsc_entry);
2309 if (op_list == NULL) {
2313 rsc = process_orphan_resource(rsc_entry, node, data_set);
2320 unpack_shutdown_lock(rsc_entry, rsc, node, data_set);
2324 saved_role = rsc->
role;
2328 for (gIter = sorted_op_list; gIter != NULL; gIter = gIter->next) {
2329 xmlNode *rsc_op = (xmlNode *) gIter->data;
2333 migrate_op = rsc_op;
2336 unpack_rsc_op(rsc, node, rsc_op, &last_failure, &on_fail, data_set);
2341 process_recurring(node, rsc, start_index, stop_index, sorted_op_list, data_set);
2344 g_list_free(sorted_op_list);
2346 process_rsc_state(rsc, node, on_fail, migrate_op, data_set);
2350 pe_rsc_debug(rsc,
"%s: Overwriting calculated next role %s" 2351 " with requested next role %s",
2356 pe_rsc_info(rsc,
"%s: Not overwriting calculated next role %s" 2357 " with requested next role %s",
2362 if (saved_role > rsc->
role) {
2363 rsc->
role = saved_role;
2370 handle_orphaned_container_fillers(xmlNode * lrm_rsc_list,
pe_working_set_t * data_set)
2372 xmlNode *rsc_entry = NULL;
2373 for (rsc_entry = pcmk__xe_first_child(lrm_rsc_list); rsc_entry != NULL;
2374 rsc_entry = pcmk__xe_next(rsc_entry)) {
2379 const char *container_id;
2387 if (container_id == NULL || rsc_id == NULL) {
2392 if (container == NULL) {
2403 pe_rsc_trace(rsc,
"Mapped container of orphaned resource %s to %s",
2404 rsc->
id, container_id);
2411 unpack_lrm_resources(
pe_node_t *node, xmlNode *lrm_rsc_list,
2414 xmlNode *rsc_entry = NULL;
2415 gboolean found_orphaned_container_filler = FALSE;
2417 for (rsc_entry = pcmk__xe_first_child(lrm_rsc_list); rsc_entry != NULL;
2418 rsc_entry = pcmk__xe_next(rsc_entry)) {
2421 pe_resource_t *rsc = unpack_lrm_rsc_state(node, rsc_entry, data_set);
2426 found_orphaned_container_filler = TRUE;
2434 if (found_orphaned_container_filler) {
2435 handle_orphaned_container_fillers(lrm_rsc_list, data_set);
2452 set_node_score(gpointer key, gpointer value, gpointer user_data)
2455 int *score = user_data;
2460 #define STATUS_PATH_MAX 1024 2462 find_lrm_op(
const char *resource,
const char *op,
const char *node,
const char *source,
2467 xmlNode *xml = NULL;
2469 offset += snprintf(xpath + offset,
STATUS_PATH_MAX - offset,
"//node_state[@uname='%s']", node);
2494 if (xml && success_only) {
2508 pe__call_id(xmlNode *op_xml)
2541 return (stop_op && (pe__call_id(stop_op) > pe__call_id(xml_op)));
2566 int from_status = 0;
2569 xmlNode *migrate_from = NULL;
2576 if (stop_happened_after(rsc, node, xml_op, data_set)) {
2588 source, FALSE, data_set);
2592 pe_rsc_trace(rsc,
"%s op on %s exited with status=%d, rc=%d",
2593 ID(migrate_from),
target, from_status, from_rc);
2602 pe_rsc_trace(rsc,
"Detected dangling migration op: %s on %s",
ID(xml_op),
2640 newer_op(
pe_resource_t *rsc,
const char *action_name,
const char *node_name,
2643 xmlNode *
action = find_lrm_op(rsc->
id, action_name, node_name, NULL, TRUE,
2646 return pe__call_id(
action) > call_id;
2653 int target_stop_id = 0;
2654 int target_migrate_from_id = 0;
2655 xmlNode *target_stop = NULL;
2656 xmlNode *target_migrate_from = NULL;
2671 target_stop_id = pe__call_id(target_stop);
2675 source, TRUE, data_set);
2676 target_migrate_from_id = pe__call_id(target_migrate_from);
2678 if ((target_stop == NULL) || (target_stop_id < target_migrate_from_id)) {
2686 target_stop_id, target_migrate_from_id);
2691 }
else if (target_migrate_from == NULL) {
2702 int source_migrate_to_id = pe__call_id(xml_op);
2722 xmlNode *source_stop = NULL;
2723 xmlNode *source_migrate_to = NULL;
2741 source,
target, TRUE, data_set);
2743 if ((source_stop == NULL)
2744 || (pe__call_id(source_stop) < pe__call_id(source_migrate_to))) {
2758 record_failed_op(xmlNode *op,
const pe_node_t *node,
2761 xmlNode *xIter = NULL;
2768 for (xIter = data_set->
failed->children; xIter; xIter = xIter->next) {
2784 static const char *get_op_key(xmlNode *xml_op)
2794 last_change_str(xmlNode *xml_op)
2797 const char *when_s = NULL;
2804 when_s = strchr(when_s,
' ');
2810 return ((when_s && *when_s)? when_s :
"unknown time");
2900 return first - second;
2907 guint interval_ms = 0;
2908 bool is_probe =
false;
2911 const char *key = get_op_key(xml_op);
2919 *last_failure = xml_op;
2926 if (exit_reason == NULL) {
2932 crm_trace(
"Unexpected result (%s%s%s) was recorded for " 2933 "%s of %s on %s at %s " CRM_XS " rc=%d id=%s",
2934 services_ocf_exitcode_str(
rc),
2935 (*exit_reason?
": " :
""), exit_reason,
2937 last_change_str(xml_op),
rc,
ID(xml_op));
2939 crm_warn(
"Unexpected result (%s%s%s) was recorded for " 2940 "%s of %s on %s at %s " CRM_XS " rc=%d id=%s",
2941 services_ocf_exitcode_str(
rc),
2942 (*exit_reason?
": " :
""), exit_reason,
2944 last_change_str(xml_op),
rc,
ID(xml_op));
2953 crm_notice(
"If it is not possible for %s to run on %s, see " 2954 "the resource-discovery option for location constraints",
2958 record_failed_op(xml_op, node, rsc, data_set);
2962 if (cmp_on_fail(*on_fail,
action->on_fail) < 0) {
2965 *on_fail =
action->on_fail;
2972 unpack_migrate_to_failure(rsc, node, xml_op, data_set);
2975 unpack_migrate_from_failure(rsc, node, xml_op, data_set);
3008 pe_rsc_trace(rsc,
"Resource %s: role=%s, unclean=%s, on_fail=%s, fail_role=%s",
3025 if (pe_rsc_is_clone(parent)
3033 crm_notice(
"%s will not be started under current conditions",
3040 g_hash_table_foreach(fail_rsc->
allowed_nodes, set_node_score, &score);
3066 determine_op_status(
3069 guint interval_ms = 0;
3070 bool is_probe =
false;
3072 const char *key = get_op_key(xml_op);
3080 if (exit_reason == NULL) {
3090 if (target_rc < 0) {
3100 crm_warn(
"Expected result not found for %s on %s (corrupt or obsolete CIB?)",
3103 }
else if (target_rc !=
rc) {
3105 pe_rsc_debug(rsc,
"%s on %s: expected %d (%s), got %d (%s%s%s)",
3107 target_rc, services_ocf_exitcode_str(target_rc),
3108 rc, services_ocf_exitcode_str(
rc),
3109 (*exit_reason?
": " :
""), exit_reason);
3116 pe_rsc_info(rsc,
"Probe found %s active on %s at %s",
3118 last_change_str(xml_op));
3123 if (is_probe || (target_rc ==
rc)
3136 if (is_probe && (
rc != target_rc)) {
3139 "Probe found %s active and promoted on %s at %s",
3141 last_change_str(xml_op));
3157 if (interval_ms > 0) {
3168 pe_proc_err(
"No further recovery can be attempted for %s " 3169 "because %s on %s failed (%s%s%s) at %s " 3170 CRM_XS " rc=%d id=%s", rsc->
id, task,
3172 (*exit_reason?
": " :
""), exit_reason,
3173 last_change_str(xml_op),
rc,
ID(xml_op));
3182 crm_info(
"Treating unknown exit status %d from %s of %s " 3183 "on %s at %s as failure",
3185 last_change_str(xml_op));
3195 should_clear_for_param_change(xmlNode *xml_op,
const char *task,
3199 if (!strcmp(task,
"start") || !strcmp(task,
"monitor")) {
3213 switch (digest_data->
rc) {
3215 crm_trace(
"Resource %s history entry %s on %s" 3216 " has no digest to compare",
3245 should_ignore_failure_timeout(
pe_resource_t *rsc, xmlNode *xml_op,
3246 const char *task, guint interval_ms,
3276 if (is_last_failure) {
3277 crm_info(
"Waiting to clear monitor failure for remote node %s" 3278 " until fencing has occurred", rsc->
id);
3312 bool expired = FALSE;
3314 time_t last_run = 0;
3315 guint interval_ms = 0;
3316 int unexpired_fail_count = 0;
3318 const char *clear_reason = NULL;
3329 time_t last_failure = 0;
3333 && !should_ignore_failure_timeout(rsc, xml_op, task, interval_ms,
3334 is_last_failure, data_set)) {
3344 crm_trace(
"%s@%lld is %sexpired @%lld with unexpired_failures=%d timeout=%ds" 3345 " last-failure@%lld",
3346 ID(xml_op), (
long long) last_run, (expired?
"" :
"not "),
3348 (
long long) last_failure);
3350 if (unexpired_fail_count && (now < last_failure)) {
3360 if (unexpired_fail_count == 0) {
3362 clear_reason =
"it expired";
3378 clear_reason =
"reconnect interval is set";
3382 if (!expired && is_last_failure
3383 && should_clear_for_param_change(xml_op, task, rsc, node, data_set)) {
3384 clear_reason =
"resource parameters have changed";
3387 if (clear_reason != NULL) {
3402 crm_info(
"Clearing %s failure will wait until any scheduled " 3403 "fencing of %s completes", task, rsc->
id);
3404 order_after_remote_fencing(clear_op, rsc, data_set);
3442 result =
action->on_fail;
3452 gboolean clear_past_failure = FALSE;
3458 clear_past_failure = TRUE;
3465 const char *op_key = get_op_key(xml_op);
3466 const char *last_failure_key = get_op_key(last_failure);
3469 clear_past_failure = TRUE;
3479 clear_past_failure = TRUE;
3483 clear_past_failure = TRUE;
3487 clear_past_failure = TRUE;
3493 clear_past_failure = TRUE;
3499 clear_past_failure = TRUE;
3502 unpack_migrate_to_success(rsc, node, xml_op, data_set);
3510 if (clear_past_failure) {
3516 pe_rsc_trace(rsc,
"%s.%s is not cleared by a completed stop",
3565 remap_monitor_rc(
int rc, xmlNode *xml_op,
const pe_node_t *node,
3570 if (
rc != remapped_rc) {
3571 crm_trace(
"Remapping monitor result %d to %d",
rc, remapped_rc);
3573 record_failed_op(xml_op, node, rsc, data_set);
3588 guint interval_ms = 0;
3589 const char *task = NULL;
3590 const char *task_key = NULL;
3591 const char *exit_reason = NULL;
3592 bool expired = FALSE;
3596 CRM_CHECK(rsc && node && xml_op,
return);
3599 task_key = get_op_key(xml_op);
3602 if (exit_reason == NULL) {
3625 pe_rsc_trace(rsc,
"Unpacking task %s/%s (call_id=%d, status=%d, rc=%d) on %s (role=%s)",
3629 pe_rsc_trace(rsc,
"Node %s (where %s is running) is unclean." 3630 " Further action depends on the value of the stop's on-fail attribute",
3647 && check_operation_expiry(rsc, node,
rc, xml_op, data_set)) {
3652 rc = remap_monitor_rc(
rc, xml_op, node, rsc, data_set);
3655 if (expired && (
rc != target_rc)) {
3658 if (interval_ms == 0) {
3659 crm_notice(
"Ignoring expired %s failure on %s " 3660 CRM_XS " actual=%d expected=%d magic=%s",
3675 crm_notice(
"Rescheduling %s after failure expired on %s " 3676 CRM_XS " actual=%d expected=%d magic=%s",
3689 status = determine_op_status(rsc,
rc, target_rc, node, xml_op, on_fail, data_set);
3690 pe_rsc_trace(rsc,
"Remapped %s status to %d", task_key, status);
3696 pe_err(
"Resource history contains cancellation '%s' " 3697 "(%s of %s on %s at %s)",
3699 last_change_str(xml_op));
3741 last_change_str(xml_op),
ID(xml_op));
3742 update_resource_state(rsc, node, xml_op, task,
rc, *last_failure, on_fail, data_set);
3746 failure_strategy = get_action_on_fail(rsc, task_key, task, data_set);
3748 crm_warn(
"Cannot ignore failed %s of %s on %s: " 3749 "Resource agent doesn't exist " 3750 CRM_XS " status=%d rc=%d id=%s",
3757 unpack_rsc_op_failure(rsc, node,
rc, xml_op, last_failure, on_fail, data_set);
3782 failure_strategy = get_action_on_fail(rsc, task_key, task, data_set);
3787 crm_warn(
"Pretending failed %s (%s%s%s) of %s on %s at %s " 3788 "succeeded " CRM_XS " rc=%d id=%s",
3789 task, services_ocf_exitcode_str(
rc),
3790 (*exit_reason?
": " :
""), exit_reason, rsc->
id,
3794 update_resource_state(rsc, node, xml_op, task, target_rc, *last_failure, on_fail, data_set);
3798 record_failed_op(xml_op, node, rsc, data_set);
3802 *on_fail = failure_strategy;
3806 unpack_rsc_op_failure(rsc, node,
rc, xml_op, last_failure, on_fail, data_set);
3810 "Preventing %s from restarting on %s because " 3811 "of hard failure (%s%s%s)" CRM_XS " rc=%d id=%s",
3813 services_ocf_exitcode_str(
rc),
3814 (*exit_reason?
": " :
""), exit_reason,
3819 crm_err(
"Preventing %s from restarting anywhere because " 3820 "of fatal failure (%s%s%s) " CRM_XS " rc=%d id=%s",
3821 parent->
id, services_ocf_exitcode_str(
rc),
3822 (*exit_reason?
": " :
""), exit_reason,
3831 pe_rsc_trace(rsc,
"Resource %s after %s: role=%s, next=%s",
3837 add_node_attrs(xmlNode *xml_obj,
pe_node_t *node,
bool overwrite,
3840 const char *cluster_name = NULL;
3845 .now = data_set->
now,
3866 cluster_name = g_hash_table_lookup(data_set->
config_hash,
"cluster-name");
3869 strdup(cluster_name));
3883 }
else if (cluster_name) {
3887 strdup(cluster_name));
3893 extract_operations(
const char *node,
const char *rsc, xmlNode * rsc_entry, gboolean active_filter)
3896 int stop_index = -1;
3897 int start_index = -1;
3899 xmlNode *rsc_op = NULL;
3907 sorted_op_list = NULL;
3909 for (rsc_op = pcmk__xe_first_child(rsc_entry);
3910 rsc_op != NULL; rsc_op = pcmk__xe_next(rsc_op)) {
3916 op_list = g_list_prepend(op_list, rsc_op);
3920 if (op_list == NULL) {
3928 if (active_filter == FALSE) {
3929 return sorted_op_list;
3936 for (gIter = sorted_op_list; gIter != NULL; gIter = gIter->next) {
3937 xmlNode *rsc_op = (xmlNode *) gIter->data;
3941 if (start_index < stop_index) {
3942 crm_trace(
"Skipping %s: not active",
ID(rsc_entry));
3945 }
else if (counter < start_index) {
3949 op_list = g_list_append(op_list, rsc_op);
3952 g_list_free(sorted_op_list);
3963 xmlNode *tmp = NULL;
3968 xmlNode *node_state = NULL;
3970 for (node_state = pcmk__xe_first_child(status); node_state != NULL;
3971 node_state = pcmk__xe_next(node_state)) {
3981 if(this_node == NULL) {
3986 determine_remote_online_status(data_set, this_node);
3989 determine_online_status(node_state, this_node, data_set);
3998 xmlNode *lrm_rsc = NULL;
4003 for (lrm_rsc = pcmk__xe_first_child(tmp); lrm_rsc != NULL;
4004 lrm_rsc = pcmk__xe_next(lrm_rsc)) {
4006 if (pcmk__str_eq((
const char *)lrm_rsc->name,
4015 intermediate = extract_operations(
uname, rsc_id, lrm_rsc, active_filter);
4016 output = g_list_concat(output, intermediate);
#define CRM_CHECK(expr, failure_action)
#define XML_RSC_OP_LAST_CHANGE
void verify_pe_options(GHashTable *options)
xmlNode * find_xml_node(xmlNode *cib, const char *node_path, gboolean must_find)
enum pe_quorum_policy no_quorum_policy
GHashTable * pe__node_list2table(GList *list)
#define crm_notice(fmt, args...)
#define CRMD_ACTION_MIGRATED
#define pe_flag_stop_action_orphans
bool pe__is_guest_or_remote_node(const pe_node_t *node)
#define pe_rsc_debug(rsc, fmt, args...)
#define XML_CONFIG_ATTR_SHUTDOWN_LOCK
gint sort_rsc_priority(gconstpointer a, gconstpointer b)
#define pe__set_action_flags(action, flags_to_set)
GListPtr dangling_migrations
#define XML_NODE_IS_FENCED
#define XML_ATTR_TRANSITION_MAGIC
#define stop_action(rsc, node, optional)
void pe__add_param_check(xmlNode *rsc_op, pe_resource_t *rsc, pe_node_t *node, enum pe_check_parameters, pe_working_set_t *data_set)
pe_resource_t * container
bool pcmk__strcase_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
pe_node_t * partial_migration_source
#define XML_ATTR_QUORUM_PANIC
#define pe_flag_concurrent_fencing
#define XML_CONFIG_ATTR_PRIORITY_FENCING_DELAY
void pe__update_recheck_time(time_t recheck, pe_working_set_t *data_set)
#define XML_TAG_UTILIZATION
#define XML_RULE_ATTR_SCORE
#define XML_BOOLEAN_FALSE
#define pe_flag_symmetric_cluster
int priority_fencing_delay
#define pcmk__config_err(fmt...)
#define pe_flag_remove_after_stop
enum rsc_role_e next_role
#define pe_flag_maintenance_mode
int char2score(const char *score)
#define pe_proc_warn(fmt...)
pe_resource_t * remote_rsc
#define XML_TAG_TRANSIENT_NODEATTRS
#define CRMD_ACTION_NOTIFY
gboolean unpack_resources(xmlNode *xml_resources, pe_working_set_t *data_set)
resource_object_functions_t * fns
#define XML_LRM_TAG_RESOURCE
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
pe_node_t * pe__copy_node(const pe_node_t *this_node)
#define CRMD_ACTION_PROMOTE
int crm_parse_int(const char *text, const char *default_text)
Parse an integer value from a string.
gboolean unpack_tags(xmlNode *xml_tags, pe_working_set_t *data_set)
#define XML_NVPAIR_ATTR_NAME
#define XML_NODE_IS_MAINTENANCE
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
#define XML_NODE_EXPECTED
#define XML_CIB_TAG_RSC_TEMPLATE
time_t get_effective_time(pe_working_set_t *data_set)
#define CRM_LOG_ASSERT(expr)
pe_node_t * pe_find_node(GListPtr node_list, const char *uname)
const char * pe_pref(GHashTable *options, const char *name)
void resource_location(pe_resource_t *rsc, pe_node_t *node, int score, const char *tag, pe_working_set_t *data_set)
gboolean unpack_remote_nodes(xmlNode *xml_resources, pe_working_set_t *data_set)
guint crm_parse_interval_spec(const char *input)
Parse milliseconds from a Pacemaker interval specification.
void copy_in_properties(xmlNode *target, xmlNode *src)
#define CRMD_JOINSTATE_NACK
#define CRM_ATTR_CLUSTER_NAME
pe_node_t * partial_migration_target
gboolean remote_was_fenced
int crm_element_value_int(const xmlNode *data, const char *name, int *dest)
Retrieve the integer value of an XML attribute.
bool pcmk__ends_with(const char *s, const char *match)
#define pe_flag_have_quorum
gboolean unpack_config(xmlNode *config, pe_working_set_t *data_set)
bool pe__bundle_needs_remote_name(pe_resource_t *rsc)
xmlNode * get_xpath_object(const char *xpath, xmlNode *xml_obj, int error_level)
#define pe_proc_err(fmt...)
gboolean remote_requires_reset
char * strndup(const char *str, size_t len)
#define pe__set_resource_flags(resource, flags_to_set)
#define XML_CIB_TAG_PROPSET
int pcmk__effective_rc(int rc)
#define pe_flag_stop_everything
void pe__unpack_dataset_nvpairs(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)
#define XML_LRM_ATTR_RSCID
gboolean remote_maintenance
#define CRMD_ACTION_START
#define demote_action(rsc, node, optional)
#define XML_LRM_ATTR_TASK_KEY
bool pe__is_remote_node(const pe_node_t *node)
#define XML_TAG_ATTR_SETS
#define XML_LRM_ATTR_TASK
const char * role2text(enum rsc_role_e role)
xmlNode * pe_create_remote_xml(xmlNode *parent, const char *uname, const char *container_id, const char *migrateable, const char *is_managed, const char *start_timeout, const char *server, const char *port)
pe_node_t *(* location)(const pe_resource_t *, GList **, int)
pe_resource_t * pe__find_bundle_replica(const pe_resource_t *bundle, const pe_node_t *node)
#define pe_flag_have_remote_nodes
#define CRMD_JOINSTATE_DOWN
#define crm_warn(fmt, args...)
guint remote_reconnect_ms
#define XML_CONFIG_ATTR_SHUTDOWN_LOCK_LIMIT
#define CRMD_ACTION_DEMOTE
#define crm_atoi(text, default_text)
char * clone_zero(const char *last_rsc_id)
#define pe_rsc_allow_migrate
#define pe_rsc_orphan_container_filler
int crm_element_value_ms(const xmlNode *data, const char *name, guint *dest)
Retrieve the millisecond value of an XML attribute.
#define crm_debug(fmt, args...)
int pe__target_rc_from_xml(xmlNode *xml_op)
pe_resource_t * uber_parent(pe_resource_t *rsc)
#define XML_RSC_ATTR_CONTAINER
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
#define XML_CIB_TAG_RESOURCE
#define pe_rsc_is_container
#define XML_CIB_TAG_STATE
const char * pe_base_name_end(const char *id)
bool pe__is_guest_node(const pe_node_t *node)
match only clone instances
#define pe_rsc_start_pending
#define pe_warn_once(pe_wo_bit, fmt...)
pe_ticket_t * ticket_new(const char *ticket_id, pe_working_set_t *data_set)
#define crm_trace(fmt, args...)
#define CRMD_JOINSTATE_MEMBER
#define do_crm_log(level, fmt, args...)
Log a message.
enum rsc_digest_cmp_val rc
bool xml_contains_remote_node(xmlNode *xml)
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
xmlNode * add_node_copy(xmlNode *new_parent, xmlNode *xml_node)
#define pe_flag_startup_fencing
const char * stonith_action
struct pe_node_shared_s * details
gboolean get_target_role(pe_resource_t *rsc, enum rsc_role_e *role)
#define crm_log_xml_debug(xml, text)
bool pe__shutdown_requested(pe_node_t *node)
#define pe_rsc_needs_fencing
gboolean order_actions(pe_action_t *lh_action, pe_action_t *rh_action, enum pe_ordering order)
#define pe_rsc_promotable
#define XML_TAG_META_SETS
Wrappers for and extensions to libxml2.
gboolean add_tag_ref(GHashTable *tags, const char *tag_name, const char *obj_ref)
#define XML_RSC_ATTR_MANAGED
xmlNode * create_xml_node(xmlNode *parent, const char *name)
#define pe_flag_stonith_enabled
gboolean unpack_status(xmlNode *status, pe_working_set_t *data_set)
int crm_element_value_epoch(const xmlNode *xml, const char *name, time_t *dest)
Retrieve the seconds-since-epoch value of an XML attribute.
const char * pe_node_attribute_raw(pe_node_t *node, const char *name)
pe_resource_t * pe__create_clone_child(pe_resource_t *rsc, pe_working_set_t *data_set)
void(* free)(pe_resource_t *)
#define XML_LRM_ATTR_MIGRATE_TARGET
#define CIB_OPTIONS_FIRST
#define XML_RSC_ATTR_REMOTE_NODE
#define XML_LRM_ATTR_EXIT_REASON
#define XML_LRM_ATTR_RESTART_DIGEST
void free_xml(xmlNode *child)
enum pe_obj_types variant
const char * placement_strategy
const char * pcmk__epoch2str(time_t *when)
pe_resource_t * pe_find_resource(GListPtr rsc_list, const char *id_rh)
char * pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms)
Generate an operation key (RESOURCE_ACTION_INTERVAL)
void native_add_running(pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set)
bool pe_can_fence(pe_working_set_t *data_set, pe_node_t *node)
#define XML_ATTR_TRANSITION_KEY
gboolean rsc_discovery_enabled
void pe_fence_node(pe_working_set_t *data_set, pe_node_t *node, const char *reason, bool priority_delay)
Schedule a fence action for a node.
pe_node_t * pe_create_node(const char *id, const char *uname, const char *type, const char *score, pe_working_set_t *data_set)
#define pe_flag_quick_location
const char * fail2text(enum action_fail_response fail)
#define XML_LRM_TAG_RESOURCES
#define crm_err(fmt, args...)
#define XML_CIB_TAG_TICKET_STATE
#define set_config_flag(data_set, option, flag)
xmlXPathObjectPtr xpath_search(xmlNode *xml_top, const char *path)
pe_action_t * pe__clear_failcount(pe_resource_t *rsc, pe_node_t *node, const char *reason, pe_working_set_t *data_set)
Schedule a controller operation to clear a fail count.
gboolean decode_transition_key(const char *key, char **uuid, int *transition_id, int *action_id, int *target_rc)
Parse a transition key into its constituent parts.
op_digest_cache_t * rsc_action_digest_cmp(pe_resource_t *rsc, xmlNode *xml_op, pe_node_t *node, pe_working_set_t *data_set)
#define XML_ATTR_HAVE_WATCHDOG
#define XML_NODE_ATTR_RSC_DISCOVERY
gboolean unpack_nodes(xmlNode *xml_nodes, pe_working_set_t *data_set)
#define CRMD_ACTION_METADATA
#define XML_LRM_ATTR_INTERVAL_MS
#define XML_LRM_ATTR_CALLID
#define CRMD_ACTION_MIGRATE
#define XML_NVPAIR_ATTR_VALUE
#define pe__clear_resource_flags(resource, flags_to_clear)
#define XML_LRM_ATTR_OPSTATUS
#define pe__set_working_set_flags(working_set, flags_to_set)
#define CRMD_JOINSTATE_PENDING
CRM_TRACE_INIT_DATA(pe_status)
GHashTable * digest_cache
cache of calculated resource digests
bool pe__is_universal_clone(pe_resource_t *rsc, pe_working_set_t *data_set)
#define pe_rsc_failure_ignored
#define XML_NODE_JOIN_STATE
void destroy_ticket(gpointer data)
#define XML_CIB_TAG_STATUS
#define XML_CIB_TAG_OBJ_REF
gboolean common_unpack(xmlNode *xml_obj, pe_resource_t **rsc, pe_resource_t *parent, pe_working_set_t *data_set)
#define XML_NODE_IN_CLUSTER
gboolean crm_is_true(const char *s)
#define pe_flag_have_stonith_resource
#define CRM_ATTR_SITE_NAME
#define XML_CIB_TAG_GROUP
#define pe_flag_enable_unfencing
#define XML_LRM_TAG_RSC_OP
#define pe_rsc_trace(rsc, fmt, args...)
GListPtr find_operations(const char *rsc, const char *node, gboolean active_filter, pe_working_set_t *data_set)
void calculate_active_ops(GListPtr sorted_op_list, int *start_index, int *stop_index)
GList * pe__resource_actions(const pe_resource_t *rsc, const pe_node_t *node, const char *task, bool require_node)
Find all actions of given type for a resource.
pe_action_t * pe__clear_resource_history(pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set)
#define XML_LRM_ATTR_MIGRATE_SOURCE
pe_resource_t *(* find_rsc)(pe_resource_t *parent, const char *search, const pe_node_t *node, int flags)
void freeXpathObject(xmlXPathObjectPtr xpathObj)
gint sort_node_uname(gconstpointer a, gconstpointer b)
char * crm_strdup_printf(char const *format,...) __attribute__((__format__(__printf__
#define XPATH_ENABLE_UNFENCING
#define pe_flag_start_failure_fatal
#define XML_CIB_TAG_TICKETS
#define crm_info(fmt, args...)
GHashTable * template_rsc_sets
#define pcmk__config_warn(fmt...)
pe_node_t * pe_find_node_any(GListPtr node_list, const char *id, const char *uname)
char * clone_strip(const char *last_rsc_id)
int pe_get_failcount(pe_node_t *node, pe_resource_t *rsc, time_t *last_failure, uint32_t flags, xmlNode *xml_op, pe_working_set_t *data_set)
pe_action_t * pe_fence_op(pe_node_t *node, const char *op, bool optional, const char *reason, bool priority_delay, pe_working_set_t *data_set)
void pe_free_action(pe_action_t *action)
#define pe_flag_shutdown_lock
enum crm_ais_msg_types type
#define pe_rsc_info(rsc, fmt, args...)
GHashTable * allowed_nodes
pe_action_t * custom_action(pe_resource_t *rsc, char *key, const char *task, pe_node_t *on_node, gboolean optional, gboolean foo, pe_working_set_t *data_set)
#define pe_flag_startup_probes
#define CRMD_ACTION_STATUS
#define pe_flag_stop_rsc_orphans