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_node_lrm(
pe_node_t *node, xmlNode *xml,
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 "='" PCMK_STONITH_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;
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",
337 #ifndef PCMK__COMPAT_2_0
339 "Support for the remove-after-stop cluster property is"
340 " deprecated and will be removed in a future release");
359 crm_trace(
"Unseen nodes will be fenced");
368 crm_debug(
"Node scores: 'red' = %s, 'yellow' = %s, 'green' = %s",
377 crm_trace(
"Resources will%s be locked to cleanly shut down nodes",
400 if (new_node == NULL) {
405 new_node->
fixed = FALSE;
408 if (new_node->
details == NULL) {
413 crm_trace(
"Creating node for entry %s/%s", uname,
id);
450 xmlNode *attr_set = NULL;
451 xmlNode *attr = NULL;
453 const char *container_id =
ID(xml_obj);
454 const char *remote_name = NULL;
455 const char *remote_server = NULL;
456 const char *remote_port = NULL;
457 const char *connect_timeout =
"60s";
458 const char *remote_allow_migrate=NULL;
459 const char *is_managed = NULL;
461 for (attr_set = pcmk__xe_first_child(xml_obj); attr_set != NULL;
462 attr_set = pcmk__xe_next(attr_set)) {
469 for (attr = pcmk__xe_first_child(attr_set); attr != NULL;
470 attr = pcmk__xe_next(attr)) {
477 remote_server = value;
480 }
else if (pcmk__str_eq(name,
"remote-connect-timeout",
pcmk__str_casei)) {
481 connect_timeout = value;
482 }
else if (pcmk__str_eq(name,
"remote-allow-migrate",
pcmk__str_casei)) {
483 remote_allow_migrate=value;
490 if (remote_name == NULL) {
499 remote_allow_migrate, is_managed,
500 connect_timeout, remote_server, remote_port);
532 xmlNode *xml_obj = NULL;
534 const char *
id = NULL;
535 const char *
uname = NULL;
536 const char *
type = NULL;
537 const char *score = NULL;
542 .now = data_set->
now,
548 for (xml_obj = pcmk__xe_first_child(xml_nodes); xml_obj != NULL;
549 xml_obj = pcmk__xe_next(xml_obj)) {
558 crm_trace(
"Processing node %s/%s", uname,
id);
562 "> entry in configuration without id");
567 if (new_node == NULL) {
577 handle_startup_fencing(data_set, new_node);
579 add_node_attrs(xml_obj, new_node, FALSE, data_set);
589 crm_info(
"Creating a fake local node");
600 const char *container_id = NULL;
605 for (; gIter != NULL; gIter = gIter->next) {
608 setup_container(child_rsc, data_set);
621 pe_rsc_trace(rsc,
"Resource %s's container is %s", rsc->
id, container_id);
623 pe_err(
"Resource %s: Unknown resource container (%s)", rsc->
id, container_id);
631 xmlNode *xml_obj = NULL;
636 for (xml_obj = pcmk__xe_first_child(xml_resources); xml_obj != NULL;
637 xml_obj = pcmk__xe_next(xml_obj)) {
639 const char *new_node_id = NULL;
645 new_node_id =
ID(xml_obj);
649 crm_trace(
"Found remote node %s defined by resource %s",
650 new_node_id,
ID(xml_obj));
665 new_node_id = expand_remote_rsc_meta(xml_obj, xml_resources, data_set);
667 crm_trace(
"Found guest node %s in resource %s",
668 new_node_id,
ID(xml_obj));
679 xmlNode *xml_obj2 = NULL;
680 for (xml_obj2 = pcmk__xe_first_child(xml_obj); xml_obj2 != NULL;
681 xml_obj2 = pcmk__xe_next(xml_obj2)) {
683 new_node_id = expand_remote_rsc_meta(xml_obj2, xml_resources, data_set);
686 crm_trace(
"Found guest node %s in resource %s inside group %s",
687 new_node_id,
ID(xml_obj2),
ID(xml_obj));
722 pe_rsc_trace(new_rsc,
"Linking remote connection resource %s to node %s",
730 handle_startup_fencing(data_set, remote_node);
737 strdup(
"container"));
742 destroy_tag(gpointer data)
748 g_list_free_full(tag->
refs, free);
768 xmlNode *xml_obj = NULL;
773 for (xml_obj = pcmk__xe_first_child(xml_resources); xml_obj != NULL;
774 xml_obj = pcmk__xe_next(xml_obj)) {
779 const char *template_id =
ID(xml_obj);
782 template_id, NULL, NULL) == FALSE) {
789 crm_trace(
"Beginning unpack... <%s id=%s... >", crm_element_name(xml_obj),
ID(xml_obj));
790 if (
common_unpack(xml_obj, &new_rsc, NULL, data_set) && (new_rsc != NULL)) {
796 "because configuration is invalid",
797 crm_element_name(xml_obj),
crm_str(
ID(xml_obj)));
798 if (new_rsc != NULL && new_rsc->
fns != NULL) {
804 for (gIter = data_set->
resources; gIter != NULL; gIter = gIter->next) {
807 setup_container(rsc, data_set);
808 link_rsc2remotenode(data_set, rsc);
818 pcmk__config_err(
"Resource start-up disabled since no STONITH resources have been defined");
819 pcmk__config_err(
"Either configure some or disable STONITH with the stonith-enabled option");
820 pcmk__config_err(
"NOTE: Clusters with shared data need STONITH to ensure data integrity");
829 xmlNode *xml_tag = NULL;
833 for (xml_tag = pcmk__xe_first_child(xml_tags); xml_tag != NULL;
834 xml_tag = pcmk__xe_next(xml_tag)) {
836 xmlNode *xml_obj_ref = NULL;
837 const char *tag_id =
ID(xml_tag);
843 if (tag_id == NULL) {
845 crm_element_name(xml_tag));
849 for (xml_obj_ref = pcmk__xe_first_child(xml_tag); xml_obj_ref != NULL;
850 xml_obj_ref = pcmk__xe_next(xml_obj_ref)) {
852 const char *obj_ref =
ID(xml_obj_ref);
858 if (obj_ref == NULL) {
860 crm_element_name(xml_obj_ref), tag_id);
878 const char *ticket_id = NULL;
879 const char *granted = NULL;
880 const char *last_granted = NULL;
881 const char *standby = NULL;
882 xmlAttrPtr xIter = NULL;
886 ticket_id =
ID(xml_ticket);
887 if (pcmk__str_empty(ticket_id)) {
891 crm_trace(
"Processing ticket state for %s", ticket_id);
893 ticket = g_hash_table_lookup(data_set->
tickets, ticket_id);
894 if (ticket == NULL) {
896 if (ticket == NULL) {
901 for (xIter = xml_ticket->properties; xIter; xIter = xIter->next) {
902 const char *prop_name = (
const char *)xIter->name;
908 g_hash_table_replace(ticket->
state, strdup(prop_name), strdup(prop_value));
911 granted = g_hash_table_lookup(ticket->
state,
"granted");
917 crm_info(
"We do not have ticket '%s'", ticket->
id);
920 last_granted = g_hash_table_lookup(ticket->
state,
"last-granted");
922 long long last_granted_ll;
928 standby = g_hash_table_lookup(ticket->
state,
"standby");
932 crm_info(
"Granted ticket '%s' is in standby-mode", ticket->
id);
938 crm_trace(
"Done with ticket state for %s", ticket_id);
946 xmlNode *xml_obj = NULL;
948 for (xml_obj = pcmk__xe_first_child(xml_tickets); xml_obj != NULL;
949 xml_obj = pcmk__xe_next(xml_obj)) {
954 unpack_ticket_state(xml_obj, data_set);
963 const char *resource_discovery_enabled = NULL;
964 xmlNode *attrs = NULL;
985 add_node_attrs(attrs, this_node, TRUE, data_set);
1004 if (resource_discovery_enabled && !
crm_is_true(resource_discovery_enabled)) {
1007 crm_warn(
"Ignoring %s attribute on remote node %s because stonith is disabled",
1030 unpack_transient_attributes(xmlNode *state,
pe_node_t *node,
1033 const char *discovery = NULL;
1036 add_node_attrs(attrs, node, TRUE, data_set);
1049 if ((discovery != NULL) && !
crm_is_true(discovery)) {
1050 crm_warn(
"Ignoring %s attribute for node %s because disabling "
1051 "resource discovery is not allowed for cluster nodes",
1071 const char *
id = NULL;
1072 const char *
uname = NULL;
1083 if (uname == NULL) {
1090 if (this_node == NULL) {
1092 "it is no longer in the configuration", uname);
1107 unpack_transient_attributes(state, this_node, data_set);
1115 crm_trace(
"Determining online status of cluster node %s (id %s)",
1117 determine_online_status(state, this_node, data_set);
1126 pe_fence_node(data_set, this_node,
"cluster does not have quorum",
1149 unpack_node_history(xmlNode *status,
bool fence,
pe_working_set_t *data_set)
1157 const char *
id =
ID(state);
1161 if ((
id == NULL) || (uname == NULL)) {
1163 crm_trace(
"Not unpacking resource history from malformed "
1169 if (this_node == NULL) {
1171 crm_trace(
"Not unpacking resource history for node %s because "
1172 "no longer in configuration",
id);
1177 crm_trace(
"Not unpacking resource history for node %s because "
1178 "already unpacked",
id);
1194 crm_trace(
"Not unpacking resource history for guest node %s "
1195 "because container and connection are not known to "
1211 crm_trace(
"Not unpacking resource history for remote node %s "
1212 "because connection is not known to be up",
id);
1224 crm_trace(
"Not unpacking resource history for offline "
1225 "cluster node %s",
id);
1230 determine_remote_online_status(data_set, this_node);
1231 unpack_handle_remote_attrs(this_node, state, data_set);
1234 crm_trace(
"Unpacking resource history for %snode %s",
1235 (fence?
"unseen " :
""),
id);
1238 unpack_node_lrm(this_node, state, data_set);
1251 xmlNode *state = NULL;
1255 if (data_set->
tickets == NULL) {
1259 for (state = pcmk__xe_first_child(status); state != NULL;
1260 state = pcmk__xe_next(state)) {
1263 unpack_tickets_state((xmlNode *) state, data_set);
1266 unpack_node_state(state, data_set);
1270 while (unpack_node_history(status, FALSE, data_set) == EAGAIN) {
1271 crm_trace(
"Another pass through node resource histories is needed");
1275 unpack_node_history(status,
1283 for (GList *item = data_set->
stop_needed; item; item = item->next) {
1285 pe_node_t *node = pe__current_node(container);
1299 for (GList *gIter = data_set->
nodes; gIter != NULL; gIter = gIter->next) {
1311 determine_remote_online_status(data_set, this_node);
1319 determine_online_status_no_fencing(
pe_working_set_t * data_set, xmlNode * node_state,
1322 gboolean online = FALSE;
1335 crm_debug(
"Node is not ready to run resources: %s", join);
1340 crm_trace(
"\tis_peer=%s, join=%s, expected=%s",
1345 pe_fence_node(data_set, this_node,
"peer is unexpectedly down", FALSE);
1346 crm_info(
"\tin_cluster=%s, is_peer=%s, join=%s, expected=%s",
1353 determine_online_status_fencing(
pe_working_set_t * data_set, xmlNode * node_state,
1356 gboolean online = FALSE;
1357 gboolean do_terminate = FALSE;
1358 bool crmd_online = FALSE;
1373 do_terminate = TRUE;
1375 }
else if (terminate != NULL && strlen(terminate) > 0) {
1377 char t = terminate[0];
1379 if (t !=
'0' && isdigit(t)) {
1380 do_terminate = TRUE;
1384 crm_trace(
"%s: in_cluster=%s, is_peer=%s, join=%s, expected=%s, term=%d",
1390 if (exp_state == NULL) {
1398 online = crmd_online;
1400 }
else if (in_cluster == NULL) {
1401 pe_fence_node(data_set, this_node,
"peer has not been seen by the cluster", FALSE);
1404 pe_fence_node(data_set, this_node,
"peer failed the pacemaker membership criteria", FALSE);
1418 &&
crm_is_true(in_cluster) == FALSE && !crmd_online) {
1424 pe_fence_node(data_set, this_node,
"peer is no longer part of the cluster", TRUE);
1426 }
else if (!crmd_online) {
1427 pe_fence_node(data_set, this_node,
"peer process is no longer available", FALSE);
1430 }
else if (do_terminate) {
1431 pe_fence_node(data_set, this_node,
"termination was requested", FALSE);
1442 pe_fence_node(data_set, this_node,
"peer was in an unknown state", FALSE);
1443 crm_warn(
"%s: in-cluster=%s, is-peer=%s, join=%s, expected=%s, term=%d, shutdown=%d",
1464 goto remote_online_done;
1469 if (container && pcmk__list_of_1(rsc->
running_on)) {
1475 crm_trace(
"%s node %s presumed ONLINE because connection resource is started",
1476 (container?
"Guest" :
"Remote"), this_node->
details->
id);
1482 crm_trace(
"%s node %s shutting down because connection resource is stopping",
1483 (container?
"Guest" :
"Remote"), this_node->
details->
id);
1489 crm_trace(
"Guest node %s UNCLEAN because guest resource failed",
1495 crm_trace(
"%s node %s OFFLINE because connection resource failed",
1496 (container?
"Guest" :
"Remote"), this_node->
details->
id);
1502 crm_trace(
"%s node %s OFFLINE because its resource is stopped",
1503 (container?
"Guest" :
"Remote"), this_node->
details->
id);
1509 crm_trace(
"Guest node %s UNCLEAN because host is unclean",
1523 gboolean online = FALSE;
1546 online = determine_online_status_no_fencing(data_set, node_state, this_node);
1549 online = determine_online_status_fencing(data_set, node_state, this_node);
1557 this_node->
fixed = TRUE;
1563 this_node->
fixed = TRUE;
1596 if (!pcmk__str_empty(
id)) {
1597 const char *end =
id + strlen(
id) - 1;
1599 for (
const char *s = end; s >
id; --s) {
1613 return (s == end)? s : (s - 1);
1637 char *basename = NULL;
1640 basename =
strndup(last_rsc_id, end - last_rsc_id + 1);
1659 size_t base_name_len = end - last_rsc_id + 1;
1663 zero = calloc(base_name_len + 3,
sizeof(
char));
1665 memcpy(zero, last_rsc_id, base_name_len);
1666 zero[base_name_len] =
':';
1667 zero[base_name_len + 1] =
'0';
1672 create_fake_resource(
const char *rsc_id, xmlNode * rsc_entry,
pe_working_set_t * data_set)
1688 crm_debug(
"Detected orphaned remote node %s", rsc_id);
1693 link_rsc2remotenode(data_set, rsc);
1696 crm_trace(
"Setting node %s as shutting down due to orphaned connection resource", rsc_id);
1703 crm_trace(
"Detected orphaned container filler %s", rsc_id);
1716 create_anonymous_orphan(
pe_resource_t *parent,
const char *rsc_id,
1724 pe_rsc_debug(parent,
"Created orphan %s for %s: %s on %s",
1747 GList *rIter = NULL;
1750 gboolean skip_inactive = FALSE;
1758 for (rIter = parent->
children; rsc == NULL && rIter; rIter = rIter->next) {
1759 GList *locations = NULL;
1803 crm_notice(
"Active (now-)anonymous clone %s has "
1804 "multiple (orphan) instance histories on %s",
1806 skip_inactive = TRUE;
1813 g_list_free(locations);
1817 if (!skip_inactive && !inactive_instance
1820 inactive_instance = parent->
fns->
find_rsc(child, rsc_id, NULL,
1826 if (inactive_instance && inactive_instance->
pending_node
1828 inactive_instance = NULL;
1834 if ((rsc == NULL) && !skip_inactive && (inactive_instance != NULL)) {
1835 pe_rsc_trace(parent,
"Resource %s, empty slot", inactive_instance->
id);
1836 rsc = inactive_instance;
1860 rsc = create_anonymous_orphan(parent, rsc_id, node, data_set);
1868 xmlNode * rsc_entry)
1887 crm_trace(
"%s found as %s (%s)", rsc_id, clone0_id, parent->
id);
1889 crm_trace(
"%s is not known as %s either (orphan)",
1895 crm_trace(
"Resource history for %s is orphaned because it is no longer primitive",
1903 if (pe_rsc_is_anon_clone(parent)) {
1905 if (pe_rsc_is_bundled(parent)) {
1910 rsc = find_anonymous_clone(data_set, node, parent, base);
1921 pe_rsc_debug(rsc,
"Internally renamed %s on %s to %s%s",
1935 rsc = create_fake_resource(rsc_id, rsc_entry, data_set);
1954 char *reason = NULL;
1958 pe_rsc_trace(rsc,
"Resource %s is %s on %s: on_fail=%s",
1986 gboolean should_fence = FALSE;
1997 should_fence = TRUE;
2011 " revoked if remote connection can "
2012 "be re-established elsewhere)",
2015 should_fence = TRUE;
2019 if (reason == NULL) {
2028 save_on_fail = on_fail;
2089 if (rsc->
container && pe_rsc_is_bundled(rsc)) {
2119 "remote connection is unrecoverable", FALSE);
2154 "%s because cluster is configured not to "
2155 "stop active orphans",
2184 GList *gIter = possible_matches;
2186 for (; gIter != NULL; gIter = gIter->next) {
2192 g_list_free(possible_matches);
2199 int start_index,
int stop_index,
2203 const char *task = NULL;
2204 const char *status = NULL;
2205 GList *gIter = sorted_op_list;
2208 pe_rsc_trace(rsc,
"%s: Start index %d, stop index = %d", rsc->
id, start_index, stop_index);
2210 for (; gIter != NULL; gIter = gIter->next) {
2211 xmlNode *rsc_op = (xmlNode *) gIter->data;
2213 guint interval_ms = 0;
2215 const char *
id =
ID(rsc_op);
2224 }
else if (start_index < stop_index && counter <= stop_index) {
2228 }
else if (counter < start_index) {
2234 if (interval_ms == 0) {
2256 int implied_monitor_start = -1;
2257 int implied_clone_start = -1;
2258 const char *task = NULL;
2259 const char *status = NULL;
2260 GList *gIter = sorted_op_list;
2265 for (; gIter != NULL; gIter = gIter->next) {
2266 xmlNode *rsc_op = (xmlNode *) gIter->data;
2275 *stop_index = counter;
2278 *start_index = counter;
2284 implied_monitor_start = counter;
2287 implied_clone_start = counter;
2291 if (*start_index == -1) {
2292 if (implied_clone_start != -1) {
2293 *start_index = implied_clone_start;
2294 }
else if (implied_monitor_start != -1) {
2295 *start_index = implied_monitor_start;
2305 time_t lock_time = 0;
2308 &lock_time) ==
pcmk_ok) && (lock_time != 0)) {
2313 pe_rsc_info(rsc,
"Shutdown lock for %s on %s expired",
2334 unpack_lrm_resource(
pe_node_t *node, xmlNode *lrm_resource,
2337 GList *gIter = NULL;
2338 int stop_index = -1;
2339 int start_index = -1;
2342 const char *task = NULL;
2343 const char *rsc_id =
ID(lrm_resource);
2346 GList *op_list = NULL;
2347 GList *sorted_op_list = NULL;
2349 xmlNode *migrate_op = NULL;
2350 xmlNode *rsc_op = NULL;
2351 xmlNode *last_failure = NULL;
2356 if (rsc_id == NULL) {
2358 " entry without id");
2368 op_list = g_list_prepend(op_list, rsc_op);
2372 if (op_list == NULL) {
2379 rsc = unpack_find_resource(data_set, node, rsc_id, lrm_resource);
2381 if (op_list == NULL) {
2385 rsc = process_orphan_resource(lrm_resource, node, data_set);
2392 unpack_shutdown_lock(lrm_resource, rsc, node, data_set);
2396 saved_role = rsc->
role;
2400 for (gIter = sorted_op_list; gIter != NULL; gIter = gIter->next) {
2401 xmlNode *rsc_op = (xmlNode *) gIter->data;
2405 migrate_op = rsc_op;
2408 unpack_rsc_op(rsc, node, rsc_op, &last_failure, &on_fail, data_set);
2413 process_recurring(node, rsc, start_index, stop_index, sorted_op_list, data_set);
2416 g_list_free(sorted_op_list);
2418 process_rsc_state(rsc, node, on_fail, migrate_op, data_set);
2425 pe_rsc_info(rsc,
"%s: Not overwriting calculated next role %s"
2426 " with requested next role %s",
2431 if (saved_role > rsc->
role) {
2432 rsc->
role = saved_role;
2439 handle_orphaned_container_fillers(xmlNode * lrm_rsc_list,
pe_working_set_t * data_set)
2441 xmlNode *rsc_entry = NULL;
2442 for (rsc_entry = pcmk__xe_first_child(lrm_rsc_list); rsc_entry != NULL;
2443 rsc_entry = pcmk__xe_next(rsc_entry)) {
2448 const char *container_id;
2456 if (container_id == NULL || rsc_id == NULL) {
2461 if (container == NULL) {
2472 pe_rsc_trace(rsc,
"Mapped container of orphaned resource %s to %s",
2473 rsc->
id, container_id);
2490 bool found_orphaned_container_filler =
false;
2506 pe_resource_t *rsc = unpack_lrm_resource(node, rsc_entry, data_set);
2510 found_orphaned_container_filler =
true;
2517 if (found_orphaned_container_filler) {
2518 handle_orphaned_container_fillers(xml, data_set);
2535 set_node_score(gpointer key, gpointer value, gpointer user_data)
2538 int *score = user_data;
2543 #define STATUS_PATH_MAX 1024
2545 find_lrm_op(
const char *resource,
const char *op,
const char *node,
const char *source,
2550 xmlNode *xml = NULL;
2552 offset += snprintf(xpath + offset,
STATUS_PATH_MAX - offset,
"//node_state[@uname='%s']", node);
2577 if (xml && success_only) {
2591 pe__call_id(xmlNode *op_xml)
2624 return (stop_op && (pe__call_id(stop_op) > pe__call_id(xml_op)));
2649 int from_status = 0;
2652 xmlNode *migrate_from = NULL;
2659 if (stop_happened_after(rsc, node, xml_op, data_set)) {
2671 source, FALSE, data_set);
2675 pe_rsc_trace(rsc,
"%s op on %s exited with status=%d, rc=%d",
2676 ID(migrate_from), target, from_status, from_rc);
2685 pe_rsc_trace(rsc,
"Detected dangling migration op: %s on %s",
ID(xml_op),
2692 pe_rsc_trace(rsc,
"Marking active on %s %p %d", target, target_node,
2699 pe_rsc_trace(rsc,
"Marking active on %s %p %d", target, target_node,
2723 newer_op(
pe_resource_t *rsc,
const char *action_name,
const char *node_name,
2726 xmlNode *
action = find_lrm_op(rsc->
id, action_name, node_name, NULL, TRUE,
2729 return pe__call_id(action) > call_id;
2736 int target_stop_id = 0;
2737 int target_migrate_from_id = 0;
2738 xmlNode *target_stop = NULL;
2739 xmlNode *target_migrate_from = NULL;
2754 target_stop_id = pe__call_id(target_stop);
2758 source, TRUE, data_set);
2759 target_migrate_from_id = pe__call_id(target_migrate_from);
2761 if ((target_stop == NULL) || (target_stop_id < target_migrate_from_id)) {
2769 target_stop_id, target_migrate_from_id);
2774 }
else if (target_migrate_from == NULL) {
2785 int source_migrate_to_id = pe__call_id(xml_op);
2805 xmlNode *source_stop = NULL;
2806 xmlNode *source_migrate_to = NULL;
2824 source, target, TRUE, data_set);
2826 if ((source_stop == NULL)
2827 || (pe__call_id(source_stop) < pe__call_id(source_migrate_to))) {
2841 record_failed_op(xmlNode *op,
const pe_node_t *node,
2844 xmlNode *xIter = NULL;
2851 for (xIter = data_set->
failed->children; xIter; xIter = xIter->next) {
2867 static const char *get_op_key(xmlNode *xml_op)
2877 last_change_str(xmlNode *xml_op)
2880 const char *when_s = NULL;
2887 when_s = strchr(when_s,
' ');
2893 return ((when_s && *when_s)? when_s :
"unknown time");
2983 return first - second;
2987 unpack_rsc_op_failure(
pe_resource_t * rsc,
pe_node_t * node,
int rc, xmlNode * xml_op, xmlNode ** last_failure,
2990 guint interval_ms = 0;
2991 bool is_probe =
false;
2994 const char *key = get_op_key(xml_op);
3002 *last_failure = xml_op;
3009 if (exit_reason == NULL) {
3015 crm_trace(
"Unexpected result (%s%s%s) was recorded for "
3016 "%s of %s on %s at %s " CRM_XS " rc=%d id=%s",
3017 services_ocf_exitcode_str(rc),
3018 (*exit_reason?
": " :
""), exit_reason,
3020 last_change_str(xml_op), rc,
ID(xml_op));
3022 crm_warn(
"Unexpected result (%s%s%s) was recorded for "
3023 "%s of %s on %s at %s " CRM_XS " rc=%d id=%s",
3024 services_ocf_exitcode_str(rc),
3025 (*exit_reason?
": " :
""), exit_reason,
3027 last_change_str(xml_op), rc,
ID(xml_op));
3036 crm_notice(
"If it is not possible for %s to run on %s, see "
3037 "the resource-discovery option for location constraints",
3041 record_failed_op(xml_op, node, rsc, data_set);
3044 action =
custom_action(rsc, strdup(key), task, NULL, TRUE, FALSE, data_set);
3045 if (cmp_on_fail(*on_fail, action->
on_fail) < 0) {
3055 unpack_migrate_to_failure(rsc, node, xml_op, data_set);
3058 unpack_migrate_from_failure(rsc, node, xml_op, data_set);
3067 "demote with on-fail=block");
3092 pe_rsc_trace(rsc,
"Resource %s: role=%s, unclean=%s, on_fail=%s, fail_role=%s",
3109 if (pe_rsc_is_clone(parent)
3117 crm_notice(
"%s will not be started under current conditions",
3124 g_hash_table_foreach(fail_rsc->
allowed_nodes, set_node_score, &score);
3150 determine_op_status(
3153 guint interval_ms = 0;
3154 bool is_probe =
false;
3156 const char *key = get_op_key(xml_op);
3164 if (exit_reason == NULL) {
3174 if (target_rc < 0) {
3184 crm_warn(
"Expected result not found for %s on %s (corrupt or obsolete CIB?)",
3187 }
else if (target_rc != rc) {
3189 pe_rsc_debug(rsc,
"%s on %s: expected %d (%s), got %d (%s%s%s)",
3191 target_rc, services_ocf_exitcode_str(target_rc),
3192 rc, services_ocf_exitcode_str(rc),
3193 (*exit_reason?
": " :
""), exit_reason);
3200 pe_rsc_info(rsc,
"Probe found %s active on %s at %s",
3202 last_change_str(xml_op));
3207 if (is_probe || (target_rc == rc)
3220 if (is_probe && (rc != target_rc)) {
3223 "Probe found %s active and promoted on %s at %s",
3225 last_change_str(xml_op));
3241 if (interval_ms > 0) {
3252 pe_proc_err(
"No further recovery can be attempted for %s "
3253 "because %s on %s failed (%s%s%s) at %s "
3254 CRM_XS " rc=%d id=%s", rsc->
id, task,
3256 (*exit_reason?
": " :
""), exit_reason,
3257 last_change_str(xml_op), rc,
ID(xml_op));
3266 crm_info(
"Treating unknown exit status %d from %s of %s "
3267 "on %s at %s as failure",
3269 last_change_str(xml_op));
3279 should_clear_for_param_change(xmlNode *xml_op,
const char *task,
3283 if (!strcmp(task,
"start") || !strcmp(task,
"monitor")) {
3297 switch (digest_data->
rc) {
3299 crm_trace(
"Resource %s history entry %s on %s"
3300 " has no digest to compare",
3329 should_ignore_failure_timeout(
pe_resource_t *rsc, xmlNode *xml_op,
3330 const char *task, guint interval_ms,
3360 if (is_last_failure) {
3361 crm_info(
"Waiting to clear monitor failure for remote node %s"
3362 " until fencing has occurred", rsc->
id);
3396 bool expired = FALSE;
3398 time_t last_run = 0;
3399 guint interval_ms = 0;
3400 int unexpired_fail_count = 0;
3402 const char *clear_reason = NULL;
3413 time_t last_failure = 0;
3417 && !should_ignore_failure_timeout(rsc, xml_op, task, interval_ms,
3418 is_last_failure, data_set)) {
3428 crm_trace(
"%s@%lld is %sexpired @%lld with unexpired_failures=%d timeout=%ds"
3429 " last-failure@%lld",
3430 ID(xml_op), (
long long) last_run, (expired?
"" :
"not "),
3432 (
long long) last_failure);
3434 if (unexpired_fail_count && (now < last_failure)) {
3444 if (unexpired_fail_count == 0) {
3446 clear_reason =
"it expired";
3462 clear_reason =
"reconnect interval is set";
3466 if (!expired && is_last_failure
3467 && should_clear_for_param_change(xml_op, task, rsc, node, data_set)) {
3468 clear_reason =
"resource parameters have changed";
3471 if (clear_reason != NULL) {
3486 crm_info(
"Clearing %s failure will wait until any scheduled "
3487 "fencing of %s completes", task, rsc->
id);
3488 order_after_remote_fencing(clear_op, rsc, data_set);
3533 update_resource_state(
pe_resource_t * rsc,
pe_node_t * node, xmlNode * xml_op,
const char * task,
int rc,
3536 gboolean clear_past_failure = FALSE;
3542 clear_past_failure = TRUE;
3549 const char *op_key = get_op_key(xml_op);
3550 const char *last_failure_key = get_op_key(last_failure);
3553 clear_past_failure = TRUE;
3563 clear_past_failure = TRUE;
3567 clear_past_failure = TRUE;
3571 clear_past_failure = TRUE;
3577 clear_past_failure = TRUE;
3583 clear_past_failure = TRUE;
3586 unpack_migrate_to_success(rsc, node, xml_op, data_set);
3594 if (clear_past_failure) {
3600 pe_rsc_trace(rsc,
"%s.%s is not cleared by a completed stop",
3622 "clear past failures and reset remote");
3650 remap_monitor_rc(
int rc, xmlNode *xml_op,
const pe_node_t *node,
3655 if (rc != remapped_rc) {
3656 crm_trace(
"Remapping monitor result %d to %d", rc, remapped_rc);
3658 record_failed_op(xml_op, node, rsc, data_set);
3673 guint interval_ms = 0;
3674 const char *task = NULL;
3675 const char *task_key = NULL;
3676 const char *exit_reason = NULL;
3677 bool expired = FALSE;
3681 CRM_CHECK(rsc && node && xml_op,
return);
3684 task_key = get_op_key(xml_op);
3687 if (exit_reason == NULL) {
3710 pe_rsc_trace(rsc,
"Unpacking task %s/%s (call_id=%d, status=%d, rc=%d) on %s (role=%s)",
3714 pe_rsc_trace(rsc,
"Node %s (where %s is running) is unclean."
3715 " Further action depends on the value of the stop's on-fail attribute",
3732 && check_operation_expiry(rsc, node, rc, xml_op, data_set)) {
3737 rc = remap_monitor_rc(rc, xml_op, node, rsc, data_set);
3740 if (expired && (rc != target_rc)) {
3743 if (interval_ms == 0) {
3744 crm_notice(
"Ignoring expired %s failure on %s "
3745 CRM_XS " actual=%d expected=%d magic=%s",
3760 crm_notice(
"Rescheduling %s after failure expired on %s "
3761 CRM_XS " actual=%d expected=%d magic=%s",
3774 status = determine_op_status(rsc, rc, target_rc, node, xml_op, on_fail, data_set);
3775 pe_rsc_trace(rsc,
"Remapped %s status to %d", task_key, status);
3781 pe_err(
"Resource history contains cancellation '%s' "
3782 "(%s of %s on %s at %s)",
3784 last_change_str(xml_op));
3826 last_change_str(xml_op),
ID(xml_op));
3827 update_resource_state(rsc, node, xml_op, task, rc, *last_failure, on_fail, data_set);
3831 failure_strategy = get_action_on_fail(rsc, task_key, task, data_set);
3833 crm_warn(
"Cannot ignore failed %s of %s on %s: "
3834 "Resource agent doesn't exist "
3835 CRM_XS " status=%d rc=%d id=%s",
3842 unpack_rsc_op_failure(rsc, node, rc, xml_op, last_failure, on_fail, data_set);
3867 failure_strategy = get_action_on_fail(rsc, task_key, task, data_set);
3872 crm_warn(
"Pretending failed %s (%s%s%s) of %s on %s at %s "
3873 "succeeded " CRM_XS " rc=%d id=%s",
3874 task, services_ocf_exitcode_str(rc),
3875 (*exit_reason?
": " :
""), exit_reason, rsc->
id,
3879 update_resource_state(rsc, node, xml_op, task, target_rc, *last_failure, on_fail, data_set);
3883 record_failed_op(xml_op, node, rsc, data_set);
3887 *on_fail = failure_strategy;
3891 unpack_rsc_op_failure(rsc, node, rc, xml_op, last_failure, on_fail, data_set);
3895 "Preventing %s from restarting on %s because "
3896 "of hard failure (%s%s%s)" CRM_XS " rc=%d id=%s",
3898 services_ocf_exitcode_str(rc),
3899 (*exit_reason?
": " :
""), exit_reason,
3904 crm_err(
"Preventing %s from restarting anywhere because "
3905 "of fatal failure (%s%s%s) " CRM_XS " rc=%d id=%s",
3906 parent->
id, services_ocf_exitcode_str(rc),
3907 (*exit_reason?
": " :
""), exit_reason,
3916 pe_rsc_trace(rsc,
"Resource %s after %s: role=%s, next=%s",
3922 add_node_attrs(xmlNode *xml_obj,
pe_node_t *node,
bool overwrite,
3925 const char *cluster_name = NULL;
3930 .now = data_set->
now,
3951 cluster_name = g_hash_table_lookup(data_set->
config_hash,
"cluster-name");
3954 strdup(cluster_name));
3968 }
else if (cluster_name) {
3972 strdup(cluster_name));
3978 extract_operations(
const char *node,
const char *rsc, xmlNode * rsc_entry, gboolean active_filter)
3981 int stop_index = -1;
3982 int start_index = -1;
3984 xmlNode *rsc_op = NULL;
3986 GList *gIter = NULL;
3987 GList *op_list = NULL;
3988 GList *sorted_op_list = NULL;
3992 sorted_op_list = NULL;
3994 for (rsc_op = pcmk__xe_first_child(rsc_entry);
3995 rsc_op != NULL; rsc_op = pcmk__xe_next(rsc_op)) {
4001 op_list = g_list_prepend(op_list, rsc_op);
4005 if (op_list == NULL) {
4013 if (active_filter == FALSE) {
4014 return sorted_op_list;
4021 for (gIter = sorted_op_list; gIter != NULL; gIter = gIter->next) {
4022 xmlNode *rsc_op = (xmlNode *) gIter->data;
4026 if (start_index < stop_index) {
4027 crm_trace(
"Skipping %s: not active",
ID(rsc_entry));
4030 }
else if (counter < start_index) {
4034 op_list = g_list_append(op_list, rsc_op);
4037 g_list_free(sorted_op_list);
4045 GList *output = NULL;
4046 GList *intermediate = NULL;
4048 xmlNode *tmp = NULL;
4053 xmlNode *node_state = NULL;
4055 for (node_state = pcmk__xe_first_child(status); node_state != NULL;
4056 node_state = pcmk__xe_next(node_state)) {
4066 if(this_node == NULL) {
4071 determine_remote_online_status(data_set, this_node);
4074 determine_online_status(node_state, this_node, data_set);
4083 xmlNode *lrm_rsc = NULL;
4088 for (lrm_rsc = pcmk__xe_first_child(tmp); lrm_rsc != NULL;
4089 lrm_rsc = pcmk__xe_next(lrm_rsc)) {
4091 if (pcmk__str_eq((
const char *)lrm_rsc->name,
4100 intermediate = extract_operations(uname, rsc_id, lrm_rsc, active_filter);
4101 output = g_list_concat(output, intermediate);
#define CRM_CHECK(expr, failure_action)
#define XML_RSC_OP_LAST_CHANGE
void verify_pe_options(GHashTable *options)
pe_node_t * pe_find_node(GList *node_list, const char *uname)
xmlNode * find_xml_node(xmlNode *cib, const char *node_path, gboolean must_find)
enum pe_quorum_policy no_quorum_policy
pe_node_t * pe_find_node_any(GList *node_list, const char *id, const char *uname)
GHashTable * pe__node_list2table(GList *list)
#define crm_notice(fmt, args...)
int pe__target_rc_from_xml(xmlNode *xml_op)
#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)
#define XML_NODE_IS_FENCED
#define XML_ATTR_TRANSITION_MAGIC
int pcmk__scan_min_int(const char *text, int *result, int minimum)
G_GNUC_INTERNAL gboolean unpack_remote_nodes(xmlNode *xml_resources, pe_working_set_t *data_set)
#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 pcmk__config_warn(fmt...)
#define XML_RULE_ATTR_SCORE
#define XML_BOOLEAN_FALSE
#define pe_flag_symmetric_cluster
int priority_fencing_delay
xmlNode * first_named_child(const xmlNode *parent, const char *name)
#define pe_flag_remove_after_stop
enum rsc_role_e next_role
#define pe_flag_maintenance_mode
enum action_fail_response on_fail
int char2score(const char *score)
#define pcmk__config_err(fmt...)
#define pe_proc_warn(fmt...)
pe_resource_t * remote_rsc
#define XML_TAG_TRANSIENT_NODEATTRS
#define CRMD_ACTION_NOTIFY
resource_object_functions_t * fns
G_GNUC_INTERNAL gboolean unpack_status(xmlNode *status, pe_working_set_t *data_set)
#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
bool pe__bundle_needs_remote_name(pe_resource_t *rsc, 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
pe_resource_t * pe_find_resource(GList *rsc_list, const char *id_rh)
time_t get_effective_time(pe_working_set_t *data_set)
#define CRM_LOG_ASSERT(expr)
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)
enum crm_ais_msg_types type
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
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
#define CRM_TRACE_INIT_DATA(name)
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)
G_GNUC_INTERNAL gboolean unpack_tags(xmlNode *xml_tags, pe_working_set_t *data_set)
pe_resource_t * pe__find_bundle_replica(const pe_resource_t *bundle, const pe_node_t *node)
int pcmk__scan_ll(const char *text, long long *result, long long default_value)
#define pe_flag_have_remote_nodes
GList * dangling_migrations
#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 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...)
G_GNUC_INTERNAL gboolean unpack_nodes(xmlNode *xml_nodes, pe_working_set_t *data_set)
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
bool pe__is_guest_node(const pe_node_t *node)
char * clone_strip(const char *last_rsc_id)
pe_resource_t *(* find_rsc)(pe_resource_t *parent, const char *search, const pe_node_t *node, int flags)
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
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.
bool xml_contains_remote_node(xmlNode *xml)
void calculate_active_ops(GList *sorted_op_list, int *start_index, int *stop_index)
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
#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)
G_GNUC_INTERNAL gboolean unpack_resources(xmlNode *xml_resources, pe_working_set_t *data_set)
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
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)
#define XML_RSC_ATTR_TARGET_ROLE
#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 pe__free_digests(gpointer ptr)
enum pe_obj_types variant
const char * placement_strategy
const char * pcmk__epoch2str(time_t *when)
char * pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms)
Generate an operation key (RESOURCE_ACTION_INTERVAL)
bool pe_can_fence(pe_working_set_t *data_set, pe_node_t *node)
#define XML_ATTR_TRANSITION_KEY
gboolean rsc_discovery_enabled
#define pe_flag_quick_location
const char * fail2text(enum action_fail_response fail)
GHashTable * pcmk__strkey_table(GDestroyNotify key_destroy_func, GDestroyNotify value_destroy_func)
#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.
char guint crm_parse_interval_spec(const char *input)
Parse milliseconds from a Pacemaker interval specification.
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)
void pe__set_next_role(pe_resource_t *rsc, enum rsc_role_e role, const char *why)
char * clone_zero(const char *last_rsc_id)
#define XML_ATTR_HAVE_WATCHDOG
#define XML_NODE_ATTR_RSC_DISCOVERY
#define CRMD_ACTION_METADATA
#define XML_LRM_ATTR_INTERVAL_MS
#define XML_LRM_ATTR_CALLID
#define CRMD_ACTION_MIGRATE
#define XML_NVPAIR_ATTR_VALUE
void(* free)(pe_resource_t *)
enum rsc_role_e fail_role
void native_add_running(pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set, gboolean failed)
#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
rsc_role_e
Possible roles that a resource can be in.
GHashTable * digest_cache
cache of calculated resource digests
bool pe__is_universal_clone(pe_resource_t *rsc, pe_working_set_t *data_set)
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_rsc_failure_ignored
pe_node_t *(* location)(const pe_resource_t *, GList **, int)
#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
GList * find_operations(const char *rsc, const char *node, gboolean active_filter, pe_working_set_t *data_set)
#define XML_CIB_TAG_GROUP
#define pe_flag_enable_unfencing
#define XML_LRM_TAG_RSC_OP
#define pe_rsc_trace(rsc, fmt, args...)
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
G_GNUC_INTERNAL gboolean unpack_config(xmlNode *config, pe_working_set_t *data_set)
void freeXpathObject(xmlXPathObjectPtr xpathObj)
const char * pe_base_name_end(const char *id)
gint sort_node_uname(gconstpointer a, gconstpointer b)
#define pe__clear_working_set_flags(working_set, flags_to_clear)
#define XPATH_ENABLE_UNFENCING
#define pe_flag_start_failure_fatal
#define XML_CIB_TAG_TICKETS
#define crm_info(fmt, args...)
GHashTable * template_rsc_sets
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
#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
xmlNode * crm_next_same_xml(const xmlNode *sibling)
Get next instance of same XML tag.
#define pe_flag_stop_rsc_orphans