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";
176 reason =
"Pacemaker Remote nodes cannot run stonith agents";
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";
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 (!pe_rsc_is_clone(top)) {
288 "Skipping probe for %s on %s because %s",
308 && pe__same_node(probe->
node, then->
node)) {
309 const char *op = g_hash_table_lookup(then->
meta,
"stonith_action");
318 && (probe->
node != NULL) && (then->
node != NULL)
319 && !pe__same_node(probe->
node, then->
node)) {
348 GList *probes = NULL;
349 GList *then_actions = NULL;
375 }
else if ((first == NULL)
385 if ((order->
rh_rsc != NULL)
391 }
else if ((then == NULL)
409 order_flags = order->
flags;
415 if (probes == NULL) {
421 then_actions = g_list_prepend(NULL, then);
423 }
else if (order->
rh_rsc != NULL) {
426 if (then_actions == NULL) {
432 crm_trace(
"Implying 'probe then' orderings for '%s then %s' " 433 "(id=%d, type=%.6x)",
438 for (GList *probe_iter = probes; probe_iter != NULL;
439 probe_iter = probe_iter->next) {
443 for (GList *then_iter = then_actions; then_iter != NULL;
444 then_iter = then_iter->next) {
448 if (probe_needed_before_action(probe, then)) {
454 g_list_free(then_actions);
495 crm_trace(
"Adding probe start orderings for 'unrunnable %s@%s " 496 "then instances of %s@%s'",
497 probe->
uuid, pe__node_name(probe->
node),
501 then_iter = then_iter->next) {
513 crm_trace(
"Adding probe start ordering for 'unrunnable %s@%s " 514 "then %s@%s' (type=%#.6x)",
515 probe->
uuid, pe__node_name(probe->
node),
543 bool interleave =
false;
547 if ((after == NULL) || (probe == NULL) || (probe->
rsc == NULL)
559 crm_trace(
"Adding probe restart orderings for '%s@%s then %s@%s'",
560 probe->
uuid, pe__node_name(probe->
node),
561 after->
uuid, pe__node_name(after->
node));
566 if ((after->
rsc != NULL)
568 && (probe->
rsc != after->
rsc)) {
570 GList *then_actions = NULL;
582 for (iter = then_actions; iter != NULL; iter = iter->next) {
590 g_list_free(then_actions);
596 if ((after->
rsc != NULL)
598 const char *interleave_s = g_hash_table_lookup(after->
rsc->
meta,
614 for (iter = after->
actions_after; iter != NULL; iter = iter->next) {
634 if ((after->
rsc == NULL)
647 && ((compatible_rsc == NULL)
648 || (compatible_rsc != after_wrapper->
action->
rsc))) {
653 crm_trace(
"Recursively adding probe restart orderings for " 654 "'%s@%s then %s@%s' (type=%#.6x)",
655 after->
uuid, pe__node_name(after->
node),
658 after_wrapper->
type);
660 add_restart_orderings_for_probe(probe, after_wrapper->
action);
688 add_start_restart_orderings_for_rsc(gpointer
data, gpointer user_data)
691 GList *probes = NULL;
695 g_list_foreach(rsc->
children, add_start_restart_orderings_for_rsc,
704 for (GList *iter = probes; iter != NULL; iter = iter->next) {
707 for (GList *then_iter = probe->
actions_after; then_iter != NULL;
708 then_iter = then_iter->next) {
712 add_start_orderings_for_probe(probe, then);
713 add_restart_orderings_for_probe(probe, then->
action);
714 clear_actions_tracking_flag(rsc->
cluster);
766 GList *actions = NULL;
767 GList *probes = NULL;
772 start = actions->data;
773 g_list_free(actions);
777 crm_err(
"No start action for %s", rsc->
id);
783 for (actions = start->actions_before; actions != NULL;
784 actions = actions->next) {
793 clone_actions != NULL;
794 clone_actions = clone_actions->next) {
796 before = clone_actions->data;
808 crm_trace(
"Not a start op %s for %s", first->
uuid, start->uuid);
811 if (first_rsc == NULL) {
816 crm_trace(
"Same parent %s for %s", first_rsc->
id, start->uuid);
821 crm_trace(
"Not a clone %s for %s", first_rsc->
id, start->uuid);
825 crm_err(
"Applying %s before %s %d", first->
uuid, start->uuid,
828 for (GList *probe_iter = probes; probe_iter != NULL;
829 probe_iter = probe_iter->next) {
847 add_probe_orderings_for_stops(
scheduler);
864 for (GList *iter =
scheduler->
nodes; iter != NULL; iter = iter->next) {
866 const char *probed = NULL;
871 "the connection is unrecoverable", FALSE);
889 if (probed != NULL &&
crm_is_true(probed) == FALSE) {
pcmk_assignment_methods_t * cmds
Resource assignment methods.
const pcmk_resource_t * pe__const_top_resource(const pcmk_resource_t *rsc, bool include_bundle)
pcmk_action_t * lh_action
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.
GHashTable * known_on
Nodes where resource has been probed (key is node ID, not name)
'then' is runnable (and migratable) only if 'first' is runnable
bool pe__is_guest_or_remote_node(const pcmk_node_t *node)
pcmk_scheduler_t * cluster
Cluster that resource is part of.
Actions are ordered if on same node (or migration target for migrate_to)
Whether action should not be executed.
#define pe__set_action_flags(action, flags_to_set)
const char * pe_node_attribute_raw(const pcmk_node_t *node, const char *name)
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)
pcmk_action_t * rh_action
Whether action has already been processed by a recursive procedure.
enum rsc_role_e role
Resource's current role.
GList * children
Resource's child resources, if any.
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
Resource's scheduled next role.
gboolean exclusive_discover
Whether exclusive probing is enabled.
Implementation of pcmk_action_t.
#define PCMK_ACTION_MONITOR
GHashTable * meta
Resource's meta-attributes.
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_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.
GList * actions
Scheduled actions.
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
Resource containing this one, if any.
Always probe resource on node.
bool pcmk__ends_with(const char *s, const char *match)
Implementation of pcmk_scheduler_t.
gboolean remote_requires_reset
GList * resources
Resources in cluster.
GList * nodes
Nodes in cluster.
const char * role2text(enum rsc_role_e role)
#define PCMK_ACTION_DEMOTE
pcmk_resource_t * parent
Resource's parent resource, if any.
pcmk_node_t * node
Node to execute action on, if any.
Implementation of pcmk_resource_t.
#define crm_debug(fmt, args...)
Actions are ordered (optionally, if no other flags are set)
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.
Whether resource is considered failed.
GList * actions_after
For Pacemaker use only.
#define pe__clear_action_flags(action, flags_to_clear)
#define crm_trace(fmt, args...)
#define PCMK_RESOURCE_CLASS_STONITH
pcmk_node_t * pe_find_node(const GList *node_list, const char *node_name)
Find a node by name in a list of nodes.
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
GHashTable * meta
Meta-attributes relevant to action.
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
struct pe_node_shared_s * details
Basic node information.
#define PCMK_ACTION_START
unsigned long long flags
Group of enum pcmk_rsc_flags.
const char * uname
Node name in cluster.
#define XML_ATTR_TE_NOWAIT
Ordering applies only if 'first' is required and on same node as 'then'.
#define PCMK_ACTION_STONITH
Never probe resource on 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)
Implementation of pcmk_node_t.
enum pe_obj_types variant
Resource variant.
bool(* create_probe)(pcmk_resource_t *rsc, pcmk_node_t *node)
int rsc_discover_mode
Probe mode (enum pe_discover_e)
const char * id
Node ID at the cluster layer.
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
Whether probes are allowed on node.
bool pe__is_guest_node(const pcmk_node_t *node)
Cluster status and scheduling.
gboolean is_remote_node
Whether this is a remote connection.
GList * ordering_constraints
Ordering constraints.
Whether action is runnable.
void add_hash_param(GHashTable *hash, const char *name, const char *value)
#define crm_err(fmt, args...)
pcmk_scheduler_t * scheduler
Whether action does not require invoking an agent.
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.
bool pcmk__probe_resource_list(GList *rscs, pcmk_node_t *node)
pcmk_node_t * allocated_to
Node resource is assigned to.
#define PCMK_ACTION_PROMOTE
GList * running_on
Nodes where resource may be active.
enum pe_action_flags flags
Group of enum pe_action_flags.
gboolean crm_is_true(const char *s)
pcmk_resource_t * rsc
Resource to apply action to, if any.
Resource role is unknown.
#define pe_rsc_trace(rsc, fmt, args...)
#define pe__set_order_flags(order_flags, flags_to_set)
unsigned long long flags
Group of enum pcmk_scheduler_flags.
#define XML_RSC_ATTR_INTERLEAVE
gboolean unclean
Whether node requires fencing.
Whether resource has been removed from the configuration.
gboolean online
Whether online.
GList * actions_before
For Pacemaker use only.
int required_runnable_before
G_GNUC_INTERNAL bool pcmk__is_failed_remote_node(const pcmk_node_t *node)
pcmk_resource_t * remote_rsc
Remote connection resource for node, if it is a Pacemaker Remote node.
No relation (compare with equality rather than bit set)
#define XML_AGENT_ATTR_CLASS
char * id
Resource ID in configuration.
GHashTable * allowed_nodes
Nodes where resource may run (key is node ID, not name)