35 if (running == NULL) {
55 bool any_created =
false;
57 for (GList *iter = rscs; iter != NULL; iter = iter->next) {
133 crm_debug(
"Scheduling probe of %s %s on %s",
141 add_expected_result(probe, rsc, node);
163 const char *reason = NULL;
168 reason =
"start-up probes are disabled";
172 if (pcmk__is_pacemaker_remote_node(node)) {
176 reason =
"Pacemaker Remote nodes cannot run stonith agents";
179 }
else if (pcmk__is_guest_or_bundle_node(node)
181 reason =
"guest nodes cannot run resources containing guest nodes";
184 }
else if (rsc->is_remote_node) {
185 reason =
"Pacemaker Remote nodes cannot host remote connections";
196 reason =
"resource is inside a container";
200 reason =
"resource is orphaned";
204 reason =
"resource state is already known";
213 if (allowed == NULL) {
215 reason =
"resource has exclusive discovery but is not allowed " 221 reason =
"resource has exclusive discovery but is not enabled " 227 if (allowed == NULL) {
231 reason =
"node has discovery disabled";
235 if (pcmk__is_guest_or_bundle_node(node)) {
240 reason =
"node's guest is stopped";
241 probe_then_start(guest, top);
244 }
else if (guest_resource_will_stop(node)) {
245 reason =
"node's guest will stop";
258 probe = probe_action(rsc, node);
265 if (!pcmk__is_clone(top)) {
288 "Skipping probe for %s on %s because %s",
308 && pcmk__same_node(probe->
node, then->
node)) {
309 const char *op = g_hash_table_lookup(then->
meta,
319 && (probe->
node != NULL) && (then->
node != NULL)
320 && !pcmk__same_node(probe->
node, then->
node)) {
349 GList *probes = NULL;
350 GList *then_actions = NULL;
360 if ((order->
rsc1 == NULL) || (order->
rsc1 == order->
rsc2)) {
367 if (((first == NULL) && (order->
task1 == NULL))
368 || ((then == NULL) && (order->
task2 == NULL))) {
376 }
else if ((first == NULL)
391 }
else if ((then == NULL)
410 order_flags = order->
flags;
416 if (probes == NULL) {
422 then_actions = g_list_prepend(NULL, then);
424 }
else if (order->
rsc2 != NULL) {
427 if (then_actions == NULL) {
433 crm_trace(
"Implying 'probe then' orderings for '%s then %s' " 434 "(id=%d, type=%.6x)",
435 ((first == NULL)? order->
task1 : first->
uuid),
436 ((then == NULL)? order->
task2 : then->
uuid),
439 for (GList *probe_iter = probes; probe_iter != NULL;
440 probe_iter = probe_iter->next) {
444 for (GList *then_iter = then_actions; then_iter != NULL;
445 then_iter = then_iter->next) {
449 if (probe_needed_before_action(probe, then)) {
455 g_list_free(then_actions);
496 crm_trace(
"Adding probe start orderings for 'unrunnable %s@%s " 497 "then instances of %s@%s'",
498 probe->
uuid, pcmk__node_name(probe->
node),
502 then_iter = then_iter->next) {
514 crm_trace(
"Adding probe start ordering for 'unrunnable %s@%s " 515 "then %s@%s' (type=%#.6x)",
516 probe->
uuid, pcmk__node_name(probe->
node),
545 bool interleave =
false;
549 if ((after == NULL) || (probe == NULL) || !pcmk__is_primitive(probe->
rsc)
560 crm_trace(
"Adding probe restart orderings for '%s@%s then %s@%s'",
561 probe->
uuid, pcmk__node_name(probe->
node),
562 after->
uuid, pcmk__node_name(after->
node));
567 if (pcmk__is_primitive(after->
rsc) && (probe->
rsc != after->
rsc)) {
569 GList *then_actions = NULL;
581 for (iter = then_actions; iter != NULL; iter = iter->next) {
589 g_list_free(then_actions);
595 if ((after->
rsc != NULL)
597 const char *interleave_s = g_hash_table_lookup(after->
rsc->
meta,
613 for (iter = after->
actions_after; iter != NULL; iter = iter->next) {
633 if ((after->
rsc == NULL)
646 && ((compatible_rsc == NULL)
647 || (compatible_rsc != after_wrapper->
action->
rsc))) {
652 crm_trace(
"Recursively adding probe restart orderings for " 653 "'%s@%s then %s@%s' (type=%#.6x)",
654 after->
uuid, pcmk__node_name(after->
node),
657 after_wrapper->
type);
659 add_restart_orderings_for_probe(probe, after_wrapper->
action);
687 add_start_restart_orderings_for_rsc(gpointer
data, gpointer user_data)
690 GList *probes = NULL;
693 if (!pcmk__is_primitive(rsc)) {
694 g_list_foreach(rsc->
children, add_start_restart_orderings_for_rsc,
703 for (GList *iter = probes; iter != NULL; iter = iter->next) {
706 for (GList *then_iter = probe->
actions_after; then_iter != NULL;
707 then_iter = then_iter->next) {
711 add_start_orderings_for_probe(probe, then);
712 add_restart_orderings_for_probe(probe, then->
action);
713 clear_actions_tracking_flag(rsc->
cluster);
765 GList *actions = NULL;
766 GList *probes = NULL;
771 start = actions->data;
772 g_list_free(actions);
782 for (actions = start->actions_before; actions != NULL;
783 actions = actions->next) {
792 clone_actions != NULL;
793 clone_actions = clone_actions->next) {
795 before = clone_actions->data;
807 crm_trace(
"Not a start op %s for %s", first->
uuid, start->uuid);
810 if (first_rsc == NULL) {
815 crm_trace(
"Same parent %s for %s", first_rsc->
id, start->uuid);
820 crm_trace(
"Not a clone %s for %s", first_rsc->
id, start->uuid);
824 crm_debug(
"Applying %s before %s %d", first->
uuid, start->uuid,
827 for (GList *probe_iter = probes; probe_iter != NULL;
828 probe_iter = probe_iter->next) {
846 add_probe_orderings_for_stops(
scheduler);
863 for (GList *iter =
scheduler->
nodes; iter != NULL; iter = iter->next) {
865 const char *probed = NULL;
870 "the connection is unrecoverable", FALSE);
889 if (probed != NULL &&
crm_is_true(probed) == FALSE) {
pcmk_assignment_methods_t * cmds
const pcmk_resource_t * pe__const_top_resource(const pcmk_resource_t *rsc, bool include_bundle)
pcmk_resource_t * pe__resource_contains_guest_node(const pcmk_scheduler_t *scheduler, const pcmk_resource_t *rsc)
Relation applies only if actions are on same node.
'then' is runnable (and migratable) only if 'first' is runnable
pcmk_scheduler_t * cluster
Actions are ordered if on same node (or migration target for migrate_to)
const char * pcmk_role_text(enum rsc_role_e role)
Get readable description of a resource role.
G_GNUC_INTERNAL void pcmk__new_ordering(pcmk_resource_t *first_rsc, char *first_task, pcmk_action_t *first_action, pcmk_resource_t *then_rsc, char *then_task, pcmk_action_t *then_action, uint32_t flags, pcmk_scheduler_t *sched)
G_GNUC_INTERNAL void pcmk__order_vs_unfence(const pcmk_resource_t *rsc, pcmk_node_t *node, pcmk_action_t *action, enum pcmk__action_relation_flags order)
pcmk_resource_t * uber_parent(pcmk_resource_t *rsc)
#define pcmk__rsc_trace(rsc, fmt, args...)
gboolean order_actions(pcmk_action_t *lh_action, pcmk_action_t *rh_action, uint32_t flags)
Service active and promoted.
enum rsc_role_e next_role
gboolean exclusive_discover
#define pcmk__insert_meta(obj, name, value)
#define PCMK_ACTION_MONITOR
bool pcmk__probe_rsc_on_node(pcmk_resource_t *rsc, pcmk_node_t *node)
G_GNUC_INTERNAL pcmk_resource_t * pcmk__find_compatible_instance(const pcmk_resource_t *match_rsc, const pcmk_resource_t *rsc, enum rsc_role_e role, bool current)
#define PCMK_META_INTERLEAVE
#define PCMK_ACTION_DO_SHUTDOWN
void pe_fence_node(pcmk_scheduler_t *scheduler, pcmk_node_t *node, const char *reason, bool priority_delay)
Schedule a fence action for a node.
#define PCMK__META_STONITH_ACTION
GList * pe__resource_actions(const pcmk_resource_t *rsc, const pcmk_node_t *node, const char *task, bool require_node)
Find all actions of given type for a resource.
pcmk_resource_t * container
bool pcmk__ends_with(const char *s, const char *match)
#define pcmk__set_relation_flags(ar_flags, flags_to_set)
gboolean remote_requires_reset
#define PCMK_ACTION_DEMOTE
#define crm_debug(fmt, args...)
Actions are ordered (optionally, if no other flags are set)
#define pcmk__clear_action_flags(action, flags_to_clear)
pcmk_node_t * pcmk__find_node_in_list(const GList *nodes, const char *node_name)
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
pcmk_node_t * pe_find_node_id(const GList *node_list, const char *id)
Find a node by ID in a list of nodes.
#define crm_trace(fmt, args...)
#define PCMK_RESOURCE_CLASS_STONITH
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
struct pe_node_shared_s * details
#define PCMK_ACTION_START
Ordering applies only if 'first' is required and on same node as 'then'.
#define PCMK_ACTION_STONITH
void pcmk__schedule_probes(pcmk_scheduler_t *scheduler)
char * pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms)
Generate an operation key (RESOURCE_ACTION_INTERVAL)
void pcmk__order_probes(pcmk_scheduler_t *scheduler)
enum pe_obj_types variant
bool(* create_probe)(pcmk_resource_t *rsc, pcmk_node_t *node)
pcmk_action_t * custom_action(pcmk_resource_t *rsc, char *key, const char *task, const pcmk_node_t *on_node, gboolean optional, pcmk_scheduler_t *scheduler)
Create or update an action object.
void pe__add_action_expected_result(pcmk_action_t *action, int expected_result)
gboolean rsc_discovery_enabled
Cluster status and scheduling.
GList * ordering_constraints
pcmk_scheduler_t * scheduler
GList * find_actions(GList *input, const char *key, const pcmk_node_t *on_node)
Relation applies only if 'first' cannot be part of a live migration.
#define PCMK__META_OP_NO_WAIT
const char * pcmk__node_attr(const pcmk_node_t *node, const char *name, const char *target, enum pcmk__rsc_node node_type)
bool pcmk__probe_resource_list(GList *rscs, pcmk_node_t *node)
pcmk_node_t * allocated_to
#define PCMK_ACTION_PROMOTE
enum pe_action_flags flags
#define pcmk__set_action_flags(action, flags_to_set)
gboolean crm_is_true(const char *s)
Resource role is unknown.
int required_runnable_before
G_GNUC_INTERNAL bool pcmk__is_failed_remote_node(const pcmk_node_t *node)
pcmk_resource_t * remote_rsc
No relation (compare with equality rather than bit set)
GHashTable * allowed_nodes
Where resource is running.