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",
115 }
else if (is_dangling_guest_node(node)) {
116 crm_info(
"Cleaning up dangling connection for guest node %s: "
117 "fencing was already done because %s, "
118 "and guest resource no longer exists",
128 "(otherwise would because %s): connection is unmanaged",
134 pe_can_fence(data_set, node)?
"will be fenced" :
"is unclean",
139 pe_fence_op(node, NULL, TRUE, reason, FALSE, data_set);
142 crm_trace(
"Cluster node %s %s because %s",
144 pe_can_fence(data_set, node)?
"would also be fenced" :
"also is unclean",
150 pe_can_fence(data_set, node)?
"will be fenced" :
"is unclean",
153 pe_fence_op(node, NULL, TRUE, reason, priority_delay, data_set);
160 #define XPATH_UNFENCING_NVPAIR XML_CIB_TAG_NVPAIR \
161 "[(@" XML_NVPAIR_ATTR_NAME "='" XML_RSC_ATTR_PROVIDES "'" \
162 "or @" XML_NVPAIR_ATTR_NAME "='" XML_RSC_ATTR_REQUIRES "') " \
163 "and @" XML_NVPAIR_ATTR_VALUE "='unfencing']"
166 #define XPATH_ENABLE_UNFENCING \
167 "/" XML_TAG_CIB "/" XML_CIB_TAG_CONFIGURATION "/" XML_CIB_TAG_RESOURCES \
168 "//" XML_TAG_META_SETS "/" XPATH_UNFENCING_NVPAIR \
169 "|/" XML_TAG_CIB "/" XML_CIB_TAG_CONFIGURATION "/" XML_CIB_TAG_RSCCONFIG \
170 "/" XML_TAG_META_SETS "/" XPATH_UNFENCING_NVPAIR
173 void set_if_xpath(
unsigned long long flag,
const char *xpath,
176 xmlXPathObjectPtr result = NULL;
178 if (is_not_set(data_set->
flags, flag)) {
180 if (result && (numXpathResults(result) > 0)) {
190 const char *value = NULL;
191 GHashTable *config_hash = crm_str_table_new();
202 crm_info(
"Startup probes: disabled (dangerous)");
207 crm_notice(
"Watchdog will be used via SBD if fencing is required "
208 "and stonith-watchdog-timeout is nonzero");
222 crm_debug(
"STONITH of failed nodes is %s",
228 "Support for stonith-action of 'poweroff' is deprecated "
229 "and will be removed in a future release (use 'off' instead)");
246 crm_debug(
"Stop all active resources: %s",
251 crm_debug(
"Cluster is symmetric" " - resources can run anywhere by default");
274 crm_notice(
"Resetting no-quorum-policy to 'stop': cluster has never had quorum");
279 "fencing is disabled");
289 crm_debug(
"On loss of quorum: Freeze resources");
292 crm_debug(
"On loss of quorum: Stop ALL resources");
296 "Demote promotable resources and stop other resources");
299 crm_notice(
"On loss of quorum: Fence all remaining nodes");
311 crm_trace(
"Orphan resource actions are %s",
315 crm_trace(
"Stopped resources are removed from the status section: %s",
324 is_set(data_set->
flags,
331 crm_trace(
"Unseen nodes will be fenced");
340 crm_debug(
"Node scores: 'red' = %s, 'yellow' = %s, 'green' = %s",
349 crm_trace(
"Resources will%s be locked to cleanly shut down nodes",
362 destroy_digest_cache(gpointer ptr)
370 free(
data->digest_all_calc);
371 free(
data->digest_restart_calc);
372 free(
data->digest_secure_calc);
388 if (new_node == NULL) {
393 new_node->
fixed = FALSE;
396 if (new_node->
details == NULL) {
431 destroy_digest_cache);
440 xmlNode *attr_set = NULL;
441 xmlNode *attr = NULL;
443 const char *container_id =
ID(xml_obj);
444 const char *remote_name = NULL;
445 const char *remote_server = NULL;
446 const char *remote_port = NULL;
447 const char *connect_timeout =
"60s";
448 const char *remote_allow_migrate=NULL;
449 const char *is_managed = NULL;
451 for (attr_set = __xml_first_child_element(xml_obj); attr_set != NULL;
452 attr_set = __xml_next_element(attr_set)) {
457 for (attr = __xml_first_child_element(attr_set); attr != NULL;
458 attr = __xml_next_element(attr)) {
465 remote_server = value;
469 connect_timeout = value;
471 remote_allow_migrate=value;
478 if (remote_name == NULL) {
487 remote_allow_migrate, is_managed,
488 connect_timeout, remote_server, remote_port);
520 xmlNode *xml_obj = NULL;
522 const char *
id = NULL;
523 const char *
uname = NULL;
524 const char *
type = NULL;
525 const char *score = NULL;
527 for (xml_obj = __xml_first_child_element(xml_nodes); xml_obj != NULL;
528 xml_obj = __xml_next_element(xml_obj)) {
541 "> entry in configuration without id");
546 if (new_node == NULL) {
556 handle_startup_fencing(data_set, new_node);
558 add_node_attrs(xml_obj, new_node, FALSE, data_set);
568 crm_info(
"Creating a fake local node");
579 const char *container_id = NULL;
584 for (; gIter != NULL; gIter = gIter->next) {
587 setup_container(child_rsc, data_set);
600 pe_rsc_trace(rsc,
"Resource %s's container is %s", rsc->
id, container_id);
602 pe_err(
"Resource %s: Unknown resource container (%s)", rsc->
id, container_id);
610 xmlNode *xml_obj = NULL;
615 for (xml_obj = __xml_first_child_element(xml_resources); xml_obj != NULL;
616 xml_obj = __xml_next_element(xml_obj)) {
618 const char *new_node_id = NULL;
624 new_node_id =
ID(xml_obj);
628 crm_trace(
"Found remote node %s defined by resource %s",
629 new_node_id,
ID(xml_obj));
644 new_node_id = expand_remote_rsc_meta(xml_obj, xml_resources, data_set);
646 crm_trace(
"Found guest node %s in resource %s",
647 new_node_id,
ID(xml_obj));
658 xmlNode *xml_obj2 = NULL;
659 for (xml_obj2 = __xml_first_child_element(xml_obj); xml_obj2 != NULL;
660 xml_obj2 = __xml_next_element(xml_obj2)) {
662 new_node_id = expand_remote_rsc_meta(xml_obj2, xml_resources, data_set);
665 crm_trace(
"Found guest node %s in resource %s inside group %s",
666 new_node_id,
ID(xml_obj2),
ID(xml_obj));
701 pe_rsc_trace(new_rsc,
"Linking remote connection resource %s to node %s",
709 handle_startup_fencing(data_set, remote_node);
716 strdup(
"container"));
721 destroy_tag(gpointer
data)
727 g_list_free_full(tag->
refs, free);
747 xmlNode *xml_obj = NULL;
754 for (xml_obj = __xml_first_child_element(xml_resources); xml_obj != NULL;
755 xml_obj = __xml_next_element(xml_obj)) {
760 const char *template_id =
ID(xml_obj);
763 template_id, NULL, NULL) == FALSE) {
770 crm_trace(
"Beginning unpack... <%s id=%s... >", crm_element_name(xml_obj),
ID(xml_obj));
771 if (
common_unpack(xml_obj, &new_rsc, NULL, data_set) && (new_rsc != NULL)) {
777 "because configuration is invalid",
778 crm_element_name(xml_obj),
crm_str(
ID(xml_obj)));
779 if (new_rsc != NULL && new_rsc->
fns != NULL) {
785 for (gIter = data_set->
resources; gIter != NULL; gIter = gIter->next) {
788 setup_container(rsc, data_set);
789 link_rsc2remotenode(data_set, rsc);
799 pcmk__config_err(
"Resource start-up disabled since no STONITH resources have been defined");
800 pcmk__config_err(
"Either configure some or disable STONITH with the stonith-enabled option");
801 pcmk__config_err(
"NOTE: Clusters with shared data need STONITH to ensure data integrity");
810 xmlNode *xml_tag = NULL;
815 for (xml_tag = __xml_first_child_element(xml_tags); xml_tag != NULL;
816 xml_tag = __xml_next_element(xml_tag)) {
818 xmlNode *xml_obj_ref = NULL;
819 const char *tag_id =
ID(xml_tag);
825 if (tag_id == NULL) {
827 crm_element_name(xml_tag));
831 for (xml_obj_ref = __xml_first_child_element(xml_tag); xml_obj_ref != NULL;
832 xml_obj_ref = __xml_next_element(xml_obj_ref)) {
834 const char *obj_ref =
ID(xml_obj_ref);
840 if (obj_ref == NULL) {
842 crm_element_name(xml_obj_ref), tag_id);
860 const char *ticket_id = NULL;
861 const char *granted = NULL;
862 const char *last_granted = NULL;
863 const char *standby = NULL;
864 xmlAttrPtr xIter = NULL;
868 ticket_id =
ID(xml_ticket);
869 if (ticket_id == NULL || strlen(ticket_id) == 0) {
873 crm_trace(
"Processing ticket state for %s", ticket_id);
875 ticket = g_hash_table_lookup(data_set->
tickets, ticket_id);
876 if (ticket == NULL) {
878 if (ticket == NULL) {
883 for (xIter = xml_ticket->properties; xIter; xIter = xIter->next) {
884 const char *prop_name = (
const char *)xIter->name;
890 g_hash_table_replace(ticket->
state, strdup(prop_name), strdup(prop_value));
893 granted = g_hash_table_lookup(ticket->
state,
"granted");
899 crm_info(
"We do not have ticket '%s'", ticket->
id);
902 last_granted = g_hash_table_lookup(ticket->
state,
"last-granted");
907 standby = g_hash_table_lookup(ticket->
state,
"standby");
911 crm_info(
"Granted ticket '%s' is in standby-mode", ticket->
id);
917 crm_trace(
"Done with ticket state for %s", ticket_id);
925 xmlNode *xml_obj = NULL;
927 for (xml_obj = __xml_first_child_element(xml_tickets); xml_obj != NULL;
928 xml_obj = __xml_next_element(xml_obj)) {
933 unpack_ticket_state(xml_obj, data_set);
942 const char *resource_discovery_enabled = NULL;
943 xmlNode *attrs = NULL;
964 add_node_attrs(attrs, this_node, TRUE, data_set);
986 if (resource_discovery_enabled && !
crm_is_true(resource_discovery_enabled)) {
989 crm_warn(
"Ignoring %s attribute on remote node %s because stonith is disabled",
1004 unpack_node_loop(xmlNode * status,
bool fence,
pe_working_set_t * data_set)
1006 bool changed =
false;
1007 xmlNode *lrm_rsc = NULL;
1009 for (xmlNode *state = __xml_first_child_element(status); state != NULL;
1010 state = __xml_next_element(state)) {
1012 const char *
id = NULL;
1013 const char *
uname = NULL;
1015 bool process = FALSE;
1025 if (this_node == NULL) {
1026 crm_info(
"Node %s is unknown",
id);
1030 crm_trace(
"Node %s was already processed",
id);
1045 }
else if(rsc == NULL) {
1065 determine_remote_online_status(data_set, this_node);
1066 unpack_handle_remote_attrs(this_node, state, data_set);
1081 crm_trace(
"Processing lrm resource entries on %shealthy%s node: %s",
1090 unpack_lrm_resources(this_node, lrm_rsc, data_set);
1102 const char *
id = NULL;
1103 const char *
uname = NULL;
1105 xmlNode *state = NULL;
1110 if (data_set->
tickets == NULL) {
1115 for (state = __xml_first_child_element(status); state != NULL;
1116 state = __xml_next_element(state)) {
1119 unpack_tickets_state((xmlNode *) state, data_set);
1122 xmlNode *attrs = NULL;
1123 const char *resource_discovery_enabled = NULL;
1129 if (
uname == NULL) {
1133 }
else if (this_node == NULL) {
1135 "because no longer in configuration",
uname);
1156 add_node_attrs(attrs, this_node, TRUE, data_set);
1169 if (resource_discovery_enabled && !
crm_is_true(resource_discovery_enabled)) {
1170 crm_warn(
"ignoring %s attribute on node %s, disabling resource discovery is not allowed on cluster nodes",
1175 determine_online_status(state, this_node, data_set);
1184 pe_fence_node(data_set, this_node,
"cluster does not have quorum", FALSE);
1190 while(unpack_node_loop(status, FALSE, data_set)) {
1201 for (GList *item = data_set->
stop_needed; item; item = item->next) {
1203 pe_node_t *node = pe__current_node(container);
1213 for (
GListPtr gIter = data_set->
nodes; gIter != NULL; gIter = gIter->next) {
1216 if (this_node == NULL) {
1223 determine_remote_online_status(data_set, this_node);
1230 determine_online_status_no_fencing(
pe_working_set_t * data_set, xmlNode * node_state,
1233 gboolean online = FALSE;
1246 crm_debug(
"Node is not ready to run resources: %s", join);
1251 crm_trace(
"\tis_peer=%s, join=%s, expected=%s",
1256 pe_fence_node(data_set, this_node,
"peer is unexpectedly down", FALSE);
1257 crm_info(
"\tin_cluster=%s, is_peer=%s, join=%s, expected=%s",
1264 determine_online_status_fencing(
pe_working_set_t * data_set, xmlNode * node_state,
1267 gboolean online = FALSE;
1268 gboolean do_terminate = FALSE;
1269 bool crmd_online = FALSE;
1284 do_terminate = TRUE;
1286 }
else if (terminate != NULL && strlen(terminate) > 0) {
1288 char t = terminate[0];
1290 if (t !=
'0' && isdigit(t)) {
1291 do_terminate = TRUE;
1295 crm_trace(
"%s: in_cluster=%s, is_peer=%s, join=%s, expected=%s, term=%d",
1301 if (exp_state == NULL) {
1309 online = crmd_online;
1311 }
else if (in_cluster == NULL) {
1312 pe_fence_node(data_set, this_node,
"peer has not been seen by the cluster", FALSE);
1315 pe_fence_node(data_set, this_node,
"peer failed the pacemaker membership criteria", FALSE);
1329 &&
crm_is_true(in_cluster) == FALSE && !crmd_online) {
1335 pe_fence_node(data_set, this_node,
"peer is no longer part of the cluster", TRUE);
1337 }
else if (!crmd_online) {
1338 pe_fence_node(data_set, this_node,
"peer process is no longer available", FALSE);
1341 }
else if (do_terminate) {
1342 pe_fence_node(data_set, this_node,
"termination was requested", FALSE);
1354 pe_fence_node(data_set, this_node,
"peer was in an unknown state", FALSE);
1355 crm_warn(
"%s: in-cluster=%s, is-peer=%s, join=%s, expected=%s, term=%d, shutdown=%d",
1376 goto remote_online_done;
1381 if (container && pcmk__list_of_1(rsc->
running_on)) {
1387 crm_trace(
"%s node %s presumed ONLINE because connection resource is started",
1388 (container?
"Guest" :
"Remote"), this_node->
details->
id);
1394 crm_trace(
"%s node %s shutting down because connection resource is stopping",
1395 (container?
"Guest" :
"Remote"), this_node->
details->
id);
1401 crm_trace(
"Guest node %s UNCLEAN because guest resource failed",
1407 crm_trace(
"%s node %s OFFLINE because connection resource failed",
1408 (container?
"Guest" :
"Remote"), this_node->
details->
id);
1414 crm_trace(
"%s node %s OFFLINE because its resource is stopped",
1415 (container?
"Guest" :
"Remote"), this_node->
details->
id);
1419 }
else if (
host && (
host->details->online == FALSE)
1420 &&
host->details->unclean) {
1421 crm_trace(
"Guest node %s UNCLEAN because host is unclean",
1435 gboolean online = FALSE;
1458 online = determine_online_status_no_fencing(data_set, node_state, this_node);
1461 online = determine_online_status_fencing(data_set, node_state, this_node);
1469 this_node->
fixed = TRUE;
1475 this_node->
fixed = TRUE;
1508 if (!pcmk__str_empty(
id)) {
1509 const char *end =
id + strlen(
id) - 1;
1511 for (
const char *s = end; s >
id; --s) {
1525 return (s == end)? s : (s - 1);
1549 char *basename = NULL;
1552 basename =
strndup(last_rsc_id, end - last_rsc_id + 1);
1571 size_t base_name_len = end - last_rsc_id + 1;
1575 zero = calloc(base_name_len + 3,
sizeof(
char));
1577 memcpy(zero, last_rsc_id, base_name_len);
1578 zero[base_name_len] =
':';
1579 zero[base_name_len + 1] =
'0';
1584 create_fake_resource(
const char *rsc_id, xmlNode * rsc_entry,
pe_working_set_t * data_set)
1600 crm_debug(
"Detected orphaned remote node %s", rsc_id);
1605 link_rsc2remotenode(data_set, rsc);
1608 crm_trace(
"Setting node %s as shutting down due to orphaned connection resource", rsc_id);
1615 crm_trace(
"Detected orphaned container filler %s", rsc_id);
1628 create_anonymous_orphan(
pe_resource_t *parent,
const char *rsc_id,
1636 pe_rsc_debug(parent,
"Created orphan %s for %s: %s on %s",
1662 gboolean skip_inactive = FALSE;
1670 for (rIter = parent->
children; rsc == NULL && rIter; rIter = rIter->next) {
1715 crm_notice(
"Active (now-)anonymous clone %s has "
1716 "multiple (orphan) instance histories on %s",
1718 skip_inactive = TRUE;
1725 g_list_free(locations);
1729 if (!skip_inactive && !inactive_instance
1732 inactive_instance = parent->
fns->
find_rsc(child, rsc_id, NULL,
1738 if (inactive_instance && inactive_instance->
pending_node
1740 inactive_instance = NULL;
1746 if ((rsc == NULL) && !skip_inactive && (inactive_instance != NULL)) {
1747 pe_rsc_trace(parent,
"Resource %s, empty slot", inactive_instance->
id);
1748 rsc = inactive_instance;
1772 rsc = create_anonymous_orphan(parent, rsc_id, node, data_set);
1780 xmlNode * rsc_entry)
1799 crm_trace(
"%s found as %s (%s)", rsc_id, clone0_id, parent->
id);
1801 crm_trace(
"%s is not known as %s either (orphan)",
1807 crm_trace(
"Resource history for %s is orphaned because it is no longer primitive",
1815 if (pe_rsc_is_anon_clone(parent)) {
1817 if (pe_rsc_is_bundled(parent)) {
1822 rsc = find_anonymous_clone(data_set, node, parent, base);
1833 pe_rsc_debug(rsc,
"Internally renamed %s on %s to %s%s",
1847 rsc = create_fake_resource(rsc_id, rsc_entry, data_set);
1866 char *reason = NULL;
1869 pe_rsc_trace(rsc,
"Resource %s is %s on %s: on_fail=%s",
1897 gboolean should_fence = FALSE;
1909 should_fence = TRUE;
1923 " revoked if remote connection can "
1924 "be re-established elsewhere)",
1927 should_fence = TRUE;
1931 if (reason == NULL) {
2001 if (rsc->
container && pe_rsc_is_bundled(rsc)) {
2032 "remote connection is unrecoverable", FALSE);
2067 "%s because cluster is configured not to "
2068 "stop active orphans",
2100 for (; gIter != NULL; gIter = gIter->next) {
2106 g_list_free(possible_matches);
2113 int start_index,
int stop_index,
2117 const char *task = NULL;
2118 const char *status = NULL;
2122 pe_rsc_trace(rsc,
"%s: Start index %d, stop index = %d", rsc->
id, start_index, stop_index);
2124 for (; gIter != NULL; gIter = gIter->next) {
2125 xmlNode *rsc_op = (xmlNode *) gIter->data;
2127 guint interval_ms = 0;
2129 const char *
id =
ID(rsc_op);
2138 }
else if (start_index < stop_index && counter <= stop_index) {
2142 }
else if (counter < start_index) {
2148 if (interval_ms == 0) {
2170 int implied_monitor_start = -1;
2171 int implied_clone_start = -1;
2172 const char *task = NULL;
2173 const char *status = NULL;
2179 for (; gIter != NULL; gIter = gIter->next) {
2180 xmlNode *rsc_op = (xmlNode *) gIter->data;
2189 *stop_index = counter;
2192 *start_index = counter;
2198 implied_monitor_start = counter;
2201 implied_clone_start = counter;
2205 if (*start_index == -1) {
2206 if (implied_clone_start != -1) {
2207 *start_index = implied_clone_start;
2208 }
else if (implied_monitor_start != -1) {
2209 *start_index = implied_monitor_start;
2219 time_t lock_time = 0;
2222 &lock_time) ==
pcmk_ok) && (lock_time != 0)) {
2227 pe_rsc_info(rsc,
"Shutdown lock for %s on %s expired",
2241 int stop_index = -1;
2242 int start_index = -1;
2245 const char *task = NULL;
2252 xmlNode *migrate_op = NULL;
2253 xmlNode *rsc_op = NULL;
2254 xmlNode *last_failure = NULL;
2260 crm_element_name(rsc_entry), rsc_id, node->
details->
uname);
2264 sorted_op_list = NULL;
2266 for (rsc_op = __xml_first_child_element(rsc_entry); rsc_op != NULL;
2267 rsc_op = __xml_next_element(rsc_op)) {
2269 op_list = g_list_prepend(op_list, rsc_op);
2274 if (op_list == NULL) {
2281 rsc = unpack_find_resource(data_set, node, rsc_id, rsc_entry);
2283 if (op_list == NULL) {
2287 rsc = process_orphan_resource(rsc_entry, node, data_set);
2294 unpack_shutdown_lock(rsc_entry, rsc, node, data_set);
2298 saved_role = rsc->
role;
2302 for (gIter = sorted_op_list; gIter != NULL; gIter = gIter->next) {
2303 xmlNode *rsc_op = (xmlNode *) gIter->data;
2307 migrate_op = rsc_op;
2310 unpack_rsc_op(rsc, node, rsc_op, &last_failure, &on_fail, data_set);
2315 process_recurring(node, rsc, start_index, stop_index, sorted_op_list, data_set);
2318 g_list_free(sorted_op_list);
2320 process_rsc_state(rsc, node, on_fail, migrate_op, data_set);
2324 pe_rsc_debug(rsc,
"%s: Overwriting calculated next role %s"
2325 " with requested next role %s",
2330 pe_rsc_info(rsc,
"%s: Not overwriting calculated next role %s"
2331 " with requested next role %s",
2336 if (saved_role > rsc->
role) {
2337 rsc->
role = saved_role;
2344 handle_orphaned_container_fillers(xmlNode * lrm_rsc_list,
pe_working_set_t * data_set)
2346 xmlNode *rsc_entry = NULL;
2347 for (rsc_entry = __xml_first_child_element(lrm_rsc_list); rsc_entry != NULL;
2348 rsc_entry = __xml_next_element(rsc_entry)) {
2353 const char *container_id;
2361 if (container_id == NULL || rsc_id == NULL) {
2366 if (container == NULL) {
2377 pe_rsc_trace(rsc,
"Mapped container of orphaned resource %s to %s",
2378 rsc->
id, container_id);
2385 unpack_lrm_resources(
pe_node_t *node, xmlNode *lrm_rsc_list,
2388 xmlNode *rsc_entry = NULL;
2389 gboolean found_orphaned_container_filler = FALSE;
2391 for (rsc_entry = __xml_first_child_element(lrm_rsc_list); rsc_entry != NULL;
2392 rsc_entry = __xml_next_element(rsc_entry)) {
2395 pe_resource_t *rsc = unpack_lrm_rsc_state(node, rsc_entry, data_set);
2400 found_orphaned_container_filler = TRUE;
2408 if (found_orphaned_container_filler) {
2409 handle_orphaned_container_fillers(lrm_rsc_list, data_set);
2426 set_node_score(gpointer key, gpointer value, gpointer user_data)
2429 int *score = user_data;
2434 #define STATUS_PATH_MAX 1024
2436 find_lrm_op(
const char *resource,
const char *op,
const char *node,
const char *source,
2441 xmlNode *xml = NULL;
2443 offset += snprintf(xpath + offset,
STATUS_PATH_MAX - offset,
"//node_state[@uname='%s']", node);
2468 if (xml && success_only) {
2482 pe__call_id(xmlNode *op_xml)
2515 return (stop_op && (pe__call_id(stop_op) > pe__call_id(xml_op)));
2540 int from_status = 0;
2543 xmlNode *migrate_from = NULL;
2550 if (stop_happened_after(rsc, node, xml_op, data_set)) {
2562 source, FALSE, data_set);
2566 pe_rsc_trace(rsc,
"%s op on %s exited with status=%d, rc=%d",
2567 ID(migrate_from),
target, from_status, from_rc);
2576 pe_rsc_trace(rsc,
"Detected dangling migration op: %s on %s",
ID(xml_op),
2617 int target_stop_id = 0;
2618 int target_migrate_from_id = 0;
2619 xmlNode *target_stop = NULL;
2620 xmlNode *target_migrate_from = NULL;
2635 target_stop_id = pe__call_id(target_stop);
2639 source, TRUE, data_set);
2640 target_migrate_from_id = pe__call_id(target_migrate_from);
2642 if ((target_stop == NULL) || (target_stop_id < target_migrate_from_id)) {
2650 target_stop_id, target_migrate_from_id);
2655 }
else if (target_migrate_from == NULL) {
2666 xmlNode *source_migrate_from = NULL;
2667 xmlNode *source_start = NULL;
2668 int source_migrate_to_id = pe__call_id(xml_op);
2671 NULL, TRUE, data_set);
2672 if (pe__call_id(source_migrate_from) > source_migrate_to_id) {
2678 if (pe__call_id(source_start) > source_migrate_to_id) {
2691 xmlNode *source_stop = NULL;
2692 xmlNode *source_migrate_to = NULL;
2710 source,
target, TRUE, data_set);
2712 if ((source_stop == NULL)
2713 || (pe__call_id(source_stop) < pe__call_id(source_migrate_to))) {
2727 record_failed_op(xmlNode *op,
const pe_node_t *node,
2730 xmlNode *xIter = NULL;
2737 for (xIter = data_set->
failed->children; xIter; xIter = xIter->next) {
2753 static const char *get_op_key(xmlNode *xml_op)
2763 last_change_str(xmlNode *xml_op)
2766 const char *when_s = NULL;
2773 when_s = strchr(when_s,
' ');
2779 return ((when_s && *when_s)? when_s :
"unknown time");
2869 return first - second;
2876 guint interval_ms = 0;
2877 bool is_probe =
false;
2880 const char *key = get_op_key(xml_op);
2888 *last_failure = xml_op;
2895 if (exit_reason == NULL) {
2901 crm_trace(
"Unexpected result (%s%s%s) was recorded for "
2902 "%s of %s on %s at %s " CRM_XS " rc=%d id=%s",
2903 services_ocf_exitcode_str(
rc),
2904 (*exit_reason?
": " :
""), exit_reason,
2906 last_change_str(xml_op),
rc,
ID(xml_op));
2908 crm_warn(
"Unexpected result (%s%s%s) was recorded for "
2909 "%s of %s on %s at %s " CRM_XS " rc=%d id=%s",
2910 services_ocf_exitcode_str(
rc),
2911 (*exit_reason?
": " :
""), exit_reason,
2913 last_change_str(xml_op),
rc,
ID(xml_op));
2922 crm_notice(
"If it is not possible for %s to run on %s, see "
2923 "the resource-discovery option for location constraints",
2927 record_failed_op(xml_op, node, rsc, data_set);
2931 if (cmp_on_fail(*on_fail,
action->on_fail) < 0) {
2934 *on_fail =
action->on_fail;
2941 unpack_migrate_to_failure(rsc, node, xml_op, data_set);
2944 unpack_migrate_from_failure(rsc, node, xml_op, data_set);
2977 pe_rsc_trace(rsc,
"Resource %s: role=%s, unclean=%s, on_fail=%s, fail_role=%s",
2994 if (pe_rsc_is_clone(parent)
3002 crm_notice(
"%s will not be started under current conditions",
3009 g_hash_table_foreach(fail_rsc->
allowed_nodes, set_node_score, &score);
3035 determine_op_status(
3038 guint interval_ms = 0;
3039 bool is_probe =
false;
3041 const char *key = get_op_key(xml_op);
3049 if (exit_reason == NULL) {
3059 if (target_rc < 0) {
3069 crm_warn(
"Expected result not found for %s on %s (corrupt or obsolete CIB?)",
3072 }
else if (target_rc !=
rc) {
3074 pe_rsc_debug(rsc,
"%s on %s: expected %d (%s), got %d (%s%s%s)",
3076 target_rc, services_ocf_exitcode_str(target_rc),
3077 rc, services_ocf_exitcode_str(
rc),
3078 (*exit_reason?
": " :
""), exit_reason);
3085 pe_rsc_info(rsc,
"Probe found %s active on %s at %s",
3087 last_change_str(xml_op));
3103 if (is_probe && (
rc != target_rc)) {
3106 "Probe found %s active and promoted on %s at %s",
3108 last_change_str(xml_op));
3124 if (interval_ms > 0) {
3135 pe_proc_err(
"No further recovery can be attempted for %s "
3136 "because %s on %s failed (%s%s%s) at %s "
3137 CRM_XS " rc=%d id=%s", rsc->
id, task,
3139 (*exit_reason?
": " :
""), exit_reason,
3140 last_change_str(xml_op),
rc,
ID(xml_op));
3149 crm_info(
"Treating unknown exit status %d from %s of %s "
3150 "on %s at %s as failure",
3152 last_change_str(xml_op));
3162 should_clear_for_param_change(xmlNode *xml_op,
const char *task,
3166 if (!strcmp(task,
"start") || !strcmp(task,
"monitor")) {
3180 switch (digest_data->
rc) {
3182 crm_trace(
"Resource %s history entry %s on %s"
3183 " has no digest to compare",
3212 should_ignore_failure_timeout(
pe_resource_t *rsc, xmlNode *xml_op,
3213 const char *task, guint interval_ms,
3243 if (is_last_failure) {
3244 crm_info(
"Waiting to clear monitor failure for remote node %s"
3245 " until fencing has occurred", rsc->
id);
3279 bool expired = FALSE;
3281 time_t last_run = 0;
3282 guint interval_ms = 0;
3283 int unexpired_fail_count = 0;
3285 const char *clear_reason = NULL;
3296 time_t last_failure = 0;
3300 && !should_ignore_failure_timeout(rsc, xml_op, task, interval_ms,
3301 is_last_failure, data_set)) {
3311 crm_trace(
"%s@%lld is %sexpired @%lld with unexpired_failures=%d timeout=%ds"
3312 " last-failure@%lld",
3313 ID(xml_op), (
long long) last_run, (expired?
"" :
"not "),
3315 (
long long) last_failure);
3317 if (unexpired_fail_count && (now < last_failure)) {
3327 if (unexpired_fail_count == 0) {
3329 clear_reason =
"it expired";
3345 clear_reason =
"reconnect interval is set";
3349 if (!expired && is_last_failure
3350 && should_clear_for_param_change(xml_op, task, rsc, node, data_set)) {
3351 clear_reason =
"resource parameters have changed";
3354 if (clear_reason != NULL) {
3369 crm_info(
"Clearing %s failure will wait until any scheduled "
3370 "fencing of %s completes", task, rsc->
id);
3371 order_after_remote_fencing(clear_op, rsc, data_set);
3409 result =
action->on_fail;
3419 gboolean clear_past_failure = FALSE;
3425 clear_past_failure = TRUE;
3432 const char *op_key = get_op_key(xml_op);
3433 const char *last_failure_key = get_op_key(last_failure);
3436 clear_past_failure = TRUE;
3446 clear_past_failure = TRUE;
3450 clear_past_failure = TRUE;
3454 clear_past_failure = TRUE;
3460 clear_past_failure = TRUE;
3466 clear_past_failure = TRUE;
3469 unpack_migrate_to_success(rsc, node, xml_op, data_set);
3477 if (clear_past_failure) {
3483 pe_rsc_trace(rsc,
"%s.%s is not cleared by a completed stop",
3532 remap_monitor_rc(
int rc, xmlNode *xml_op,
const pe_node_t *node,
3535 int remapped_rc =
rc;
3550 if (
rc != remapped_rc) {
3551 crm_trace(
"Remapping monitor result %d to %d",
rc, remapped_rc);
3553 record_failed_op(xml_op, node, rsc, data_set);
3568 guint interval_ms = 0;
3569 const char *task = NULL;
3570 const char *task_key = NULL;
3571 const char *exit_reason = NULL;
3572 bool expired = FALSE;
3576 CRM_CHECK(rsc && node && xml_op,
return);
3579 task_key = get_op_key(xml_op);
3582 if (exit_reason == NULL) {
3605 pe_rsc_trace(rsc,
"Unpacking task %s/%s (call_id=%d, status=%d, rc=%d) on %s (role=%s)",
3609 pe_rsc_trace(rsc,
"Node %s (where %s is running) is unclean."
3610 " Further action depends on the value of the stop's on-fail attribute",
3627 && check_operation_expiry(rsc, node,
rc, xml_op, data_set)) {
3632 rc = remap_monitor_rc(
rc, xml_op, node, rsc, data_set);
3635 if (expired && (
rc != target_rc)) {
3638 if (interval_ms == 0) {
3639 crm_notice(
"Ignoring expired %s failure on %s "
3640 CRM_XS " actual=%d expected=%d magic=%s",
3655 crm_notice(
"Rescheduling %s after failure expired on %s "
3656 CRM_XS " actual=%d expected=%d magic=%s",
3669 status = determine_op_status(rsc,
rc, target_rc, node, xml_op, on_fail, data_set);
3670 pe_rsc_trace(rsc,
"Remapped %s status to %d", task_key, status);
3676 pe_err(
"Resource history contains cancellation '%s' "
3677 "(%s of %s on %s at %s)",
3679 last_change_str(xml_op));
3721 last_change_str(xml_op),
ID(xml_op));
3722 update_resource_state(rsc, node, xml_op, task,
rc, *last_failure, on_fail, data_set);
3726 failure_strategy = get_action_on_fail(rsc, task_key, task, data_set);
3728 crm_warn(
"Cannot ignore failed %s of %s on %s: "
3729 "Resource agent doesn't exist "
3730 CRM_XS " status=%d rc=%d id=%s",
3737 unpack_rsc_op_failure(rsc, node,
rc, xml_op, last_failure, on_fail, data_set);
3762 failure_strategy = get_action_on_fail(rsc, task_key, task, data_set);
3767 crm_warn(
"Pretending failed %s (%s%s%s) of %s on %s at %s "
3768 "succeeded " CRM_XS " rc=%d id=%s",
3769 task, services_ocf_exitcode_str(
rc),
3770 (*exit_reason?
": " :
""), exit_reason, rsc->
id,
3774 update_resource_state(rsc, node, xml_op, task, target_rc, *last_failure, on_fail, data_set);
3778 record_failed_op(xml_op, node, rsc, data_set);
3782 *on_fail = failure_strategy;
3786 unpack_rsc_op_failure(rsc, node,
rc, xml_op, last_failure, on_fail, data_set);
3790 "Preventing %s from restarting on %s because "
3791 "of hard failure (%s%s%s)" CRM_XS " rc=%d id=%s",
3793 services_ocf_exitcode_str(
rc),
3794 (*exit_reason?
": " :
""), exit_reason,
3799 crm_err(
"Preventing %s from restarting anywhere because "
3800 "of fatal failure (%s%s%s) " CRM_XS " rc=%d id=%s",
3801 parent->
id, services_ocf_exitcode_str(
rc),
3802 (*exit_reason?
": " :
""), exit_reason,
3811 pe_rsc_trace(rsc,
"Resource %s after %s: role=%s, next=%s",
3817 add_node_attrs(xmlNode *xml_obj,
pe_node_t *node,
bool overwrite,
3820 const char *cluster_name = NULL;
3837 cluster_name = g_hash_table_lookup(data_set->
config_hash,
"cluster-name");
3840 strdup(cluster_name));
3854 }
else if (cluster_name) {
3858 strdup(cluster_name));
3864 extract_operations(
const char *node,
const char *rsc, xmlNode * rsc_entry, gboolean active_filter)
3867 int stop_index = -1;
3868 int start_index = -1;
3870 xmlNode *rsc_op = NULL;
3878 sorted_op_list = NULL;
3880 for (rsc_op = __xml_first_child_element(rsc_entry);
3881 rsc_op != NULL; rsc_op = __xml_next_element(rsc_op)) {
3885 op_list = g_list_prepend(op_list, rsc_op);
3889 if (op_list == NULL) {
3897 if (active_filter == FALSE) {
3898 return sorted_op_list;
3905 for (gIter = sorted_op_list; gIter != NULL; gIter = gIter->next) {
3906 xmlNode *rsc_op = (xmlNode *) gIter->data;
3910 if (start_index < stop_index) {
3911 crm_trace(
"Skipping %s: not active",
ID(rsc_entry));
3914 }
else if (counter < start_index) {
3918 op_list = g_list_append(op_list, rsc_op);
3921 g_list_free(sorted_op_list);
3932 xmlNode *tmp = NULL;
3937 xmlNode *node_state = NULL;
3939 for (node_state = __xml_first_child_element(status); node_state != NULL;
3940 node_state = __xml_next_element(node_state)) {
3950 if(this_node == NULL) {
3955 determine_remote_online_status(data_set, this_node);
3958 determine_online_status(node_state, this_node, data_set);
3966 xmlNode *lrm_rsc = NULL;
3971 for (lrm_rsc = __xml_first_child_element(tmp); lrm_rsc != NULL;
3972 lrm_rsc = __xml_next_element(lrm_rsc)) {
3981 intermediate = extract_operations(
uname, rsc_id, lrm_rsc, active_filter);
3982 output = g_list_concat(output, intermediate);
pe_resource_t * pe__create_clone_child(pe_resource_t *rsc, pe_working_set_t *data_set)
enum crm_ais_msg_types type
#define pcmk__config_warn(fmt...)
char * pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms)
Generate an operation key (RESOURCE_ACTION_INTERVAL)
#define pcmk__config_err(fmt...)
bool pcmk__ends_with(const char *s, const char *match)
#define crm_atoi(text, default_text)
char * crm_strdup_printf(char const *format,...) __attribute__((__format__(__printf__
gboolean crm_str_eq(const char *a, const char *b, gboolean use_case)
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.
gboolean safe_str_neq(const char *a, const char *b)
int char2score(const char *score)
guint crm_parse_interval_spec(const char *input)
Parse milliseconds from a Pacemaker interval specification.
gboolean crm_is_true(const char *s)
#define safe_str_eq(a, b)
int crm_parse_int(const char *text, const char *default_text)
Parse an integer value from a string.
const char * fail2text(enum action_fail_response fail)
@ action_fail_reset_remote
@ action_fail_restart_container
const char * role2text(enum rsc_role_e role)
const char * pe_pref(GHashTable *options, const char *name)
pe_resource_t * uber_parent(pe_resource_t *rsc)
#define CRMD_JOINSTATE_NACK
#define CRMD_ACTION_NOTIFY
#define CRM_ATTR_SITE_NAME
#define CRMD_JOINSTATE_DOWN
#define CRMD_ACTION_METADATA
#define CRMD_JOINSTATE_PENDING
#define CRMD_ACTION_MIGRATED
#define CRMD_ACTION_STATUS
#define CRMD_ACTION_DEMOTE
#define CRMD_ACTION_MIGRATE
#define CRMD_ACTION_START
#define CRMD_ACTION_PROMOTE
#define CRM_ATTR_CLUSTER_NAME
#define CRMD_JOINSTATE_MEMBER
#define clear_bit(word, bit)
#define set_bit(word, bit)
const char * pcmk__epoch2str(time_t *when)
#define crm_info(fmt, args...)
#define do_crm_log(level, fmt, args...)
Log a message.
#define crm_warn(fmt, args...)
#define crm_log_xml_debug(xml, text)
#define CRM_LOG_ASSERT(expr)
#define crm_notice(fmt, args...)
#define CRM_CHECK(expr, failure_action)
#define crm_debug(fmt, args...)
#define crm_err(fmt, args...)
#define crm_trace(fmt, args...)
#define XML_NODE_ATTR_RSC_DISCOVERY
#define XML_LRM_TAG_RSC_OP
#define XML_ATTR_TRANSITION_KEY
#define XML_ATTR_HAVE_WATCHDOG
#define XML_CIB_TAG_TICKET_STATE
#define XML_TAG_TRANSIENT_NODEATTRS
#define XML_NVPAIR_ATTR_VALUE
#define XML_RSC_ATTR_REMOTE_NODE
#define XML_RULE_ATTR_SCORE
#define XML_CIB_TAG_OBJ_REF
#define XML_LRM_TAG_RESOURCES
#define XML_RSC_ATTR_MANAGED
#define XML_LRM_ATTR_MIGRATE_SOURCE
#define XML_NODE_IS_FENCED
#define XML_LRM_ATTR_TASK_KEY
#define XML_CONFIG_ATTR_PRIORITY_FENCING_DELAY
#define XML_RSC_ATTR_CONTAINER
#define XML_CIB_TAG_STATE
#define XML_NODE_JOIN_STATE
#define XML_CONFIG_ATTR_SHUTDOWN_LOCK
#define XML_LRM_ATTR_OPSTATUS
#define XML_CIB_TAG_TICKETS
#define XML_TAG_ATTR_SETS
#define XML_NODE_IN_CLUSTER
#define XML_ATTR_TRANSITION_MAGIC
#define XML_LRM_ATTR_RESTART_DIGEST
#define XML_LRM_ATTR_EXIT_REASON
#define XML_NODE_IS_MAINTENANCE
#define XML_TAG_META_SETS
#define XML_BOOLEAN_FALSE
#define XML_ATTR_QUORUM_PANIC
#define XML_CIB_TAG_RSC_TEMPLATE
#define XML_LRM_ATTR_TASK
#define XML_NODE_EXPECTED
#define XML_CIB_TAG_PROPSET
#define XML_LRM_ATTR_MIGRATE_TARGET
#define XML_NVPAIR_ATTR_NAME
#define CIB_OPTIONS_FIRST
#define XML_CIB_TAG_GROUP
#define XML_CIB_TAG_STATUS
#define XML_RSC_OP_LAST_CHANGE
#define XML_LRM_ATTR_CALLID
#define XML_LRM_ATTR_RSCID
#define XML_TAG_UTILIZATION
#define XML_CIB_TAG_RESOURCE
#define XML_CONFIG_ATTR_SHUTDOWN_LOCK_LIMIT
#define XML_LRM_ATTR_INTERVAL_MS
#define XML_LRM_TAG_RESOURCE
int crm_element_value_int(const xmlNode *data, const char *name, int *dest)
Retrieve the integer value of an XML attribute.
int crm_element_value_ms(const xmlNode *data, const char *name, guint *dest)
Retrieve the millisecond value of an XML attribute.
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
int crm_element_value_epoch(const xmlNode *xml, const char *name, time_t *dest)
Retrieve the seconds-since-epoch value of an XML attribute.
#define pe_flag_have_stonith_resource
#define pe_flag_startup_fencing
#define pe_flag_have_quorum
#define pe_flag_maintenance_mode
#define pe_rsc_orphan_container_filler
#define pe_flag_enable_unfencing
#define pe_flag_shutdown_lock
#define pe_flag_symmetric_cluster
#define pe_flag_quick_location
#define pe_flag_stop_everything
#define pe_flag_startup_probes
#define pe_flag_start_failure_fatal
#define pe_rsc_allow_migrate
#define pe_flag_concurrent_fencing
@ pe_find_clone
match only clone instances
#define pe_rsc_is_container
#define pe_flag_stonith_enabled
#define pe_flag_stop_rsc_orphans
#define pe_rsc_needs_fencing
#define pe_flag_remove_after_stop
#define pe_rsc_failure_ignored
#define pe_rsc_promotable
#define pe_flag_have_remote_nodes
#define pe_flag_stop_action_orphans
#define pe_rsc_start_pending
void verify_pe_options(GHashTable *options)
const char * pe_node_attribute_raw(pe_node_t *node, const char *name)
#define pe_warn_once(pe_wo_bit, fmt...)
bool pe__is_universal_clone(pe_resource_t *rsc, pe_working_set_t *data_set)
#define demote_action(rsc, node, optional)
void destroy_ticket(gpointer data)
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)
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)
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)
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)
gboolean get_target_role(pe_resource_t *rsc, enum rsc_role_e *role)
bool pe__bundle_needs_remote_name(pe_resource_t *rsc)
void native_add_running(pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set)
#define pe_rsc_debug(rsc, fmt, args...)
gint sort_node_uname(gconstpointer a, gconstpointer b)
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)
gboolean common_unpack(xmlNode *xml_obj, pe_resource_t **rsc, pe_resource_t *parent, pe_working_set_t *data_set)
void pe_free_action(pe_action_t *action)
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)
gboolean order_actions(pe_action_t *lh_action, pe_action_t *rh_action, enum pe_ordering order)
#define pe_rsc_trace(rsc, fmt, args...)
gint sort_rsc_priority(gconstpointer a, gconstpointer b)
bool pe__shutdown_requested(pe_node_t *node)
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
void resource_location(pe_resource_t *rsc, pe_node_t *node, int score, const char *tag, pe_working_set_t *data_set)
time_t get_effective_time(pe_working_set_t *data_set)
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.
#define stop_action(rsc, node, optional)
pe_ticket_t * ticket_new(const char *ticket_id, pe_working_set_t *data_set)
#define pe_rsc_info(rsc, fmt, args...)
GHashTable * pe__node_list2table(GList *list)
pe_resource_t * pe__find_bundle_replica(const pe_resource_t *bundle, const pe_node_t *node)
#define pe_proc_err(fmt...)
void pe__update_recheck_time(time_t recheck, pe_working_set_t *data_set)
pe_node_t * pe__copy_node(const pe_node_t *this_node)
gboolean add_tag_ref(GHashTable *tags, const char *tag_name, const char *obj_ref)
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_can_fence(pe_working_set_t *data_set, pe_node_t *node)
#define pe_proc_warn(fmt...)
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)
gboolean pe__is_remote_node(pe_node_t *node)
gboolean pe__is_guest_node(pe_node_t *node)
gboolean xml_contains_remote_node(xmlNode *xml)
gboolean pe__is_guest_or_remote_node(pe_node_t *node)
char * strndup(const char *str, size_t len)
@ PCMK_LRM_OP_NOT_INSTALLED
@ PCMK_LRM_OP_ERROR_FATAL
@ PCMK_LRM_OP_NOT_CONNECTED
@ PCMK_LRM_OP_NOTSUPPORTED
@ PCMK_OCF_INSUFFICIENT_PRIV
@ PCMK_OCF_DEGRADED_MASTER
@ PCMK_OCF_UNIMPLEMENT_FEATURE
@ PCMK_OCF_NOT_CONFIGURED
@ PCMK_OCF_RUNNING_MASTER
pe_resource_t * pe_find_resource(GListPtr rsc_list, const char *id_rh)
pe_node_t * pe_find_node(GListPtr node_list, const char *uname)
pe_node_t * pe_find_node_any(GListPtr node_list, const char *id, const char *uname)
enum rsc_digest_cmp_val rc
enum pe_action_flags flags
struct pe_node_shared_s * details
GHashTable * digest_cache
cache of calculated resource digests
pe_resource_t * remote_rsc
gboolean remote_maintenance
gboolean remote_requires_reset
gboolean rsc_discovery_enabled
gboolean remote_was_fenced
enum pe_obj_types variant
pe_resource_t * container
GHashTable * allowed_nodes
pe_node_t * partial_migration_source
guint remote_reconnect_ms
GListPtr dangling_migrations
pe_node_t * partial_migration_target
enum rsc_role_e next_role
resource_object_functions_t * fns
const char * stonith_action
const char * placement_strategy
GHashTable * template_rsc_sets
enum pe_quorum_policy no_quorum_policy
int priority_fencing_delay
pe_node_t *(* location)(const pe_resource_t *, GList **, int)
void(* free)(pe_resource_t *)
pe_resource_t *(* find_rsc)(pe_resource_t *parent, const char *search, const pe_node_t *node, int flags)
int pe__target_rc_from_xml(xmlNode *xml_op)
void calculate_active_ops(GListPtr sorted_op_list, int *start_index, int *stop_index)
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.
const char * pe_base_name_end(const char *id)
gboolean unpack_status(xmlNode *status, pe_working_set_t *data_set)
#define XPATH_ENABLE_UNFENCING
gboolean unpack_config(xmlNode *config, pe_working_set_t *data_set)
GListPtr find_operations(const char *rsc, const char *node, gboolean active_filter, pe_working_set_t *data_set)
char * clone_zero(const char *last_rsc_id)
gboolean unpack_remote_nodes(xmlNode *xml_resources, 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)
CRM_TRACE_INIT_DATA(pe_status)
gboolean unpack_nodes(xmlNode *xml_nodes, pe_working_set_t *data_set)
gboolean unpack_resources(xmlNode *xml_resources, pe_working_set_t *data_set)
char * clone_strip(const char *last_rsc_id)
#define set_config_flag(data_set, option, flag)
gboolean unpack_tags(xmlNode *xml_tags, pe_working_set_t *data_set)
Wrappers for and extensions to libxml2.
xmlXPathObjectPtr xpath_search(xmlNode *xml_top, const char *path)
xmlNode * get_xpath_object(const char *xpath, xmlNode *xml_obj, int error_level)
void freeXpathObject(xmlXPathObjectPtr xpathObj)
void free_xml(xmlNode *child)
xmlNode * add_node_copy(xmlNode *new_parent, xmlNode *xml_node)
xmlNode * find_xml_node(xmlNode *cib, const char *node_path, gboolean must_find)
xmlNode * create_xml_node(xmlNode *parent, const char *name)
void copy_in_properties(xmlNode *target, xmlNode *src)