36 if (running == NULL) {
56 bool any_created =
false;
58 for (GList *iter = rscs; iter != NULL; iter = iter->next) {
80 if ((rsc1_node != NULL)
82 rsc1_node->
priv->
id) == NULL)) {
120 && (guest_node != NULL)
140 crm_debug(
"Scheduling probe of %s %s on %s",
142 pcmk__node_name(node));
149 add_expected_result(probe, rsc, node);
171 const char *reason = NULL;
177 reason =
"start-up probes are disabled";
181 if (pcmk__is_pacemaker_remote_node(node)) {
183 reason =
"Pacemaker Remote nodes cannot run stonith agents";
186 }
else if (pcmk__is_guest_or_bundle_node(node)
189 reason =
"guest nodes cannot run resources containing guest nodes";
193 reason =
"Pacemaker Remote nodes cannot host remote connections";
205 reason =
"resource is inside a container";
209 reason =
"resource is orphaned";
213 node->
priv->
id) != NULL) {
214 reason =
"resource state is already known";
225 if (allowed == NULL) {
227 reason =
"resource has exclusive discovery but is not allowed " 233 reason =
"resource has exclusive discovery but is not enabled " 239 if (allowed == NULL) {
243 reason =
"node has discovery disabled";
247 if (pcmk__is_guest_or_bundle_node(node)) {
252 reason =
"node's guest is stopped";
253 probe_then_start(guest, top);
256 }
else if (guest_resource_will_stop(node)) {
257 reason =
"node's guest will stop";
270 probe = probe_action(rsc, node);
277 if (!pcmk__is_clone(top)) {
300 "Skipping probe for %s on %s because %s",
320 && pcmk__same_node(probe->
node, then->
node)) {
321 const char *op = g_hash_table_lookup(then->
meta,
331 && (probe->
node != NULL) && (then->
node != NULL)
332 && !pcmk__same_node(probe->
node, then->
node)) {
357 iter != NULL; iter = iter->next) {
361 GList *probes = NULL;
362 GList *then_actions = NULL;
372 if ((order->
rsc1 == NULL) || (order->
rsc1 == order->
rsc2)) {
379 if (((first == NULL) && (order->
task1 == NULL))
380 || ((then == NULL) && (order->
task2 == NULL))) {
388 }
else if ((first == NULL)
398 if ((order->
rsc2 != NULL)
404 }
else if ((then == NULL)
423 order_flags = order->
flags;
429 if (probes == NULL) {
435 then_actions = g_list_prepend(NULL, then);
437 }
else if (order->
rsc2 != NULL) {
440 if (then_actions == NULL) {
446 crm_trace(
"Implying 'probe then' orderings for '%s then %s' " 447 "(id=%d, type=%.6x)",
448 ((first == NULL)? order->
task1 : first->
uuid),
449 ((then == NULL)? order->
task2 : then->
uuid),
452 for (GList *probe_iter = probes; probe_iter != NULL;
453 probe_iter = probe_iter->next) {
457 for (GList *then_iter = then_actions; then_iter != NULL;
458 then_iter = then_iter->next) {
462 if (probe_needed_before_action(probe, then)) {
468 g_list_free(then_actions);
509 crm_trace(
"Adding probe start orderings for 'unrunnable %s@%s " 510 "then instances of %s@%s'",
511 probe->
uuid, pcmk__node_name(probe->
node),
515 then_iter = then_iter->next) {
527 crm_trace(
"Adding probe start ordering for 'unrunnable %s@%s " 528 "then %s@%s' (type=%#.6x)",
529 probe->
uuid, pcmk__node_name(probe->
node),
558 bool interleave =
false;
562 if ((after == NULL) || (probe == NULL) || !pcmk__is_primitive(probe->
rsc)
573 crm_trace(
"Adding probe restart orderings for '%s@%s then %s@%s'",
574 probe->
uuid, pcmk__node_name(probe->
node),
575 after->
uuid, pcmk__node_name(after->
node));
580 if (pcmk__is_primitive(after->
rsc) && (probe->
rsc != after->
rsc)) {
582 GList *then_actions = NULL;
594 for (iter = then_actions; iter != NULL; iter = iter->next) {
602 g_list_free(then_actions);
608 if ((after->
rsc != NULL)
625 for (iter = after->
actions_after; iter != NULL; iter = iter->next) {
646 if ((after->
rsc == NULL)
649 || (after_wrapper->
action->
rsc == NULL)) {
652 chained_rsc = after_wrapper->
action->
rsc;
664 && ((compatible_rsc == NULL)
665 || (compatible_rsc != chained_rsc))) {
670 crm_trace(
"Recursively adding probe restart orderings for " 671 "'%s@%s then %s@%s' (type=%#.6x)",
672 after->
uuid, pcmk__node_name(after->
node),
675 after_wrapper->
flags);
677 add_restart_orderings_for_probe(probe, after_wrapper->
action);
691 iter != NULL; iter = iter->next) {
706 add_start_restart_orderings_for_rsc(gpointer
data, gpointer user_data)
709 GList *probes = NULL;
712 if (!pcmk__is_primitive(rsc)) {
714 add_start_restart_orderings_for_rsc, NULL);
722 for (GList *iter = probes; iter != NULL; iter = iter->next) {
725 for (GList *then_iter = probe->
actions_after; then_iter != NULL;
726 then_iter = then_iter->next) {
730 add_start_orderings_for_probe(probe, then);
731 add_restart_orderings_for_probe(probe, then->
action);
781 iter != NULL; iter = iter->next) {
785 GList *actions = NULL;
786 GList *probes = NULL;
791 start = actions->data;
792 g_list_free(actions);
802 for (actions = start->actions_before; actions != NULL;
803 actions = actions->next) {
812 clone_actions != NULL;
813 clone_actions = clone_actions->next) {
815 before = clone_actions->data;
827 crm_trace(
"Not a start op %s for %s", first->
uuid, start->uuid);
830 if (first_rsc == NULL) {
835 crm_trace(
"Same parent %s for %s", first_rsc->
id, start->uuid);
840 crm_trace(
"Not a clone %s for %s", first_rsc->
id, start->uuid);
844 crm_debug(
"Applying %s before %s", first->
uuid, start->uuid);
846 for (GList *probe_iter = probes; probe_iter != NULL;
847 probe_iter = probe_iter->next) {
864 add_start_restart_orderings_for_rsc, NULL);
865 add_probe_orderings_for_stops(
scheduler);
882 for (GList *iter =
scheduler->
nodes; iter != NULL; iter = iter->next) {
888 "the connection is unrecoverable", FALSE);
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)
enum pcmk__probe_mode probe_mode
Relation applies only if actions are on same node.
'then' is runnable (and migratable) only if 'first' is runnable
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...)
Service active and promoted.
#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)
pcmk__scheduler_private_t * priv
#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.
bool pcmk__ends_with(const char *s, const char *match)
#define pcmk__set_relation_flags(ar_flags, flags_to_set)
GList * ordering_constraints
pcmk__node_private_t * priv
#define PCMK_ACTION_DEMOTE
#define crm_debug(fmt, args...)
pcmk_scheduler_t * scheduler
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)
pcmk_node_t * pe_find_node_id(const GList *node_list, const char *id)
Find a node by ID in a list of nodes.
enum pcmk__rsc_variant variant
#define crm_trace(fmt, args...)
pcmk_node_t * assigned_node
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
#define PCMK_ACTION_START
pcmk__resource_private_t * priv
enum rsc_role_e next_role
Ordering applies only if 'first' is required and on same node as 'then'.
#define PCMK_ACTION_STONITH
bool(* create_probe)(pcmk_resource_t *rsc, pcmk_node_t *node)
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)
gboolean order_actions(pcmk_action_t *first, pcmk_action_t *then, uint32_t flags)
GHashTable * allowed_nodes
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.
#define pcmk__assert(expr)
void pe__add_action_expected_result(pcmk_action_t *action, int expected_result)
int required_runnable_before
Cluster status and scheduling.
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.
enum rsc_role_e orig_role
pcmk_resource_t * launcher
bool pcmk__probe_resource_list(GList *rscs, pcmk_node_t *node)
#define PCMK_ACTION_PROMOTE
gboolean crm_is_true(const char *s)
#define pcmk__set_action_flags(action, flags_to_set)
Resource role is unknown.
struct pcmk__node_details * details
GHashTable * probed_nodes
const pcmk__assignment_methods_t * cmds
G_GNUC_INTERNAL bool pcmk__is_failed_remote_node(const pcmk_node_t *node)
No relation (compare with equality rather than bit set)
struct pcmk__node_assignment * assign