30 #define set_config_flag(data_set, option, flag) do { \
31 const char *tmp = pe_pref(data_set->config_hash, option); \
33 if(crm_is_true(tmp)) { \
34 set_bit(data_set->flags, flag); \
36 clear_bit(data_set->flags, flag); \
42 xmlNode **last_failure,
47 static void add_node_attrs(xmlNode *attrs,
pe_node_t *node,
bool overwrite,
49 static void determine_online_status(xmlNode *node_state,
pe_node_t *this_node,
52 static void unpack_lrm_resources(
pe_node_t *node, xmlNode *lrm_state,
86 const char *reason,
bool priority_delay)
97 "(otherwise would because %s): "
98 "its guest resource %s is unmanaged",
101 crm_warn(
"Guest node %s will be fenced "
102 "(by recovering its guest resource %s): %s",
114 }
else if (is_dangling_guest_node(node)) {
115 crm_info(
"Cleaning up dangling connection for guest node %s: "
116 "fencing was already done because %s, "
117 "and guest resource no longer exists",
126 "(otherwise would because %s): connection is unmanaged",
132 pe_can_fence(data_set, node)?
"will be fenced" :
"is unclean",
137 pe_fence_op(node, NULL, TRUE, reason, FALSE, data_set);
140 crm_trace(
"Cluster node %s %s because %s",
142 pe_can_fence(data_set, node)?
"would also be fenced" :
"also is unclean",
148 pe_can_fence(data_set, node)?
"will be fenced" :
"is unclean",
151 pe_fence_op(node, NULL, TRUE, reason, priority_delay, data_set);
158 #define XPATH_UNFENCING_NVPAIR XML_CIB_TAG_NVPAIR \
159 "[(@" XML_NVPAIR_ATTR_NAME "='" XML_RSC_ATTR_PROVIDES "'" \
160 "or @" XML_NVPAIR_ATTR_NAME "='" XML_RSC_ATTR_REQUIRES "') " \
161 "and @" XML_NVPAIR_ATTR_VALUE "='unfencing']"
164 #define XPATH_ENABLE_UNFENCING \
165 "/" XML_TAG_CIB "/" XML_CIB_TAG_CONFIGURATION "/" XML_CIB_TAG_RESOURCES \
166 "//" XML_TAG_META_SETS "/" XPATH_UNFENCING_NVPAIR \
167 "|/" XML_TAG_CIB "/" XML_CIB_TAG_CONFIGURATION "/" XML_CIB_TAG_RSCCONFIG \
168 "/" XML_TAG_META_SETS "/" XPATH_UNFENCING_NVPAIR
171 void set_if_xpath(
unsigned long long flag,
const char *xpath,
174 xmlXPathObjectPtr result = NULL;
176 if (is_not_set(data_set->
flags, flag)) {
178 if (result && (numXpathResults(result) > 0)) {
188 const char *value = NULL;
189 GHashTable *config_hash = crm_str_table_new();
200 crm_info(
"Startup probes: disabled (dangerous)");
205 crm_notice(
"Watchdog will be used via SBD if fencing is required "
206 "and stonith-watchdog-timeout is nonzero");
220 crm_debug(
"STONITH of failed nodes is %s",
226 "Support for stonith-action of 'poweroff' is deprecated "
227 "and will be removed in a future release (use 'off' instead)");
244 crm_debug(
"Stop all active resources: %s",
249 crm_debug(
"Cluster is symmetric" " - resources can run anywhere by default");
269 crm_notice(
"Resetting no-quorum-policy to 'stop': cluster has never had quorum");
274 "fencing is disabled");
284 crm_debug(
"On loss of quorum: Freeze resources");
287 crm_debug(
"On loss of quorum: Stop ALL resources");
290 crm_notice(
"On loss of quorum: Fence all remaining nodes");
302 crm_trace(
"Orphan resource actions are %s",
306 crm_trace(
"Stopped resources are removed from the status section: %s",
315 is_set(data_set->
flags,
322 crm_trace(
"Unseen nodes will be fenced");
331 crm_debug(
"Node scores: 'red' = %s, 'yellow' = %s, 'green' = %s",
340 crm_trace(
"Resources will%s be locked to cleanly shut down nodes",
353 destroy_digest_cache(gpointer ptr)
379 if (new_node == NULL) {
384 new_node->
fixed = FALSE;
387 if (new_node->
details == NULL) {
392 crm_trace(
"Creating node for entry %s/%s", uname,
id);
404 }
else if ((type == NULL) ||
safe_str_eq(type,
"member")) {
422 destroy_digest_cache);
431 xmlNode *attr_set = NULL;
432 xmlNode *attr = NULL;
434 const char *container_id =
ID(xml_obj);
435 const char *remote_name = NULL;
436 const char *remote_server = NULL;
437 const char *remote_port = NULL;
438 const char *connect_timeout =
"60s";
439 const char *remote_allow_migrate=NULL;
440 const char *is_managed = NULL;
442 for (attr_set = __xml_first_child_element(xml_obj); attr_set != NULL;
443 attr_set = __xml_next_element(attr_set)) {
448 for (attr = __xml_first_child_element(attr_set); attr != NULL;
449 attr = __xml_next_element(attr)) {
456 remote_server = value;
459 }
else if (
safe_str_eq(name,
"remote-connect-timeout")) {
460 connect_timeout = value;
461 }
else if (
safe_str_eq(name,
"remote-allow-migrate")) {
462 remote_allow_migrate=value;
469 if (remote_name == NULL) {
478 remote_allow_migrate, is_managed,
479 connect_timeout, remote_server, remote_port);
511 xmlNode *xml_obj = NULL;
513 const char *
id = NULL;
514 const char *
uname = NULL;
515 const char *
type = NULL;
516 const char *score = NULL;
518 for (xml_obj = __xml_first_child_element(xml_nodes); xml_obj != NULL;
519 xml_obj = __xml_next_element(xml_obj)) {
528 crm_trace(
"Processing node %s/%s", uname,
id);
532 "> entry in configuration without id");
537 if (new_node == NULL) {
547 handle_startup_fencing(data_set, new_node);
549 add_node_attrs(xml_obj, new_node, FALSE, data_set);
559 crm_info(
"Creating a fake local node");
570 const char *container_id = NULL;
575 for (; gIter != NULL; gIter = gIter->next) {
578 setup_container(child_rsc, data_set);
591 pe_rsc_trace(rsc,
"Resource %s's container is %s", rsc->
id, container_id);
593 pe_err(
"Resource %s: Unknown resource container (%s)", rsc->
id, container_id);
601 xmlNode *xml_obj = NULL;
606 for (xml_obj = __xml_first_child_element(xml_resources); xml_obj != NULL;
607 xml_obj = __xml_next_element(xml_obj)) {
609 const char *new_node_id = NULL;
615 new_node_id =
ID(xml_obj);
619 crm_trace(
"Found remote node %s defined by resource %s",
620 new_node_id,
ID(xml_obj));
635 new_node_id = expand_remote_rsc_meta(xml_obj, xml_resources, data_set);
637 crm_trace(
"Found guest node %s in resource %s",
638 new_node_id,
ID(xml_obj));
649 xmlNode *xml_obj2 = NULL;
650 for (xml_obj2 = __xml_first_child_element(xml_obj); xml_obj2 != NULL;
651 xml_obj2 = __xml_next_element(xml_obj2)) {
653 new_node_id = expand_remote_rsc_meta(xml_obj2, xml_resources, data_set);
656 crm_trace(
"Found guest node %s in resource %s inside group %s",
657 new_node_id,
ID(xml_obj2),
ID(xml_obj));
692 pe_rsc_trace(new_rsc,
"Linking remote connection resource %s to node %s",
700 handle_startup_fencing(data_set, remote_node);
707 strdup(
"container"));
712 destroy_tag(gpointer data)
718 g_list_free_full(tag->
refs, free);
738 xmlNode *xml_obj = NULL;
745 for (xml_obj = __xml_first_child_element(xml_resources); xml_obj != NULL;
746 xml_obj = __xml_next_element(xml_obj)) {
751 const char *template_id =
ID(xml_obj);
754 template_id, NULL, NULL) == FALSE) {
761 crm_trace(
"Beginning unpack... <%s id=%s... >", crm_element_name(xml_obj),
ID(xml_obj));
762 if (
common_unpack(xml_obj, &new_rsc, NULL, data_set) && (new_rsc != NULL)) {
768 "because configuration is invalid",
769 crm_element_name(xml_obj),
crm_str(
ID(xml_obj)));
770 if (new_rsc != NULL && new_rsc->
fns != NULL) {
776 for (gIter = data_set->
resources; gIter != NULL; gIter = gIter->next) {
779 setup_container(rsc, data_set);
780 link_rsc2remotenode(data_set, rsc);
790 pcmk__config_err(
"Resource start-up disabled since no STONITH resources have been defined");
791 pcmk__config_err(
"Either configure some or disable STONITH with the stonith-enabled option");
792 pcmk__config_err(
"NOTE: Clusters with shared data need STONITH to ensure data integrity");
801 xmlNode *xml_tag = NULL;
806 for (xml_tag = __xml_first_child_element(xml_tags); xml_tag != NULL;
807 xml_tag = __xml_next_element(xml_tag)) {
809 xmlNode *xml_obj_ref = NULL;
810 const char *tag_id =
ID(xml_tag);
816 if (tag_id == NULL) {
818 crm_element_name(xml_tag));
822 for (xml_obj_ref = __xml_first_child_element(xml_tag); xml_obj_ref != NULL;
823 xml_obj_ref = __xml_next_element(xml_obj_ref)) {
825 const char *obj_ref =
ID(xml_obj_ref);
831 if (obj_ref == NULL) {
833 crm_element_name(xml_obj_ref), tag_id);
851 const char *ticket_id = NULL;
852 const char *granted = NULL;
853 const char *last_granted = NULL;
854 const char *standby = NULL;
855 xmlAttrPtr xIter = NULL;
859 ticket_id =
ID(xml_ticket);
860 if (ticket_id == NULL || strlen(ticket_id) == 0) {
864 crm_trace(
"Processing ticket state for %s", ticket_id);
866 ticket = g_hash_table_lookup(data_set->
tickets, ticket_id);
867 if (ticket == NULL) {
869 if (ticket == NULL) {
874 for (xIter = xml_ticket->properties; xIter; xIter = xIter->next) {
875 const char *prop_name = (
const char *)xIter->name;
881 g_hash_table_replace(ticket->
state, strdup(prop_name), strdup(prop_value));
884 granted = g_hash_table_lookup(ticket->
state,
"granted");
890 crm_info(
"We do not have ticket '%s'", ticket->
id);
893 last_granted = g_hash_table_lookup(ticket->
state,
"last-granted");
898 standby = g_hash_table_lookup(ticket->
state,
"standby");
902 crm_info(
"Granted ticket '%s' is in standby-mode", ticket->
id);
908 crm_trace(
"Done with ticket state for %s", ticket_id);
916 xmlNode *xml_obj = NULL;
918 for (xml_obj = __xml_first_child_element(xml_tickets); xml_obj != NULL;
919 xml_obj = __xml_next_element(xml_obj)) {
924 unpack_ticket_state(xml_obj, data_set);
933 const char *resource_discovery_enabled = NULL;
934 xmlNode *attrs = NULL;
955 add_node_attrs(attrs, this_node, TRUE, data_set);
977 if (resource_discovery_enabled && !
crm_is_true(resource_discovery_enabled)) {
980 crm_warn(
"Ignoring %s attribute on remote node %s because stonith is disabled",
997 bool changed =
false;
998 xmlNode *lrm_rsc = NULL;
1000 for (xmlNode *state = __xml_first_child_element(status); state != NULL;
1001 state = __xml_next_element(state)) {
1003 const char *
id = NULL;
1004 const char *
uname = NULL;
1006 bool process = FALSE;
1016 if (this_node == NULL) {
1017 crm_info(
"Node %s is unknown",
id);
1021 crm_trace(
"Node %s was already processed",
id);
1036 }
else if(rsc == NULL) {
1056 determine_remote_online_status(data_set, this_node);
1057 unpack_handle_remote_attrs(this_node, state, data_set);
1072 crm_trace(
"Processing lrm resource entries on %shealthy%s node: %s",
1081 unpack_lrm_resources(this_node, lrm_rsc, data_set);
1093 const char *
id = NULL;
1094 const char *uname = NULL;
1096 xmlNode *state = NULL;
1101 if (data_set->
tickets == NULL) {
1106 for (state = __xml_first_child_element(status); state != NULL;
1107 state = __xml_next_element(state)) {
1110 unpack_tickets_state((xmlNode *) state, data_set);
1113 xmlNode *attrs = NULL;
1114 const char *resource_discovery_enabled = NULL;
1120 if (uname == NULL) {
1124 }
else if (this_node == NULL) {
1126 "because no longer in configuration", uname);
1139 crm_trace(
"Processing node id=%s, uname=%s",
id, uname);
1147 add_node_attrs(attrs, this_node, TRUE, data_set);
1160 if (resource_discovery_enabled && !
crm_is_true(resource_discovery_enabled)) {
1161 crm_warn(
"ignoring %s attribute on node %s, disabling resource discovery is not allowed on cluster nodes",
1166 determine_online_status(state, this_node, data_set);
1175 pe_fence_node(data_set, this_node,
"cluster does not have quorum", FALSE);
1181 while(unpack_node_loop(status, FALSE, data_set)) {
1192 for (GList *item = data_set->
stop_needed; item; item = item->next) {
1194 pe_node_t *node = pe__current_node(container);
1204 for (
GListPtr gIter = data_set->
nodes; gIter != NULL; gIter = gIter->next) {
1207 if (this_node == NULL) {
1214 determine_remote_online_status(data_set, this_node);
1221 determine_online_status_no_fencing(
pe_working_set_t * data_set, xmlNode * node_state,
1224 gboolean online = FALSE;
1237 crm_debug(
"Node is not ready to run resources: %s", join);
1242 crm_trace(
"\tis_peer=%s, join=%s, expected=%s",
1247 pe_fence_node(data_set, this_node,
"peer is unexpectedly down", FALSE);
1248 crm_info(
"\tin_cluster=%s, is_peer=%s, join=%s, expected=%s",
1255 determine_online_status_fencing(
pe_working_set_t * data_set, xmlNode * node_state,
1258 gboolean online = FALSE;
1259 gboolean do_terminate = FALSE;
1260 bool crmd_online = FALSE;
1275 do_terminate = TRUE;
1277 }
else if (terminate != NULL && strlen(terminate) > 0) {
1279 char t = terminate[0];
1281 if (t !=
'0' && isdigit(t)) {
1282 do_terminate = TRUE;
1286 crm_trace(
"%s: in_cluster=%s, is_peer=%s, join=%s, expected=%s, term=%d",
1292 if (exp_state == NULL) {
1300 online = crmd_online;
1302 }
else if (in_cluster == NULL) {
1303 pe_fence_node(data_set, this_node,
"peer has not been seen by the cluster", FALSE);
1306 pe_fence_node(data_set, this_node,
"peer failed the pacemaker membership criteria", FALSE);
1320 &&
crm_is_true(in_cluster) == FALSE && !crmd_online) {
1326 pe_fence_node(data_set, this_node,
"peer is no longer part of the cluster", TRUE);
1328 }
else if (!crmd_online) {
1329 pe_fence_node(data_set, this_node,
"peer process is no longer available", FALSE);
1332 }
else if (do_terminate) {
1333 pe_fence_node(data_set, this_node,
"termination was requested", FALSE);
1345 pe_fence_node(data_set, this_node,
"peer was in an unknown state", FALSE);
1346 crm_warn(
"%s: in-cluster=%s, is-peer=%s, join=%s, expected=%s, term=%d, shutdown=%d",
1367 goto remote_online_done;
1372 if (container && pcmk__list_of_1(rsc->
running_on)) {
1378 crm_trace(
"%s node %s presumed ONLINE because connection resource is started",
1379 (container?
"Guest" :
"Remote"), this_node->
details->
id);
1385 crm_trace(
"%s node %s shutting down because connection resource is stopping",
1386 (container?
"Guest" :
"Remote"), this_node->
details->
id);
1392 crm_trace(
"Guest node %s UNCLEAN because guest resource failed",
1398 crm_trace(
"%s node %s OFFLINE because connection resource failed",
1399 (container?
"Guest" :
"Remote"), this_node->
details->
id);
1405 crm_trace(
"%s node %s OFFLINE because its resource is stopped",
1406 (container?
"Guest" :
"Remote"), this_node->
details->
id);
1412 crm_trace(
"Guest node %s UNCLEAN because host is unclean",
1426 gboolean online = FALSE;
1449 online = determine_online_status_no_fencing(data_set, node_state, this_node);
1452 online = determine_online_status_fencing(data_set, node_state, this_node);
1460 this_node->
fixed = TRUE;
1466 this_node->
fixed = TRUE;
1499 if (!pcmk__str_empty(
id)) {
1500 const char *end =
id + strlen(
id) - 1;
1502 for (
const char *s = end; s >
id; --s) {
1516 return (s == end)? s : (s - 1);
1540 char *basename = NULL;
1543 basename =
strndup(last_rsc_id, end - last_rsc_id + 1);
1562 size_t base_name_len = end - last_rsc_id + 1;
1566 zero = calloc(base_name_len + 3,
sizeof(
char));
1568 memcpy(zero, last_rsc_id, base_name_len);
1569 zero[base_name_len] =
':';
1570 zero[base_name_len + 1] =
'0';
1575 create_fake_resource(
const char *rsc_id, xmlNode * rsc_entry,
pe_working_set_t * data_set)
1591 crm_debug(
"Detected orphaned remote node %s", rsc_id);
1596 link_rsc2remotenode(data_set, rsc);
1599 crm_trace(
"Setting node %s as shutting down due to orphaned connection resource", rsc_id);
1606 crm_trace(
"Detected orphaned container filler %s", rsc_id);
1619 create_anonymous_orphan(
pe_resource_t *parent,
const char *rsc_id,
1627 pe_rsc_debug(parent,
"Created orphan %s for %s: %s on %s",
1653 gboolean skip_inactive = FALSE;
1661 for (rIter = parent->
children; rsc == NULL && rIter; rIter = rIter->next) {
1706 crm_notice(
"Active (now-)anonymous clone %s has "
1707 "multiple (orphan) instance histories on %s",
1709 skip_inactive = TRUE;
1716 g_list_free(locations);
1720 if (!skip_inactive && !inactive_instance
1723 inactive_instance = parent->
fns->
find_rsc(child, rsc_id, NULL,
1729 if (inactive_instance && inactive_instance->
pending_node
1731 inactive_instance = NULL;
1737 if ((rsc == NULL) && !skip_inactive && (inactive_instance != NULL)) {
1738 pe_rsc_trace(parent,
"Resource %s, empty slot", inactive_instance->
id);
1739 rsc = inactive_instance;
1763 rsc = create_anonymous_orphan(parent, rsc_id, node, data_set);
1771 xmlNode * rsc_entry)
1790 crm_trace(
"%s found as %s (%s)", rsc_id, clone0_id, parent->
id);
1792 crm_trace(
"%s is not known as %s either (orphan)",
1798 crm_trace(
"Resource history for %s is orphaned because it is no longer primitive",
1806 if (pe_rsc_is_anon_clone(parent)) {
1808 if (pe_rsc_is_bundled(parent)) {
1813 rsc = find_anonymous_clone(data_set, node, parent, base);
1824 pe_rsc_debug(rsc,
"Internally renamed %s on %s to %s%s",
1838 rsc = create_fake_resource(rsc_id, rsc_entry, data_set);
1857 char *reason = NULL;
1860 pe_rsc_trace(rsc,
"Resource %s is %s on %s: on_fail=%s",
1888 gboolean should_fence = FALSE;
1899 should_fence = TRUE;
1913 " revoked if remote connection can "
1914 "be re-established elsewhere)",
1917 should_fence = TRUE;
1921 if (reason == NULL) {
1984 if (rsc->
container && pe_rsc_is_bundled(rsc)) {
2014 "remote connection is unrecoverable", FALSE);
2049 "%s because cluster is configured not to "
2050 "stop active orphans",
2073 for (; gIter != NULL; gIter = gIter->next) {
2079 g_list_free(possible_matches);
2086 int start_index,
int stop_index,
2090 const char *task = NULL;
2091 const char *status = NULL;
2095 pe_rsc_trace(rsc,
"%s: Start index %d, stop index = %d", rsc->
id, start_index, stop_index);
2097 for (; gIter != NULL; gIter = gIter->next) {
2098 xmlNode *rsc_op = (xmlNode *) gIter->data;
2100 guint interval_ms = 0;
2102 const char *
id =
ID(rsc_op);
2111 }
else if (start_index < stop_index && counter <= stop_index) {
2115 }
else if (counter < start_index) {
2121 if (interval_ms == 0) {
2143 int implied_monitor_start = -1;
2144 int implied_clone_start = -1;
2145 const char *task = NULL;
2146 const char *status = NULL;
2152 for (; gIter != NULL; gIter = gIter->next) {
2153 xmlNode *rsc_op = (xmlNode *) gIter->data;
2162 *stop_index = counter;
2165 *start_index = counter;
2171 implied_monitor_start = counter;
2174 implied_clone_start = counter;
2178 if (*start_index == -1) {
2179 if (implied_clone_start != -1) {
2180 *start_index = implied_clone_start;
2181 }
else if (implied_monitor_start != -1) {
2182 *start_index = implied_monitor_start;
2192 time_t lock_time = 0;
2195 &lock_time) ==
pcmk_ok) && (lock_time != 0)) {
2200 pe_rsc_info(rsc,
"Shutdown lock for %s on %s expired",
2214 int stop_index = -1;
2215 int start_index = -1;
2218 const char *task = NULL;
2225 xmlNode *migrate_op = NULL;
2226 xmlNode *rsc_op = NULL;
2227 xmlNode *last_failure = NULL;
2233 crm_element_name(rsc_entry), rsc_id, node->
details->
uname);
2237 sorted_op_list = NULL;
2239 for (rsc_op = __xml_first_child_element(rsc_entry); rsc_op != NULL;
2240 rsc_op = __xml_next_element(rsc_op)) {
2242 op_list = g_list_prepend(op_list, rsc_op);
2247 if (op_list == NULL) {
2254 rsc = unpack_find_resource(data_set, node, rsc_id, rsc_entry);
2256 if (op_list == NULL) {
2260 rsc = process_orphan_resource(rsc_entry, node, data_set);
2267 unpack_shutdown_lock(rsc_entry, rsc, node, data_set);
2271 saved_role = rsc->
role;
2276 for (gIter = sorted_op_list; gIter != NULL; gIter = gIter->next) {
2277 xmlNode *rsc_op = (xmlNode *) gIter->data;
2281 migrate_op = rsc_op;
2284 unpack_rsc_op(rsc, node, rsc_op, &last_failure, &on_fail, data_set);
2289 process_recurring(node, rsc, start_index, stop_index, sorted_op_list, data_set);
2292 g_list_free(sorted_op_list);
2294 process_rsc_state(rsc, node, on_fail, migrate_op, data_set);
2298 pe_rsc_debug(rsc,
"%s: Overwriting calculated next role %s"
2299 " with requested next role %s",
2304 pe_rsc_info(rsc,
"%s: Not overwriting calculated next role %s"
2305 " with requested next role %s",
2310 if (saved_role > rsc->
role) {
2311 rsc->
role = saved_role;
2318 handle_orphaned_container_fillers(xmlNode * lrm_rsc_list,
pe_working_set_t * data_set)
2320 xmlNode *rsc_entry = NULL;
2321 for (rsc_entry = __xml_first_child_element(lrm_rsc_list); rsc_entry != NULL;
2322 rsc_entry = __xml_next_element(rsc_entry)) {
2327 const char *container_id;
2335 if (container_id == NULL || rsc_id == NULL) {
2340 if (container == NULL) {
2351 pe_rsc_trace(rsc,
"Mapped container of orphaned resource %s to %s",
2352 rsc->
id, container_id);
2359 unpack_lrm_resources(
pe_node_t *node, xmlNode *lrm_rsc_list,
2362 xmlNode *rsc_entry = NULL;
2363 gboolean found_orphaned_container_filler = FALSE;
2365 for (rsc_entry = __xml_first_child_element(lrm_rsc_list); rsc_entry != NULL;
2366 rsc_entry = __xml_next_element(rsc_entry)) {
2369 pe_resource_t *rsc = unpack_lrm_rsc_state(node, rsc_entry, data_set);
2374 found_orphaned_container_filler = TRUE;
2382 if (found_orphaned_container_filler) {
2383 handle_orphaned_container_fillers(lrm_rsc_list, data_set);
2400 set_node_score(gpointer key, gpointer value, gpointer user_data)
2403 int *score = user_data;
2408 #define STATUS_PATH_MAX 1024
2410 find_lrm_op(
const char *resource,
const char *op,
const char *node,
const char *source,
2415 xmlNode *xml = NULL;
2417 offset += snprintf(xpath + offset,
STATUS_PATH_MAX - offset,
"//node_state[@uname='%s']", node);
2442 if (xml && success_only) {
2456 pe__call_id(xmlNode *op_xml)
2489 return (stop_op && (pe__call_id(stop_op) > pe__call_id(xml_op)));
2514 int from_status = 0;
2517 xmlNode *migrate_from = NULL;
2524 if (stop_happened_after(rsc, node, xml_op, data_set)) {
2536 source, FALSE, data_set);
2540 pe_rsc_trace(rsc,
"%s op on %s exited with status=%d, rc=%d",
2541 ID(migrate_from), target, from_status, from_rc);
2550 pe_rsc_trace(rsc,
"Detected dangling migration op: %s on %s",
ID(xml_op),
2557 pe_rsc_trace(rsc,
"Marking active on %s %p %d", target, target_node,
2564 pe_rsc_trace(rsc,
"Marking active on %s %p %d", target, target_node,
2590 int target_stop_id = 0;
2591 int target_migrate_from_id = 0;
2592 xmlNode *target_stop = NULL;
2593 xmlNode *target_migrate_from = NULL;
2608 target_stop_id = pe__call_id(target_stop);
2612 source, TRUE, data_set);
2613 target_migrate_from_id = pe__call_id(target_migrate_from);
2615 if ((target_stop == NULL) || (target_stop_id < target_migrate_from_id)) {
2623 target_stop_id, target_migrate_from_id);
2628 }
else if (target_migrate_from == NULL) {
2639 xmlNode *source_migrate_from = NULL;
2640 xmlNode *source_start = NULL;
2641 int source_migrate_to_id = pe__call_id(xml_op);
2644 NULL, TRUE, data_set);
2645 if (pe__call_id(source_migrate_from) > source_migrate_to_id) {
2651 if (pe__call_id(source_start) > source_migrate_to_id) {
2664 xmlNode *source_stop = NULL;
2665 xmlNode *source_migrate_to = NULL;
2683 source, target, TRUE, data_set);
2685 if ((source_stop == NULL)
2686 || (pe__call_id(source_stop) < pe__call_id(source_migrate_to))) {
2700 record_failed_op(xmlNode *op,
const pe_node_t *node,
2703 xmlNode *xIter = NULL;
2710 for (xIter = data_set->
failed->children; xIter; xIter = xIter->next) {
2726 static const char *get_op_key(xmlNode *xml_op)
2736 last_change_str(xmlNode *xml_op)
2739 const char *when_s = NULL;
2746 when_s = strchr(when_s,
' ');
2752 return ((when_s && *when_s)? when_s :
"unknown time");
2759 guint interval_ms = 0;
2760 bool is_probe =
false;
2763 const char *key = get_op_key(xml_op);
2771 *last_failure = xml_op;
2778 if (exit_reason == NULL) {
2784 crm_trace(
"Unexpected result (%s%s%s) was recorded for "
2785 "%s of %s on %s at %s " CRM_XS " rc=%d id=%s",
2786 services_ocf_exitcode_str(rc),
2787 (*exit_reason?
": " :
""), exit_reason,
2789 last_change_str(xml_op), rc,
ID(xml_op));
2791 crm_warn(
"Unexpected result (%s%s%s) was recorded for "
2792 "%s of %s on %s at %s " CRM_XS " rc=%d id=%s",
2793 services_ocf_exitcode_str(rc),
2794 (*exit_reason?
": " :
""), exit_reason,
2796 last_change_str(xml_op), rc,
ID(xml_op));
2805 crm_notice(
"If it is not possible for %s to run on %s, see "
2806 "the resource-discovery option for location constraints",
2810 record_failed_op(xml_op, node, rsc, data_set);
2813 action =
custom_action(rsc, strdup(key), task, NULL, TRUE, FALSE, data_set);
2827 unpack_migrate_to_failure(rsc, node, xml_op, data_set);
2830 unpack_migrate_from_failure(rsc, node, xml_op, data_set);
2863 pe_rsc_trace(rsc,
"Resource %s: role=%s, unclean=%s, on_fail=%s, fail_role=%s",
2880 if (pe_rsc_is_clone(parent)
2888 crm_notice(
"%s will not be started under current conditions",
2895 g_hash_table_foreach(fail_rsc->
allowed_nodes, set_node_score, &score);
2921 determine_op_status(
2924 guint interval_ms = 0;
2925 bool is_probe =
false;
2927 const char *key = get_op_key(xml_op);
2935 if (exit_reason == NULL) {
2945 if (target_rc < 0) {
2955 crm_warn(
"Expected result not found for %s on %s (corrupt or obsolete CIB?)",
2958 }
else if (target_rc != rc) {
2960 pe_rsc_debug(rsc,
"%s on %s: expected %d (%s), got %d (%s%s%s)",
2962 target_rc, services_ocf_exitcode_str(target_rc),
2963 rc, services_ocf_exitcode_str(rc),
2964 (*exit_reason?
": " :
""), exit_reason);
2971 pe_rsc_info(rsc,
"Probe found %s active on %s at %s",
2973 last_change_str(xml_op));
2989 if (is_probe && (rc != target_rc)) {
2992 "Probe found %s active and promoted on %s at %s",
2994 last_change_str(xml_op));
3010 if (interval_ms > 0) {
3021 pe_proc_err(
"No further recovery can be attempted for %s "
3022 "because %s on %s failed (%s%s%s) at %s "
3023 CRM_XS " rc=%d id=%s", rsc->
id, task,
3025 (*exit_reason?
": " :
""), exit_reason,
3026 last_change_str(xml_op), rc,
ID(xml_op));
3035 crm_info(
"Treating unknown exit status %d from %s of %s "
3036 "on %s at %s as failure",
3038 last_change_str(xml_op));
3048 should_clear_for_param_change(xmlNode *xml_op,
const char *task,
3052 if (!strcmp(task,
"start") || !strcmp(task,
"monitor")) {
3066 switch (digest_data->
rc) {
3068 crm_trace(
"Resource %s history entry %s on %s"
3069 " has no digest to compare",
3098 should_ignore_failure_timeout(
pe_resource_t *rsc, xmlNode *xml_op,
3099 const char *task, guint interval_ms,
3129 if (is_last_failure) {
3130 crm_info(
"Waiting to clear monitor failure for remote node %s"
3131 " until fencing has occurred", rsc->
id);
3165 bool expired = FALSE;
3167 time_t last_run = 0;
3168 guint interval_ms = 0;
3169 int unexpired_fail_count = 0;
3171 const char *clear_reason = NULL;
3182 time_t last_failure = 0;
3186 && !should_ignore_failure_timeout(rsc, xml_op, task, interval_ms,
3187 is_last_failure, data_set)) {
3197 crm_trace(
"%s@%lld is %sexpired @%lld with unexpired_failures=%d timeout=%ds"
3198 " last-failure@%lld",
3199 ID(xml_op), (
long long) last_run, (expired?
"" :
"not "),
3201 (
long long) last_failure);
3203 if (unexpired_fail_count && (now < last_failure)) {
3213 if (unexpired_fail_count == 0) {
3215 clear_reason =
"it expired";
3231 clear_reason =
"reconnect interval is set";
3235 if (!expired && is_last_failure
3236 && should_clear_for_param_change(xml_op, task, rsc, node, data_set)) {
3237 clear_reason =
"resource parameters have changed";
3240 if (clear_reason != NULL) {
3255 crm_info(
"Clearing %s failure will wait until any scheduled "
3256 "fencing of %s completes", task, rsc->
id);
3257 order_after_remote_fencing(clear_op, rsc, data_set);
3302 update_resource_state(
pe_resource_t * rsc,
pe_node_t * node, xmlNode * xml_op,
const char * task,
int rc,
3305 gboolean clear_past_failure = FALSE;
3311 clear_past_failure = TRUE;
3318 const char *op_key = get_op_key(xml_op);
3319 const char *last_failure_key = get_op_key(last_failure);
3322 clear_past_failure = TRUE;
3332 clear_past_failure = TRUE;
3336 clear_past_failure = TRUE;
3340 clear_past_failure = TRUE;
3348 clear_past_failure = TRUE;
3351 unpack_migrate_to_success(rsc, node, xml_op, data_set);
3359 if (clear_past_failure) {
3365 pe_rsc_trace(rsc,
"%s.%s is not cleared by a completed stop",
3413 remap_monitor_rc(
int rc, xmlNode *xml_op,
const pe_node_t *node,
3416 int remapped_rc =
rc;
3431 if (rc != remapped_rc) {
3432 crm_trace(
"Remapping monitor result %d to %d", rc, remapped_rc);
3434 record_failed_op(xml_op, node, rsc, data_set);
3449 guint interval_ms = 0;
3450 const char *task = NULL;
3451 const char *task_key = NULL;
3452 const char *exit_reason = NULL;
3453 bool expired = FALSE;
3457 CRM_CHECK(rsc && node && xml_op,
return);
3460 task_key = get_op_key(xml_op);
3463 if (exit_reason == NULL) {
3486 pe_rsc_trace(rsc,
"Unpacking task %s/%s (call_id=%d, status=%d, rc=%d) on %s (role=%s)",
3490 pe_rsc_trace(rsc,
"Node %s (where %s is running) is unclean."
3491 " Further action depends on the value of the stop's on-fail attribute",
3508 && check_operation_expiry(rsc, node, rc, xml_op, data_set)) {
3513 rc = remap_monitor_rc(rc, xml_op, node, rsc, data_set);
3516 if (expired && (rc != target_rc)) {
3519 if (interval_ms == 0) {
3520 crm_notice(
"Ignoring expired %s failure on %s "
3521 CRM_XS " actual=%d expected=%d magic=%s",
3536 crm_notice(
"Rescheduling %s after failure expired on %s "
3537 CRM_XS " actual=%d expected=%d magic=%s",
3550 status = determine_op_status(rsc, rc, target_rc, node, xml_op, on_fail, data_set);
3551 pe_rsc_trace(rsc,
"Remapped %s status to %d", task_key, status);
3557 pe_err(
"Resource history contains cancellation '%s' "
3558 "(%s of %s on %s at %s)",
3560 last_change_str(xml_op));
3602 last_change_str(xml_op),
ID(xml_op));
3603 update_resource_state(rsc, node, xml_op, task, rc, *last_failure, on_fail, data_set);
3607 failure_strategy = get_action_on_fail(rsc, task_key, task, data_set);
3609 crm_warn(
"Cannot ignore failed %s of %s on %s: "
3610 "Resource agent doesn't exist "
3611 CRM_XS " status=%d rc=%d id=%s",
3618 unpack_rsc_op_failure(rsc, node, rc, xml_op, last_failure, on_fail, data_set);
3642 failure_strategy = get_action_on_fail(rsc, task_key, task, data_set);
3647 crm_warn(
"Pretending failed %s (%s%s%s) of %s on %s at %s "
3648 "succeeded " CRM_XS " rc=%d id=%s",
3649 task, services_ocf_exitcode_str(rc),
3650 (*exit_reason?
": " :
""), exit_reason, rsc->
id,
3654 update_resource_state(rsc, node, xml_op, task, target_rc, *last_failure, on_fail, data_set);
3658 record_failed_op(xml_op, node, rsc, data_set);
3661 *on_fail = failure_strategy;
3665 unpack_rsc_op_failure(rsc, node, rc, xml_op, last_failure, on_fail, data_set);
3669 "Preventing %s from restarting on %s because "
3670 "of hard failure (%s%s%s)" CRM_XS " rc=%d id=%s",
3672 services_ocf_exitcode_str(rc),
3673 (*exit_reason?
": " :
""), exit_reason,
3678 crm_err(
"Preventing %s from restarting anywhere because "
3679 "of fatal failure (%s%s%s) " CRM_XS " rc=%d id=%s",
3680 parent->
id, services_ocf_exitcode_str(rc),
3681 (*exit_reason?
": " :
""), exit_reason,
3690 pe_rsc_trace(rsc,
"Resource %s after %s: role=%s, next=%s",
3696 add_node_attrs(xmlNode *xml_obj,
pe_node_t *node,
bool overwrite,
3699 const char *cluster_name = NULL;
3716 cluster_name = g_hash_table_lookup(data_set->
config_hash,
"cluster-name");
3719 strdup(cluster_name));
3733 }
else if (cluster_name) {
3737 strdup(cluster_name));
3743 extract_operations(
const char *node,
const char *rsc, xmlNode * rsc_entry, gboolean active_filter)
3746 int stop_index = -1;
3747 int start_index = -1;
3749 xmlNode *rsc_op = NULL;
3757 sorted_op_list = NULL;
3759 for (rsc_op = __xml_first_child_element(rsc_entry);
3760 rsc_op != NULL; rsc_op = __xml_next_element(rsc_op)) {
3764 op_list = g_list_prepend(op_list, rsc_op);
3768 if (op_list == NULL) {
3776 if (active_filter == FALSE) {
3777 return sorted_op_list;
3784 for (gIter = sorted_op_list; gIter != NULL; gIter = gIter->next) {
3785 xmlNode *rsc_op = (xmlNode *) gIter->data;
3789 if (start_index < stop_index) {
3790 crm_trace(
"Skipping %s: not active",
ID(rsc_entry));
3793 }
else if (counter < start_index) {
3797 op_list = g_list_append(op_list, rsc_op);
3800 g_list_free(sorted_op_list);
3811 xmlNode *tmp = NULL;
3816 xmlNode *node_state = NULL;
3818 for (node_state = __xml_first_child_element(status); node_state != NULL;
3819 node_state = __xml_next_element(node_state)) {
3829 if(this_node == NULL) {
3834 determine_remote_online_status(data_set, this_node);
3837 determine_online_status(node_state, this_node, data_set);
3845 xmlNode *lrm_rsc = NULL;
3850 for (lrm_rsc = __xml_first_child_element(tmp); lrm_rsc != NULL;
3851 lrm_rsc = __xml_next_element(lrm_rsc)) {
3860 intermediate = extract_operations(uname, rsc_id, lrm_rsc, active_filter);
3861 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...)
int pe__target_rc_from_xml(xmlNode *xml_op)
#define CRMD_ACTION_MIGRATED
#define pe_flag_stop_action_orphans
#define pe_rsc_debug(rsc, fmt, args...)
#define XML_CONFIG_ATTR_SHUTDOWN_LOCK
gboolean safe_str_neq(const char *a, const char *b)
gint sort_rsc_priority(gconstpointer a, gconstpointer b)
GListPtr dangling_migrations
#define XML_NODE_IS_FENCED
#define XML_ATTR_TRANSITION_MAGIC
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
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
enum action_fail_response on_fail
int char2score(const char *score)
#define pe_proc_warn(fmt...)
pe_resource_t * remote_rsc
#define XML_TAG_TRANSIENT_NODEATTRS
#define CRMD_ACTION_NOTIFY
resource_object_functions_t * fns
gboolean pe__is_guest_or_remote_node(pe_node_t *node)
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
int crm_parse_int(const char *text, const char *default_text)
Parse an integer value from a string.
#define XML_NVPAIR_ATTR_NAME
#define XML_NODE_IS_MAINTENANCE
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
#define XML_NODE_EXPECTED
gboolean xml_contains_remote_node(xmlNode *xml)
#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)
#define clear_bit(word, bit)
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.
#define pe_flag_have_quorum
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 XML_CIB_TAG_PROPSET
gboolean pe__is_remote_node(pe_node_t *node)
#define CRM_TRACE_INIT_DATA(name)
#define pe_flag_stop_everything
#define XML_LRM_ATTR_RSCID
gboolean remote_maintenance
#define CRMD_ACTION_START
#define XML_LRM_ATTR_TASK_KEY
#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)
GListPtr find_operations(const char *rsc, const char *node, gboolean active_filter, pe_working_set_t *data_set)
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 set_bit(word, bit)
#define crm_atoi(text, default_text)
#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
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.
char * digest_secure_calc
void calculate_active_ops(GList *sorted_op_list, int *start_index, int *stop_index)
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)
void pe__unpack_dataset_nvpairs(xmlNode *xml_obj, const char *set_name, GHashTable *node_hash, GHashTable *hash, const char *always_first, gboolean overwrite, 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_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
gboolean crm_str_eq(const char *a, const char *b, gboolean use_case)
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
#define pe_flag_quick_location
gboolean pe__is_guest_node(pe_node_t *node)
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)
bool pcmk__ends_with(const char *s, const char *match)
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)
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
#define XML_LRM_ATTR_OPSTATUS
#define CRMD_JOINSTATE_PENDING
enum pe_action_flags flags
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
#define XML_CIB_TAG_GROUP
#define pe_flag_enable_unfencing
#define XML_LRM_TAG_RSC_OP
#define pe_rsc_trace(rsc, fmt, args...)
#define safe_str_eq(a, b)
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)
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...)
char * digest_restart_calc
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)
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