12 #include <sys/param.h> 102 gboolean force_restart = FALSE;
103 gboolean delete_resource = FALSE;
104 gboolean changed = FALSE;
106 const char *value = NULL;
107 const char *old_value = NULL;
109 const char *attr_list[] = {
115 for (; attr_lpc <
PCMK__NELEM(attr_list); attr_lpc++) {
118 if (value == old_value
126 force_restart = TRUE;
127 crm_notice(
"Forcing restart of %s on %s, %s changed: %s -> %s",
136 delete_resource = TRUE;
138 }
else if (changed) {
139 delete_resource = TRUE;
141 return delete_resource;
148 guint interval_ms = 0;
151 const char *task = NULL;
152 const char *call_id = NULL;
162 rsc->
id, task, interval_ms,
163 active_node->
details->
uname, (reason? reason :
"unknown"));
165 cancel =
pe_cancel_op(rsc, task, interval_ms, active_node, data_set);
176 guint interval_ms = 0;
178 gboolean did_change = FALSE;
181 const char *digest_secure = NULL;
183 CRM_CHECK(active_node != NULL,
return FALSE);
186 if (interval_ms > 0) {
187 xmlNode *op_match = NULL;
195 if ((op_match == NULL)
197 CancelXmlOp(rsc, xml_op, active_node,
"orphan", data_set);
201 }
else if (op_match == NULL) {
236 out->
info(out,
"Only 'private' parameters to " 249 required =
custom_action(rsc, key, task, NULL, FALSE, TRUE, data_set);
251 trigger_unfencing(rsc, active_node,
"Device parameters changed", NULL, data_set);
258 trigger_unfencing(rsc, active_node,
"Device parameters changed (reload)", NULL, data_set);
262 if (interval_ms > 0) {
270 op =
custom_action(rsc, key, task, active_node, TRUE, TRUE, data_set);
274 }
else if (digest_restart) {
275 pe_rsc_trace(rsc,
"Reloading '%s' action for resource %s", task, rsc->
id);
283 pe_rsc_trace(rsc,
"Resource %s doesn't support agent reloads",
308 const char *reason = NULL;
313 if (check_action_definition(rsc, node, rsc_op, data_set)
317 reason =
"action definition changed";
323 switch (digest_data->
rc) {
325 crm_trace(
"Resource %s history entry %s on %s has no digest to compare",
331 reason =
"resource parameters have changed";
350 const char *task = NULL;
352 xmlNode *rsc_op = NULL;
353 GList *op_list = NULL;
354 GList *sorted_op_list = NULL;
361 || pe_rsc_is_clone(parent) == FALSE
363 pe_rsc_trace(rsc,
"Skipping param check for %s and deleting: orphan", rsc->
id);
366 pe_rsc_trace(rsc,
"Skipping param check for %s (orphan clone)", rsc->
id);
371 if (check_rsc_parameters(rsc, node, rsc_entry, FALSE, data_set)) {
374 pe_rsc_trace(rsc,
"Skipping param check for %s: no longer active on %s",
381 if (check_rsc_parameters(rsc, node, rsc_entry, TRUE, data_set)) {
385 for (rsc_op = pcmk__xe_first_child(rsc_entry); rsc_op != NULL;
386 rsc_op = pcmk__xe_next(rsc_op)) {
389 op_list = g_list_prepend(op_list, rsc_op);
396 for (gIter = sorted_op_list; gIter != NULL; gIter = gIter->next) {
397 xmlNode *rsc_op = (xmlNode *) gIter->data;
398 guint interval_ms = 0;
402 if (start_index < stop_index) {
405 }
else if (offset < start_index) {
413 if ((interval_ms > 0) &&
416 CancelXmlOp(rsc, rsc_op, node,
"maintenance mode", data_set);
435 }
else if (check_action_definition(rsc, node, rsc_op, data_set)
443 g_list_free(sorted_op_list);
447 find_rsc_list(GList *result,
pe_resource_t * rsc,
const char *
id, gboolean renamed_clones,
451 gboolean match = FALSE;
458 if (data_set == NULL) {
461 for (gIter = data_set->
resources; gIter != NULL; gIter = gIter->next) {
464 result = find_rsc_list(result, child,
id, renamed_clones, partial,
471 if (strstr(rsc->
id,
id)) {
479 if (strcmp(rsc->
id,
id) == 0) {
488 result = g_list_prepend(result, rsc);
493 for (; gIter != NULL; gIter = gIter->next) {
496 result = find_rsc_list(result, child,
id, renamed_clones, partial, NULL);
506 const char *
id = NULL;
508 xmlNode *lrm_rscs = NULL;
511 xmlNode *node_state = NULL;
513 for (node_state = pcmk__xe_first_child(status); node_state != NULL;
514 node_state = pcmk__xe_next(node_state)) {
529 crm_trace(
"Skipping param check for %s: can't run resources",
537 xmlNode *rsc_entry = NULL;
539 for (rsc_entry = pcmk__xe_first_child(lrm_rscs);
541 rsc_entry = pcmk__xe_next(rsc_entry)) {
547 GList *result = NULL;
548 const char *rsc_id =
ID(rsc_entry);
552 result = find_rsc_list(NULL, NULL, rsc_id, TRUE, FALSE, data_set);
553 for (gIter = result; gIter != NULL; gIter = gIter->next) {
559 check_actions_for(rsc_entry, rsc, node, data_set);
589 for (; gIter != NULL; gIter = gIter->next) {
592 common_apply_stickiness(child_rsc, node, data_set);
602 if (current == NULL) {
604 }
else if ((match != NULL)
609 pe_rsc_debug(sticky_rsc,
"Resource %s: preferring current location" 610 " (node=%s, weight=%d)", sticky_rsc->
id,
616 pe_rsc_debug(rsc,
"Ignoring stickiness for %s: the cluster is asymmetric" 617 " and node %s is not explicitly allowed", rsc->
id, node->
details->
uname);
619 while (g_hash_table_iter_next(&iter, NULL, (
void **)&nIter)) {
620 crm_err(
"%s[%s] = %d", rsc->
id, nIter->details->uname, nIter->weight);
636 if (failcount_clear_action_exists(node, rsc) == FALSE) {
653 for (; gIter != NULL; gIter = gIter->next) {
666 for (; gIter != NULL; gIter = gIter->next) {
674 calculate_system_health(gpointer gKey, gpointer gValue, gpointer user_data)
676 const char *key = (
const char *)gKey;
677 const char *value = (
const char *)gValue;
678 int *system_health = (
int *)user_data;
680 if (!gKey || !gValue || !user_data) {
709 }
else if (pcmk__str_eq(health_strategy,
"migrate-on-red",
pcmk__str_casei)) {
718 }
else if (pcmk__str_eq(health_strategy,
"only-green",
pcmk__str_casei)) {
727 }
else if (pcmk__str_eq(health_strategy,
"progressive",
pcmk__str_casei)) {
733 "node-health-base"));
744 crm_err(
"Unknown node health strategy: %s", health_strategy);
748 crm_info(
"Applying automated node health strategy: %s", health_strategy);
750 for (gIter = data_set->
nodes; gIter != NULL; gIter = gIter->next) {
751 int system_health = base_health;
755 g_hash_table_foreach(node->
details->
attrs, calculate_system_health, &system_health);
757 crm_info(
" Node %s has an combined system health of %d",
763 if (system_health != 0) {
767 for (; gIter2 != NULL; gIter2 = gIter2->next) {
782 if (data_set->
input == NULL) {
792 apply_system_health(data_set);
806 for (GList *gIter = data_set->
nodes; gIter != NULL; gIter = gIter->next) {
813 pe_fence_node(data_set, node,
"the connection is unrecoverable", FALSE);
825 if (probed != NULL &&
crm_is_true(probed) == FALSE) {
833 for (GList *gIter2 = data_set->
resources; gIter2 != NULL; gIter2 = gIter2->next) {
852 g_list_foreach(rsc->
children, (GFunc) rsc_discover_filter, node);
870 result = (time_t) result_ll;
883 g_list_foreach(rsc->
children, (GFunc) apply_shutdown_lock, data_set);
904 "Cancelling shutdown lock because %s is already active",
912 }
else if (pcmk__list_of_1(rsc->
running_on)) {
917 pe_rsc_debug(rsc,
"Not locking %s to unclean %s for shutdown",
921 rsc->
lock_time = shutdown_time(node, data_set);
934 pe_rsc_info(rsc,
"Locking %s to %s due to shutdown (expires @%lld)",
936 (
long long) lock_expiration);
939 pe_rsc_info(rsc,
"Locking %s to %s due to shutdown",
944 for (GList *item = data_set->
nodes; item != NULL; item = item->next) {
967 g_list_foreach(data_set->
resources, (GFunc) apply_shutdown_lock, data_set);
972 for (gIter = data_set->
nodes; gIter != NULL; gIter = gIter->next) {
984 gIter = data_set->
nodes;
985 for (; gIter != NULL; gIter = gIter->next) {
986 GList *gIter2 = NULL;
990 for (; gIter2 != NULL; gIter2 = gIter2->next) {
993 common_apply_stickiness(rsc, node, data_set);
994 rsc_discover_filter(rsc, node);
1007 check_actions(data_set);
1012 convert_const_pointer(
const void *ptr)
1019 sort_rsc_process_order(gconstpointer a, gconstpointer b, gpointer
data)
1025 const char *reason =
"existence";
1027 GList *nodes = (GList *)
data;
1033 GList *gIter = NULL;
1034 GHashTable *r1_nodes = NULL;
1035 GHashTable *r2_nodes = NULL;
1037 reason =
"priority";
1041 if (r1_weight > r2_weight) {
1046 if (r1_weight < r2_weight) {
1051 reason =
"no node list";
1052 if (nodes == NULL) {
1057 resource1->
id, NULL, NULL, 1,
1063 resource2->
id, NULL, NULL, 1,
1069 reason =
"current location";
1074 r1_node = pe__current_node(resource1);
1075 r1_node = g_hash_table_lookup(r1_nodes, r1_node->
details->
id);
1076 if (r1_node != NULL) {
1077 r1_weight = r1_node->
weight;
1081 r2_node = pe__current_node(resource2);
1082 r2_node = g_hash_table_lookup(r2_nodes, r2_node->
details->
id);
1083 if (r2_node != NULL) {
1084 r2_weight = r2_node->
weight;
1088 if (r1_weight > r2_weight) {
1093 if (r1_weight < r2_weight) {
1099 for (gIter = nodes; gIter != NULL; gIter = gIter->next) {
1107 r1_node = g_hash_table_lookup(r1_nodes, node->
details->
id);
1110 r1_weight = r1_node->
weight;
1115 r2_node = g_hash_table_lookup(r2_nodes, node->
details->
id);
1118 r2_weight = r2_node->
weight;
1121 if (r1_weight > r2_weight) {
1126 if (r1_weight < r2_weight) {
1133 crm_trace(
"%s (%d) on %s %c %s (%d) on %s: %s",
1134 resource1->
id, r1_weight, r1_node ? r1_node->
details->
id :
"n/a",
1135 rc < 0 ? '>
' : rc > 0 ? '<
' : '=
', 1136 resource2->id, r2_weight, r2_node ? r2_node->details->id : "n/a", reason); 1139 g_hash_table_destroy(r1_nodes); 1142 g_hash_table_destroy(r2_nodes); 1149 allocate_resources(pe_working_set_t * data_set) 1151 GList *gIter = NULL; 1153 if (pcmk_is_set(data_set->flags, pe_flag_have_remote_nodes)) { 1154 /* Allocate remote connection resources first (which will also allocate 1155 * any colocation dependencies). If the connection is migrating, always 1156 * prefer the partial migration target. 1158 for (gIter = data_set->resources; gIter != NULL; gIter = gIter->next) { 1159 pe_resource_t *rsc = (pe_resource_t *) gIter->data; 1160 if (rsc->is_remote_node == FALSE) { 1163 pe_rsc_trace(rsc, "Allocating remote connection resource '%s
'", 1165 rsc->cmds->allocate(rsc, rsc->partial_migration_target, data_set); 1169 /* now do the rest of the resources */ 1170 for (gIter = data_set->resources; gIter != NULL; gIter = gIter->next) { 1171 pe_resource_t *rsc = (pe_resource_t *) gIter->data; 1172 if (rsc->is_remote_node == TRUE) { 1175 pe_rsc_trace(rsc, "Allocating %s resource '%s
'", 1176 crm_element_name(rsc->xml), rsc->id); 1177 rsc->cmds->allocate(rsc, NULL, data_set); 1181 // Clear fail counts for orphaned rsc on all online nodes 1183 cleanup_orphans(pe_resource_t * rsc, pe_working_set_t * data_set) 1185 GList *gIter = NULL; 1187 for (gIter = data_set->nodes; gIter != NULL; gIter = gIter->next) { 1188 pe_node_t *node = (pe_node_t *) gIter->data; 1190 if (node->details->online 1191 && pe_get_failcount(node, rsc, NULL, pe_fc_effective, NULL, 1194 pe_action_t *clear_op = NULL; 1196 clear_op = pe__clear_failcount(rsc, node, "it is orphaned", 1199 /* We can't use order_action_then_stop() here because its
1213 GList *gIter = NULL;
1216 GList *nodes = g_list_copy(data_set->
nodes);
1220 g_list_sort_with_data(data_set->
resources, sort_rsc_process_order, nodes);
1225 gIter = data_set->
nodes;
1226 for (; gIter != NULL; gIter = gIter->next) {
1230 out->
message(out,
"node-capacity", node,
"Original");
1237 allocate_resources(data_set);
1239 gIter = data_set->
nodes;
1240 for (; gIter != NULL; gIter = gIter->next) {
1244 out->
message(out,
"node-capacity", node,
"Remaining");
1293 for (gIter = data_set->
resources; gIter != NULL; gIter = gIter->next) {
1300 cleanup_orphans(rsc, data_set);
1307 for (gIter = data_set->
resources; gIter != NULL; gIter = gIter->next) {
1326 for (; gIter != NULL; gIter = gIter->next) {
1329 if (is_managed(child_rsc)) {
1343 for (; gIter != NULL; gIter = gIter->next) {
1346 if (is_managed(rsc)) {
1361 gboolean integrity_lost = FALSE;
1362 gboolean need_stonith = TRUE;
1364 GList *stonith_ops = NULL;
1365 GList *shutdown_ops = NULL;
1372 crm_trace(
"Processing fencing and shutdown cases");
1373 if (any_managed_resources(data_set) == FALSE) {
1374 crm_notice(
"Delaying fencing operations until there are resources to manage");
1375 need_stonith = FALSE;
1379 for (gIter = data_set->
nodes; gIter != NULL; gIter = gIter->next) {
1398 stonith_op =
pe_fence_op(node, NULL, FALSE,
"node is unclean", FALSE, data_set);
1405 dc_down = stonith_op;
1410 && (stonith_ops != NULL)) {
1421 stonith_ops = g_list_prepend(stonith_ops, stonith_op);
1437 shutdown_ops = g_list_prepend(shutdown_ops, down_op);
1442 integrity_lost = TRUE;
1447 if (integrity_lost) {
1449 pe_warn(
"YOUR RESOURCES ARE NOW LIKELY COMPROMISED");
1450 pe_err(
"ENABLE STONITH TO KEEP YOUR RESOURCES SAFE");
1453 crm_notice(
"Cannot fence unclean nodes until quorum is" 1454 " attained (or no-quorum-policy is set to ignore)");
1458 if (dc_down != NULL) {
1467 for (gIter = shutdown_ops; gIter != NULL; gIter = gIter->next) {
1470 crm_debug(
"Ordering shutdown on %s before %s on DC %s",
1484 for (gIter = stonith_ops; gIter != NULL; gIter = gIter->next) {
1488 }
else if (stonith_ops) {
1498 g_list_free(stonith_ops);
1499 g_list_free(shutdown_ops);
1514 const char *op = g_hash_table_lookup(rh_action->
meta,
"stonith_action");
1533 GList *gIter = NULL;
1546 GList *probes = NULL;
1547 GList *rh_actions = NULL;
1549 GList *pIter = NULL;
1551 if (lh_rsc == NULL) {
1554 }
else if (rh_rsc && lh_rsc == rh_rsc) {
1558 if (lh_action == NULL && lh_action_task == NULL) {
1562 if (rh_action == NULL && rh_action_task == NULL) {
1573 }
else if (lh_action == NULL
1583 if (rh_rsc && lh_rsc->
container == rh_rsc) {
1587 }
else if (rh_action == NULL && rh_action_task
1610 order_type = order->
type;
1614 if (probes == NULL) {
1619 rh_actions = g_list_prepend(rh_actions, rh_action);
1621 }
else if (rh_rsc && rh_action_task) {
1625 if (rh_actions == NULL) {
1626 g_list_free(probes);
1630 crm_trace(
"Processing for LH probe based on ordering constraint %s -> %s" 1631 " (id=%d, type=%.6x)",
1632 lh_action ? lh_action->
uuid : lh_action_task,
1633 rh_action ? rh_action->
uuid : rh_action_task,
1636 for (pIter = probes; pIter != NULL; pIter = pIter->next) {
1638 GList *rIter = NULL;
1640 for (rIter = rh_actions; rIter != NULL; rIter = rIter->next) {
1643 if (order_first_probe_unneeded(probe, rh_action_iter)) {
1650 g_list_free(rh_actions);
1651 g_list_free(probes);
1656 order_first_probe_then_restart_repromote(
pe_action_t * probe,
1660 GList *gIter = NULL;
1661 bool interleave = FALSE;
1665 || probe->
rsc == NULL
1682 crm_trace(
"Processing based on %s %s -> %s %s",
1694 && probe->
rsc != after->
rsc) {
1696 GList *then_actions = NULL;
1706 for (gIter = then_actions; gIter != NULL; gIter = gIter->next) {
1716 g_list_free(then_actions);
1721 const char *interleave_s = g_hash_table_lookup(after->
rsc->
meta,
1737 for (gIter = after->
actions_after; gIter != NULL; gIter = gIter->next) {
1756 if (after->
rsc == NULL
1769 && interleave == TRUE
1770 && (compatible_rsc == NULL
1771 || compatible_rsc != after_wrapper->
action->
rsc)) {
1776 crm_trace(
"Proceeding through %s %s -> %s %s (type=0x%.6x)",
1781 after_wrapper->
type);
1783 order_first_probe_then_restart_repromote(probe, after_wrapper->
action, data_set);
1789 GList *gIter = NULL;
1791 for (gIter = data_set->
actions; gIter != NULL; gIter = gIter->next) {
1803 GList *gIter = NULL;
1804 GList *probes = NULL;
1806 g_list_foreach(rsc->
children, (GFunc) order_first_rsc_probes, data_set);
1814 for (gIter = probes; gIter != NULL; gIter= gIter->next) {
1816 GList *aIter = NULL;
1818 for (aIter = probe->
actions_after; aIter != NULL; aIter = aIter->next) {
1821 order_first_probe_then_restart_repromote(probe, after_wrapper->
action, data_set);
1822 clear_actions_tracking_flag(data_set);
1826 g_list_free(probes);
1832 GList *gIter = NULL;
1834 for (gIter = data_set->
resources; gIter != NULL; gIter = gIter->next) {
1837 order_first_rsc_probes(rsc, data_set);
1840 order_first_probes_imply_stops(data_set);
1847 GList *gIter = NULL;
1849 for (gIter = data_set->
resources; gIter != NULL; gIter = gIter->next) {
1895 GList *actions = NULL;
1896 GList *probes = NULL;
1901 start = actions->data;
1902 g_list_free(actions);
1906 crm_err(
"No start action for %s", rsc->
id);
1912 for (actions = start->actions_before; actions != NULL; actions = actions->next) {
1915 GList *pIter = NULL;
1919 if(first->required_runnable_before) {
1920 GList *clone_actions = NULL;
1921 for (clone_actions = first->actions_before; clone_actions != NULL; clone_actions = clone_actions->next) {
1932 crm_trace(
"Not a start op %s for %s", first->uuid, start->uuid);
1935 if(first_rsc == NULL) {
1939 crm_trace(
"Same parent %s for %s", first_rsc->id, start->uuid);
1942 }
else if(FALSE && pe_rsc_is_clone(
uber_parent(first_rsc)) == FALSE) {
1943 crm_trace(
"Not a clone %s for %s", first_rsc->id, start->uuid);
1947 crm_err(
"Applying %s before %s %d", first->uuid, start->uuid,
uber_parent(first_rsc)->variant);
1949 for (pIter = probes; pIter != NULL; pIter = pIter->next) {
1952 crm_err(
"Ordering %s before %s", first->uuid, probe->
uuid);
1963 order_first_probes(data_set);
1964 order_then_probes(data_set);
1967 static int transition_id = -1;
1979 crm_err(
"Calculated transition %d (with errors)%s%s",
1981 (filename == NULL)?
"" :
", saving inputs in ",
1982 (filename == NULL)?
"" : filename);
1985 crm_warn(
"Calculated transition %d (with warnings)%s%s",
1987 (filename == NULL)?
"" :
", saving inputs in ",
1988 (filename == NULL)?
"" : filename);
1993 (filename == NULL)?
"" :
", saving inputs in ",
1994 (filename == NULL)?
"" : filename);
1997 crm_notice(
"Configuration errors found during scheduler processing," 1998 " please run \"crm_verify -L\" to identify issues");
2008 GList *gIter = NULL;
2009 const char *value = NULL;
2010 long long limit = 0LL;
2013 crm_trace(
"Creating transition graph %d.", transition_id);
2042 char *recheck_epoch = NULL;
2047 free(recheck_epoch);
2056 for (; gIter != NULL; gIter = gIter->next) {
2069 crm_trace(
"processing non-resource actions");
2072 for (; gIter != NULL; gIter = gIter->next) {
2077 &&
action->node->details->shutdown
2079 && !pcmk_any_flags_set(
action->flags,
2089 crm_crit(
"Cannot %s node '%s' because of %s:%s%s (%s)",
2090 action->node->details->unclean ?
"fence" :
"shut down",
2102 crm_trace(
"Created transition graph %d.", transition_id);
2111 GList *gIter = NULL;
2113 for (gIter = data_set->
actions; gIter != NULL; gIter = gIter->next) {
2114 char *node_name = NULL;
2118 if (
action->rsc != NULL) {
2126 }
else if(
action->node) {
2132 task = strdup(
"Shutdown");
2134 const char *op = g_hash_table_lookup(
action->meta,
"stonith_action");
2138 out->
message(out,
"node-action", task, node_name,
action->reason);
pe_action_t * pe_cancel_op(pe_resource_t *rsc, const char *name, guint interval_ms, pe_node_t *node, pe_working_set_t *data_set)
void pe__foreach_param_check(pe_working_set_t *data_set, void(*cb)(pe_resource_t *, pe_node_t *, xmlNode *, enum pe_check_parameters, pe_working_set_t *))
#define CRM_CHECK(expr, failure_action)
void complex_set_cmds(pe_resource_t *rsc)
xmlNode * find_xml_node(xmlNode *cib, const char *node_path, gboolean must_find)
void group_append_meta(pe_resource_t *rsc, xmlNode *xml)
enum pe_action_flags clone_action_flags(pe_action_t *action, pe_node_t *node)
enum pe_quorum_policy no_quorum_policy
void clone_append_meta(pe_resource_t *rsc, xmlNode *xml)
#define crm_notice(fmt, args...)
#define pe_flag_stop_action_orphans
bool pe__is_guest_or_remote_node(const pe_node_t *node)
enum pe_action_flags pcmk__bundle_action_flags(pe_action_t *action, pe_node_t *node)
#define pe_rsc_debug(rsc, fmt, args...)
#define XML_CONFIG_ATTR_SHUTDOWN_LOCK
#define crm_crit(fmt, args...)
#define pe__set_action_flags(action, flags_to_set)
#define pe__show_node_weights(level, rsc, text, nodes, data_set)
#define XML_ATTR_TRANSITION_MAGIC
G_GNUC_INTERNAL GList * pcmk__colocated_resources(pe_resource_t *rsc, pe_resource_t *orig_rsc, GList *colocated_rscs)
GList * sort_nodes_by_weight(GList *nodes, pe_node_t *active_node, pe_working_set_t *data_set)
#define stop_action(rsc, node, optional)
void pe__add_param_check(xmlNode *rsc_op, pe_resource_t *rsc, pe_node_t *node, enum pe_check_parameters, pe_working_set_t *data_set)
pe_resource_t * container
bool pcmk__strcase_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
int(* message)(pcmk__output_t *out, const char *message_id,...)
#define pe_flag_concurrent_fencing
void pe__update_recheck_time(time_t recheck, pe_working_set_t *data_set)
resource_alloc_functions_t * cmds
#define pe_flag_symmetric_cluster
GList * find_actions(GList *input, const char *key, const pe_node_t *on_node)
gboolean stage4(pe_working_set_t *data_set)
xmlNode * get_object_root(const char *object_type, xmlNode *the_root)
#define pe_flag_no_compat
G_GNUC_INTERNAL void pcmk__new_ordering(pe_resource_t *lh_rsc, char *lh_task, pe_action_t *lh_action, pe_resource_t *rh_rsc, char *rh_task, pe_action_t *rh_action, enum pe_ordering type, pe_working_set_t *data_set)
void add_maintenance_update(pe_working_set_t *data_set)
const char * crm_xml_add_int(xmlNode *node, const char *name, int value)
Create an XML attribute with specified name and integer value.
gboolean exclusive_discover
int char2score(const char *score)
G_GNUC_INTERNAL bool pcmk__is_failed_remote_node(pe_node_t *node)
pe_action_t * sched_shutdown_op(pe_node_t *node, pe_working_set_t *data_set)
#define XML_LRM_TAG_RESOURCE
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
void ReloadRsc(pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set)
bool pe__bundle_needs_remote_name(pe_resource_t *rsc, pe_working_set_t *data_set)
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
#define pe_flag_have_status
gboolean stage2(pe_working_set_t *data_set)
void group_rsc_location(pe_resource_t *rsc, pe__location_t *constraint)
time_t get_effective_time(pe_working_set_t *data_set)
gboolean stage5(pe_working_set_t *data_set)
const char * pe_pref(GHashTable *options, const char *name)
int(* info)(pcmk__output_t *out, const char *format,...) G_GNUC_PRINTF(2
void resource_location(pe_resource_t *rsc, pe_node_t *node, int score, const char *tag, pe_working_set_t *data_set)
enum pe_graph_flags native_update_actions(pe_action_t *first, pe_action_t *then, pe_node_t *node, enum pe_action_flags flags, enum pe_action_flags filter, enum pe_ordering type, pe_working_set_t *data_set)
void native_expand(pe_resource_t *rsc, pe_working_set_t *data_set)
void native_rsc_location(pe_resource_t *rsc, pe__location_t *constraint)
void native_rsc_colocation_lh(pe_resource_t *dependent, pe_resource_t *primary, pcmk__colocation_t *constraint, pe_working_set_t *data_set)
GHashTable * pcmk__native_merge_weights(pe_resource_t *rsc, const char *rhs, GHashTable *nodes, const char *attr, float factor, uint32_t flags)
bool pcmk__ends_with(const char *s, const char *match)
gboolean can_run_resources(const pe_node_t *node)
#define pe_flag_have_quorum
G_GNUC_INTERNAL void pcmk__order_vs_fence(pe_action_t *stonith_op, pe_working_set_t *data_set)
#define CRM_SCORE_INFINITY
gboolean remote_requires_reset
void native_rsc_colocation_rh(pe_resource_t *dependent, pe_resource_t *primary, pcmk__colocation_t *constraint, pe_working_set_t *data_set)
void pcmk__bundle_rsc_colocation_rh(pe_resource_t *dependent, pe_resource_t *primary, pcmk__colocation_t *constraint, pe_working_set_t *data_set)
void LogNodeActions(pe_working_set_t *data_set)
#define pe__set_resource_flags(resource, flags_to_set)
void trigger_unfencing(pe_resource_t *rsc, pe_node_t *node, const char *reason, pe_action_t *dependency, pe_working_set_t *data_set)
void pcmk__bundle_rsc_colocation_lh(pe_resource_t *dependent, pe_resource_t *primary, pcmk__colocation_t *constraint, pe_working_set_t *data_set)
#define XML_LRM_ATTR_TASK
G_GNUC_INTERNAL void pcmk__apply_locations(pe_working_set_t *data_set)
void native_internal_constraints(pe_resource_t *rsc, pe_working_set_t *data_set)
void group_rsc_colocation_lh(pe_resource_t *dependent, pe_resource_t *primary, pcmk__colocation_t *constraint, pe_working_set_t *data_set)
#define CRM_OP_CLEAR_FAILCOUNT
gboolean crm_config_error
int pcmk__scan_ll(const char *text, long long *result, long long default_value)
#define crm_warn(fmt, args...)
void native_create_actions(pe_resource_t *rsc, pe_working_set_t *data_set)
void pe_action_set_reason(pe_action_t *action, const char *reason, bool overwrite)
gboolean(* create_probe)(pe_resource_t *, pe_node_t *, pe_action_t *, gboolean, pe_working_set_t *)
void clone_expand(pe_resource_t *rsc, pe_working_set_t *data_set)
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...)
pe_resource_t * uber_parent(pe_resource_t *rsc)
#define pe_flag_sanitized
pe_node_t * pcmk__clone_allocate(pe_resource_t *rsc, pe_node_t *preferred, pe_working_set_t *data_set)
#define XML_CIB_ATTR_SHUTDOWN
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
#define XML_CIB_TAG_STATE
bool pe__is_guest_node(const pe_node_t *node)
gboolean stage0(pe_working_set_t *data_set)
enum pe_graph_flags group_update_actions(pe_action_t *first, pe_action_t *then, pe_node_t *node, enum pe_action_flags flags, enum pe_action_flags filter, enum pe_ordering type, pe_working_set_t *data_set)
#define pe_rsc_start_pending
#define pe__clear_action_flags(action, flags_to_clear)
G_GNUC_INTERNAL void pcmk__order_remote_connection_actions(pe_working_set_t *data_set)
#define crm_trace(fmt, args...)
enum rsc_digest_cmp_val rc
void pe_fence_node(pe_working_set_t *data_set, pe_node_t *node, const char *reason, bool priority_delay)
Schedule a fence action for a node.
G_GNUC_INTERNAL GList * pcmk__group_colocated_resources(pe_resource_t *rsc, pe_resource_t *orig_rsc, GList *colocated_rscs)
char * digest_secure_calc
void calculate_active_ops(GList *sorted_op_list, int *start_index, int *stop_index)
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
struct pe_node_shared_s * details
#define XML_AGENT_ATTR_PROVIDER
gboolean order_actions(pe_action_t *lh_action, pe_action_t *rh_action, enum pe_ordering order)
void(* expand)(pe_resource_t *, pe_working_set_t *)
GHashTable * pcmk__group_merge_weights(pe_resource_t *rsc, const char *rhs, GHashTable *nodes, const char *attr, float factor, uint32_t flags)
void pcmk__unpack_constraints(pe_working_set_t *data_set)
Wrappers for and extensions to libxml2.
#define XML_ATTR_TE_NOWAIT
xmlNode * find_rsc_op_entry(pe_resource_t *rsc, const char *key)
xmlNode * create_xml_node(xmlNode *parent, const char *name)
void pcmk__log_transition_summary(const char *filename)
#define pe_flag_stonith_enabled
const char * pe_node_attribute_raw(pe_node_t *node, const char *name)
gboolean native_create_probe(pe_resource_t *rsc, pe_node_t *node, pe_action_t *complete, gboolean force, pe_working_set_t *data_set)
#define XML_LRM_ATTR_RESTART_DIGEST
void group_internal_constraints(pe_resource_t *rsc, pe_working_set_t *data_set)
pe_node_t * pcmk__bundle_allocate(pe_resource_t *rsc, pe_node_t *preferred, pe_working_set_t *data_set)
enum pe_obj_types variant
gboolean xml_has_children(const xmlNode *root)
const char * placement_strategy
void pe__free_param_checks(pe_working_set_t *data_set)
char * pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms)
Generate an operation key (RESOURCE_ACTION_INTERVAL)
gboolean pcmk__bundle_create_probe(pe_resource_t *rsc, pe_node_t *node, pe_action_t *complete, gboolean force, pe_working_set_t *data_set)
pe_node_t * pe_find_node_id(GList *node_list, const char *id)
bool pe_can_fence(pe_working_set_t *data_set, pe_node_t *node)
pe_resource_t * find_compatible_child(pe_resource_t *local_child, pe_resource_t *rsc, enum rsc_role_e filter, gboolean current, pe_working_set_t *data_set)
G_GNUC_INTERNAL pe__location_t * pcmk__new_location(const char *id, pe_resource_t *rsc, int node_weight, const char *discover_mode, pe_node_t *foo_node, pe_working_set_t *data_set)
#define PCMK_RESOURCE_CLASS_STONITH
gboolean rsc_discovery_enabled
#define XML_LRM_ATTR_SECURE_DIGEST
void group_create_actions(pe_resource_t *rsc, pe_working_set_t *data_set)
gboolean probe_resources(pe_working_set_t *data_set)
enum pe_action_flags group_action_flags(pe_action_t *action, pe_node_t *node)
Cluster status and scheduling.
bool pcmk__threshold_reached(pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set, pe_resource_t **failed)
GList * ordering_constraints
void add_hash_param(GHashTable *hash, const char *name, const char *value)
#define pe_flag_show_utilization
void pcmk__bundle_rsc_location(pe_resource_t *rsc, pe__location_t *constraint)
void clone_rsc_location(pe_resource_t *rsc, pe__location_t *constraint)
#define XML_LRM_TAG_RESOURCES
void group_rsc_colocation_rh(pe_resource_t *dependent, pe_resource_t *primary, pcmk__colocation_t *constraint, pe_working_set_t *data_set)
int pe__add_scores(int score1, int score2)
#define crm_err(fmt, args...)
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.
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)
gboolean cluster_status(pe_working_set_t *data_set)
This structure contains everything that makes up a single output formatter.
#define XML_LRM_ATTR_INTERVAL_MS
#define crm_log_xml_info(xml, text)
gboolean stage8(pe_working_set_t *data_set)
void clone_create_actions(pe_resource_t *rsc, pe_working_set_t *data_set)
#define XML_LRM_ATTR_CALLID
void pcmk__bundle_expand(pe_resource_t *rsc, pe_working_set_t *data_set)
gboolean clone_create_probe(pe_resource_t *rsc, pe_node_t *node, pe_action_t *complete, gboolean force, pe_working_set_t *data_set)
void pcmk__order_probes(pe_working_set_t *data_set)
void clone_rsc_colocation_lh(pe_resource_t *dependent, pe_resource_t *primary, pcmk__colocation_t *constraint, pe_working_set_t *data_set)
void native_append_meta(pe_resource_t *rsc, xmlNode *xml)
void(* create_actions)(pe_resource_t *, pe_working_set_t *)
enum pe_action_flags flags
#define pe_rsc_maintenance
pe_working_set_t * cluster
#define XML_CIB_TAG_STATUS
G_GNUC_INTERNAL void pcmk__fence_guest(pe_node_t *node, pe_working_set_t *data_set)
void clone_rsc_colocation_rh(pe_resource_t *dependent, pe_resource_t *primary, pcmk__colocation_t *constraint, pe_working_set_t *data_set)
bool pe__resource_is_remote_conn(const pe_resource_t *rsc, const pe_working_set_t *data_set)
#define crm_log_xml_trace(xml, text)
gboolean crm_is_true(const char *s)
bool pcmk__starts_with(const char *str, const char *prefix)
Check whether a string starts with a certain sequence.
CRM_TRACE_INIT_DATA(pacemaker)
#define XML_LRM_TAG_RSC_OP
#define pe_rsc_trace(rsc, fmt, args...)
#define pe__set_order_flags(order_flags, flags_to_set)
gboolean was_processing_error
#define XML_RSC_ATTR_INTERLEAVE
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)
gboolean stage6(pe_working_set_t *data_set)
resource_alloc_functions_t resource_class_alloc_functions[]
gboolean was_processing_warning
void clone_internal_constraints(pe_resource_t *rsc, pe_working_set_t *data_set)
#define pe_flag_start_failure_fatal
gboolean DeleteRsc(pe_resource_t *rsc, pe_node_t *node, gboolean optional, pe_working_set_t *data_set)
void group_expand(pe_resource_t *rsc, pe_working_set_t *data_set)
void pcmk__bundle_create_actions(pe_resource_t *rsc, pe_working_set_t *data_set)
void graph_element_from_action(pe_action_t *action, pe_working_set_t *data_set)
#define crm_info(fmt, args...)
enum pe_action_flags native_action_flags(pe_action_t *action, pe_node_t *node)
enum pe_graph_flags pcmk__multi_update_actions(pe_action_t *first, pe_action_t *then, pe_node_t *node, enum pe_action_flags flags, enum pe_action_flags filter, enum pe_ordering type, pe_working_set_t *data_set)
void pcmk__bundle_internal_constraints(pe_resource_t *rsc, pe_working_set_t *data_set)
void set_alloc_actions(pe_working_set_t *data_set)
void pcmk__bundle_append_meta(pe_resource_t *rsc, xmlNode *xml)
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)
#define pe_flag_shutdown_lock
#define pe_rsc_info(rsc, fmt, args...)
pe_node_t * pcmk__native_allocate(pe_resource_t *rsc, pe_node_t *preferred, pe_working_set_t *data_set)
#define XML_AGENT_ATTR_CLASS
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
pe_node_t * pcmk__group_allocate(pe_resource_t *rsc, pe_node_t *preferred, pe_working_set_t *data_set)
#define pe_flag_stop_rsc_orphans