12 #include <sys/param.h>
121 static unsigned long calls = 0;
122 gboolean changed = FALSE;
127 action->
flags = crm_clear_bit(source, line, action->
uuid, action->
flags, flags);
129 action->
flags = crm_set_bit(source, line, action->
uuid, action->
flags, flags);
132 if (last != action->
flags) {
138 crm_trace(
"%s on %s: %sset flags 0x%.6x (was 0x%.6x, now 0x%.6x, %lu, %s)",
140 clear ?
"un-" :
"", flags, last, action->
flags, calls, source);
151 gboolean force_restart = FALSE;
152 gboolean delete_resource = FALSE;
153 gboolean changed = FALSE;
155 const char *value = NULL;
156 const char *old_value = NULL;
158 const char *attr_list[] = {
164 for (; attr_lpc <
DIMOF(attr_list); attr_lpc++) {
167 if (value == old_value
175 force_restart = TRUE;
176 crm_notice(
"Forcing restart of %s on %s, %s changed: %s -> %s",
185 delete_resource = TRUE;
187 }
else if (changed) {
188 delete_resource = TRUE;
190 return delete_resource;
197 guint interval_ms = 0;
200 const char *task = NULL;
201 const char *call_id = NULL;
202 const char *interval_ms_s = NULL;
214 rsc->
id, task, interval_ms,
215 active_node->
details->
uname, (reason? reason :
"unknown"));
217 cancel =
pe_cancel_op(rsc, task, interval_ms, active_node, data_set);
223 check_action_definition(
resource_t * rsc,
node_t * active_node, xmlNode * xml_op,
227 guint interval_ms = 0;
228 const char *interval_ms_s = NULL;
230 gboolean did_change = FALSE;
233 const char *digest_secure = NULL;
235 CRM_CHECK(active_node != NULL,
return FALSE);
240 if (interval_ms > 0) {
241 xmlNode *op_match = NULL;
250 CancelXmlOp(rsc, xml_op, active_node,
"orphan", data_set);
254 }
else if (op_match == NULL) {
288 printf(
"Only 'private' parameters to " CRM_OP_FMT " on %s changed: %s\n",
300 required =
custom_action(rsc, key, task, NULL, TRUE, TRUE, data_set);
304 trigger_unfencing(rsc, active_node,
"Device parameters changed", NULL, data_set);
311 trigger_unfencing(rsc, active_node,
"Device parameters changed (reload)", NULL, data_set);
315 if (interval_ms > 0) {
323 op =
custom_action(rsc, key, task, active_node, TRUE, TRUE, data_set);
327 }
else if (digest_restart) {
328 pe_rsc_trace(rsc,
"Reloading '%s' action for resource %s", task, rsc->
id);
336 pe_rsc_trace(rsc,
"Resource %s doesn't know how to reload", rsc->
id);
341 required =
custom_action(rsc, key, task, NULL, TRUE, TRUE, data_set);
360 const char *reason = NULL;
365 if (check_action_definition(rsc, node, rsc_op, data_set)
369 reason =
"action definition changed";
375 switch (digest_data->
rc) {
377 crm_trace(
"Resource %s history entry %s on %s has no digest to compare",
383 reason =
"resource parameters have changed";
399 guint interval_ms = 0;
403 const char *task = NULL;
404 const char *interval_ms_s = NULL;
406 xmlNode *rsc_op = NULL;
415 || pe_rsc_is_clone(parent) == FALSE
417 pe_rsc_trace(rsc,
"Skipping param check for %s and deleting: orphan", rsc->
id);
420 pe_rsc_trace(rsc,
"Skipping param check for %s (orphan clone)", rsc->
id);
425 if (check_rsc_parameters(rsc, node, rsc_entry, FALSE, data_set)) {
428 pe_rsc_trace(rsc,
"Skipping param check for %s: no longer active on %s",
435 if (check_rsc_parameters(rsc, node, rsc_entry, TRUE, data_set)) {
439 for (rsc_op = __xml_first_child(rsc_entry); rsc_op != NULL; rsc_op = __xml_next_element(rsc_op)) {
441 op_list = g_list_prepend(op_list, rsc_op);
448 for (gIter = sorted_op_list; gIter != NULL; gIter = gIter->next) {
449 xmlNode *rsc_op = (xmlNode *) gIter->data;
453 if (start_index < stop_index) {
456 }
else if (offset < start_index) {
466 if ((interval_ms > 0) &&
469 CancelXmlOp(rsc, rsc_op, node,
"maintenance mode", data_set);
471 }
else if ((interval_ms > 0)
492 }
else if (check_action_definition(rsc, node, rsc_op, data_set)
500 g_list_free(sorted_op_list);
504 find_rsc_list(
GListPtr result,
resource_t * rsc,
const char *
id, gboolean renamed_clones,
508 gboolean match = FALSE;
513 }
else if (rsc == NULL && data_set) {
515 for (gIter = data_set->
resources; gIter != NULL; gIter = gIter->next) {
518 result = find_rsc_list(result, child,
id, renamed_clones, partial, NULL);
523 }
else if (rsc == NULL) {
528 if (strstr(rsc->
id,
id)) {
536 if (strcmp(rsc->
id,
id) == 0) {
545 result = g_list_prepend(result, rsc);
550 for (; gIter != NULL; gIter = gIter->next) {
553 result = find_rsc_list(result, child,
id, renamed_clones, partial, NULL);
563 const char *
id = NULL;
565 xmlNode *lrm_rscs = NULL;
568 xmlNode *node_state = NULL;
570 for (node_state = __xml_first_child(status); node_state != NULL;
571 node_state = __xml_next_element(node_state)) {
584 crm_trace(
"Skipping param check for %s: can't run resources",
591 xmlNode *rsc_entry = NULL;
593 for (rsc_entry = __xml_first_child(lrm_rscs); rsc_entry != NULL;
594 rsc_entry = __xml_next_element(rsc_entry)) {
600 const char *rsc_id =
ID(rsc_entry);
604 result = find_rsc_list(NULL, NULL, rsc_id, TRUE, FALSE, data_set);
605 for (gIter = result; gIter != NULL; gIter = gIter->next) {
611 check_actions_for(rsc_entry, rsc, node, data_set);
664 int fail_count, countdown;
681 if (fail_count <= 0) {
694 if (countdown == 0) {
696 crm_warn(
"Forcing %s away from %s after %d failures (max=%d)",
700 crm_info(
"%s can fail %d more times on %s before being forced off",
711 for (; gIter != NULL; gIter = gIter->next) {
714 common_apply_stickiness(child_rsc, node, data_set);
724 if (current == NULL) {
730 pe_rsc_debug(sticky_rsc,
"Resource %s: preferring current location"
731 " (node=%s, weight=%d)", sticky_rsc->
id,
737 pe_rsc_debug(rsc,
"Ignoring stickiness for %s: the cluster is asymmetric"
738 " and node %s is not explicitly allowed", rsc->
id, node->
details->
uname);
740 while (g_hash_table_iter_next(&iter, NULL, (
void **)&nIter)) {
757 if (failcount_clear_action_exists(node, rsc) == FALSE) {
758 check_migration_threshold(rsc, node, data_set);
767 rsc->
cmds = &resource_class_alloc_functions[rsc->
variant];
769 for (; gIter != NULL; gIter = gIter->next) {
782 for (; gIter != NULL; gIter = gIter->next) {
790 calculate_system_health(gpointer gKey, gpointer gValue, gpointer user_data)
792 const char *key = (
const char *)gKey;
793 const char *value = (
const char *)gValue;
794 int *system_health = (
int *)user_data;
796 if (!gKey || !gValue || !user_data) {
818 if (health_strategy == NULL ||
safe_str_eq(health_strategy,
"none")) {
825 }
else if (
safe_str_eq(health_strategy,
"migrate-on-red")) {
834 }
else if (
safe_str_eq(health_strategy,
"only-green")) {
843 }
else if (
safe_str_eq(health_strategy,
"progressive")) {
850 }
else if (
safe_str_eq(health_strategy,
"custom")) {
859 crm_err(
"Unknown node health strategy: %s", health_strategy);
863 crm_info(
"Applying automated node health strategy: %s", health_strategy);
865 for (gIter = data_set->
nodes; gIter != NULL; gIter = gIter->next) {
866 int system_health = base_health;
870 g_hash_table_foreach(node->
details->
attrs, calculate_system_health, &system_health);
872 crm_info(
" Node %s has an combined system health of %d",
878 if (system_health != 0) {
882 for (; gIter2 != NULL; gIter2 = gIter2->next) {
885 rsc2node_new(health_strategy, rsc, system_health, NULL, node, data_set);
898 if (data_set->
input == NULL) {
908 apply_system_health(data_set);
920 action_t *probe_node_complete = NULL;
922 for (
GListPtr gIter = data_set->
nodes; gIter != NULL; gIter = gIter->next) {
931 pe_fence_node(data_set, node,
"the connection is unrecoverable");
943 if (probed != NULL &&
crm_is_true(probed) == FALSE) {
951 for (
GListPtr gIter2 = data_set->
resources; gIter2 != NULL; gIter2 = gIter2->next) {
971 for (; gIter != NULL; gIter = gIter->next) {
973 rsc_discover_filter(child_rsc, node);
993 crm_trace(
"Applying placement constraints");
995 gIter = data_set->
nodes;
996 for (; gIter != NULL; gIter = gIter->next) {
1002 }
else if (node->
weight >= 0.0
1008 apply_placement_constraints(data_set);
1010 gIter = data_set->
nodes;
1011 for (; gIter != NULL; gIter = gIter->next) {
1016 for (; gIter2 != NULL; gIter2 = gIter2->next) {
1019 common_apply_stickiness(rsc, node, data_set);
1020 rsc_discover_filter(rsc, node);
1036 for (; gIter != NULL; gIter = gIter->next) {
1051 check_actions(data_set);
1056 convert_const_pointer(
const void *ptr)
1063 sort_rsc_process_order(gconstpointer a, gconstpointer b, gpointer
data)
1069 const char *reason =
"existence";
1078 GHashTable *r1_nodes = NULL;
1079 GHashTable *r2_nodes = NULL;
1081 if (a == NULL && b == NULL) {
1091 reason =
"priority";
1095 if (r1_weight > r2_weight) {
1100 if (r1_weight < r2_weight) {
1105 reason =
"no node list";
1106 if (nodes == NULL) {
1111 resource1->
id, NULL, NULL, 1,
1116 resource2->
id, NULL, NULL, 1,
1121 reason =
"current location";
1126 r1_node = pe__current_node(resource1);
1127 r1_node = g_hash_table_lookup(r1_nodes, r1_node->
details->
id);
1128 if (r1_node != NULL) {
1129 r1_weight = r1_node->
weight;
1133 r2_node = pe__current_node(resource2);
1134 r2_node = g_hash_table_lookup(r2_nodes, r2_node->
details->
id);
1135 if (r2_node != NULL) {
1136 r2_weight = r2_node->
weight;
1140 if (r1_weight > r2_weight) {
1145 if (r1_weight < r2_weight) {
1151 for (gIter = nodes; gIter != NULL; gIter = gIter->next) {
1159 r1_node = g_hash_table_lookup(r1_nodes, node->
details->
id);
1162 r1_weight = r1_node->
weight;
1167 r2_node = g_hash_table_lookup(r2_nodes, node->
details->
id);
1170 r2_weight = r2_node->
weight;
1173 if (r1_weight > r2_weight) {
1178 if (r1_weight < r2_weight) {
1185 crm_trace(
"%s (%d) on %s %c %s (%d) on %s: %s",
1186 resource1->
id, r1_weight, r1_node ? r1_node->
details->
id :
"n/a",
1187 rc < 0 ? '>
' : rc > 0 ? '<
' : '=
',
1188 resource2->id, r2_weight, r2_node ? r2_node->details->id : "n/a", reason);
1191 g_hash_table_destroy(r1_nodes);
1194 g_hash_table_destroy(r2_nodes);
1201 allocate_resources(pe_working_set_t * data_set)
1203 GListPtr gIter = NULL;
1205 if (is_set(data_set->flags, pe_flag_have_remote_nodes)) {
1206 /* Force remote connection resources to be allocated first. This
1207 * also forces any colocation dependencies to be allocated as well */
1208 for (gIter = data_set->resources; gIter != NULL; gIter = gIter->next) {
1209 resource_t *rsc = (resource_t *) gIter->data;
1210 if (rsc->is_remote_node == FALSE) {
1213 pe_rsc_trace(rsc, "Allocating: %s", rsc->id);
1214 /* For remote node connection resources, always prefer the partial
1215 * migration target during resource allocation, if the rsc is in the
1216 * middle of a migration.
1218 rsc->cmds->allocate(rsc, rsc->partial_migration_target, data_set);
1222 /* now do the rest of the resources */
1223 for (gIter = data_set->resources; gIter != NULL; gIter = gIter->next) {
1224 resource_t *rsc = (resource_t *) gIter->data;
1225 if (rsc->is_remote_node == TRUE) {
1228 pe_rsc_trace(rsc, "Allocating: %s", rsc->id);
1229 rsc->cmds->allocate(rsc, NULL, data_set);
1233 /* We always use pe_order_preserve with these convenience functions to exempt
1234 * internally generated constraints from the prohibition of user constraints
1235 * involving remote connection resources.
1237 * The start ordering additionally uses pe_order_runnable_left so that the
1238 * specified action is not runnable if the start is not runnable.
1242 order_start_then_action(resource_t *lh_rsc, action_t *rh_action,
1243 enum pe_ordering extra, pe_working_set_t *data_set)
1245 if (lh_rsc && rh_action && data_set) {
1246 custom_action_order(lh_rsc, start_key(lh_rsc), NULL,
1247 rh_action->rsc, NULL, rh_action,
1248 pe_order_preserve | pe_order_runnable_left | extra,
1254 order_action_then_stop(action_t *lh_action, resource_t *rh_rsc,
1255 enum pe_ordering extra, pe_working_set_t *data_set)
1257 if (lh_action && rh_rsc && data_set) {
1258 custom_action_order(lh_action->rsc, NULL, lh_action,
1259 rh_rsc, stop_key(rh_rsc), NULL,
1260 pe_order_preserve | extra, data_set);
1265 cleanup_orphans(resource_t * rsc, pe_working_set_t * data_set)
1267 GListPtr gIter = NULL;
1269 if (is_set(data_set->flags, pe_flag_stop_rsc_orphans) == FALSE) {
1273 /* Don't recurse into ->children, those are just unallocated clone instances */
1278 for (gIter = data_set->
nodes; gIter != NULL; gIter = gIter->next) {
1310 g_list_sort_with_data(data_set->
resources, sort_rsc_process_order, nodes);
1315 gIter = data_set->
nodes;
1316 for (; gIter != NULL; gIter = gIter->next) {
1325 allocate_resources(data_set);
1327 gIter = data_set->
nodes;
1328 for (; gIter != NULL; gIter = gIter->next) {
1379 for (gIter = data_set->
resources; gIter != NULL; gIter = gIter->next) {
1381 cleanup_orphans(rsc, data_set);
1386 for (gIter = data_set->
resources; gIter != NULL; gIter = gIter->next) {
1405 for (; gIter != NULL; gIter = gIter->next) {
1408 if (is_managed(child_rsc)) {
1422 for (; gIter != NULL; gIter = gIter->next) {
1425 if (is_managed(rsc)) {
1452 const char *fence_action =
"off";
1461 fence_action =
"reboot";
1468 stonith_op =
pe_fence_op(node, fence_action, FALSE,
"guest is unclean", data_set);
1470 __FUNCTION__, __LINE__);
1478 crm_info(
"Implying guest node %s is down (action %d) after %s fencing",
1486 crm_info(
"Implying guest node %s is down (action %d) "
1487 "after container %s is stopped (action %d)",
1489 container->
id, stop->
id);
1503 crm_info(
"Implying guest node %s is down (action %d) "
1504 "after connection is stopped (action %d)",
1510 crm_info(
"Implying guest node %s is down (action %d) ",
1527 gboolean integrity_lost = FALSE;
1528 gboolean need_stonith = TRUE;
1531 GList *shutdown_ops = NULL;
1541 crm_trace(
"Creating remote ordering constraints");
1542 apply_remote_node_ordering(data_set);
1544 crm_trace(
"Processing fencing and shutdown cases");
1545 if (any_managed_resources(data_set) == FALSE) {
1546 crm_notice(
"Delaying fencing operations until there are resources to manage");
1547 need_stonith = FALSE;
1551 for (gIter = data_set->
nodes; gIter != NULL; gIter = gIter->next) {
1559 fence_guest(node, data_set);
1569 stonith_op =
pe_fence_op(node, NULL, FALSE,
"node is unclean", data_set);
1576 dc_down = stonith_op;
1581 && (stonith_ops != NULL)) {
1592 stonith_ops = g_list_prepend(stonith_ops, stonith_op);
1608 shutdown_ops = g_list_prepend(shutdown_ops, down_op);
1613 integrity_lost = TRUE;
1618 if (integrity_lost) {
1620 pe_warn(
"YOUR RESOURCES ARE NOW LIKELY COMPROMISED");
1621 pe_err(
"ENABLE STONITH TO KEEP YOUR RESOURCES SAFE");
1624 crm_notice(
"Cannot fence unclean nodes until quorum is"
1625 " attained (or no-quorum-policy is set to ignore)");
1629 if (dc_down != NULL) {
1638 for (gIter = shutdown_ops; gIter != NULL; gIter = gIter->next) {
1641 crm_debug(
"Ordering shutdown on %s before %s on DC %s",
1655 for (gIter = stonith_ops; gIter != NULL; gIter = gIter->next) {
1659 }
else if (stonith_ops) {
1669 g_list_free(stonith_ops);
1670 g_list_free(shutdown_ops);
1691 guint interval_ms = 0;
1693 if (
parse_op_key(original_key, NULL, &task, &interval_ms)) {
1698 crm_err(
"search key: %s", original_key);
1722 crm_trace(
"Processing RH of ordering constraint %d", order->
id);
1724 if (rh_action != NULL) {
1725 rh_actions = g_list_prepend(NULL, rh_action);
1727 }
else if (rsc != NULL) {
1731 if (rh_actions == NULL) {
1732 pe_rsc_trace(rsc,
"No RH-Side (%s/%s) found for constraint..."
1747 for (; gIter != NULL; gIter = gIter->next) {
1755 crm_warn(
"Unrunnable %s 0x%.6x", rh_action_iter->
uuid, type);
1757 crm_warn(
"neither %s 0x%.6x", rh_action_iter->
uuid, type);
1761 g_list_free(rh_actions);
1773 crm_trace(
"Processing LH of ordering constraint %d", order->
id);
1776 if (lh_action != NULL) {
1777 lh_actions = g_list_prepend(NULL, lh_action);
1783 if (lh_actions == NULL && lh_rsc != rh_rsc) {
1785 char *op_type = NULL;
1786 guint interval_ms = 0;
1793 pe_rsc_trace(lh_rsc,
"No LH-Side (%s/%s) found for constraint %d with %s - ignoring",
1798 pe_rsc_trace(lh_rsc,
"No LH-Side (%s/%s) found for constraint %d with %s - ignoring",
1802 pe_rsc_trace(lh_rsc,
"No LH-Side (%s/%s) found for constraint %d with %s - creating",
1804 lh_action =
custom_action(lh_rsc, key, op_type, NULL, TRUE, TRUE, data_set);
1805 lh_actions = g_list_prepend(NULL, lh_action);
1812 for (; gIter != NULL; gIter = gIter->next) {
1815 if (rh_rsc == NULL && order->
rh_action) {
1819 rsc_order_then(lh_action_iter, rh_rsc, order);
1826 g_list_free(lh_actions);
1833 is_recurring_action(
action_t *action)
1835 const char *interval_ms_s = g_hash_table_lookup(action->
meta,
1839 return (interval_ms > 0);
1870 crm_trace(
"Order %s action %s relative to %s%s for %s%s",
1922 if (is_recurring_action(action)) {
1928 order_start_then_action(remote_rsc, action,
1943 node_t *cluster_node = NULL;
1950 cluster_node = pe__current_node(remote_rsc);
1989 }
else if (cluster_node == NULL) {
1998 }
else if (g_list_length(remote_rsc->
running_on) > 1
2024 if (action->
rsc == NULL) {
2034 crm_trace(
"Order %s action %s relative to %s%s (state: %s)",
2037 remote_rsc->
id, state2text(state));
2058 order_start_then_action(remote_rsc, action, order_opts, data_set);
2063 order_action_then_stop(action, remote_rsc,
2072 pe_fence_node(data_set, action->
node,
"resources are active and the connection is unrecoverable");
2073 order_action_then_stop(action, remote_rsc,
2081 order_action_then_stop(action, remote_rsc,
2088 order_start_then_action(remote_rsc, action,
pe_order_none, data_set);
2105 if (is_recurring_action(action)) {
2110 order_start_then_action(remote_rsc, action,
2114 node_t *cluster_node = pe__current_node(remote_rsc);
2122 pe_fence_node(data_set, action->
node,
"resources are in an unknown state and the connection is unrecoverable");
2133 order_action_then_stop(action, remote_rsc,
2152 for (
GListPtr gIter = data_set->
actions; gIter != NULL; gIter = gIter->next) {
2157 if (action->
rsc == NULL) {
2181 if (action->
node == NULL) {
2200 if (remote == NULL) {
2211 for (GList *item = action->
rsc->
actions; item != NULL;
2212 item = item->next) {
2218 action->
rsc, NULL, rsc_action,
2233 if (remote->container) {
2235 apply_container_ordering(action, data_set);
2239 apply_remote_ordering(action, data_set);
2255 const char *op = g_hash_table_lookup(rh_action->
meta,
"stonith_action");
2293 if (lh_rsc == NULL) {
2296 }
else if (rh_rsc && lh_rsc == rh_rsc) {
2300 if (lh_action == NULL && lh_action_task == NULL) {
2304 if (rh_action == NULL && rh_action_task == NULL) {
2315 }
else if (lh_action == NULL
2325 if (rh_rsc && lh_rsc->
container == rh_rsc) {
2329 }
else if (rh_action == NULL && rh_action_task
2351 order_type = order->
type;
2355 if (probes == NULL) {
2360 rh_actions = g_list_prepend(rh_actions, rh_action);
2362 }
else if (rh_rsc && rh_action_task) {
2366 if (rh_actions == NULL) {
2367 g_list_free(probes);
2371 crm_trace(
"Processing for LH probe based on ordering constraint %s -> %s"
2372 " (id=%d, type=%.6x)",
2373 lh_action ? lh_action->
uuid : lh_action_task,
2374 rh_action ? rh_action->
uuid : rh_action_task,
2377 for (pIter = probes; pIter != NULL; pIter = pIter->next) {
2381 for (rIter = rh_actions; rIter != NULL; rIter = rIter->next) {
2384 if (order_first_probe_unneeded(probe, rh_action_iter)) {
2391 g_list_free(rh_actions);
2392 g_list_free(probes);
2402 for (gIter = data_set->
resources; gIter != NULL; gIter = gIter->next) {
2454 start = actions->data;
2455 g_list_free(actions);
2459 crm_err(
"No start action for %s", rsc->
id);
2465 for (actions = start->actions_before; actions != NULL; actions = actions->next) {
2472 if(first->required_runnable_before) {
2474 for (clone_actions = first->actions_before; clone_actions != NULL; clone_actions = clone_actions->next) {
2485 crm_trace(
"Not a start op %s for %s", first->uuid, start->uuid);
2488 if(first_rsc == NULL) {
2492 crm_trace(
"Same parent %s for %s", first_rsc->id, start->uuid);
2495 }
else if(FALSE && pe_rsc_is_clone(
uber_parent(first_rsc)) == FALSE) {
2496 crm_trace(
"Not a clone %s for %s", first_rsc->id, start->uuid);
2500 crm_err(
"Applying %s before %s %d", first->uuid, start->uuid,
uber_parent(first_rsc)->variant);
2502 for (pIter = probes; pIter != NULL; pIter = pIter->next) {
2505 crm_err(
"Ordering %s before %s", first->uuid, probe->
uuid);
2516 order_first_probes(data_set);
2517 order_then_probes(data_set);
2525 crm_trace(
"Applying ordering constraints");
2539 crm_trace(
"Applying ordering constraint: %d", order->
id);
2543 rsc_order_first(rsc, order, data_set);
2550 rsc_order_then(order->
lh_action, rsc, order);
2558 for (gIter = data_set->
actions; gIter != NULL; gIter = gIter->next) {
2565 order_probes(data_set);
2568 for (gIter = data_set->
actions; gIter != NULL; gIter = gIter->next) {
2575 for (gIter = data_set->
resources; gIter != NULL; gIter = gIter->next) {
2583 static int transition_id = -1;
2595 crm_err(
"Calculated transition %d (with errors), saving inputs in %s",
2596 transition_id, filename);
2599 crm_warn(
"Calculated transition %d (with warnings), saving inputs in %s",
2600 transition_id, filename);
2603 crm_notice(
"Calculated transition %d, saving inputs in %s",
2604 transition_id, filename);
2607 crm_notice(
"Configuration errors found during scheduler processing,"
2608 " please run \"crm_verify -L\" to identify issues");
2619 const char *value = NULL;
2622 crm_trace(
"Creating transition graph %d.", transition_id);
2659 for (; gIter != NULL; gIter = gIter->next) {
2672 crm_trace(
"processing non-resource actions");
2675 for (; gIter != NULL; gIter = gIter->next) {
2692 crm_crit(
"Cannot %s node '%s' because of %s:%s%s (%s)",
2705 crm_trace(
"Created transition graph %d.", transition_id);
2715 for (gIter = data_set->
actions; gIter != NULL; gIter = gIter->next) {
2716 char *node_name = NULL;
2720 if (action->
rsc != NULL) {
2728 }
else if(action->
node) {
2734 task = strdup(
"Shutdown");
2736 const char *op = g_hash_table_lookup(action->
meta,
"stonith_action");
2742 }
else if(terminal && action->
reason) {
2743 printf(
" * %s %s '%s'\n", task, node_name, action->
reason);
2744 }
else if(terminal) {
2745 printf(
" * %s %s\n", task, node_name);
2746 }
else if(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)
node_t * group_color(resource_t *rsc, node_t *preferred, pe_working_set_t *data_set)
xmlNode * find_xml_node(xmlNode *cib, const char *node_path, gboolean must_find)
void group_internal_constraints(resource_t *rsc, pe_working_set_t *data_set)
pe_node_t * pcmk__bundle_color(pe_resource_t *rsc, pe_node_t *preferred, pe_working_set_t *data_set)
enum pe_quorum_policy no_quorum_policy
gboolean parse_op_key(const char *key, char **rsc_id, char **op_type, guint *interval_ms)
GHashTable * pcmk__bundle_merge_weights(pe_resource_t *rsc, const char *rhs, GHashTable *nodes, const char *attr, float factor, enum pe_weights flags)
#define crm_notice(fmt, args...)
#define CRMD_ACTION_MIGRATED
void native_expand(resource_t *rsc, pe_working_set_t *data_set)
#define pe_flag_stop_action_orphans
enum pe_action_flags pcmk__bundle_action_flags(pe_action_t *action, pe_node_t *node)
#define pe_rsc_debug(rsc, fmt, args...)
#define crm_crit(fmt, args...)
gboolean safe_str_neq(const char *a, const char *b)
void native_internal_constraints(resource_t *rsc, pe_working_set_t *data_set)
gboolean stage2(pe_working_set_t *data_set)
gboolean stage5(pe_working_set_t *data_set)
gboolean stage3(pe_working_set_t *data_set)
#define XML_ATTR_TRANSITION_MAGIC
enum rsc_role_e(* state)(const pe_resource_t *, gboolean)
node_t * clone_color(resource_t *rsc, node_t *preferred, pe_working_set_t *data_set)
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
pe_node_t * partial_migration_source
#define pe_flag_concurrent_fencing
void group_expand(resource_t *rsc, pe_working_set_t *data_set)
bool pe_can_fence(pe_working_set_t *data_set, node_t *node)
void(* expand)(resource_t *, pe_working_set_t *)
GHashTable * clone_merge_weights(resource_t *rsc, const char *rhs, GHashTable *nodes, const char *attr, float factor, enum pe_weights flags)
void pcmk__log_transition_summary(const char *filename)
int utilization_log_level
#define XML_CIB_TAG_CONSTRAINTS
resource_alloc_functions_t * cmds
#define pe_flag_symmetric_cluster
xmlNode * get_object_root(const char *object_type, xmlNode *the_root)
void clone_rsc_colocation_lh(pe_resource_t *lh_rsc, pe_resource_t *rh_rsc, rsc_colocation_t *constraint, pe_working_set_t *data_set)
gboolean stage0(pe_working_set_t *data_set)
enum rsc_role_e next_role
action_t * pe_fence_op(node_t *node, const char *op, bool optional, const char *reason, 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
long long crm_int_helper(const char *text, char **end_text)
int char2score(const char *score)
pe_resource_t * remote_rsc
pe_action_t * sched_shutdown_op(pe_node_t *node, pe_working_set_t *data_set)
resource_alloc_functions_t resource_class_alloc_functions[]
GListPtr find_actions(GListPtr input, const char *key, const node_t *on_node)
resource_object_functions_t * fns
#define XML_LRM_TAG_RESOURCE
void pe_action_set_flag_reason(const char *function, long line, pe_action_t *action, pe_action_t *reason, const char *text, enum pe_action_flags flags, bool overwrite)
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
gboolean pe__is_guest_or_remote_node(pe_node_t *node)
int crm_parse_int(const char *text, const char *default_text)
Parse an integer value from a string.
void pcmk__bundle_rsc_colocation_rh(pe_resource_t *lh_rsc, pe_resource_t *rh_rsc, rsc_colocation_t *constraint, pe_working_set_t *data_set)
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
gboolean unpack_constraints(xmlNode *xml_constraints, pe_working_set_t *data_set)
#define pe_flag_have_status
gboolean clone_create_probe(resource_t *rsc, node_t *node, action_t *complete, gboolean force, pe_working_set_t *data_set)
void group_rsc_location(pe_resource_t *rsc, pe__location_t *constraint)
enum action_tasks text2task(const char *task)
void native_create_actions(resource_t *rsc, pe_working_set_t *data_set)
void(* create_actions)(resource_t *, pe_working_set_t *)
const char * pe_pref(GHashTable *options, const char *name)
enum pe_action_flags clone_action_flags(action_t *action, node_t *node)
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)
#define clear_bit(word, bit)
void native_rsc_location(pe_resource_t *rsc, pe__location_t *constraint)
pe_node_t * partial_migration_target
gboolean remote_was_fenced
#define pe_flag_have_quorum
bool pe__bundle_needs_remote_name(pe_resource_t *rsc)
gboolean remote_requires_reset
bool crm_starts_with(const char *str, const char *prefix)
Check whether a string starts with a certain sequence.
pe_node_t * pe_find_node_id(GListPtr node_list, const char *id)
#define CRM_TRACE_INIT_DATA(name)
#define CRMD_ACTION_START
void group_rsc_colocation_lh(pe_resource_t *lh_rsc, pe_resource_t *rh_rsc, rsc_colocation_t *constraint, pe_working_set_t *data_set)
void native_rsc_colocation_lh(pe_resource_t *lh_rsc, pe_resource_t *rh_rsc, rsc_colocation_t *constraint, pe_working_set_t *data_set)
GListPtr placement_constraints
void native_append_meta(resource_t *rsc, xmlNode *xml)
#define XML_LRM_ATTR_TASK
pe__location_t * rsc2node_new(const char *id, pe_resource_t *rsc, int weight, const char *discovery_mode, pe_node_t *node, pe_working_set_t *data_set)
GHashTable * group_merge_weights(resource_t *rsc, const char *rhs, GHashTable *nodes, const char *attr, float factor, enum pe_weights flags)
#define CRM_OP_CLEAR_FAILCOUNT
gboolean crm_config_error
#define pe_flag_have_remote_nodes
#define crm_warn(fmt, args...)
guint remote_reconnect_ms
#define set_bit(word, bit)
gboolean pe__is_guest_node(pe_node_t *node)
#define crm_debug(fmt, args...)
gboolean stage8(pe_working_set_t *data_set)
pe_resource_t * uber_parent(pe_resource_t *rsc)
#define pe_flag_sanitized
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
void clone_expand(resource_t *rsc, pe_working_set_t *data_set)
#define XML_CIB_TAG_STATE
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
gboolean stage4(pe_working_set_t *data_set)
void group_rsc_colocation_rh(pe_resource_t *lh_rsc, pe_resource_t *rh_rsc, rsc_colocation_t *constraint, pe_working_set_t *data_set)
gboolean update_action(pe_action_t *action, pe_working_set_t *data_set)
#define crm_trace(fmt, args...)
enum rsc_digest_cmp_val rc
action_t * find_first_action(GListPtr input, const char *uuid, const char *task, node_t *on_node)
char * digest_secure_calc
void calculate_active_ops(GList *sorted_op_list, int *start_index, int *stop_index)
struct pe_node_shared_s * details
GHashTable * rsc_merge_weights(resource_t *rsc, const char *rhs, GHashTable *nodes, const char *attr, float factor, enum pe_weights flags)
#define XML_AGENT_ATTR_PROVIDER
void LogActions(resource_t *rsc, pe_working_set_t *data_set, gboolean terminal)
void pe_fence_node(pe_working_set_t *data_set, node_t *node, const char *reason)
Schedule a fence action for a node.
Wrappers for and extensions to libxml2.
#define XML_ATTR_TE_NOWAIT
void LogNodeActions(pe_working_set_t *data_set, gboolean terminal)
xmlNode * create_xml_node(xmlNode *parent, const char *name)
action_t * custom_action(resource_t *rsc, char *key, const char *task, node_t *on_node, gboolean optional, gboolean foo, pe_working_set_t *data_set)
#define pe_flag_stonith_enabled
const char * pe_node_attribute_raw(pe_node_t *node, const char *name)
xmlNode * find_rsc_op_entry(resource_t *rsc, const char *key)
void clone_internal_constraints(resource_t *rsc, pe_working_set_t *data_set)
#define XML_LRM_ATTR_RESTART_DIGEST
gboolean native_create_probe(resource_t *rsc, node_t *node, action_t *complete, gboolean force, pe_working_set_t *data_set)
enum pe_obj_types variant
gboolean xml_has_children(const xmlNode *root)
void ReloadRsc(resource_t *rsc, node_t *node, pe_working_set_t *data_set)
gboolean crm_str_eq(const char *a, const char *b, gboolean use_case)
const char * placement_strategy
gboolean can_run_resources(const node_t *node)
void graph_element_from_action(action_t *action, pe_working_set_t *data_set)
void(* rsc_location)(pe_resource_t *, pe__location_t *)
void pe__free_param_checks(pe_working_set_t *data_set)
gboolean crm_ends_with(const char *s, const char *match)
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)
GListPtr ordering_constraints
enum pe_action_flags group_action_flags(action_t *action, node_t *node)
gboolean rsc_discovery_enabled
#define XML_LRM_ATTR_SECURE_DIGEST
gboolean show_utilization
guint crm_parse_ms(const char *text)
node_t * native_color(resource_t *rsc, node_t *preferred, pe_working_set_t *data_set)
void update_colo_start_chain(pe_action_t *action, pe_working_set_t *data_set)
gboolean stage7(pe_working_set_t *data_set)
Cluster status and scheduling.
void add_hash_param(GHashTable *hash, const char *name, const char *value)
void complex_set_cmds(resource_t *rsc)
void(* internal_constraints)(resource_t *, pe_working_set_t *)
void pcmk__bundle_rsc_location(pe_resource_t *rsc, pe__location_t *constraint)
gboolean update_action_flags(action_t *action, enum pe_action_flags flags, const char *source, int line)
void clone_rsc_location(pe_resource_t *rsc, pe__location_t *constraint)
void clone_rsc_colocation_rh(pe_resource_t *lh_rsc, pe_resource_t *rh_rsc, rsc_colocation_t *constraint, pe_working_set_t *data_set)
#define XML_LRM_TAG_RESOURCES
#define crm_err(fmt, args...)
void resource_location(resource_t *rsc, node_t *node, int score, const char *tag, pe_working_set_t *data_set)
pe_action_t * pe__clear_failcount(pe_resource_t *rsc, pe_node_t *node, const char *reason, pe_working_set_t *data_set)
Schedule a controller operation to clear a fail count.
gboolean cluster_status(pe_working_set_t *data_set)
void group_create_actions(resource_t *rsc, pe_working_set_t *data_set)
gboolean DeleteRsc(resource_t *rsc, node_t *node, gboolean optional, pe_working_set_t *data_set)
GHashTable * native_merge_weights(resource_t *rsc, const char *rhs, GHashTable *nodes, const char *attr, float factor, enum pe_weights flags)
#define XML_LRM_ATTR_INTERVAL_MS
gboolean stage6(pe_working_set_t *data_set)
#define crm_log_xml_info(xml, text)
void dump_node_capacity(int level, const char *comment, node_t *node)
int merge_weights(int w1, int w2)
#define XML_LRM_ATTR_CALLID
#define CRMD_ACTION_MIGRATE
void pcmk__bundle_expand(pe_resource_t *rsc, pe_working_set_t *data_set)
int pe_get_failcount(node_t *node, resource_t *rsc, time_t *last_failure, uint32_t flags, xmlNode *xml_op, pe_working_set_t *data_set)
gboolean(* create_probe)(resource_t *, node_t *, action_t *, gboolean, pe_working_set_t *)
void clone_append_meta(resource_t *rsc, xmlNode *xml)
enum pe_action_flags flags
#define pe_rsc_maintenance
#define pe_rsc_failure_ignored
void group_append_meta(resource_t *rsc, xmlNode *xml)
void clone_create_actions(resource_t *rsc, pe_working_set_t *data_set)
#define XML_CIB_TAG_STATUS
int custom_action_order(resource_t *lh_rsc, char *lh_task, action_t *lh_action, resource_t *rh_rsc, char *rh_task, action_t *rh_action, enum pe_ordering type, pe_working_set_t *data_set)
gboolean stonith_constraints(node_t *node, action_t *stonith_op, pe_working_set_t *data_set)
#define crm_log_xml_trace(xml, text)
gboolean pe__is_remote_node(pe_node_t *node)
gboolean crm_is_true(const char *s)
#define XML_LRM_TAG_RSC_OP
#define pe_rsc_trace(rsc, fmt, args...)
#define dump_node_scores(level, rsc, text, nodes)
gboolean was_processing_error
#define safe_str_eq(a, b)
gboolean order_actions(action_t *lh_action, action_t *rh_action, enum pe_ordering order)
op_digest_cache_t * rsc_action_digest_cmp(resource_t *rsc, xmlNode *xml_op, node_t *node, pe_working_set_t *data_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.
gboolean was_processing_warning
gboolean probe_resources(pe_working_set_t *data_set)
char * crm_strdup_printf(char const *format,...) __attribute__((__format__(__printf__
#define pe_flag_start_failure_fatal
void pcmk__bundle_create_actions(pe_resource_t *rsc, pe_working_set_t *data_set)
#define crm_info(fmt, args...)
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)
char * generate_op_key(const char *rsc_id, const char *op_type, guint interval_ms)
Generate an operation key.
void trigger_unfencing(resource_t *rsc, node_t *node, const char *reason, action_t *dependency, 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)
enum pe_action_flags native_action_flags(action_t *action, node_t *node)
enum crm_ais_msg_types type
void pcmk__bundle_rsc_colocation_lh(pe_resource_t *lh_rsc, pe_resource_t *rh_rsc, rsc_colocation_t *constraint, pe_working_set_t *data_set)
void native_rsc_colocation_rh(pe_resource_t *lh_rsc, pe_resource_t *rh_rsc, rsc_colocation_t *constraint, pe_working_set_t *data_set)
#define XML_AGENT_ATTR_CLASS
GHashTable * allowed_nodes
#define pe_flag_startup_probes