25 #define INFINITY_HACK (INFINITY * -100) 27 #define VARIANT_NATIVE 1 82 #define clear_node_weights_flags(nw_flags, nw_rsc, flags_to_clear) do { \ 83 flags = pcmk__clear_flags_as(__func__, __LINE__, LOG_TRACE, \ 84 "Node weight", (nw_rsc)->id, (flags), \ 85 (flags_to_clear), #flags_to_clear); \ 96 gboolean result = FALSE;
113 best = g_list_nth_data(nodes, 0);
116 if (prefer && nodes) {
119 if (chosen == NULL) {
120 pe_rsc_trace(rsc,
"Preferred node %s for %s was unknown",
130 pe_rsc_trace(rsc,
"Preferred node %s for %s was unsuitable",
135 pe_rsc_trace(rsc,
"Preferred node %s for %s was unavailable",
141 "Chose preferred node %s for %s (ignoring %d candidates)",
146 if ((chosen == NULL) && nodes) {
152 pe_rsc_trace(rsc,
"Chose node %s for %s from %d candidates",
155 if (!pe_rsc_is_unique_clone(rsc->
parent)
166 pe_node_t *running = pe__current_node(rsc);
169 pe_rsc_trace(rsc,
"Current node for %s (%s) can't run resources",
171 }
else if (running) {
172 for (GList *iter = nodes->next; iter; iter = iter->next) {
190 static char score[33];
191 int log_level = (chosen->
weight >=
INFINITY)? LOG_WARNING : LOG_INFO;
195 "Chose node %s for %s from %d nodes with score %s",
213 best_node_score_matching_attr(
const pe_resource_t *rsc,
const char *attr,
219 const char *best_node = NULL;
223 while (g_hash_table_iter_next(&iter, NULL, (
void **) &node)) {
228 best_score = node->weight;
229 best_node = node->details->uname;
234 if (best_node == NULL) {
235 crm_info(
"No allowed node for %s matches node attribute %s=%s",
236 rsc->
id, attr, value);
238 crm_info(
"Allowed node %s for %s had best score (%d) " 239 "of those matching node attribute %s=%s",
240 best_node, rsc->
id, best_score, attr, value);
261 add_node_scores_matching_attr(GHashTable *nodes,
const pe_resource_t *rsc,
262 const char *attr,
float factor,
273 g_hash_table_iter_init(&iter, nodes);
274 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
280 score = best_node_score_matching_attr(rsc, attr,
283 if ((factor < 0) && (score < 0)) {
289 crm_trace(
"%s: Filtering %d + %f * %d (double negative disallowed)",
290 node->details->uname, node->weight, factor, score);
295 crm_trace(
"%s: Filtering %d + %f * %d (node was marked unusable)",
296 node->details->uname, node->weight, factor, score);
300 weight_f = factor * score;
303 weight = (int) ((weight_f < 0)? (weight_f - 0.5) : (weight_f + 0.5));
309 if ((weight == 0) && (score != 0)) {
312 }
else if (factor < 0.0) {
319 if (only_positive && (new_score < 0) && (node->weight > 0)) {
320 crm_trace(
"%s: Filtering %d + %f * %d = %d " 321 "(negative disallowed, marking node unusable)",
322 node->details->uname, node->weight, factor, score,
328 if (only_positive && (new_score < 0) && (node->weight == 0)) {
329 crm_trace(
"%s: Filtering %d + %f * %d = %d (negative disallowed)",
330 node->details->uname, node->weight, factor, score,
335 crm_trace(
"%s: %d + %f * %d = %d", node->details->uname,
336 node->weight, factor, score, new_score);
337 node->weight = new_score;
364 GHashTable *nodes,
const char *attr,
float factor,
367 GHashTable *work = NULL;
371 pe_rsc_info(rsc,
"%s: Breaking dependency loop at %s",
372 primary_id, rsc->
id);
378 if (is_nonempty_group(rsc)) {
379 GList *last = g_list_last(rsc->
children);
383 "using last member %s (at %.6f)",
384 primary_id, rsc->
id, last_rsc->
id, factor);
392 }
else if (is_nonempty_group(rsc)) {
403 pe_rsc_trace(rsc,
"%s: Merging scores from first member of group %s " 404 "(at %.6f)", primary_id, rsc->
id, factor);
407 attr, factor,
flags);
410 pe_rsc_trace(rsc,
"%s: Merging scores from %s (at %.6f)",
411 primary_id, rsc->
id, factor);
413 add_node_scores_matching_attr(work, rsc, attr, factor,
419 int multiplier = (factor < 0)? -1 : 1;
424 "Checking additional %d optional '%s with' constraints",
425 g_list_length(gIter), rsc->
id);
427 }
else if (is_nonempty_group(rsc)) {
431 pe_rsc_trace(rsc,
"Checking additional %d optional 'with group %s' " 432 "constraints using last member %s",
433 g_list_length(gIter), rsc->
id, last_rsc->
id);
438 "Checking additional %d optional 'with %s' constraints",
439 g_list_length(gIter), rsc->
id);
442 for (; gIter != NULL; gIter = gIter->next) {
448 }
else if (!pcmk__colocation_has_influence(constraint, NULL)) {
454 pe_rsc_trace(rsc,
"Optionally merging score of '%s' constraint (%s with %s)",
465 pe_rsc_info(rsc,
"%s: Rolling back optional scores from %s",
466 primary_id, rsc->
id);
467 g_hash_table_destroy(work);
477 g_hash_table_iter_init(&iter, work);
478 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
486 g_hash_table_destroy(nodes);
501 pe_rsc_debug(rsc,
"Escalating allocation of %s to its parent: %s", rsc->
id,
511 pe_rsc_debug(rsc,
"Dependency loop detected involving %s", rsc->
id);
518 for (gIter = rsc->
rsc_cons; gIter != NULL; gIter = gIter->next) {
521 GHashTable *archive = NULL;
530 "%s: Allocating %s first (constraint=%s score=%d role=%s)",
531 rsc->
id, primary->id, constraint->
id,
533 primary->cmds->allocate(primary, NULL, data_set);
536 pe_rsc_info(rsc,
"%s: Rolling back scores from %s",
537 rsc->
id, primary->id);
543 g_hash_table_destroy(archive);
549 for (gIter = rsc->
rsc_cons_lhs; gIter != NULL; gIter = gIter->next) {
552 if (!pcmk__colocation_has_influence(constraint, NULL)) {
555 pe_rsc_trace(rsc,
"Merging score of '%s' constraint (%s with %s)",
565 pe_rsc_trace(rsc,
"Making sure %s doesn't get allocated", rsc->
id);
572 crm_notice(
"Resource %s cannot be elevated from %s to %s: no-quorum-policy=freeze",
585 const char *reason = NULL;
589 assign_to = pe__current_node(rsc);
590 if (assign_to == NULL) {
599 pe_rsc_info(rsc,
"Unmanaged resource %s allocated to %s: %s", rsc->
id,
600 (assign_to? assign_to->
details->
uname :
"no node"), reason);
608 && native_choose_node(rsc, prefer, data_set)) {
614 pe_rsc_info(rsc,
"Resource %s cannot run anywhere", rsc->
id);
631 crm_trace(
"Setting Pacemaker Remote node %s to ONLINE",
641 crm_trace(
"Setting Pacemaker Remote node %s to SHUTDOWN (next role %s, %sallocated)",
654 gboolean dup = FALSE;
655 const char *
id = NULL;
656 const char *value = NULL;
657 xmlNode *operation = NULL;
658 guint interval2_ms = 0;
661 for (operation = pcmk__xe_first_child(rsc->
ops_xml); operation != NULL;
662 operation = pcmk__xe_next(operation)) {
664 if (pcmk__str_eq((
const char *)operation->name,
"op",
pcmk__str_none)) {
672 if (interval_ms != interval2_ms) {
681 "same name and interval combination more " 682 "than once per resource)",
ID(operation),
id);
692 op_cannot_recur(
const char *
name)
702 const char *
name = NULL;
703 const char *role = NULL;
704 const char *interval_spec = NULL;
705 const char *node_uname = node? node->
details->
uname :
"n/a";
707 guint interval_ms = 0;
709 gboolean is_optional = TRUE;
710 GList *possible_matches = NULL;
722 if (interval_ms == 0) {
727 if (is_op_dup(rsc,
name, interval_ms)) {
728 crm_trace(
"Not creating duplicate recurring action %s for %dms %s",
729 ID(operation), interval_ms,
name);
733 if (op_cannot_recur(
name)) {
741 crm_trace(
"Not creating recurring action %s for disabled resource %s",
742 ID(operation), rsc->
id);
747 pe_rsc_trace(rsc,
"Creating recurring action %s for %s in role %s on %s",
762 if (possible_matches == NULL) {
764 pe_rsc_trace(rsc,
"Marking %s mandatory: not active", key);
769 for (gIter = possible_matches; gIter != NULL; gIter = gIter->next) {
777 g_list_free(possible_matches);
783 const char *result =
"Ignoring";
786 char *after_key = NULL;
790 log_level = LOG_INFO;
791 result =
"Cancelling";
818 do_crm_log(log_level,
"%s action %s (%s vs. %s)",
833 pe_rsc_debug(rsc,
"%s\t %s (cancelled : start un-runnable)",
834 node_uname, mon->
uuid);
838 pe_rsc_debug(rsc,
"%s\t %s (cancelled : no node available)",
839 node_uname, mon->
uuid);
843 pe_rsc_info(rsc,
" Start recurring %s (%us) for %s on %s",
844 mon->
task, interval_ms / 1000, rsc->
id, node_uname);
851 free(running_promoted);
881 xmlNode *operation = NULL;
883 for (operation = pcmk__xe_first_child(rsc->
ops_xml);
885 operation = pcmk__xe_next(operation)) {
887 if (pcmk__str_eq((
const char *)operation->name,
"op",
pcmk__str_none)) {
888 RecurringOp(rsc, start, node, operation, data_set);
899 const char *
name = NULL;
900 const char *role = NULL;
901 const char *interval_spec = NULL;
902 const char *node_uname = node? node->
details->
uname :
"n/a";
904 guint interval_ms = 0;
905 GList *possible_matches = NULL;
916 if (interval_ms == 0) {
921 if (is_op_dup(rsc,
name, interval_ms)) {
922 crm_trace(
"Not creating duplicate recurring action %s for %dms %s",
923 ID(operation), interval_ms,
name);
927 if (op_cannot_recur(
name)) {
935 crm_trace(
"Not creating recurring action %s for disabled resource %s",
936 ID(operation), rsc->
id);
943 crm_notice(
"Ignoring %s (recurring monitors for Stopped role are " 944 "not supported for anonymous clones)",
950 "Creating recurring action %s for %s in role %s on nodes where it should not be running",
956 if (possible_matches) {
959 g_list_free(possible_matches);
971 pe_rsc_info(rsc,
"Cancel action %s (%s vs. %s) on %s",
976 for (gIter = data_set->
nodes; gIter != NULL; gIter = gIter->next) {
978 const char *stop_node_uname = stop_node->
details->
uname;
979 gboolean is_optional = TRUE;
980 gboolean probe_is_optional = TRUE;
981 gboolean stop_is_optional = TRUE;
983 char *rc_inactive = NULL;
984 GList *probe_complete_ops = NULL;
985 GList *stop_ops = NULL;
986 GList *local_gIter = NULL;
988 if (node && pcmk__str_eq(stop_node_uname, node_uname,
pcmk__str_casei)) {
992 pe_rsc_trace(rsc,
"Creating recurring action %s for %s on %s",
997 if (possible_matches == NULL) {
998 pe_rsc_trace(rsc,
"Marking %s mandatory on %s: not active", key,
1000 is_optional = FALSE;
1002 pe_rsc_trace(rsc,
"Marking %s optional on %s: already active", key,
1005 g_list_free(possible_matches);
1008 stopped_mon =
custom_action(rsc, strdup(key),
name, stop_node, is_optional, TRUE, data_set);
1017 GList *pIter = NULL;
1019 for (pIter = probes; pIter != NULL; pIter = pIter->next) {
1026 g_list_free(probes);
1029 if (probe_complete_ops) {
1030 g_list_free(probe_complete_ops);
1035 for (local_gIter = stop_ops; local_gIter != NULL; local_gIter = local_gIter->next) {
1039 stop_is_optional = FALSE;
1043 crm_debug(
"%s\t %s (cancelled : stop un-runnable)",
1044 crm_str(stop_node_uname), stopped_mon->uuid);
1058 g_list_free(stop_ops);
1061 if (is_optional == FALSE && probe_is_optional && stop_is_optional
1063 pe_rsc_trace(rsc,
"Marking %s optional on %s due to unmanaged",
1064 key,
crm_str(stop_node_uname));
1073 pe_rsc_debug(rsc,
"%s\t %s (cancelled : no node available)",
1074 crm_str(stop_node_uname), stopped_mon->uuid);
1080 crm_notice(
" Start recurring %s (%us) for %s on %s", stopped_mon->task,
1081 interval_ms / 1000, rsc->
id,
crm_str(stop_node_uname));
1093 xmlNode *operation = NULL;
1095 for (operation = pcmk__xe_first_child(rsc->
ops_xml);
1097 operation = pcmk__xe_next(operation)) {
1099 if (pcmk__str_eq((
const char *)operation->name,
"op",
pcmk__str_none)) {
1100 RecurringOp_Stopped(rsc, start, node, operation, data_set);
1115 pe_rsc_trace(rsc,
"Processing migration actions %s moving from %s to %s . partial migration = %s",
1120 if (partial == FALSE) {
1128 if ((migrate_to && migrate_from) || (migrate_from && partial)) {
1200 gboolean need_stop = FALSE;
1201 bool need_promote = FALSE;
1202 gboolean is_moving = FALSE;
1205 GList *gIter = NULL;
1206 unsigned int num_all_active = 0;
1207 unsigned int num_clean_active = 0;
1208 bool multiply_active = FALSE;
1220 pe_rsc_trace(rsc,
"Creating all actions for %s transition from %s to %s (%s) on %s",
1223 ((chosen == NULL)?
"no node" : chosen->
details->
uname));
1232 pe_rsc_trace(rsc,
"Creating stop action %sfor %s on %s due to dangling migration",
1238 DeleteRsc(rsc, dangling_source, FALSE, data_set);
1242 if ((num_all_active == 2) && (num_clean_active == 2) && chosen
1251 pe_rsc_trace(rsc,
"Will attempt to continue with partial migration " 1252 "to target %s from %s",
1264 multiply_active = (num_clean_active > 1);
1266 multiply_active = (num_all_active > 1);
1269 if (multiply_active) {
1272 crm_notice(
"Resource %s can no longer migrate from %s to %s " 1273 "(will stop on both nodes)",
1281 pe_proc_err(
"%s resource %s might be active on %u nodes (%s)",
1282 crm_str(
class), rsc->id, num_all_active,
1283 recovery2text(rsc->recovery_type));
1284 crm_notice(
"See https://wiki.clusterlabs.org/wiki/FAQ#Resource_is_Too_Active for more information");
1295 allow_migrate = FALSE;
1299 pe_rsc_trace(rsc,
"Creating start action for %s to represent already pending start",
1319 need_promote = TRUE;
1328 pe_rsc_trace(rsc,
"Creating start action for promoted resource %s",
1333 pe_rsc_trace(rsc,
"%s restart is required for recovery", rsc->
id);
1344 pe_rsc_trace(rsc,
"Creating %s action to take %s down from %s to %s",
1345 (need_stop?
"required" :
"optional"), rsc->
id,
1347 if (rsc_action_matrix[role][next_role] (rsc, current, !need_stop, data_set) == FALSE) {
1356 bool required = need_stop;
1358 next_role = rsc_state_matrix[role][rsc->
role];
1362 pe_rsc_trace(rsc,
"Creating %s action to take %s up from %s to %s",
1363 (required?
"required" :
"optional"), rsc->
id,
1365 if (rsc_action_matrix[role][next_role](rsc, chosen, !required,
1366 data_set) == FALSE) {
1375 next_role = rsc_state_matrix[role][rsc->
next_role];
1376 pe_rsc_trace(rsc,
"Creating action to take %s from %s to %s (ending at %s)",
1379 if (rsc_action_matrix[role][next_role] (rsc, chosen, FALSE, data_set) == FALSE) {
1386 pe_rsc_trace(rsc,
"Not creating recurring monitors for blocked resource %s",
1391 pe_rsc_trace(rsc,
"Creating recurring monitors for %s resource %s",
1395 Recurring(rsc, start, chosen, data_set);
1396 Recurring_Stopped(rsc, start, chosen, data_set);
1399 pe_rsc_trace(rsc,
"Creating recurring monitors for inactive resource %s",
1401 Recurring_Stopped(rsc, NULL, NULL, data_set);
1408 pe_rsc_trace(rsc,
"Not allowing partial migration of %s to continue",
1410 allow_migrate = FALSE;
1413 || pcmk_any_flags_set(rsc->
flags,
1418 allow_migrate = FALSE;
1421 if (allow_migrate) {
1422 handle_migration_actions(rsc, current, chosen, data_set);
1429 GHashTableIter iter;
1432 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
1433 if (node->details->remote_rsc) {
1456 GList *allowed_nodes = NULL;
1459 allowed_nodes = g_hash_table_get_values(rsc->
allowed_nodes);
1466 return allowed_nodes;
1475 GList *allowed_nodes = NULL;
1476 bool check_unfencing = FALSE;
1477 bool check_utilization = FALSE;
1481 "Skipping native constraints for unmanaged resource: %s",
1494 check_utilization = (g_hash_table_size(rsc->
utilization) > 0)
1524 if (check_unfencing || check_utilization || rsc->
container) {
1525 allowed_nodes = allowed_nodes_as_list(rsc, data_set);
1528 if (check_unfencing) {
1531 for (GList *item = allowed_nodes; item; item = item->next) {
1535 crm_debug(
"Ordering any stops of %s before %s, and any starts after",
1554 NULL, strdup(unfence->
uuid), unfence,
1564 if (check_utilization) {
1565 GList *gIter = NULL;
1567 pe_rsc_trace(rsc,
"Creating utilization constraints for %s - strategy: %s",
1570 for (gIter = rsc->
running_on; gIter != NULL; gIter = gIter->next) {
1577 if (load_stopped->
node == NULL) {
1587 for (GList *item = allowed_nodes; item; item = item->next) {
1593 if (load_stopped->
node == NULL) {
1606 free(load_stopped_task);
1621 rsc_avoids_remote_nodes(rsc->
container);
1651 for (GList *item = allowed_nodes; item; item = item->next) {
1666 crm_trace(
"Order and colocate %s relative to its container %s",
1687 rsc->
container, NULL, NULL,
true, data_set);
1694 rsc_avoids_remote_nodes(rsc);
1696 g_list_free(allowed_nodes);
1704 if (dependent == NULL) {
1705 pe_err(
"dependent was NULL for %s", constraint->
id);
1708 }
else if (constraint->
primary == NULL) {
1709 pe_err(
"primary was NULL for %s", constraint->
id);
1714 "Processing colocation constraint between %s and %s",
1715 dependent->
id, primary->
id);
1727 CRM_ASSERT((dependent != NULL) && (primary != NULL));
1730 pe_rsc_trace(dependent,
"%s %s with %s (%s, score=%d, filter=%d)",
1731 ((constraint->
score > 0)?
"Colocating" :
"Anti-colocating"),
1732 dependent->
id, primary->
id, constraint->
id, constraint->
score,
1735 switch (filter_results) {
1768 #define clear_action_flag_because(action, flag, reason) do { \ 1769 if (pcmk_is_set((action)->flags, (flag))) { \ 1770 pe__clear_action_flags(action, flag); \ 1771 if ((action)->rsc != (reason)->rsc) { \ 1772 char *reason_text = pe__action2reason((reason), (flag)); \ 1773 pe_action_set_reason((action), reason_text, \ 1774 ((flag) == pe_action_migrate_runnable)); \ 1775 free(reason_text); \ 1795 const char *reason = NULL;
1814 && (first->
rsc == then->
rsc)) {
1818 if (reason == NULL) {
1959 handle_restart_ordering(first, then, filter);
1962 if (then_flags != then->
flags) {
1965 "%s on %s: flags are now 0x%.6x (was 0x%.6x) " 1966 "because of 'first' %s (0x%.6x)",
1977 if (first_flags != first->
flags) {
1980 "%s on %s: flags are now 0x%.6x (was 0x%.6x) " 1981 "because of 'then' %s (0x%.6x)",
1999 GList *gIter = NULL;
2004 for (gIter = rsc->
actions; gIter != NULL; gIter = gIter->next) {
2011 for (gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
2014 child_rsc->
cmds->
expand(child_rsc, data_set);
2018 #define STOP_SANITY_ASSERT(lineno) do { \ 2019 if(current && current->details->unclean) { \ 2021 } else if(stop == NULL) { \ 2022 crm_err("%s:%d: No stop action exists for %s", \ 2023 __func__, lineno, rsc->id); \ 2024 CRM_ASSERT(stop != NULL); \ 2025 } else if (pcmk_is_set(stop->flags, pe_action_optional)) { \ 2026 crm_err("%s:%d: Action %s is still optional", \ 2027 __func__, lineno, stop->uuid); \ 2028 CRM_ASSERT(!pcmk_is_set(stop->flags, pe_action_optional)); \ 2040 gboolean moving = FALSE;
2054 current = pe__current_node(rsc);
2069 out->
message(out,
"rsc-action", rsc, current, next, moving);
2075 GList *gIter = NULL;
2080 for (gIter = rsc->
running_on; gIter != NULL; gIter = gIter->next) {
2107 DeleteRsc(rsc, current, optional, data_set);
2145 GList *gIter = NULL;
2146 gboolean runnable = TRUE;
2147 GList *action_list = NULL;
2155 for (gIter = action_list; gIter != NULL; gIter = gIter->next) {
2162 g_list_free(action_list);
2173 for (gIter = action_list; gIter != NULL; gIter = gIter->next) {
2179 g_list_free(action_list);
2186 GList *gIter = NULL;
2192 for (gIter = rsc->
running_on; gIter != NULL; gIter = gIter->next) {
2225 }
else if (node == NULL) {
2226 pe_rsc_trace(rsc,
"Resource %s not deleted: NULL node", rsc->
id);
2230 pe_rsc_trace(rsc,
"Resource %s not deleted from %s: unrunnable", rsc->
id,
2261 static const char *rc_promoted = NULL;
2262 static const char *rc_inactive = NULL;
2264 if (rc_inactive == NULL) {
2271 pe_rsc_trace(rsc,
"Skipping active resource detection for %s", rsc->
id);
2280 "Skipping probe for %s on %s because Pacemaker Remote nodes cannot run stonith agents",
2286 "Skipping probe for %s on %s because guest nodes cannot run resources containing guest nodes",
2289 }
else if (rsc->is_remote_node) {
2291 "Skipping probe for %s on %s because Pacemaker Remote nodes cannot host remote connections",
2298 GList *gIter = NULL;
2299 gboolean any_created = FALSE;
2301 for (gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
2304 any_created = child_rsc->
cmds->
create_probe(child_rsc, node, complete, force, data_set)
2329 if (allowed == NULL) {
2390 pe_rsc_trace(rsc,
"Skipping probe for %s on node %s, %s is stopped",
2411 pe_rsc_trace(rsc,
"Skipping probe for %s on node %s, %s is stopping, restarting or moving",
2431 if (running == NULL) {
2481 GList *gIter = NULL;
2485 for (gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
2504 pe_rsc_trace(rsc,
"%s: preventing agent reload because failed",
2512 pe_rsc_trace(rsc,
"%s: preventing agent reload because start pending",
2517 }
else if (node == NULL) {
2526 FALSE, TRUE, data_set);
2560 for (parent = rsc; parent != NULL; parent = parent->
parent) {
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)
#define CRM_CHECK(expr, failure_action)
pe_node_t * pe_find_node(GList *node_list, const char *uname)
void pcmk__bundle_log_actions(pe_resource_t *rsc, pe_working_set_t *data_set)
enum rsc_start_requirement needs
enum pe_quorum_policy no_quorum_policy
void native_rsc_colocation_rh(pe_resource_t *dependent, pe_resource_t *primary, pcmk__colocation_t *constraint, pe_working_set_t *data_set)
#define crm_notice(fmt, args...)
bool pe__is_guest_or_remote_node(const pe_node_t *node)
#define pe_rsc_debug(rsc, fmt, args...)
Service active and promoted.
#define pe__set_action_flags(action, flags_to_set)
#define pe__show_node_weights(level, rsc, text, nodes, data_set)
#define promote_action(rsc, node, optional)
G_GNUC_INTERNAL bool pcmk__node_unfenced(pe_node_t *node)
GList * sort_nodes_by_weight(GList *nodes, pe_node_t *active_node, pe_working_set_t *data_set)
#define stop_action(rsc, node, optional)
pe_node_t * pe__find_active_on(const pe_resource_t *rsc, unsigned int *count_all, unsigned int *count_clean)
pe_resource_t * container
bool pcmk__strcase_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
pe_node_t * partial_migration_source
int(* message)(pcmk__output_t *out, const char *message_id,...)
gboolean PromoteRsc(pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)
resource_alloc_functions_t * cmds
#define delete_action(rsc, node, optional)
#define pe_flag_remove_after_stop
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)
#define XML_RSC_ATTR_INCARNATION
enum rsc_role_e next_role
gboolean exclusive_discover
#define pcmk__config_err(fmt...)
gboolean StartRsc(pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)
pe_resource_t * remote_rsc
gboolean native_assign_node(pe_resource_t *rsc, pe_node_t *chosen, gboolean force)
void LogActions(pe_resource_t *rsc, pe_working_set_t *data_set)
char * score2char_stack(int score, char *buf, size_t len)
resource_object_functions_t * fns
#define clear_node_weights_flags(nw_flags, nw_rsc, flags_to_clear)
#define XML_LRM_ATTR_INTERVAL
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)
pe_resource_t * dependent
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 resource_location(pe_resource_t *rsc, pe_node_t *node, int score, const char *tag, pe_working_set_t *data_set)
enum crm_ais_msg_types type
pe_node_t * partial_migration_target
pe_node_t *(* allocate)(pe_resource_t *, pe_node_t *, pe_working_set_t *)
gboolean RoleError(pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)
#define pe_rsc_allow_remote_remotes
gboolean can_run_resources(const pe_node_t *node)
#define pe_flag_have_quorum
G_GNUC_INTERNAL void pcmk__apply_coloc_to_priority(pe_resource_t *dependent, pe_resource_t *primary, pcmk__colocation_t *constraint)
#define pe_proc_err(fmt...)
gboolean remote_requires_reset
char * crm_meta_name(const char *field)
G_GNUC_INTERNAL void pcmk__new_colocation(const char *id, const char *node_attr, int score, pe_resource_t *dependent, pe_resource_t *primary, const char *dependent_role, const char *primary_role, bool influence, pe_working_set_t *data_set)
#define pe__set_resource_flags(resource, flags_to_set)
#define clear_action_flag_because(action, flag, reason)
#define pe_flag_stop_everything
#define demote_action(rsc, node, optional)
#define pe_rsc_provisional
const char * role2text(enum rsc_role_e role)
GList * dangling_migrations
#define CRMD_ACTION_RELOAD_AGENT
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 *)
gboolean DemoteRsc(pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)
#define pe_rsc_allow_migrate
pe_action_t * get_pseudo_op(const char *name, pe_working_set_t *data_set)
#define crm_debug(fmt, args...)
void native_expand(pe_resource_t *rsc, pe_working_set_t *data_set)
gboolean(* rsc_transition_fn)(pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)
pe_resource_t * uber_parent(pe_resource_t *rsc)
pe_resource_t * pe__resource_contains_guest_node(const pe_working_set_t *data_set, const pe_resource_t *rsc)
#define XML_RSC_ATTR_CONTAINER
void native_internal_constraints(pe_resource_t *rsc, pe_working_set_t *data_set)
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
bool pe__is_guest_node(const pe_node_t *node)
void(* rsc_colocation_lh)(pe_resource_t *, pe_resource_t *, pcmk__colocation_t *, pe_working_set_t *)
void native_append_meta(pe_resource_t *rsc, xmlNode *xml)
#define pe_rsc_start_pending
gboolean update_action(pe_action_t *action, pe_working_set_t *data_set)
#define pe__clear_action_flags(action, flags_to_clear)
#define crm_trace(fmt, args...)
#define do_crm_log(level, fmt, args...)
Log a message.
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
void process_utilization(pe_resource_t *rsc, pe_node_t **prefer, pe_working_set_t *data_set)
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
struct pe_node_shared_s * details
enum rsc_recovery_type recovery_type
#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
void(* expand)(pe_resource_t *, pe_working_set_t *)
#define pcmk__order_resource_actions(lh_rsc, lh_task, rh_rsc, rh_task, flags, data_set)
xmlNode * find_rsc_op_entry(pe_resource_t *rsc, const char *key)
#define pe_flag_stonith_enabled
const char * pe_node_attribute_raw(pe_node_t *node, const char *name)
#define pe__set_graph_flags(graph_flags, gr_action, flags_to_set)
#define XML_RSC_ATTR_TARGET_ROLE
#define XML_LRM_ATTR_MIGRATE_TARGET
#define XML_RSC_ATTR_REMOTE_NODE
void(* rsc_colocation_rh)(pe_resource_t *, pe_resource_t *, pcmk__colocation_t *, pe_working_set_t *)
enum pe_action_flags(* action_flags)(pe_action_t *, pe_node_t *)
#define pe_rsc_allocating
enum rsc_role_e text2role(const char *role)
enum pe_obj_types variant
void native_rsc_location(pe_resource_t *rsc, pe__location_t *constraint)
const char * placement_strategy
gboolean can_run_any(GHashTable *nodes)
char * pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms)
Generate an operation key (RESOURCE_ACTION_INTERVAL)
#define pe_rsc_fence_device
GHashTable * pcmk__copy_node_table(GHashTable *nodes)
pe_node_t * pe_find_node_id(GList *node_list, const char *id)
void native_rsc_colocation_lh(pe_resource_t *dependent, pe_resource_t *primary, pcmk__colocation_t *constraint, pe_working_set_t *data_set)
#define PCMK_RESOURCE_CLASS_STONITH
enum pe_action_flags native_action_flags(pe_action_t *action, pe_node_t *node)
enum rsc_role_e(* state)(const pe_resource_t *, gboolean)
void ReloadRsc(pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set)
void add_hash_param(GHashTable *hash, const char *name, const char *value)
#define start_action(rsc, node, optional)
int pe__add_scores(int score1, int score2)
#define crm_err(fmt, args...)
G_GNUC_INTERNAL void pcmk__order_vs_unfence(pe_resource_t *rsc, pe_node_t *node, pe_action_t *action, enum pe_ordering order, pe_working_set_t *data_set)
char guint crm_parse_interval_spec(const char *input)
Parse milliseconds from a Pacemaker interval specification.
void pe__set_next_role(pe_resource_t *rsc, enum rsc_role_e role, const char *why)
gboolean StopRsc(pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)
This structure contains everything that makes up a single output formatter.
pe_node_t * pcmk__native_allocate(pe_resource_t *rsc, pe_node_t *prefer, pe_working_set_t *data_set)
#define pe_rsc_needs_unfencing
void native_create_actions(pe_resource_t *rsc, pe_working_set_t *data_set)
#define pe__clear_resource_flags(resource, flags_to_clear)
rsc_role_e
Possible roles that a resource can be in.
enum pe_action_flags flags
#define pe_rsc_maintenance
pe_working_set_t * cluster
const char * node_attribute
#define XML_OP_ATTR_PENDING
gboolean DeleteRsc(pe_resource_t *rsc, pe_node_t *node, gboolean optional, pe_working_set_t *data_set)
#define pe_flag_have_stonith_resource
G_GNUC_INTERNAL enum pcmk__coloc_affects pcmk__colocation_affects(pe_resource_t *dependent, pe_resource_t *primary, pcmk__colocation_t *constraint, bool preview)
GList * find_actions_exact(GList *input, const char *key, const pe_node_t *on_node)
#define pe_flag_enable_unfencing
#define pe_rsc_trace(rsc, fmt, args...)
G_GNUC_INTERNAL void pcmk__apply_coloc_to_weights(pe_resource_t *dependent, pe_resource_t *primary, pcmk__colocation_t *constraint)
#define pe__set_order_flags(order_flags, flags_to_set)
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.
#define XML_LRM_ATTR_MIGRATE_SOURCE
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 CRM_OP_LRM_DELETE
gint sort_node_uname(gconstpointer a, gconstpointer b)
#define pe_flag_show_scores
void graph_element_from_action(pe_action_t *action, pe_working_set_t *data_set)
#define crm_info(fmt, args...)
G_GNUC_INTERNAL void pcmk__apply_location(pe__location_t *constraint, pe_resource_t *rsc)
#define XML_ATTR_TE_TARGET_RC
G_GNUC_INTERNAL bool pcmk__is_unfence_device(const pe_resource_t *rsc, const 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)
GHashTable * pcmk__native_merge_weights(pe_resource_t *rsc, const char *primary_id, GHashTable *nodes, const char *attr, float factor, uint32_t flags)
GHashTable *(* merge_weights)(pe_resource_t *, const char *, GHashTable *, const char *, float, enum pe_weights)
#define pe_rsc_info(rsc, fmt, args...)
gboolean NullOp(pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)
#define XML_AGENT_ATTR_CLASS
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.
GHashTable * allowed_nodes
#define pe_flag_startup_probes