34 #define set_config_flag(data_set, option, flag) do {                        \    35         const char *scf_value = pe_pref((data_set)->config_hash, (option)); \    36         if (scf_value != NULL) {                                            \    37             if (crm_is_true(scf_value)) {                                   \    38                 (data_set)->flags = pcmk__set_flags_as(__func__, __LINE__,  \    39                                     LOG_TRACE, "Working set",               \    40                                     crm_system_name, (data_set)->flags,     \    43                 (data_set)->flags = pcmk__clear_flags_as(__func__, __LINE__,\    44                                     LOG_TRACE, "Working set",               \    45                                     crm_system_name, (data_set)->flags,     \    52                           xmlNode **last_failure,
    57 static void add_node_attrs(xmlNode *attrs, 
pe_node_t *node, 
bool overwrite,
    59 static void determine_online_status(xmlNode *node_state, 
pe_node_t *this_node,
    62 static void unpack_node_lrm(
pe_node_t *node, xmlNode *xml,
    97               const char *reason, 
bool priority_delay)
   108                            "(otherwise would because %s): "   109                            "its guest resource %s is unmanaged",
   112                 crm_warn(
"Guest node %s will be fenced "   113                          "(by recovering its guest resource %s): %s",
   125     } 
else if (is_dangling_guest_node(node)) {
   126         crm_info(
"Cleaning up dangling connection for guest node %s: "   127                  "fencing was already done because %s, "   128                  "and guest resource no longer exists",
   138                        "(otherwise would because %s): connection is unmanaged",
   144                      pe_can_fence(data_set, node)? 
"will be fenced" : 
"is unclean",
   149         pe_fence_op(node, NULL, TRUE, reason, FALSE, data_set);
   152         crm_trace(
"Cluster node %s %s because %s",
   154                   pe_can_fence(data_set, node)? 
"would also be fenced" : 
"also is unclean",
   160                  pe_can_fence(data_set, node)? 
"will be fenced" : 
"is unclean",
   163         pe_fence_op(node, NULL, TRUE, reason, priority_delay, data_set);
   170 #define XPATH_UNFENCING_NVPAIR XML_CIB_TAG_NVPAIR                \   171     "[(@" XML_NVPAIR_ATTR_NAME "='" PCMK_STONITH_PROVIDES "'"    \   172     "or @" XML_NVPAIR_ATTR_NAME "='" XML_RSC_ATTR_REQUIRES "') " \   173     "and @" XML_NVPAIR_ATTR_VALUE "='unfencing']"   176 #define XPATH_ENABLE_UNFENCING \   177     "/" XML_TAG_CIB "/" XML_CIB_TAG_CONFIGURATION "/" XML_CIB_TAG_RESOURCES   \   178     "//" XML_TAG_META_SETS "/" XPATH_UNFENCING_NVPAIR                                               \   179     "|/" XML_TAG_CIB "/" XML_CIB_TAG_CONFIGURATION "/" XML_CIB_TAG_RSCCONFIG  \   180     "/" XML_TAG_META_SETS "/" XPATH_UNFENCING_NVPAIR   185     xmlXPathObjectPtr result = NULL;
   189         if (result && (numXpathResults(result) > 0)) {
   199     const char *value = NULL;
   205         .now = data_set->
now,
   220         crm_info(
"Startup probes: disabled (dangerous)");
   225         crm_info(
"Watchdog-based self-fencing will be performed via SBD if "   226                  "fencing is required and stonith-watchdog-timeout is nonzero");
   240     crm_debug(
"STONITH of failed nodes is %s",
   246                      "Support for stonith-action of 'poweroff' is deprecated "   247                      "and will be removed in a future release (use 'off' instead)");
   264     crm_debug(
"Stop all active resources: %s",
   269         crm_debug(
"Cluster is symmetric" " - resources can run anywhere by default");
   292                 crm_notice(
"Resetting no-quorum-policy to 'stop': cluster has never had quorum");
   297                              "fencing is disabled");
   307             crm_debug(
"On loss of quorum: Freeze resources");
   310             crm_debug(
"On loss of quorum: Stop ALL resources");
   314                       "Demote promotable resources and stop other resources");
   317             crm_notice(
"On loss of quorum: Fence all remaining nodes");
   329     crm_trace(
"Orphan resource actions are %s",
   336 #ifndef PCMK__COMPAT_2_0   338                          "Support for the remove-after-stop cluster property is"   339                          " deprecated and will be removed in a future release");
   358         crm_trace(
"Unseen nodes will be fenced");
   367     crm_debug(
"Node scores: 'red' = %s, 'yellow' = %s, 'green' = %s",
   376     crm_trace(
"Resources will%s be locked to cleanly shut down nodes",
   399     if (new_node == NULL) {
   404     new_node->
fixed = FALSE;
   407     if (new_node->
details == NULL) {
   449     xmlNode *attr_set = NULL;
   450     xmlNode *attr = NULL;
   452     const char *container_id = 
ID(xml_obj);
   453     const char *remote_name = NULL;
   454     const char *remote_server = NULL;
   455     const char *remote_port = NULL;
   456     const char *connect_timeout = 
"60s";
   457     const char *remote_allow_migrate=NULL;
   458     const char *is_managed = NULL;
   460     for (attr_set = pcmk__xe_first_child(xml_obj); attr_set != NULL;
   461          attr_set = pcmk__xe_next(attr_set)) {
   468         for (attr = pcmk__xe_first_child(attr_set); attr != NULL;
   469              attr = pcmk__xe_next(attr)) {
   476                 remote_server = value;
   480                 connect_timeout = value;
   482                 remote_allow_migrate=value;
   489     if (remote_name == NULL) {
   498                          remote_allow_migrate, is_managed,
   499                          connect_timeout, remote_server, remote_port);
   531     xmlNode *xml_obj = NULL;
   533     const char *
id = NULL;
   534     const char *
uname = NULL;
   535     const char *
type = NULL;
   536     const char *score = NULL;
   541         .now = data_set->
now,
   547     for (xml_obj = pcmk__xe_first_child(xml_nodes); xml_obj != NULL;
   548          xml_obj = pcmk__xe_next(xml_obj)) {
   561                                  "> entry in configuration without id");
   566             if (new_node == NULL) {
   576             handle_startup_fencing(data_set, new_node);
   578             add_node_attrs(xml_obj, new_node, FALSE, data_set);
   588         crm_info(
"Creating a fake local node");
   599     const char *container_id = NULL;
   602         g_list_foreach(rsc->
children, (GFunc) setup_container, data_set);
   614             pe_rsc_trace(rsc, 
"Resource %s's container is %s", rsc->
id, container_id);
   616             pe_err(
"Resource %s: Unknown resource container (%s)", rsc->
id, container_id);
   624     xmlNode *xml_obj = NULL;
   629     for (xml_obj = pcmk__xe_first_child(xml_resources); xml_obj != NULL;
   630          xml_obj = pcmk__xe_next(xml_obj)) {
   632         const char *new_node_id = NULL;
   638             new_node_id = 
ID(xml_obj);
   642                 crm_trace(
"Found remote node %s defined by resource %s",
   643                           new_node_id, 
ID(xml_obj));
   658             new_node_id = expand_remote_rsc_meta(xml_obj, xml_resources, data_set);
   660                 crm_trace(
"Found guest node %s in resource %s",
   661                           new_node_id, 
ID(xml_obj));
   672             xmlNode *xml_obj2 = NULL;
   673             for (xml_obj2 = pcmk__xe_first_child(xml_obj); xml_obj2 != NULL;
   674                  xml_obj2 = pcmk__xe_next(xml_obj2)) {
   676                 new_node_id = expand_remote_rsc_meta(xml_obj2, xml_resources, data_set);
   679                     crm_trace(
"Found guest node %s in resource %s inside group %s",
   680                               new_node_id, 
ID(xml_obj2), 
ID(xml_obj));
   715     pe_rsc_trace(new_rsc, 
"Linking remote connection resource %s to node %s",
   723         handle_startup_fencing(data_set, remote_node);
   730                              strdup(
"container"));
   735 destroy_tag(gpointer 
data)
   741         g_list_free_full(tag->
refs, free);
   761     xmlNode *xml_obj = NULL;
   766     for (xml_obj = pcmk__xe_first_child(xml_resources); xml_obj != NULL;
   767          xml_obj = pcmk__xe_next(xml_obj)) {
   772             const char *template_id = 
ID(xml_obj);
   775                                                             template_id, NULL, NULL) == FALSE) {
   782         crm_trace(
"Beginning unpack... <%s id=%s... >", crm_element_name(xml_obj), 
ID(xml_obj));
   783         if (
common_unpack(xml_obj, &new_rsc, NULL, data_set) && (new_rsc != NULL)) {
   789                              "because configuration is invalid",
   790                              crm_element_name(xml_obj), 
crm_str(
ID(xml_obj)));
   791             if (new_rsc != NULL && new_rsc->
fns != NULL) {
   797     for (gIter = data_set->
resources; gIter != NULL; gIter = gIter->next) {
   800         setup_container(rsc, data_set);
   801         link_rsc2remotenode(data_set, rsc);
   811         pcmk__config_err(
"Resource start-up disabled since no STONITH resources have been defined");
   812         pcmk__config_err(
"Either configure some or disable STONITH with the stonith-enabled option");
   813         pcmk__config_err(
"NOTE: Clusters with shared data need STONITH to ensure data integrity");
   822     xmlNode *xml_tag = NULL;
   826     for (xml_tag = pcmk__xe_first_child(xml_tags); xml_tag != NULL;
   827          xml_tag = pcmk__xe_next(xml_tag)) {
   829         xmlNode *xml_obj_ref = NULL;
   830         const char *tag_id = 
ID(xml_tag);
   836         if (tag_id == NULL) {
   838                              crm_element_name(xml_tag));
   842         for (xml_obj_ref = pcmk__xe_first_child(xml_tag); xml_obj_ref != NULL;
   843              xml_obj_ref = pcmk__xe_next(xml_obj_ref)) {
   845             const char *obj_ref = 
ID(xml_obj_ref);
   851             if (obj_ref == NULL) {
   853                                  crm_element_name(xml_obj_ref), tag_id);
   871     const char *ticket_id = NULL;
   872     const char *granted = NULL;
   873     const char *last_granted = NULL;
   874     const char *standby = NULL;
   875     xmlAttrPtr xIter = NULL;
   879     ticket_id = 
ID(xml_ticket);
   880     if (pcmk__str_empty(ticket_id)) {
   884     crm_trace(
"Processing ticket state for %s", ticket_id);
   886     ticket = g_hash_table_lookup(data_set->
tickets, ticket_id);
   887     if (ticket == NULL) {
   889         if (ticket == NULL) {
   894     for (xIter = xml_ticket->properties; xIter; xIter = xIter->next) {
   895         const char *prop_name = (
const char *)xIter->name;
   901         g_hash_table_replace(ticket->
state, strdup(prop_name), strdup(prop_value));
   904     granted = g_hash_table_lookup(ticket->
state, 
"granted");
   910         crm_info(
"We do not have ticket '%s'", ticket->
id);
   913     last_granted = g_hash_table_lookup(ticket->
state, 
"last-granted");
   915         long long last_granted_ll;
   921     standby = g_hash_table_lookup(ticket->
state, 
"standby");
   925             crm_info(
"Granted ticket '%s' is in standby-mode", ticket->
id);
   931     crm_trace(
"Done with ticket state for %s", ticket_id);
   939     xmlNode *xml_obj = NULL;
   941     for (xml_obj = pcmk__xe_first_child(xml_tickets); xml_obj != NULL;
   942          xml_obj = pcmk__xe_next(xml_obj)) {
   947         unpack_ticket_state(xml_obj, data_set);
   956     const char *resource_discovery_enabled = NULL;
   957     xmlNode *attrs = NULL;
   978     add_node_attrs(attrs, this_node, TRUE, data_set);
   997     if (resource_discovery_enabled && !
crm_is_true(resource_discovery_enabled)) {
  1000             crm_warn(
"Ignoring %s attribute on remote node %s because stonith is disabled",
  1023 unpack_transient_attributes(xmlNode *state, 
pe_node_t *node,
  1026     const char *discovery = NULL;
  1029     add_node_attrs(attrs, node, TRUE, data_set);
  1042     if ((discovery != NULL) && !
crm_is_true(discovery)) {
  1043         crm_warn(
"Ignoring %s attribute for node %s because disabling "  1044                  "resource discovery is not allowed for cluster nodes",
  1064     const char *
id = NULL;
  1065     const char *
uname = NULL;
  1076     if (
uname == NULL) {
  1083     if (this_node == NULL) {
  1085                           "it is no longer in the configuration", 
uname);
  1100     unpack_transient_attributes(state, this_node, data_set);
  1108     crm_trace(
"Determining online status of cluster node %s (id %s)",
  1110     determine_online_status(state, this_node, data_set);
  1119         pe_fence_node(data_set, this_node, 
"cluster does not have quorum",
  1142 unpack_node_history(xmlNode *status, 
bool fence, 
pe_working_set_t *data_set)
  1150         const char *
id = 
ID(state);
  1154         if ((
id == NULL) || (
uname == NULL)) {
  1156             crm_trace(
"Not unpacking resource history from malformed "  1162         if (this_node == NULL) {
  1164             crm_trace(
"Not unpacking resource history for node %s because "  1165                       "no longer in configuration", 
id);
  1170             crm_trace(
"Not unpacking resource history for node %s because "  1171                       "already unpacked", 
id);
  1187                 crm_trace(
"Not unpacking resource history for guest node %s "  1188                           "because container and connection are not known to "  1204                 crm_trace(
"Not unpacking resource history for remote node %s "  1205                           "because connection is not known to be up", 
id);
  1217             crm_trace(
"Not unpacking resource history for offline "  1218                       "cluster node %s", 
id);
  1223             determine_remote_online_status(data_set, this_node);
  1224             unpack_handle_remote_attrs(this_node, state, data_set);
  1227         crm_trace(
"Unpacking resource history for %snode %s",
  1228                   (fence? 
"unseen " : 
""), 
id);
  1231         unpack_node_lrm(this_node, state, data_set);
  1244     xmlNode *state = NULL;
  1248     if (data_set->
tickets == NULL) {
  1252     for (state = pcmk__xe_first_child(status); state != NULL;
  1253          state = pcmk__xe_next(state)) {
  1256             unpack_tickets_state((xmlNode *) state, data_set);
  1259             unpack_node_state(state, data_set);
  1263     while (unpack_node_history(status, FALSE, data_set) == EAGAIN) {
  1264         crm_trace(
"Another pass through node resource histories is needed");
  1268     unpack_node_history(status,
  1276         for (GList *item = data_set->
stop_needed; item; item = item->next) {
  1278             pe_node_t *node = pe__current_node(container);
  1292     for (GList *gIter = data_set->
nodes; gIter != NULL; gIter = gIter->next) {
  1304             determine_remote_online_status(data_set, this_node);
  1312 determine_online_status_no_fencing(
pe_working_set_t * data_set, xmlNode * node_state,
  1315     gboolean online = FALSE;
  1328             crm_debug(
"Node is not ready to run resources: %s", join);
  1333         crm_trace(
"\tis_peer=%s, join=%s, expected=%s",
  1338         pe_fence_node(data_set, this_node, 
"peer is unexpectedly down", FALSE);
  1339         crm_info(
"\tin_cluster=%s, is_peer=%s, join=%s, expected=%s",
  1346 determine_online_status_fencing(
pe_working_set_t * data_set, xmlNode * node_state,
  1349     gboolean online = FALSE;
  1350     gboolean do_terminate = FALSE;
  1351     bool crmd_online = FALSE;
  1366         do_terminate = TRUE;
  1368     } 
else if (terminate != NULL && strlen(terminate) > 0) {
  1370         char t = terminate[0];
  1372         if (t != 
'0' && isdigit(t)) {
  1373             do_terminate = TRUE;
  1377     crm_trace(
"%s: in_cluster=%s, is_peer=%s, join=%s, expected=%s, term=%d",
  1383     if (exp_state == NULL) {
  1391         online = crmd_online;
  1393     } 
else if (in_cluster == NULL) {
  1394         pe_fence_node(data_set, this_node, 
"peer has not been seen by the cluster", FALSE);
  1398                       "peer failed Pacemaker membership criteria", FALSE);
  1412                && 
crm_is_true(in_cluster) == FALSE && !crmd_online) {
  1418         pe_fence_node(data_set, this_node, 
"peer is no longer part of the cluster", TRUE);
  1420     } 
else if (!crmd_online) {
  1421         pe_fence_node(data_set, this_node, 
"peer process is no longer available", FALSE);
  1424     } 
else if (do_terminate) {
  1425         pe_fence_node(data_set, this_node, 
"termination was requested", FALSE);
  1436         pe_fence_node(data_set, this_node, 
"peer was in an unknown state", FALSE);
  1437         crm_warn(
"%s: in-cluster=%s, is-peer=%s, join=%s, expected=%s, term=%d, shutdown=%d",
  1458         goto remote_online_done;
  1463     if (container && pcmk__list_of_1(rsc->
running_on)) {
  1469         crm_trace(
"%s node %s presumed ONLINE because connection resource is started",
  1470                   (container? 
"Guest" : 
"Remote"), this_node->
details->
id);
  1476         crm_trace(
"%s node %s shutting down because connection resource is stopping",
  1477                   (container? 
"Guest" : 
"Remote"), this_node->
details->
id);
  1483         crm_trace(
"Guest node %s UNCLEAN because guest resource failed",
  1489         crm_trace(
"%s node %s OFFLINE because connection resource failed",
  1490                   (container? 
"Guest" : 
"Remote"), this_node->
details->
id);
  1496         crm_trace(
"%s node %s OFFLINE because its resource is stopped",
  1497                   (container? 
"Guest" : 
"Remote"), this_node->
details->
id);
  1501     } 
else if (
host && (
host->details->online == FALSE)
  1502                && 
host->details->unclean) {
  1503         crm_trace(
"Guest node %s UNCLEAN because host is unclean",
  1517     gboolean online = FALSE;
  1540         online = determine_online_status_no_fencing(data_set, node_state, this_node);
  1543         online = determine_online_status_fencing(data_set, node_state, this_node);
  1551         this_node->
fixed = TRUE;
  1557         this_node->
fixed = TRUE;
  1590     if (!pcmk__str_empty(
id)) {
  1591         const char *end = 
id + strlen(
id) - 1;
  1593         for (
const char *s = end; s > 
id; --s) {
  1607                     return (s == end)? s : (s - 1);
  1631     char *basename = NULL;
  1634     basename = 
strndup(last_rsc_id, end - last_rsc_id + 1);
  1653     size_t base_name_len = end - last_rsc_id + 1;
  1657     zero = calloc(base_name_len + 3, 
sizeof(
char));
  1659     memcpy(zero, last_rsc_id, base_name_len);
  1660     zero[base_name_len] = 
':';
  1661     zero[base_name_len + 1] = 
'0';
  1666 create_fake_resource(
const char *rsc_id, xmlNode * rsc_entry, 
pe_working_set_t * data_set)
  1682         crm_debug(
"Detected orphaned remote node %s", rsc_id);
  1687         link_rsc2remotenode(data_set, rsc);
  1690             crm_trace(
"Setting node %s as shutting down due to orphaned connection resource", rsc_id);
  1697         crm_trace(
"Detected orphaned container filler %s", rsc_id);
  1710 create_anonymous_orphan(
pe_resource_t *parent, 
const char *rsc_id,
  1718     pe_rsc_debug(parent, 
"Created orphan %s for %s: %s on %s",
  1741     GList *rIter = NULL;
  1744     gboolean skip_inactive = FALSE;
  1752     for (rIter = parent->
children; rsc == NULL && rIter; rIter = rIter->next) {
  1753         GList *locations = NULL;
  1797                         crm_notice(
"Active (now-)anonymous clone %s has "  1798                                    "multiple (orphan) instance histories on %s",
  1800                         skip_inactive = TRUE;
  1807             g_list_free(locations);
  1811             if (!skip_inactive && !inactive_instance
  1814                 inactive_instance = parent->
fns->
find_rsc(child, rsc_id, NULL,
  1820                 if (inactive_instance && inactive_instance->
pending_node  1822                     inactive_instance = NULL;
  1828     if ((rsc == NULL) && !skip_inactive && (inactive_instance != NULL)) {
  1829         pe_rsc_trace(parent, 
"Resource %s, empty slot", inactive_instance->
id);
  1830         rsc = inactive_instance;
  1854         rsc = create_anonymous_orphan(parent, rsc_id, node, data_set);
  1862                      xmlNode * rsc_entry)
  1881             crm_trace(
"%s found as %s (%s)", rsc_id, clone0_id, parent->
id);
  1883             crm_trace(
"%s is not known as %s either (orphan)",
  1889         crm_trace(
"Resource history for %s is orphaned because it is no longer primitive",
  1897     if (pe_rsc_is_anon_clone(parent)) {
  1899         if (pe_rsc_is_bundled(parent)) {
  1904             rsc = find_anonymous_clone(data_set, node, parent, base);
  1915         pe_rsc_debug(rsc, 
"Internally renamed %s on %s to %s%s",
  1929     rsc = create_fake_resource(rsc_id, rsc_entry, data_set);
  1951     char *reason = NULL;
  1955     pe_rsc_trace(rsc, 
"Resource %s is %s on %s: on_fail=%s",
  1983         gboolean should_fence = FALSE;
  1994             should_fence = TRUE;
  2008                                            " revoked if remote connection can "  2009                                            "be re-established elsewhere)",
  2012             should_fence = TRUE;
  2016             if (reason == NULL) {
  2025     save_on_fail = on_fail;
  2086             if (rsc->
container && pe_rsc_is_bundled(rsc)) {
  2116                                   "remote connection is unrecoverable", FALSE);
  2151                                   "%s because cluster is configured not to "  2152                                   "stop active orphans",
  2181         GList *gIter = possible_matches;
  2183         for (; gIter != NULL; gIter = gIter->next) {
  2189         g_list_free(possible_matches);
  2196                   int start_index, 
int stop_index,
  2200     const char *task = NULL;
  2201     const char *status = NULL;
  2202     GList *gIter = sorted_op_list;
  2205     pe_rsc_trace(rsc, 
"%s: Start index %d, stop index = %d", rsc->
id, start_index, stop_index);
  2207     for (; gIter != NULL; gIter = gIter->next) {
  2208         xmlNode *rsc_op = (xmlNode *) gIter->data;
  2210         guint interval_ms = 0;
  2212         const char *
id = 
ID(rsc_op);
  2221         } 
else if (start_index < stop_index && counter <= stop_index) {
  2225         } 
else if (counter < start_index) {
  2231         if (interval_ms == 0) {
  2253     int implied_monitor_start = -1;
  2254     int implied_clone_start = -1;
  2255     const char *task = NULL;
  2256     const char *status = NULL;
  2257     GList *gIter = sorted_op_list;
  2262     for (; gIter != NULL; gIter = gIter->next) {
  2263         xmlNode *rsc_op = (xmlNode *) gIter->data;
  2272             *stop_index = counter;
  2275             *start_index = counter;
  2281                 implied_monitor_start = counter;
  2284             implied_clone_start = counter;
  2288     if (*start_index == -1) {
  2289         if (implied_clone_start != -1) {
  2290             *start_index = implied_clone_start;
  2291         } 
else if (implied_monitor_start != -1) {
  2292             *start_index = implied_monitor_start;
  2302     time_t lock_time = 0;   
  2305                                  &lock_time) == 
pcmk_ok) && (lock_time != 0)) {
  2310             pe_rsc_info(rsc, 
"Shutdown lock for %s on %s expired",
  2331 unpack_lrm_resource(
pe_node_t *node, xmlNode *lrm_resource,
  2334     GList *gIter = NULL;
  2335     int stop_index = -1;
  2336     int start_index = -1;
  2339     const char *task = NULL;
  2340     const char *rsc_id = 
ID(lrm_resource);
  2343     GList *op_list = NULL;
  2344     GList *sorted_op_list = NULL;
  2346     xmlNode *migrate_op = NULL;
  2347     xmlNode *rsc_op = NULL;
  2348     xmlNode *last_failure = NULL;
  2353     if (rsc_id == NULL) {
  2355                  " entry without id");
  2365         op_list = g_list_prepend(op_list, rsc_op);
  2369         if (op_list == NULL) {
  2376     rsc = unpack_find_resource(data_set, node, rsc_id, lrm_resource);
  2378         if (op_list == NULL) {
  2382             rsc = process_orphan_resource(lrm_resource, node, data_set);
  2389         unpack_shutdown_lock(lrm_resource, rsc, node, data_set);
  2393     saved_role = rsc->
role;
  2397     for (gIter = sorted_op_list; gIter != NULL; gIter = gIter->next) {
  2398         xmlNode *rsc_op = (xmlNode *) gIter->data;
  2402             migrate_op = rsc_op;
  2405         unpack_rsc_op(rsc, node, rsc_op, &last_failure, &on_fail, data_set);
  2410     process_recurring(node, rsc, start_index, stop_index, sorted_op_list, data_set);
  2413     g_list_free(sorted_op_list);
  2415     process_rsc_state(rsc, node, on_fail, migrate_op, data_set);
  2422             pe_rsc_info(rsc, 
"%s: Not overwriting calculated next role %s"  2423                         " with requested next role %s",
  2428     if (saved_role > rsc->
role) {
  2429         rsc->
role = saved_role;
  2436 handle_orphaned_container_fillers(xmlNode * lrm_rsc_list, 
pe_working_set_t * data_set)
  2438     xmlNode *rsc_entry = NULL;
  2439     for (rsc_entry = pcmk__xe_first_child(lrm_rsc_list); rsc_entry != NULL;
  2440          rsc_entry = pcmk__xe_next(rsc_entry)) {
  2445         const char *container_id;
  2453         if (container_id == NULL || rsc_id == NULL) {
  2458         if (container == NULL) {
  2469         pe_rsc_trace(rsc, 
"Mapped container of orphaned resource %s to %s",
  2470                      rsc->
id, container_id);
  2487     bool found_orphaned_container_filler = 
false;
  2503         pe_resource_t *rsc = unpack_lrm_resource(node, rsc_entry, data_set);
  2507             found_orphaned_container_filler = 
true;
  2514     if (found_orphaned_container_filler) {
  2515         handle_orphaned_container_fillers(xml, data_set);
  2532 set_node_score(gpointer key, gpointer value, gpointer user_data)
  2535     int *score = user_data;
  2540 #define STATUS_PATH_MAX 1024  2542 find_lrm_op(
const char *resource, 
const char *op, 
const char *node, 
const char *source,
  2547     xmlNode *xml = NULL;
  2549     offset += snprintf(xpath + offset, 
STATUS_PATH_MAX - offset, 
"//node_state[@uname='%s']", node);
  2574     if (xml && success_only) {
  2588 pe__call_id(xmlNode *op_xml)
  2621     return (stop_op && (pe__call_id(stop_op) > pe__call_id(xml_op)));
  2646     int from_status = 0;
  2649     xmlNode *migrate_from = NULL;
  2656     if (stop_happened_after(rsc, node, xml_op, data_set)) {
  2668                                source, FALSE, data_set);
  2672         pe_rsc_trace(rsc, 
"%s op on %s exited with status=%d, rc=%d",
  2673                      ID(migrate_from), 
target, from_status, from_rc);
  2682         pe_rsc_trace(rsc, 
"Detected dangling migration op: %s on %s", 
ID(xml_op),
  2720 newer_op(
pe_resource_t *rsc, 
const char *action_name, 
const char *node_name,
  2723     xmlNode *
action = find_lrm_op(rsc->
id, action_name, node_name, NULL, TRUE,
  2726     return pe__call_id(
action) > call_id;
  2733     int target_stop_id = 0;
  2734     int target_migrate_from_id = 0;
  2735     xmlNode *target_stop = NULL;
  2736     xmlNode *target_migrate_from = NULL;
  2751     target_stop_id = pe__call_id(target_stop);
  2755                                       source, TRUE, data_set);
  2756     target_migrate_from_id = pe__call_id(target_migrate_from);
  2758     if ((target_stop == NULL) || (target_stop_id < target_migrate_from_id)) {
  2766                      target_stop_id, target_migrate_from_id);
  2771     } 
else if (target_migrate_from == NULL) {
  2782         int source_migrate_to_id = pe__call_id(xml_op);
  2802     xmlNode *source_stop = NULL;
  2803     xmlNode *source_migrate_to = NULL;
  2821                                     source, 
target, TRUE, data_set);
  2823     if ((source_stop == NULL)
  2824         || (pe__call_id(source_stop) < pe__call_id(source_migrate_to))) {
  2838 record_failed_op(xmlNode *op, 
const pe_node_t *node,
  2841     xmlNode *xIter = NULL;
  2848     for (xIter = data_set->
failed->children; xIter; xIter = xIter->next) {
  2864 static const char *get_op_key(xmlNode *xml_op)
  2874 last_change_str(xmlNode *xml_op)
  2877     const char *when_s = NULL;
  2884             when_s = strchr(when_s, 
' ');
  2890     return ((when_s && *when_s)? when_s : 
"unknown time");
  2980     return first - second;
  2987     guint interval_ms = 0;
  2988     bool is_probe = 
false;
  2991     const char *key = get_op_key(xml_op);
  2999     *last_failure = xml_op;
  3006     if (exit_reason == NULL) {
  3012         crm_trace(
"Unexpected result (%s%s%s) was recorded for "  3013                   "%s of %s on %s at %s " CRM_XS " rc=%d id=%s",
  3014                   services_ocf_exitcode_str(
rc),
  3015                   (*exit_reason? 
": " : 
""), exit_reason,
  3017                   last_change_str(xml_op), 
rc, 
ID(xml_op));
  3019         crm_warn(
"Unexpected result (%s%s%s) was recorded for "  3020                   "%s of %s on %s at %s " CRM_XS " rc=%d id=%s",
  3021                  services_ocf_exitcode_str(
rc),
  3022                  (*exit_reason? 
": " : 
""), exit_reason,
  3024                  last_change_str(xml_op), 
rc, 
ID(xml_op));
  3033             crm_notice(
"If it is not possible for %s to run on %s, see "  3034                        "the resource-discovery option for location constraints",
  3038         record_failed_op(xml_op, node, rsc, data_set);
  3042     if (cmp_on_fail(*on_fail, 
action->on_fail) < 0) {
  3045         *on_fail = 
action->on_fail;
  3052         unpack_migrate_to_failure(rsc, node, xml_op, data_set);
  3055         unpack_migrate_from_failure(rsc, node, xml_op, data_set);
  3064                               "demote with on-fail=block");
  3089     pe_rsc_trace(rsc, 
"Resource %s: role=%s, unclean=%s, on_fail=%s, fail_role=%s",
  3106             if (pe_rsc_is_clone(parent)
  3114         crm_notice(
"%s will not be started under current conditions",
  3121         g_hash_table_foreach(fail_rsc->
allowed_nodes, set_node_score, &score);
  3147 determine_op_status(
  3150     guint interval_ms = 0;
  3151     bool is_probe = 
false;
  3153     const char *key = get_op_key(xml_op);
  3161     if (exit_reason == NULL) {
  3171     if (target_rc < 0) {
  3181         crm_warn(
"Expected result not found for %s on %s (corrupt or obsolete CIB?)",
  3184     } 
else if (target_rc != 
rc) {
  3186         pe_rsc_debug(rsc, 
"%s on %s: expected %d (%s), got %d (%s%s%s)",
  3188                      target_rc, services_ocf_exitcode_str(target_rc),
  3189                      rc, services_ocf_exitcode_str(
rc),
  3190                      (*exit_reason? 
": " : 
""), exit_reason);
  3197                 pe_rsc_info(rsc, 
"Probe found %s active on %s at %s",
  3199                             last_change_str(xml_op));
  3204             if (is_probe || (target_rc == 
rc)
  3217             if (is_probe && (
rc != target_rc)) {
  3220                             "Probe found %s active and promoted on %s at %s",
  3222                             last_change_str(xml_op));
  3238             if (interval_ms > 0) {
  3249                 pe_proc_err(
"No further recovery can be attempted for %s "  3250                             "because %s on %s failed (%s%s%s) at %s "  3251                             CRM_XS " rc=%d id=%s", rsc->
id, task,
  3253                             (*exit_reason? 
": " : 
""), exit_reason,
  3254                             last_change_str(xml_op), 
rc, 
ID(xml_op));
  3263                 crm_info(
"Treating unknown exit status %d from %s of %s "  3264                          "on %s at %s as failure",
  3266                          last_change_str(xml_op));
  3276 should_clear_for_param_change(xmlNode *xml_op, 
const char *task,
  3280     if (!strcmp(task, 
"start") || !strcmp(task, 
"monitor")) {
  3294             switch (digest_data->
rc) {
  3296                     crm_trace(
"Resource %s history entry %s on %s"  3297                               " has no digest to compare",
  3326 should_ignore_failure_timeout(
pe_resource_t *rsc, xmlNode *xml_op,
  3327                               const char *task, guint interval_ms,
  3357             if (is_last_failure) {
  3358                 crm_info(
"Waiting to clear monitor failure for remote node %s"  3359                          " until fencing has occurred", rsc->
id);
  3393     bool expired = FALSE;
  3395     time_t last_run = 0;
  3396     guint interval_ms = 0;
  3397     int unexpired_fail_count = 0;
  3399     const char *clear_reason = NULL;
  3410         time_t last_failure = 0;
  3414             && !should_ignore_failure_timeout(rsc, xml_op, task, interval_ms,
  3415                                               is_last_failure, data_set)) {
  3425         crm_trace(
"%s@%lld is %sexpired @%lld with unexpired_failures=%d timeout=%ds"  3426                   " last-failure@%lld",
  3427                   ID(xml_op), (
long long) last_run, (expired? 
"" : 
"not "),
  3429                   (
long long) last_failure);
  3431         if (unexpired_fail_count && (now < last_failure)) {
  3441             if (unexpired_fail_count == 0) {
  3443                 clear_reason = 
"it expired";
  3459             clear_reason = 
"reconnect interval is set";
  3463     if (!expired && is_last_failure
  3464         && should_clear_for_param_change(xml_op, task, rsc, node, data_set)) {
  3465         clear_reason = 
"resource parameters have changed";
  3468     if (clear_reason != NULL) {
  3483             crm_info(
"Clearing %s failure will wait until any scheduled "  3484                      "fencing of %s completes", task, rsc->
id);
  3485             order_after_remote_fencing(clear_op, rsc, data_set);
  3523     result = 
action->on_fail;
  3533     gboolean clear_past_failure = FALSE;
  3539         clear_past_failure = TRUE;
  3546             const char *op_key = get_op_key(xml_op);
  3547             const char *last_failure_key = get_op_key(last_failure);
  3550                 clear_past_failure = TRUE;
  3560         clear_past_failure = TRUE;
  3564         clear_past_failure = TRUE;
  3568         clear_past_failure = TRUE;
  3574             clear_past_failure = TRUE;
  3580         clear_past_failure = TRUE;
  3583         unpack_migrate_to_success(rsc, node, xml_op, data_set);
  3591     if (clear_past_failure) {
  3597                 pe_rsc_trace(rsc, 
"%s.%s is not cleared by a completed stop",
  3619                                       "clear past failures and reset remote");
  3647 remap_monitor_rc(
int rc, xmlNode *xml_op, 
const pe_node_t *node,
  3652     if (
rc != remapped_rc) {
  3653         crm_trace(
"Remapping monitor result %d to %d", 
rc, remapped_rc);
  3655             record_failed_op(xml_op, node, rsc, data_set);
  3670     guint interval_ms = 0;
  3671     const char *task = NULL;
  3672     const char *task_key = NULL;
  3673     const char *exit_reason = NULL;
  3674     bool expired = FALSE;
  3678     CRM_CHECK(rsc && node && xml_op, 
return);
  3681     task_key = get_op_key(xml_op);
  3684     if (exit_reason == NULL) {
  3707     pe_rsc_trace(rsc, 
"Unpacking task %s/%s (call_id=%d, status=%d, rc=%d) on %s (role=%s)",
  3711         pe_rsc_trace(rsc, 
"Node %s (where %s is running) is unclean."  3712                      " Further action depends on the value of the stop's on-fail attribute",
  3729         && check_operation_expiry(rsc, node, 
rc, xml_op, data_set)) {
  3734         rc = remap_monitor_rc(
rc, xml_op, node, rsc, data_set);
  3737     if (expired && (
rc != target_rc)) {
  3740         if (interval_ms == 0) {
  3741             crm_notice(
"Ignoring expired %s failure on %s "  3742                        CRM_XS " actual=%d expected=%d magic=%s",
  3757             crm_notice(
"Rescheduling %s after failure expired on %s "  3758                        CRM_XS " actual=%d expected=%d magic=%s",
  3771         status = determine_op_status(rsc, 
rc, target_rc, node, xml_op, on_fail, data_set);
  3772         pe_rsc_trace(rsc, 
"Remapped %s status to %d", task_key, status);
  3778             pe_err(
"Resource history contains cancellation '%s' "  3779                    "(%s of %s on %s at %s)",
  3781                    last_change_str(xml_op));
  3823                          last_change_str(xml_op), 
ID(xml_op));
  3824             update_resource_state(rsc, node, xml_op, task, 
rc, *last_failure, on_fail, data_set);
  3828             failure_strategy = get_action_on_fail(rsc, task_key, task, data_set);
  3830                 crm_warn(
"Cannot ignore failed %s of %s on %s: "  3831                          "Resource agent doesn't exist "  3832                          CRM_XS " status=%d rc=%d id=%s",
  3839             unpack_rsc_op_failure(rsc, node, 
rc, xml_op, last_failure, on_fail, data_set);
  3873     failure_strategy = get_action_on_fail(rsc, task_key, task, data_set);
  3878         crm_warn(
"Pretending failed %s (%s%s%s) of %s on %s at %s "  3879                  "succeeded " CRM_XS " rc=%d id=%s",
  3880                  task, services_ocf_exitcode_str(
rc),
  3881                  (*exit_reason? 
": " : 
""), exit_reason, rsc->
id,
  3885         update_resource_state(rsc, node, xml_op, task, target_rc, *last_failure,
  3890         record_failed_op(xml_op, node, rsc, data_set);
  3894             *on_fail = failure_strategy;
  3898         unpack_rsc_op_failure(rsc, node, 
rc, xml_op, last_failure, on_fail,
  3903                        "Preventing %s from restarting on %s because "  3904                        "of hard failure (%s%s%s)" CRM_XS " rc=%d id=%s",
  3906                        services_ocf_exitcode_str(
rc),
  3907                        (*exit_reason? 
": " : 
""), exit_reason,
  3912             crm_err(
"Preventing %s from restarting anywhere because "  3913                     "of fatal failure (%s%s%s) " CRM_XS " rc=%d id=%s",
  3914                     parent->
id, services_ocf_exitcode_str(
rc),
  3915                     (*exit_reason? 
": " : 
""), exit_reason,
  3922     pe_rsc_trace(rsc, 
"Resource %s after %s: role=%s, next=%s",
  3928 add_node_attrs(xmlNode *xml_obj, 
pe_node_t *node, 
bool overwrite,
  3931     const char *cluster_name = NULL;
  3936         .now = data_set->
now,
  3957     cluster_name = g_hash_table_lookup(data_set->
config_hash, 
"cluster-name");
  3960                             strdup(cluster_name));
  3974         } 
else if (cluster_name) {
  3978                                 strdup(cluster_name));
  3984 extract_operations(
const char *node, 
const char *rsc, xmlNode * rsc_entry, gboolean active_filter)
  3987     int stop_index = -1;
  3988     int start_index = -1;
  3990     xmlNode *rsc_op = NULL;
  3992     GList *gIter = NULL;
  3993     GList *op_list = NULL;
  3994     GList *sorted_op_list = NULL;
  3998     sorted_op_list = NULL;
  4000     for (rsc_op = pcmk__xe_first_child(rsc_entry);
  4001          rsc_op != NULL; rsc_op = pcmk__xe_next(rsc_op)) {
  4007             op_list = g_list_prepend(op_list, rsc_op);
  4011     if (op_list == NULL) {
  4019     if (active_filter == FALSE) {
  4020         return sorted_op_list;
  4027     for (gIter = sorted_op_list; gIter != NULL; gIter = gIter->next) {
  4028         xmlNode *rsc_op = (xmlNode *) gIter->data;
  4032         if (start_index < stop_index) {
  4033             crm_trace(
"Skipping %s: not active", 
ID(rsc_entry));
  4036         } 
else if (counter < start_index) {
  4040         op_list = g_list_append(op_list, rsc_op);
  4043     g_list_free(sorted_op_list);
  4051     GList *output = NULL;
  4052     GList *intermediate = NULL;
  4054     xmlNode *tmp = NULL;
  4059     xmlNode *node_state = NULL;
  4061     for (node_state = pcmk__xe_first_child(status); node_state != NULL;
  4062          node_state = pcmk__xe_next(node_state)) {
  4072             if(this_node == NULL) {
  4077                 determine_remote_online_status(data_set, this_node);
  4080                 determine_online_status(node_state, this_node, data_set);
  4089                 xmlNode *lrm_rsc = NULL;
  4094                 for (lrm_rsc = pcmk__xe_first_child(tmp); lrm_rsc != NULL;
  4095                      lrm_rsc = pcmk__xe_next(lrm_rsc)) {
  4097                     if (pcmk__str_eq((
const char *)lrm_rsc->name,
  4106                         intermediate = extract_operations(
uname, rsc_id, lrm_rsc, active_filter);
  4107                         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)
 
Service failed and possibly in promoted role. 
 
GHashTable * pe__node_list2table(GList *list)
 
#define crm_notice(fmt, args...)
 
#define CRMD_ACTION_MIGRATED
 
No connection to executor. 
 
#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)
 
Service active and promoted. 
 
#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)
 
#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
 
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
 
gboolean unpack_resources(xmlNode *xml_resources, pe_working_set_t *data_set)
 
resource_object_functions_t * fns
 
#define XML_LRM_TAG_RESOURCE
 
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value. 
 
pe_node_t * pe__copy_node(const pe_node_t *this_node)
 
#define CRMD_ACTION_PROMOTE
 
bool pe__bundle_needs_remote_name(pe_resource_t *rsc, pe_working_set_t *data_set)
 
gboolean unpack_tags(xmlNode *xml_tags, pe_working_set_t *data_set)
 
void calculate_active_ops(GList *sorted_op_list, int *start_index, int *stop_index)
 
#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
 
Necessary CIB secrets are unavailable. 
 
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)
 
Service promoted but more likely to fail soon. 
 
gboolean unpack_remote_nodes(xmlNode *xml_resources, 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
 
Action did not complete in time. 
 
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. 
 
Execution failed, do not retry on node. 
 
bool pcmk__ends_with(const char *s, const char *match)
 
#define pe_flag_have_quorum
 
gboolean unpack_config(xmlNode *config, pe_working_set_t *data_set)
 
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)
 
No fence device is configured for target. 
 
#define pe__set_resource_flags(resource, flags_to_set)
 
#define XML_CIB_TAG_PROPSET
 
int pcmk__effective_rc(int rc)
 
#define pe_flag_stop_everything
 
void pe__unpack_dataset_nvpairs(xmlNode *xml_obj, const char *set_name, pe_rule_eval_data_t *rule_data, GHashTable *hash, const char *always_first, gboolean overwrite, pe_working_set_t *data_set)
 
#define XML_LRM_ATTR_RSCID
 
gboolean remote_maintenance
 
#define CRMD_ACTION_START
 
#define demote_action(rsc, node, optional)
 
#define XML_LRM_ATTR_TASK_KEY
 
bool pe__is_remote_node(const pe_node_t *node)
 
#define XML_TAG_ATTR_SETS
 
#define XML_LRM_ATTR_TASK
 
const char * role2text(enum rsc_role_e role)
 
xmlNode * pe_create_remote_xml(xmlNode *parent, const char *uname, const char *container_id, const char *migrateable, const char *is_managed, const char *start_timeout, const char *server, const char *port)
 
pe_node_t *(* location)(const pe_resource_t *, GList **, int)
 
pe_resource_t * pe__find_bundle_replica(const pe_resource_t *bundle, const pe_node_t *node)
 
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
 
Maximum value for this enum. 
 
#define crm_warn(fmt, args...)
 
guint remote_reconnect_ms
 
#define XML_CONFIG_ATTR_SHUTDOWN_LOCK_LIMIT
 
#define CRMD_ACTION_DEMOTE
 
char * clone_zero(const char *last_rsc_id)
 
#define pe_rsc_allow_migrate
 
#define pe_rsc_orphan_container_filler
 
int crm_element_value_ms(const xmlNode *data, const char *name, guint *dest)
Retrieve the millisecond value of an XML attribute. 
 
#define crm_debug(fmt, args...)
 
int pe__target_rc_from_xml(xmlNode *xml_op)
 
pe_resource_t * uber_parent(pe_resource_t *rsc)
 
#define XML_RSC_ATTR_CONTAINER
 
Used only to initialize variables. 
 
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute. 
 
#define XML_CIB_TAG_RESOURCE
 
#define pe_rsc_is_container
 
#define XML_CIB_TAG_STATE
 
const char * pe_base_name_end(const char *id)
 
bool pe__is_guest_node(const pe_node_t *node)
 
Parameter invalid (in local context) 
 
match only clone instances 
 
#define pe_rsc_start_pending
 
Parameter invalid (inherently) 
 
#define pe_warn_once(pe_wo_bit, fmt...)
 
pe_ticket_t * ticket_new(const char *ticket_id, pe_working_set_t *data_set)
 
#define crm_trace(fmt, args...)
 
#define CRMD_JOINSTATE_MEMBER
 
#define do_crm_log(level, fmt, args...)
Log a message. 
 
enum rsc_digest_cmp_val rc
 
bool xml_contains_remote_node(xmlNode *xml)
 
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)
 
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)
 
Action completed, result is known. 
 
#define pe_flag_stonith_enabled
 
gboolean unpack_status(xmlNode *status, pe_working_set_t *data_set)
 
int crm_element_value_epoch(const xmlNode *xml, const char *name, time_t *dest)
Retrieve the seconds-since-epoch value of an XML attribute. 
 
const char * pe_node_attribute_raw(pe_node_t *node, const char *name)
 
pe_resource_t * pe__create_clone_child(pe_resource_t *rsc, pe_working_set_t *data_set)
 
#define XML_RSC_ATTR_TARGET_ROLE
 
void(* free)(pe_resource_t *)
 
#define XML_LRM_ATTR_MIGRATE_TARGET
 
Execution failed, do not retry anywhere. 
 
#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)
 
Dependencies not available locally. 
 
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
 
void pe_fence_node(pe_working_set_t *data_set, pe_node_t *node, const char *reason, bool priority_delay)
Schedule a fence action for a node. 
 
pe_node_t * pe_create_node(const char *id, const char *uname, const char *type, const char *score, pe_working_set_t *data_set)
 
Requested action not implemented. 
 
#define pe_flag_quick_location
 
Service active but more likely to fail soon. 
 
const char * fail2text(enum action_fail_response fail)
 
Agent does not implement requested action. 
 
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)
 
#define XML_ATTR_HAVE_WATCHDOG
 
#define XML_NODE_ATTR_RSC_DISCOVERY
 
gboolean unpack_nodes(xmlNode *xml_nodes, pe_working_set_t *data_set)
 
#define CRMD_ACTION_METADATA
 
#define XML_LRM_ATTR_INTERVAL_MS
 
#define XML_LRM_ATTR_CALLID
 
#define CRMD_ACTION_MIGRATE
 
#define XML_NVPAIR_ATTR_VALUE
 
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. 
 
CRM_TRACE_INIT_DATA(pe_status)
 
Agent or dependency not available locally. 
 
GHashTable * digest_cache
cache of calculated resource digests 
 
bool pe__is_universal_clone(pe_resource_t *rsc, pe_working_set_t *data_set)
 
#define pe_rsc_failure_ignored
 
#define XML_NODE_JOIN_STATE
 
void destroy_ticket(gpointer data)
 
#define XML_CIB_TAG_STATUS
 
#define XML_CIB_TAG_OBJ_REF
 
gboolean common_unpack(xmlNode *xml_obj, pe_resource_t **rsc, pe_resource_t *parent, pe_working_set_t *data_set)
 
#define XML_NODE_IN_CLUSTER
 
gboolean crm_is_true(const char *s)
 
#define pe_flag_have_stonith_resource
 
#define CRM_ATTR_SITE_NAME
 
#define XML_CIB_TAG_GROUP
 
#define pe_flag_enable_unfencing
 
GList * find_operations(const char *rsc, const char *node, gboolean active_filter, pe_working_set_t *data_set)
 
#define XML_LRM_TAG_RSC_OP
 
#define pe_rsc_trace(rsc, fmt, args...)
 
Action cannot be attempted (e.g. shutdown) 
 
GList * pe__resource_actions(const pe_resource_t *rsc, const pe_node_t *node, const char *task, bool require_node)
Find all actions of given type for a resource. 
 
pe_action_t * pe__clear_resource_history(pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set)
 
#define XML_LRM_ATTR_MIGRATE_SOURCE
 
pe_resource_t *(* find_rsc)(pe_resource_t *parent, const char *search, const pe_node_t *node, int flags)
 
void freeXpathObject(xmlXPathObjectPtr xpathObj)
 
gint sort_node_uname(gconstpointer a, gconstpointer b)
 
#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
 
Execution failed, may be retried. 
 
#define crm_info(fmt, args...)
 
GHashTable * template_rsc_sets
 
char * clone_strip(const char *last_rsc_id)
 
int pe_get_failcount(pe_node_t *node, pe_resource_t *rsc, time_t *last_failure, uint32_t flags, xmlNode *xml_op, pe_working_set_t *data_set)
 
pe_action_t * pe_fence_op(pe_node_t *node, const char *op, bool optional, const char *reason, bool priority_delay, pe_working_set_t *data_set)
 
void pe_free_action(pe_action_t *action)
 
#define pe_flag_shutdown_lock
 
#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)
Create or update an action object. 
 
#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