46 const char *reason = NULL;
54 reason =
"action definition changed";
60 switch (digest_data->
rc) {
62 crm_trace(
"Resource %s history entry %s on %s has " 63 "no digest to compare",
69 reason =
"resource parameters have changed";
113 g_list_foreach(rsc->
children, (GFunc) check_failure_threshold,
117 }
else if (failcount_clear_action_exists(node, rsc)) {
159 g_list_foreach(rsc->
children, (GFunc) apply_exclusive_discovery, node);
206 "Ignoring %s stickiness because the cluster is " 207 "asymmetric and node %s is not explicitly allowed",
212 pe_rsc_debug(rsc,
"Resource %s has %d stickiness on node %s",
251 for (GList *iter =
data_set->
nodes; iter != NULL; iter = iter->next) {
273 crm_trace(
"Applying node-specific scheduling criteria");
280 node_iter = node_iter->next) {
282 rsc_iter = rsc_iter->next) {
286 check_failure_threshold(rsc, node);
287 apply_exclusive_discovery(rsc, node);
303 crm_trace(
"Allocating resources to nodes");
319 pe_rsc_trace(rsc,
"Allocating remote connection resource '%s'",
333 crm_element_name(rsc->
xml), rsc->
id);
354 crm_trace(
"Clear fail counts for orphaned resource %s", rsc->
id);
360 for (GList *iter =
data_set->
nodes; iter != NULL; iter = iter->next) {
402 (GFunc) clear_failcounts_if_orphaned,
data_set);
405 crm_trace(
"Scheduling resource actions");
427 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
512 return g_list_prepend(list,
action);
543 bool integrity_lost =
false;
544 bool have_managed = any_managed_resources(
data_set);
545 GList *fencing_ops = NULL;
546 GList *shutdown_ops = NULL;
548 crm_trace(
"Scheduling fencing and shutdowns as needed");
550 crm_notice(
"No fencing will be done until there are resources to manage");
554 for (GList *iter =
data_set->
nodes; iter != NULL; iter = iter->next) {
569 if (needs_fencing(node, have_managed,
data_set)) {
570 fencing = schedule_fencing(node,
data_set);
576 fencing_ops = add_nondc_fencing(fencing_ops, fencing,
data_set);
579 }
else if (needs_shutdown(node)) {
586 shutdown_ops = g_list_prepend(shutdown_ops, down_op);
591 integrity_lost =
true;
592 pe_warn(
"Node %s is unclean but cannot be fenced",
597 if (integrity_lost) {
599 pe_warn(
"Resource functionality and data integrity cannot be " 600 "guaranteed (configure, enable, and test fencing to " 604 crm_notice(
"Unclean nodes will not be fenced until quorum is " 605 "attained or no-quorum-policy is set to ignore");
609 if (dc_down != NULL) {
628 }
else if (fencing_ops != NULL) {
638 g_list_free(fencing_ops);
639 g_list_free(shutdown_ops);
653 all = g_list_prepend(all, (gpointer)
"*");
661 out->
message(out, crm_map_element_name(rsc->
xml), 0, rsc, all, all);
704 crm_trace(
"Required but unrunnable actions:");
705 for (GList *iter =
data_set->
actions; iter != NULL; iter = iter->next) {
726 crm_trace(
"Reusing previously calculated cluster status");
780 schedule_resource_actions(
data_set);
787 schedule_fencing_and_shutdowns(
data_set);
void(* end_list)(pcmk__output_t *out)
void pe__foreach_param_check(pe_working_set_t *data_set, void(*cb)(pe_resource_t *, pe_node_t *, xmlNode *, enum pe_check_parameters, pe_working_set_t *))
#define crm_notice(fmt, args...)
pcmk__output_t * pcmk__new_logger(void)
bool pe__is_guest_or_remote_node(const pe_node_t *node)
#define pe_rsc_debug(rsc, fmt, args...)
G_GNUC_INTERNAL void pcmk__show_node_capacities(const char *desc, pe_working_set_t *data_set)
int(* message)(pcmk__output_t *out, const char *message_id,...)
#define pe_flag_concurrent_fencing
void pcmk__output_set_log_level(pcmk__output_t *out, int log_level)
resource_alloc_functions_t * cmds
#define pe_flag_symmetric_cluster
G_GNUC_INTERNAL void pcmk__set_allocation_methods(pe_working_set_t *data_set)
#define pe_flag_no_compat
G_GNUC_INTERNAL void pcmk__new_ordering(pe_resource_t *lh_rsc, char *lh_task, pe_action_t *lh_action, pe_resource_t *rh_rsc, char *rh_task, pe_action_t *rh_action, enum pe_ordering type, pe_working_set_t *data_set)
G_GNUC_INTERNAL bool pcmk__threshold_reached(pe_resource_t *rsc, pe_node_t *node, pe_resource_t **failed)
gboolean exclusive_discover
G_GNUC_INTERNAL void pcmk__apply_node_health(pe_working_set_t *data_set)
#define pe_flag_have_status
void resource_location(pe_resource_t *rsc, pe_node_t *node, int score, const char *tag, pe_working_set_t *data_set)
G_GNUC_INTERNAL bool pcmk__check_action_config(pe_resource_t *rsc, pe_node_t *node, xmlNode *xml_op)
pe_node_t * partial_migration_target
pe_node_t *(* allocate)(pe_resource_t *, pe_node_t *, pe_working_set_t *)
#define pe_flag_have_quorum
#define pe_flag_check_config
G_GNUC_INTERNAL void pcmk__order_vs_fence(pe_action_t *stonith_op, pe_working_set_t *data_set)
gboolean remote_requires_reset
G_GNUC_INTERNAL void pcmk__apply_locations(pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__schedule_probes(pe_working_set_t *data_set)
#define CRM_OP_CLEAR_FAILCOUNT
#define pe_flag_have_remote_nodes
pe_resource_t * uber_parent(pe_resource_t *rsc)
bool pe__is_guest_node(const pe_node_t *node)
void pcmk__schedule_actions(xmlNode *cib, unsigned long long flags, pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__order_remote_connection_actions(pe_working_set_t *data_set)
#define crm_trace(fmt, args...)
enum rsc_digest_cmp_val rc
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
void set_working_set_defaults(pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__log_action(const char *pre_text, pe_action_t *action, bool details)
struct pe_node_shared_s * details
G_GNUC_INTERNAL pe_action_t * pcmk__new_shutdown_action(pe_node_t *node, pe_working_set_t *data_set)
gboolean order_actions(pe_action_t *lh_action, pe_action_t *rh_action, enum pe_ordering order)
pe_working_set_t * data_set
void pcmk__unpack_constraints(pe_working_set_t *data_set)
Wrappers for and extensions to libxml2.
void(* finish)(pcmk__output_t *out, crm_exit_t exit_status, bool print, void **copy_dest)
#define pe_flag_stonith_enabled
G_GNUC_INTERNAL void pcmk__create_internal_constraints(pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__order_after_each(pe_action_t *after, GList *list)
G_GNUC_INTERNAL void pcmk__output_actions(pe_working_set_t *data_set)
const char * placement_strategy
void pe__free_param_checks(pe_working_set_t *data_set)
void pcmk__output_free(pcmk__output_t *out)
bool pe_can_fence(pe_working_set_t *data_set, pe_node_t *node)
unsigned int get_crm_log_level(void)
#define pe_flag_quick_location
Cluster status and scheduling.
G_GNUC_INTERNAL void pcmk__handle_rsc_config_changes(pe_working_set_t *data_set)
pe_action_t * pe__clear_failcount(pe_resource_t *rsc, pe_node_t *node, const char *reason, pe_working_set_t *data_set)
Schedule a controller operation to clear a fail count.
op_digest_cache_t * rsc_action_digest_cmp(pe_resource_t *rsc, xmlNode *xml_op, pe_node_t *node, pe_working_set_t *data_set)
gboolean cluster_status(pe_working_set_t *data_set)
This structure contains everything that makes up a single output formatter.
G_GNUC_INTERNAL void pcmk__create_graph(pe_working_set_t *data_set)
void(* begin_list)(pcmk__output_t *out, const char *singular_noun, const char *plural_noun, const char *format,...) G_GNUC_PRINTF(4
#define pe__set_working_set_flags(working_set, flags_to_set)
void(* create_actions)(pe_resource_t *, pe_working_set_t *)
pe_working_set_t * cluster
G_GNUC_INTERNAL void pcmk__sort_resources(pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__fence_guest(pe_node_t *node, pe_working_set_t *data_set)
CRM_TRACE_INIT_DATA(pacemaker)
void(* shutdown_lock)(pe_resource_t *rsc)
#define pe_rsc_trace(rsc, fmt, args...)
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.
G_GNUC_INTERNAL void pcmk__apply_orderings(pe_working_set_t *data_set)
int pe_get_failcount(pe_node_t *node, pe_resource_t *rsc, time_t *last_failure, uint32_t flags, xmlNode *xml_op, pe_working_set_t *data_set)
pe_action_t * pe_fence_op(pe_node_t *node, const char *op, bool optional, const char *reason, bool priority_delay, pe_working_set_t *data_set)
#define pe_flag_shutdown_lock
GHashTable * allowed_nodes
#define pe_flag_startup_probes
#define pe_flag_stop_rsc_orphans