20 #define INFINITY_HACK (INFINITY * -100)
22 #define VARIANT_NATIVE 1
80 gboolean result = FALSE;
97 best = g_list_nth_data(nodes, 0);
100 if (prefer && nodes) {
103 if (chosen == NULL) {
104 pe_rsc_trace(rsc,
"Preferred node %s for %s was unknown",
114 pe_rsc_trace(rsc,
"Preferred node %s for %s was unsuitable",
119 pe_rsc_trace(rsc,
"Preferred node %s for %s was unavailable",
125 "Chose preferred node %s for %s (ignoring %d candidates)",
130 if ((chosen == NULL) && nodes) {
136 pe_rsc_trace(rsc,
"Chose node %s for %s from %d candidates",
139 if (!pe_rsc_is_unique_clone(rsc->
parent)
150 node_t *running = pe__current_node(rsc);
153 pe_rsc_trace(rsc,
"Current node for %s (%s) can't run resources",
155 }
else if (running) {
156 for (GList *iter = nodes->next; iter; iter = iter->next) {
174 static char score[33];
175 int log_level = (chosen->
weight >=
INFINITY)? LOG_WARNING : LOG_INFO;
179 "Chose node %s for %s from %d nodes with score %s",
189 node_list_attr_score(GHashTable * list,
const char *attr,
const char *value)
194 const char *best_node = NULL;
200 g_hash_table_iter_init(&iter, list);
201 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
202 int weight = node->weight;
207 if (weight > best_score || best_node == NULL) {
212 best_node = node->details->uname;
218 crm_info(
"Best score for %s=%s was %s with %d",
219 attr, value, best_node ? best_node :
"<none>", best_score);
226 node_hash_update(GHashTable * list1, GHashTable * list2,
const char *attr,
float factor,
227 gboolean only_positive)
238 g_hash_table_iter_init(&iter, list1);
239 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
244 if(node == NULL) {
continue; };
248 weight_f = factor * score;
251 weight = (int)(weight_f < 0 ? weight_f - 0.5 : weight_f + 0.5);
255 if (factor < 0 && score < 0) {
262 crm_trace(
"%s: Filtering %d + %f*%d (factor * score)",
263 node->details->uname, node->weight, factor, score);
266 crm_trace(
"%s: Filtering %d + %f*%d (node < 0)",
267 node->details->uname, node->weight, factor, score);
269 }
else if (only_positive && new_score < 0 && node->weight > 0) {
271 crm_trace(
"%s: Filtering %d + %f*%d (score > 0)",
272 node->details->uname, node->weight, factor, score);
274 }
else if (only_positive && new_score < 0 && node->weight == 0) {
275 crm_trace(
"%s: Filtering %d + %f*%d (score == 0)",
276 node->details->uname, node->weight, factor, score);
279 crm_trace(
"%s: %d + %f*%d", node->details->uname, node->weight, factor, score);
280 node->weight = new_score;
289 GListPtr list = g_hash_table_get_values(hash);
307 GHashTable *work = NULL;
315 pe_rsc_info(rsc,
"%s: Breaking dependency loop at %s", rhs, rsc->
id);
325 while (last->next != NULL) {
340 pe_rsc_trace(rsc,
"%s: Combining scores from %d children of %s", rhs, g_list_length(iter), rsc->
id);
342 for(iter = rsc->
children; iter->next != NULL; iter = iter->next) {
354 pe_rsc_info(rsc,
"%s: Rolling back scores from %s", rhs, rsc->
id);
355 g_hash_table_destroy(work);
365 crm_trace(
"Checking %d additional colocation constraints", g_list_length(gIter));
370 while (last->next != NULL) {
374 gIter = ((
resource_t*)last->data)->rsc_cons_lhs;
375 crm_trace(
"Checking %d additional optional group colocation constraints from %s",
376 g_list_length(gIter), ((
resource_t*)last->data)->id);
380 crm_trace(
"Checking %d additional optional colocation constraints %s", g_list_length(gIter), rsc->
id);
383 for (; gIter != NULL; gIter = gIter->next) {
388 other = constraint->
rsc_rh;
390 other = constraint->
rsc_lh;
405 g_hash_table_iter_init(&iter, work);
406 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
414 g_hash_table_destroy(nodes);
422 node_has_been_unfenced(
node_t *node)
426 return unfenced && strcmp(
"0", unfenced);
444 pe_rsc_debug(rsc,
"Escalating allocation of %s to its parent: %s", rsc->
id,
454 pe_rsc_debug(rsc,
"Dependency loop detected involving %s", rsc->
id);
461 for (gIter = rsc->
rsc_cons; gIter != NULL; gIter = gIter->next) {
464 GHashTable *archive = NULL;
468 rsc->
id, constraint->
id, rsc_rh->id,
474 rsc_rh->cmds->allocate(rsc_rh, NULL, data_set);
477 pe_rsc_info(rsc,
"%s: Rolling back scores from %s", rsc->
id, rsc_rh->id);
483 g_hash_table_destroy(archive);
489 for (gIter = rsc->
rsc_cons_lhs; gIter != NULL; gIter = gIter->next) {
500 pe_rsc_trace(rsc,
"Making sure %s doesn't get allocated", rsc->
id);
507 crm_notice(
"Resource %s cannot be elevated from %s to %s: no-quorum-policy=freeze",
520 const char *reason = NULL;
524 assign_to = pe__current_node(rsc);
525 if (assign_to == NULL) {
534 pe_rsc_info(rsc,
"Unmanaged resource %s allocated to %s: %s", rsc->
id,
535 (assign_to? assign_to->
details->
uname :
"no node"), reason);
543 && native_choose_node(rsc, prefer, data_set)) {
549 pe_rsc_info(rsc,
"Resource %s cannot run anywhere", rsc->
id);
566 crm_trace(
"Setting Pacemaker Remote node %s to ONLINE",
576 crm_trace(
"Setting Pacemaker Remote node %s to SHUTDOWN (next role %s, %sallocated)",
587 is_op_dup(
resource_t *rsc,
const char *name, guint interval_ms)
589 gboolean dup = FALSE;
590 const char *
id = NULL;
591 const char *value = NULL;
592 xmlNode *operation = NULL;
593 guint interval2_ms = 0;
596 for (operation = __xml_first_child_element(rsc->
ops_xml); operation != NULL;
597 operation = __xml_next_element(operation)) {
599 if (
crm_str_eq((
const char *)operation->name,
"op", TRUE)) {
607 if (interval_ms != interval2_ms) {
617 (
"Do not use the same (name, interval) combination more than once per resource");
627 op_cannot_recur(
const char *name)
640 const char *name = NULL;
641 const char *role = NULL;
642 const char *interval_spec = NULL;
643 const char *node_uname = node? node->
details->
uname :
"n/a";
645 guint interval_ms = 0;
647 gboolean is_optional = TRUE;
660 if (interval_ms == 0) {
665 if (is_op_dup(rsc, name, interval_ms)) {
666 crm_trace(
"Not creating duplicate recurring action %s for %dms %s",
667 ID(operation), interval_ms, name);
671 if (op_cannot_recur(name)) {
672 crm_config_err(
"Ignoring %s because action '%s' cannot be recurring",
673 ID(operation), name);
679 crm_trace(
"Not creating recurring action %s for disabled resource %s",
680 ID(operation), rsc->
id);
685 pe_rsc_trace(rsc,
"Creating recurring action %s for %s in role %s on %s",
700 if (possible_matches == NULL) {
702 pe_rsc_trace(rsc,
"Marking %s mandatory: not active", key);
707 for (gIter = possible_matches; gIter != NULL; gIter = gIter->next) {
715 g_list_free(possible_matches);
721 const char *result =
"Ignoring";
724 char *after_key = NULL;
728 log_level = LOG_INFO;
729 result =
"Cancelling";
730 cancel_op =
pe_cancel_op(rsc, name, interval_ms, node, data_set);
756 do_crm_log(log_level,
"%s action %s (%s vs. %s)",
764 mon =
custom_action(rsc, key, name, node, is_optional, TRUE, data_set);
771 pe_rsc_debug(rsc,
"%s\t %s (cancelled : start un-runnable)",
772 node_uname, mon->
uuid);
776 pe_rsc_debug(rsc,
"%s\t %s (cancelled : no node available)",
777 node_uname, mon->
uuid);
781 pe_rsc_info(rsc,
" Start recurring %s (%us) for %s on %s",
782 mon->
task, interval_ms / 1000, rsc->
id, node_uname);
789 free(running_master);
794 NULL, strdup(key), mon,
798 NULL, strdup(key), mon,
819 xmlNode *operation = NULL;
821 for (operation = __xml_first_child_element(rsc->
ops_xml);
823 operation = __xml_next_element(operation)) {
825 if (
crm_str_eq((
const char *)operation->name,
"op", TRUE)) {
826 RecurringOp(rsc, start, node, operation, data_set);
837 const char *name = NULL;
838 const char *role = NULL;
839 const char *interval_spec = NULL;
840 const char *node_uname = node? node->
details->
uname :
"n/a";
842 guint interval_ms = 0;
854 if (interval_ms == 0) {
859 if (is_op_dup(rsc, name, interval_ms)) {
860 crm_trace(
"Not creating duplicate recurring action %s for %dms %s",
861 ID(operation), interval_ms, name);
865 if (op_cannot_recur(name)) {
866 crm_config_err(
"Invalid recurring action %s wth name: '%s'",
ID(operation), name);
872 crm_trace(
"Not creating recurring action %s for disabled resource %s",
873 ID(operation), rsc->
id);
880 crm_notice(
"Ignoring %s (recurring monitors for Stopped role are "
881 "not supported for anonymous clones)",
887 "Creating recurring action %s for %s in role %s on nodes where it should not be running",
893 if (possible_matches) {
896 g_list_free(possible_matches);
898 cancel_op =
pe_cancel_op(rsc, name, interval_ms, node, data_set);
907 pe_rsc_info(rsc,
"Cancel action %s (%s vs. %s) on %s",
912 for (gIter = data_set->
nodes; gIter != NULL; gIter = gIter->next) {
914 const char *stop_node_uname = stop_node->
details->
uname;
915 gboolean is_optional = TRUE;
916 gboolean probe_is_optional = TRUE;
917 gboolean stop_is_optional = TRUE;
919 char *rc_inactive = NULL;
924 if (node &&
safe_str_eq(stop_node_uname, node_uname)) {
928 pe_rsc_trace(rsc,
"Creating recurring action %s for %s on %s",
933 if (possible_matches == NULL) {
934 pe_rsc_trace(rsc,
"Marking %s mandatory on %s: not active", key,
938 pe_rsc_trace(rsc,
"Marking %s optional on %s: already active", key,
941 g_list_free(possible_matches);
944 stopped_mon =
custom_action(rsc, strdup(key), name, stop_node, is_optional, TRUE, data_set);
955 for (pIter = probes; pIter != NULL; pIter = pIter->next) {
965 if (probe_complete_ops) {
966 g_list_free(probe_complete_ops);
971 for (local_gIter = stop_ops; local_gIter != NULL; local_gIter = local_gIter->next) {
975 stop_is_optional = FALSE;
979 crm_debug(
"%s\t %s (cancelled : stop un-runnable)",
980 crm_str(stop_node_uname), stopped_mon->uuid);
986 NULL, strdup(key), stopped_mon,
993 g_list_free(stop_ops);
996 if (is_optional == FALSE && probe_is_optional && stop_is_optional
998 pe_rsc_trace(rsc,
"Marking %s optional on %s due to unmanaged",
999 key,
crm_str(stop_node_uname));
1008 pe_rsc_debug(rsc,
"%s\t %s (cancelled : no node available)",
1009 crm_str(stop_node_uname), stopped_mon->uuid);
1015 crm_notice(
" Start recurring %s (%us) for %s on %s", stopped_mon->task,
1016 interval_ms / 1000, rsc->
id,
crm_str(stop_node_uname));
1028 xmlNode *operation = NULL;
1030 for (operation = __xml_first_child_element(rsc->
ops_xml);
1032 operation = __xml_next_element(operation)) {
1034 if (
crm_str_eq((
const char *)operation->name,
"op", TRUE)) {
1035 RecurringOp_Stopped(rsc, start, node, operation, data_set);
1050 pe_rsc_trace(rsc,
"Processing migration actions %s moving from %s to %s . partial migration = %s",
1055 if (partial == FALSE) {
1061 if ((migrate_to && migrate_from) || (migrate_from && partial)) {
1124 gboolean need_stop = FALSE;
1125 bool need_promote = FALSE;
1126 gboolean is_moving = FALSE;
1130 unsigned int num_all_active = 0;
1131 unsigned int num_clean_active = 0;
1132 bool multiply_active = FALSE;
1147 pe_rsc_trace(rsc,
"Processing state transition for %s %p: %s->%s", rsc->
id, rsc,
1162 DeleteRsc(rsc, dangling_source, FALSE, data_set);
1166 if ((num_all_active == 2) && (num_clean_active == 2) && chosen
1176 "Will attempt to continue with a partial migration to target %s from %s",
1188 multiply_active = (num_clean_active > 1);
1190 multiply_active = (num_all_active > 1);
1193 if (multiply_active) {
1196 crm_notice(
"Resource %s can no longer migrate to %s. Stopping on %s too",
1202 pe_proc_err(
"Resource %s is active on %u nodes (%s)",
1203 rsc->
id, num_all_active,
1205 crm_notice(
"See https://wiki.clusterlabs.org/wiki/FAQ#Resource_is_Too_Active for more information");
1216 allow_migrate = FALSE;
1236 need_promote = TRUE;
1263 rsc->
id, need_stop ?
" required" :
"");
1264 if (
rsc_action_matrix[role][next_role] (rsc, current, !need_stop, data_set) == FALSE) {
1272 bool required = need_stop;
1279 rsc->
id, (required?
" required" :
""));
1281 data_set) == FALSE) {
1292 if (
rsc_action_matrix[role][next_role] (rsc, chosen, FALSE, data_set) == FALSE) {
1299 pe_rsc_trace(rsc,
"No monitor additional ops for blocked resource");
1304 Recurring(rsc, start, chosen, data_set);
1305 Recurring_Stopped(rsc, start, chosen, data_set);
1307 pe_rsc_trace(rsc,
"Monitor ops for inactive resource");
1308 Recurring_Stopped(rsc, NULL, NULL, data_set);
1315 pe_rsc_trace(rsc,
"Not allowing partial migration to continue. %s", rsc->
id);
1316 allow_migrate = FALSE;
1318 }
else if (is_moving == FALSE ||
1325 allow_migrate = FALSE;
1328 if (allow_migrate) {
1329 handle_migration_actions(rsc, current, chosen, data_set);
1336 GHashTableIter iter;
1339 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
1340 if (node->details->remote_rsc) {
1363 GList *allowed_nodes = NULL;
1366 allowed_nodes = g_hash_table_get_values(rsc->
allowed_nodes);
1372 return allowed_nodes;
1381 GList *allowed_nodes = NULL;
1382 bool check_unfencing = FALSE;
1387 "Skipping native constraints for unmanaged resource: %s",
1422 allowed_nodes = allowed_nodes_as_list(rsc, data_set);
1425 if (check_unfencing) {
1428 for (GList *item = allowed_nodes; item; item = item->next) {
1432 crm_debug(
"Ordering any stops of %s before %s, and any starts after",
1451 NULL, strdup(unfence->
uuid), unfence,
1464 pe_rsc_trace(rsc,
"Creating utilization constraints for %s - strategy: %s",
1467 for (gIter = rsc->
running_on; gIter != NULL; gIter = gIter->next) {
1473 if (load_stopped->
node == NULL) {
1479 NULL, load_stopped_task, load_stopped,
pe_order_load, data_set);
1482 for (GList *item = allowed_nodes; item; item = item->next) {
1487 if (load_stopped->
node == NULL) {
1499 free(load_stopped_task);
1514 rsc_avoids_remote_nodes(rsc->
container);
1544 for (GList *item = allowed_nodes; item; item = item->next) {
1559 crm_trace(
"Order and colocate %s relative to its container %s",
1583 rsc_avoids_remote_nodes(rsc);
1585 g_list_free(allowed_nodes);
1593 if (rsc_lh == NULL) {
1594 pe_err(
"rsc_lh was NULL for %s", constraint->
id);
1597 }
else if (constraint->
rsc_rh == NULL) {
1598 pe_err(
"rsc_rh was NULL for %s", constraint->
id);
1602 pe_rsc_trace(rsc_lh,
"Processing colocation constraint between %s and %s", rsc_lh->
id,
1612 if (constraint->
score == 0) {
1642 if ((rh_node == NULL)
1644 crm_err(
"%s must be colocated with %s but is not (%s vs. %s)",
1645 rsc_lh->
id, rsc_rh->
id,
1653 if ((rh_node != NULL)
1655 crm_err(
"%s and %s must be anti-colocated but are allocated "
1656 "to the same node (%s)",
1663 if (constraint->
score > 0
1665 crm_trace(
"LH: Skipping constraint: \"%s\" state filter nextrole is %s",
1670 if (constraint->
score > 0
1676 if (constraint->
score < 0
1678 crm_trace(
"LH: Skipping negative constraint: \"%s\" state filter",
1683 if (constraint->
score < 0
1685 crm_trace(
"RH: Skipping negative constraint: \"%s\" state filter",
1696 const char *rh_value = NULL;
1697 const char *lh_value = NULL;
1699 int score_multiplier = 1;
1724 score_multiplier = -1;
1733 const char *tmp = NULL;
1734 const char *value = NULL;
1737 GHashTable *work = NULL;
1738 gboolean do_check = FALSE;
1740 GHashTableIter iter;
1751 }
else if (constraint->
score < 0) {
1760 g_hash_table_iter_init(&iter, work);
1761 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
1766 node->details->uname, constraint->
score);
1770 }
else if (do_check == FALSE || constraint->
score >=
INFINITY) {
1772 node->details->uname, constraint->
score,
1773 do_check ?
"failed" :
"unallocated");
1785 static char score[33];
1789 pe_rsc_info(rsc_lh,
"%s: Rolling back scores from %s (%d, %s)",
1790 rsc_lh->
id, rsc_rh->
id, do_check, score);
1794 g_hash_table_destroy(work);
1808 pe_rsc_trace(rsc_lh,
"%sColocating %s with %s (%s, weight=%d, filter=%d)",
1809 constraint->
score >= 0 ?
"" :
"Anti-",
1810 rsc_lh->
id, rsc_rh->
id, constraint->
id, constraint->
score, filter_results);
1812 switch (filter_results) {
1814 influence_priority(rsc_lh, rsc_rh, constraint);
1817 pe_rsc_trace(rsc_lh,
"%sColocating %s with %s (%s, weight=%d)",
1818 constraint->
score >= 0 ?
"" :
"Anti-",
1819 rsc_lh->
id, rsc_rh->
id, constraint->
id, constraint->
score);
1820 colocation_match(rsc_lh, rsc_rh, constraint);
1832 pe_rsc_trace(rsc_lh,
"LH: Skipping constraint: \"%s\" state filter",
1843 if (rsc_ticket == NULL) {
1844 pe_err(
"rsc_ticket was NULL");
1848 if (rsc_lh == NULL) {
1849 pe_err(
"rsc_lh was NULL for %s", rsc_ticket->
id);
1860 pe_rsc_trace(rsc_lh,
"Processing ticket dependencies from %s", rsc_lh->
id);
1862 for (; gIter != NULL; gIter = gIter->next) {
1870 pe_rsc_trace(rsc_lh,
"%s: Processing ticket dependency on %s (%s, %s)",
1892 if (filter_rsc_ticket(rsc_lh, rsc_ticket) == FALSE) {
1898 for (gIter = rsc_lh->
running_on; gIter != NULL; gIter = gIter->next) {
1906 if (filter_rsc_ticket(rsc_lh, rsc_ticket) == FALSE) {
1933 return action->
flags;
1957 const char *reason = NULL;
1980 if (reason == NULL) {
2019 crm_trace(
"Testing %s on %s (0x%.6x) with %s 0x%.6x",
2066 pe_rsc_trace(first->
rsc,
"Unset migrate runnable on %s because of %s",
2094 pe_rsc_trace(then->
rsc,
"Unset runnable on %s because %s is neither runnable or migratable", first->
uuid, then->
uuid);
2137 handle_restart_ordering(first, then, filter);
2140 if (then_flags != then->
flags) {
2143 "Then: Flags for %s on %s are now 0x%.6x (was 0x%.6x) because of %s 0x%.6x",
2153 if (first_flags != first->
flags) {
2156 "First: Flags for %s on %s are now 0x%.6x (was 0x%.6x) because of %s 0x%.6x",
2168 GHashTableIter iter;
2171 if (constraint == NULL) {
2172 pe_err(
"Constraint is NULL");
2175 }
else if (rsc == NULL) {
2176 pe_err(
"LHS of rsc_to_node (%s) is NULL", constraint->
id);
2185 pe_rsc_debug(rsc,
"Constraint (%s) is not active (role : %s vs. %s)",
2191 pe_rsc_trace(rsc,
"RHS of constraint %s is NULL", constraint->
id);
2195 for (gIter = constraint->
node_list_rh; gIter != NULL; gIter = gIter->next) {
2197 node_t *other_node = NULL;
2201 if (other_node != NULL) {
2204 other_node->details->uname, node->
weight, other_node->weight);
2211 g_hash_table_insert(rsc->
allowed_nodes, (gpointer) other_node->details->id, other_node);
2214 if (other_node->rsc_discover_mode < constraint->
discover_mode) {
2224 while (g_hash_table_iter_next(&iter, NULL, (
void **)&node)) {
2225 pe_rsc_trace(rsc,
"%s + %s : %d", rsc->
id, node->details->uname, node->weight);
2237 for (gIter = rsc->
actions; gIter != NULL; gIter = gIter->next) {
2240 crm_trace(
"processing action %d for rsc=%s", action->
id, rsc->
id);
2244 for (gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
2247 child_rsc->
cmds->
expand(child_rsc, data_set);
2251 #define log_change(a, fmt, args...) do { \
2252 if(a && a->reason && terminal) { \
2253 printf(" * "fmt" \tdue to %s\n", ##args, a->reason); \
2254 } else if(a && a->reason) { \
2255 crm_notice(fmt" \tdue to %s", ##args, a->reason); \
2256 } else if(terminal) { \
2257 printf(" * "fmt"\n", ##args); \
2259 crm_notice(fmt, ##args); \
2263 #define STOP_SANITY_ASSERT(lineno) do { \
2264 if(current && current->details->unclean) { \
2266 } else if(stop == NULL) { \
2267 crm_err("%s:%d: No stop action exists for %s", __FUNCTION__, lineno, rsc->id); \
2268 CRM_ASSERT(stop != NULL); \
2269 } else if(is_set(stop->flags, pe_action_optional)) { \
2270 crm_err("%s:%d: Action %s is still optional", __FUNCTION__, lineno, stop->uuid); \
2271 CRM_ASSERT(is_not_set(stop->flags, pe_action_optional)); \
2275 static int rsc_width = 5;
2276 static int detail_width = 5;
2281 char *reason = NULL;
2282 char *details = NULL;
2283 bool same_host = FALSE;
2284 bool same_role = FALSE;
2285 bool need_role = FALSE;
2288 CRM_ASSERT(destination != NULL || origin != NULL);
2290 if(source == NULL) {
2294 len = strlen(rsc->
id);
2295 if(len > rsc_width) {
2296 rsc_width = len + 2;
2303 if(origin != NULL && destination != NULL && origin->
details == destination->
details) {
2311 if(need_role && origin == NULL) {
2315 }
else if(need_role && destination == NULL) {
2319 }
else if(origin == NULL || destination == NULL) {
2323 }
else if(need_role && same_role && same_host) {
2327 }
else if(same_role && same_host) {
2331 }
else if(same_role && need_role) {
2335 }
else if(same_role) {
2339 }
else if(same_host) {
2348 len = strlen(details);
2349 if(len > detail_width) {
2356 }
else if(source->
reason) {
2360 reason = strdup(
" blocked");
2363 reason = strdup(
"");
2367 printf(
" * %-8s %-*s ( %*s ) %s\n", change, rsc_width, rsc->
id, detail_width, details, reason);
2369 crm_notice(
" * %-8s %-*s ( %*s ) %s", change, rsc_width, rsc->
id, detail_width, details, reason);
2390 gboolean moving = FALSE;
2401 for (gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
2411 current = pe__current_node(rsc);
2427 || (current == NULL && next == NULL)) {
2439 if (possible_matches) {
2440 start = possible_matches->data;
2441 g_list_free(possible_matches);
2447 start_node = current;
2450 if (possible_matches) {
2451 stop = possible_matches->data;
2452 g_list_free(possible_matches);
2456 if (possible_matches) {
2457 promote = possible_matches->data;
2458 g_list_free(possible_matches);
2462 if (possible_matches) {
2463 demote = possible_matches->data;
2464 g_list_free(possible_matches);
2471 if (possible_matches) {
2472 migrate_op = possible_matches->data;
2478 LogAction(
"Migrate", rsc, current, next, start, NULL, terminal);
2481 LogAction(
"Reload", rsc, current, next, start, NULL, terminal);
2485 if ((demote != NULL) && (promote != NULL)
2488 LogAction(
"Re-promote", rsc, current, next, promote, demote,
2496 LogAction(
"Stop", rsc, current, NULL, stop,
2497 (stop && stop->
reason)? stop : start, terminal);
2500 }
else if (moving && current) {
2502 rsc, current, next, stop, NULL, terminal);
2505 LogAction(
"Recover", rsc, current, NULL, stop, NULL, terminal);
2509 LogAction(
"Restart", rsc, current, next, start, NULL, terminal);
2513 g_list_free(possible_matches);
2524 for (gIter = rsc->
running_on; gIter != NULL; gIter = gIter->next) {
2529 if (possible_matches) {
2530 stop_op = possible_matches->data;
2531 g_list_free(possible_matches);
2538 LogAction(
"Stop", rsc, node, NULL, stop_op,
2539 (stop_op && stop_op->reason)? stop_op : start, terminal);
2547 LogAction(
"Recover", rsc, current, next, stop, start, terminal);
2550 }
else if (moving) {
2551 LogAction(
"Move", rsc, current, next, stop, NULL, terminal);
2555 LogAction(
"Reload", rsc, current, next, start, NULL, terminal);
2558 LogAction(
"Restart", rsc, current, next, start, NULL, terminal);
2563 LogAction(
"Demote", rsc, current, next, demote, NULL, terminal);
2567 LogAction(
"Promote", rsc, current, next, promote, NULL, terminal);
2570 LogAction(
"Start", rsc, current, next, start, NULL, terminal);
2582 for (gIter = rsc->
running_on; gIter != NULL; gIter = gIter->next) {
2609 DeleteRsc(rsc, current, optional, data_set);
2616 if (!node_has_been_unfenced(current)) {
2636 if (is_unfence_device(rsc, data_set)
2647 if (!node_has_been_unfenced(node)) {
2681 gboolean runnable = TRUE;
2690 for (gIter = action_list; gIter != NULL; gIter = gIter->next) {
2697 g_list_free(action_list);
2708 for (gIter = action_list; gIter != NULL; gIter = gIter->next) {
2714 g_list_free(action_list);
2727 for (gIter = rsc->
running_on; gIter != NULL; gIter = gIter->next) {
2760 }
else if (node == NULL) {
2761 pe_rsc_trace(rsc,
"Resource %s not deleted: NULL node", rsc->
id);
2765 pe_rsc_trace(rsc,
"Resource %s not deleted from %s: unrunnable", rsc->
id,
2794 static const char *rc_master = NULL;
2795 static const char *rc_inactive = NULL;
2797 if (rc_inactive == NULL) {
2804 pe_rsc_trace(rsc,
"Skipping active resource detection for %s", rsc->
id);
2813 "Skipping probe for %s on %s because Pacemaker Remote nodes cannot run stonith agents",
2819 "Skipping probe for %s on %s because guest nodes cannot run resources containing guest nodes",
2822 }
else if (rsc->is_remote_node) {
2824 "Skipping probe for %s on %s because Pacemaker Remote nodes cannot host remote connections",
2832 gboolean any_created = FALSE;
2834 for (gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
2837 any_created = child_rsc->
cmds->
create_probe(child_rsc, node, complete, force, data_set)
2862 if (allowed == NULL) {
2921 pe_rsc_trace(rsc,
"Skipping probe for %s on node %s, %s is stopped",
2942 pe_rsc_trace(rsc,
"Skipping probe for %s on node %s, %s is stopping, restarting or moving",
2962 if (running == NULL) {
2972 if (is_unfence_device(rsc, data_set) || !pe_rsc_is_clone(top)) {
2996 if (!is_unfence_device(rsc, data_set)) {
3025 && pe_rsc_is_anon_clone(rsc->
parent)
3051 target = stonith_op->
node;
3053 for (gIter = rsc->
actions; gIter != NULL; gIter = gIter->next) {
3056 switch (action->
needs) {
3068 && !rsc_is_known_on(rsc, target)) {
3094 bool order_implicit =
false;
3101 target = stonith_op->
node;
3113 order_implicit =
true;
3116 if (action_list && order_implicit) {
3120 for (gIter = action_list; gIter != NULL; gIter = gIter->next) {
3125 __FUNCTION__, __LINE__);
3127 if (order_implicit) {
3129 __FUNCTION__, __LINE__);
3143 if (!pe_rsc_is_bundled(rsc)) {
3150 crm_notice(
"Stop of failed resource %s is implicit %s %s is fenced",
3151 rsc->
id, (order_implicit?
"after" :
"because"),
3154 crm_info(
"%s is implicit %s %s is fenced",
3155 action->
uuid, (order_implicit?
"after" :
"because"),
3215 g_list_free(action_list);
3220 for (gIter = action_list; gIter != NULL; gIter = gIter->next) {
3228 "Demote of failed resource %s is implicit after %s is fenced",
3231 pe_rsc_info(rsc,
"%s is implicit after %s is fenced",
3239 __FUNCTION__, __LINE__);
3241 if (pe_rsc_is_bundled(rsc)) {
3244 }
else if (order_implicit) {
3250 g_list_free(action_list);
3259 for (gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
3266 pe_rsc_trace(rsc,
"Skipping fencing constraints for unmanaged resource: %s", rsc->
id);
3269 native_start_constraints(rsc, stonith_op, data_set);
3270 native_stop_constraints(rsc, stonith_op, data_set);
3281 for (gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
3300 pe_rsc_trace(rsc,
"%s: preventing reload because failed", rsc->
id);
3307 pe_rsc_trace(rsc,
"%s: preventing reload because start pending", rsc->
id);
3311 }
else if (node == NULL) {
3354 for (parent = rsc; parent != NULL; parent = parent->
parent) {