35 if (running == NULL) {
55 bool any_created =
false;
57 for (GList *iter = rscs; iter != NULL; iter = iter->next) {
96 guest_resource_will_stop(
const pe_node_t *node)
130 crm_debug(
"Scheduling probe of %s %s on %s",
138 add_expected_result(probe, rsc, node);
160 const char *reason = NULL;
162 CRM_CHECK((rsc != NULL) && (node != NULL),
return false);
165 reason =
"start-up probes are disabled";
173 reason =
"Pacemaker Remote nodes cannot run stonith agents";
178 reason =
"guest nodes cannot run resources containing guest nodes";
181 }
else if (rsc->is_remote_node) {
182 reason =
"Pacemaker Remote nodes cannot host remote connections";
193 reason =
"resource is inside a container";
197 reason =
"resource is orphaned";
201 reason =
"resource state is already known";
210 if (allowed == NULL) {
212 reason =
"resource has exclusive discovery but is not allowed " 218 reason =
"resource has exclusive discovery but is not enabled " 224 if (allowed == NULL) {
228 reason =
"node has discovery disabled";
237 reason =
"node's guest is stopped";
238 probe_then_start(guest, top);
241 }
else if (guest_resource_will_stop(node)) {
242 reason =
"node's guest will stop";
253 probe = probe_action(rsc, node);
260 if (!pe_rsc_is_clone(top)) {
283 "Skipping probe for %s on %s because %s",
302 && (probe->
node != NULL) && (then->
node != NULL)
304 const char *op = g_hash_table_lookup(then->
meta,
"stonith_action");
313 && (probe->
node != NULL) && (then->
node != NULL)
343 GList *probes = NULL;
344 GList *then_actions = NULL;
375 if ((order->
rh_rsc != NULL)
401 order_flags = order->
flags;
406 if (probes == NULL) {
412 then_actions = g_list_prepend(NULL, order->
rh_action);
414 }
else if (order->
rh_rsc != NULL) {
417 if (then_actions == NULL) {
423 crm_trace(
"Implying 'probe then' orderings for '%s then %s' " 424 "(id=%d, type=%.6x)",
429 for (GList *probe_iter = probes; probe_iter != NULL;
430 probe_iter = probe_iter->next) {
434 for (GList *then_iter = then_actions; then_iter != NULL;
435 then_iter = then_iter->next) {
439 if (probe_needed_before_action(probe, then)) {
445 g_list_free(then_actions);
484 crm_trace(
"Adding probe start orderings for '%s@%s (%s) " 485 "then instances of %s@%s'",
486 probe->
uuid, pe__node_name(probe->
node),
491 then_iter = then_iter->next) {
502 crm_trace(
"Adding probe start ordering for '%s@%s (%s) " 503 "then %s@%s' (type=%#.6x)",
504 probe->
uuid, pe__node_name(probe->
node),
536 bool interleave =
false;
540 if ((after == NULL) || (probe == NULL) || (probe->
rsc == NULL)
552 crm_trace(
"Adding probe restart orderings for '%s@%s then %s@%s'",
553 probe->
uuid, pe__node_name(probe->
node),
554 after->
uuid, pe__node_name(after->
node));
560 && (probe->
rsc != after->
rsc)) {
562 GList *then_actions = NULL;
573 for (iter = then_actions; iter != NULL; iter = iter->next) {
581 g_list_free(then_actions);
587 if ((after->
rsc != NULL)
589 const char *interleave_s = g_hash_table_lookup(after->
rsc->
meta,
605 for (iter = after->
actions_after; iter != NULL; iter = iter->next) {
624 if ((after->
rsc == NULL)
637 && ((compatible_rsc == NULL)
638 || (compatible_rsc != after_wrapper->
action->
rsc))) {
643 crm_trace(
"Recursively adding probe restart orderings for " 644 "'%s@%s then %s@%s' (type=%#.6x)",
645 after->
uuid, pe__node_name(after->
node),
648 after_wrapper->
type);
650 add_restart_orderings_for_probe(probe, after_wrapper->
action,
data_set);
683 GList *probes = NULL;
688 (GFunc) add_start_restart_orderings_for_rsc,
data_set);
696 for (GList *iter = probes; iter != NULL; iter = iter->next) {
699 for (GList *then_iter = probe->
actions_after; then_iter != NULL;
700 then_iter = then_iter->next) {
704 add_start_orderings_for_probe(probe, then);
706 clear_actions_tracking_flag(
data_set);
758 GList *actions = NULL;
759 GList *probes = NULL;
764 start = actions->data;
765 g_list_free(actions);
769 crm_err(
"No start action for %s", rsc->
id);
775 for (actions = start->actions_before; actions != NULL;
776 actions = actions->next) {
783 if (first->required_runnable_before) {
784 for (GList *clone_actions = first->actions_before;
785 clone_actions != NULL;
786 clone_actions = clone_actions->next) {
791 first->uuid, before->
action->
uuid, start->uuid);
799 crm_trace(
"Not a start op %s for %s", first->uuid, start->uuid);
802 if (first_rsc == NULL) {
807 crm_trace(
"Same parent %s for %s", first_rsc->id, start->uuid);
812 crm_trace(
"Not a clone %s for %s", first_rsc->id, start->uuid);
816 crm_err(
"Applying %s before %s %d", first->uuid, start->uuid,
819 for (GList *probe_iter = probes; probe_iter != NULL;
820 probe_iter = probe_iter->next) {
824 crm_err(
"Ordering %s before %s", first->uuid, probe->
uuid);
837 (GFunc) add_start_restart_orderings_for_rsc,
data_set);
838 add_probe_orderings_for_stops(
data_set);
855 for (GList *iter =
data_set->
nodes; iter != NULL; iter = iter->next) {
857 const char *probed = NULL;
862 "the connection is unrecoverable", FALSE);
880 if (probed != NULL &&
crm_is_true(probed) == FALSE) {
#define CRM_CHECK(expr, failure_action)
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
G_GNUC_INTERNAL pe_resource_t * pcmk__find_compatible_instance(const pe_resource_t *match_rsc, const pe_resource_t *rsc, enum rsc_role_e role, bool current)
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
pe_resource_t * remote_rsc
void pcmk__schedule_probes(pe_working_set_t *data_set)
const pe_resource_t * pe__const_top_resource(const pe_resource_t *rsc, bool include_bundle)
bool pcmk__ends_with(const char *s, const char *match)
gboolean remote_requires_reset
const char * role2text(enum rsc_role_e role)
G_GNUC_INTERNAL bool pcmk__is_failed_remote_node(const pe_node_t *node)
#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)
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)
pe_node_t * pe_find_node_id(const GList *node_list, const char *id)
Find a node by ID in a list of nodes.
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...)
pe_node_t * pe_find_node(const GList *node_list, const char *node_name)
Find a node by name in a list of nodes.
enum pe_action_flags flags
pe_working_set_t * cluster
G_GNUC_INTERNAL void pcmk__order_vs_unfence(const pe_resource_t *rsc, pe_node_t *node, pe_action_t *action, enum pe_ordering order)
gboolean crm_is_true(const char *s)
#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