34 if (running == NULL) {
54 bool any_created =
false;
56 for (GList *iter = rscs; iter != NULL; iter = iter->next) {
129 crm_debug(
"Scheduling probe of %s %s on %s",
137 add_expected_result(probe, rsc, node);
159 const char *reason = NULL;
161 CRM_CHECK((rsc != NULL) && (node != NULL),
return false);
164 reason =
"start-up probes are disabled";
172 reason =
"Pacemaker Remote nodes cannot run stonith agents";
177 reason =
"guest nodes cannot run resources containing guest nodes";
180 }
else if (rsc->is_remote_node) {
181 reason =
"Pacemaker Remote nodes cannot host remote connections";
192 reason =
"resource is inside a container";
196 reason =
"resource is orphaned";
200 reason =
"resource state is already known";
209 if (allowed == NULL) {
211 reason =
"resource has exclusive discovery but is not allowed " 217 reason =
"resource has exclusive discovery but is not enabled " 223 if (allowed == NULL) {
227 reason =
"node has discovery disabled";
236 reason =
"node's guest is stopped";
237 probe_then_start(guest, top);
240 }
else if (guest_resource_will_stop(node)) {
241 reason =
"node's guest will stop";
252 probe = probe_action(rsc, node);
259 || !pe_rsc_is_clone(top)) {
282 "Skipping probe for %s on %s because %s",
301 && (probe->
node != NULL) && (then->
node != NULL)
303 const char *op = g_hash_table_lookup(then->
meta,
"stonith_action");
312 && (probe->
node != NULL) && (then->
node != NULL)
342 GList *probes = NULL;
343 GList *then_actions = NULL;
374 if ((order->
rh_rsc != NULL)
400 order_flags = order->
flags;
405 if (probes == NULL) {
411 then_actions = g_list_prepend(NULL, order->
rh_action);
413 }
else if (order->
rh_rsc != NULL) {
416 if (then_actions == NULL) {
422 crm_trace(
"Implying 'probe then' orderings for '%s then %s' " 423 "(id=%d, type=%.6x)",
428 for (GList *probe_iter = probes; probe_iter != NULL;
429 probe_iter = probe_iter->next) {
433 for (GList *then_iter = then_actions; then_iter != NULL;
434 then_iter = then_iter->next) {
438 if (probe_needed_before_action(probe, then)) {
444 g_list_free(then_actions);
467 bool interleave =
false;
471 if ((after == NULL) || (probe == NULL) || (probe->
rsc == NULL)
483 crm_trace(
"Adding probe restart orderings for '%s@%s then %s@%s'",
484 probe->
uuid, pe__node_name(probe->
node),
485 after->
uuid, pe__node_name(after->
node));
491 && (probe->
rsc != after->
rsc)) {
493 GList *then_actions = NULL;
504 for (iter = then_actions; iter != NULL; iter = iter->next) {
512 g_list_free(then_actions);
518 if ((after->
rsc != NULL)
520 const char *interleave_s = g_hash_table_lookup(after->
rsc->
meta,
536 for (iter = after->
actions_after; iter != NULL; iter = iter->next) {
555 if ((after->
rsc == NULL)
568 && ((compatible_rsc == NULL)
569 || (compatible_rsc != after_wrapper->
action->
rsc))) {
574 crm_trace(
"Recursively adding probe restart orderings for " 575 "'%s@%s then %s@%s' (type=%#.6x)",
576 after->
uuid, pe__node_name(after->
node),
579 after_wrapper->
type);
581 add_restart_orderings_for_probe(probe, after_wrapper->
action,
data_set);
613 GList *probes = NULL;
617 g_list_foreach(rsc->
children, (GFunc) add_restart_orderings_for_rsc,
626 for (GList *iter = probes; iter != NULL; iter = iter->next) {
629 for (GList *then_iter = probe->
actions_after; then_iter != NULL;
630 then_iter = then_iter->next) {
635 clear_actions_tracking_flag(
data_set);
687 GList *actions = NULL;
688 GList *probes = NULL;
693 start = actions->data;
694 g_list_free(actions);
698 crm_err(
"No start action for %s", rsc->
id);
704 for (actions = start->actions_before; actions != NULL;
705 actions = actions->next) {
712 if (first->required_runnable_before) {
713 for (GList *clone_actions = first->actions_before;
714 clone_actions != NULL;
715 clone_actions = clone_actions->next) {
720 first->uuid, before->
action->
uuid, start->uuid);
728 crm_trace(
"Not a start op %s for %s", first->uuid, start->uuid);
731 if (first_rsc == NULL) {
735 crm_trace(
"Same parent %s for %s", first_rsc->id, start->uuid);
738 }
else if (!pe_rsc_is_clone(
uber_parent(first_rsc))) {
739 crm_trace(
"Not a clone %s for %s", first_rsc->id, start->uuid);
743 crm_err(
"Applying %s before %s %d", first->uuid, start->uuid,
746 for (GList *probe_iter = probes; probe_iter != NULL;
747 probe_iter = probe_iter->next) {
751 crm_err(
"Ordering %s before %s", first->uuid, probe->
uuid);
765 add_probe_orderings_for_stops(
data_set);
782 for (GList *iter =
data_set->
nodes; iter != NULL; iter = iter->next) {
784 const char *probed = NULL;
789 "the connection is unrecoverable", FALSE);
807 if (probed != NULL &&
crm_is_true(probed) == FALSE) {
#define CRM_CHECK(expr, failure_action)
pe_node_t * pe_find_node(GList *node_list, const char *uname)
bool pe__is_guest_or_remote_node(const pe_node_t *node)
#define pe__set_action_flags(action, flags_to_set)
pe_resource_t * container
resource_alloc_functions_t * cmds
GList * find_actions(GList *input, const char *key, const pe_node_t *on_node)
Service active and promoted.
enum rsc_role_e next_role
gboolean exclusive_discover
G_GNUC_INTERNAL bool pcmk__is_failed_remote_node(pe_node_t *node)
pe_resource_t * remote_rsc
void pcmk__schedule_probes(pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__order_vs_unfence(pe_resource_t *rsc, pe_node_t *node, pe_action_t *action, enum pe_ordering order)
bool pcmk__ends_with(const char *s, const char *match)
gboolean remote_requires_reset
const char * role2text(enum rsc_role_e role)
pe_resource_t * find_compatible_child(const pe_resource_t *local_child, const pe_resource_t *rsc, enum rsc_role_e filter, gboolean current)
#define crm_debug(fmt, args...)
pe_resource_t * uber_parent(pe_resource_t *rsc)
pe_resource_t * pe__resource_contains_guest_node(const pe_working_set_t *data_set, const pe_resource_t *rsc)
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
const char * pe_node_attribute_raw(const pe_node_t *node, const char *name)
bool pe__is_guest_node(const pe_node_t *node)
void pe__add_action_expected_result(pe_action_t *action, int expected_result)
#define pe__clear_action_flags(action, flags_to_clear)
bool pcmk__probe_resource_list(GList *rscs, pe_node_t *node)
#define crm_trace(fmt, args...)
void pe_fence_node(pe_working_set_t *data_set, pe_node_t *node, const char *reason, bool priority_delay)
Schedule a fence action for a node.
#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
gboolean order_actions(pe_action_t *lh_action, pe_action_t *rh_action, enum pe_ordering order)
pe_working_set_t * data_set
#define XML_ATTR_TE_NOWAIT
G_GNUC_INTERNAL void pcmk__new_ordering(pe_resource_t *first_rsc, char *first_task, pe_action_t *first_action, pe_resource_t *then_rsc, char *then_task, pe_action_t *then_action, uint32_t flags, pe_working_set_t *data_set)
enum pe_obj_types variant
char * pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms)
Generate an operation key (RESOURCE_ACTION_INTERVAL)
#define pe_rsc_fence_device
pe_node_t * pe_find_node_id(GList *node_list, const char *id)
gboolean rsc_discovery_enabled
void pcmk__order_probes(pe_working_set_t *data_set)
bool(* create_probe)(pe_resource_t *rsc, pe_node_t *node)
Cluster status and scheduling.
GList * ordering_constraints
void add_hash_param(GHashTable *hash, const char *name, const char *value)
bool pcmk__probe_rsc_on_node(pe_resource_t *rsc, pe_node_t *node)
#define crm_err(fmt, args...)
enum pe_action_flags flags
pe_working_set_t * cluster
gboolean crm_is_true(const char *s)
#define pe_flag_enable_unfencing
#define pe_rsc_trace(rsc, fmt, args...)
#define pe__set_order_flags(order_flags, flags_to_set)
#define XML_RSC_ATTR_INTERLEAVE
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.
pe_action_t * custom_action(pe_resource_t *rsc, char *key, const char *task, const pe_node_t *on_node, gboolean optional, gboolean foo, pe_working_set_t *data_set)
Create or update an action object.
#define XML_AGENT_ATTR_CLASS
GHashTable * allowed_nodes
#define pe_flag_startup_probes