45 const char *reason = NULL;
52 reason =
"action definition changed";
59 switch (digest_data->
rc) {
61 crm_trace(
"Resource %s history entry %s on %s has " 62 "no digest to compare",
68 reason =
"resource parameters have changed";
112 g_list_foreach(rsc->
children, (GFunc) check_failure_threshold,
116 }
else if (failcount_clear_action_exists(node, rsc)) {
159 g_list_foreach(rsc->
children, (GFunc) apply_exclusive_discovery,
207 "Ignoring %s stickiness because the cluster is " 208 "asymmetric and %s is not explicitly allowed",
209 rsc->
id, pe__node_name(node));
213 pe_rsc_debug(rsc,
"Resource %s has %d stickiness on %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'",
332 crm_element_name(rsc->
xml), rsc->
id);
353 crm_trace(
"Clear fail counts for orphaned resource %s", rsc->
id);
359 for (GList *iter =
data_set->
nodes; iter != NULL; iter = iter->next) {
400 (GFunc) clear_failcounts_if_orphaned,
data_set);
403 crm_trace(
"Scheduling resource actions");
425 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
445 iter != NULL; iter = iter->next) {
464 needs_fencing(
const pe_node_t *node,
bool have_managed,
514 return g_list_prepend(list,
action);
530 pe_warn(
"Scheduling node %s for fencing", pe__node_name(node));
545 bool integrity_lost =
false;
546 bool have_managed = any_managed_resources(
data_set);
547 GList *fencing_ops = NULL;
548 GList *shutdown_ops = NULL;
550 crm_trace(
"Scheduling fencing and shutdowns as needed");
552 crm_notice(
"No fencing will be done until there are resources to manage");
556 for (GList *iter =
data_set->
nodes; iter != NULL; iter = iter->next) {
571 if (needs_fencing(node, have_managed,
data_set)) {
572 fencing = schedule_fencing(node,
data_set);
578 fencing_ops = add_nondc_fencing(fencing_ops, fencing,
data_set);
581 }
else if (needs_shutdown(node)) {
588 shutdown_ops = g_list_prepend(shutdown_ops, down_op);
593 integrity_lost =
true;
594 pe_warn(
"Node %s is unclean but cannot be fenced",
595 pe__node_name(node));
599 if (integrity_lost) {
601 pe_warn(
"Resource functionality and data integrity cannot be " 602 "guaranteed (configure, enable, and test fencing to " 606 crm_notice(
"Unclean nodes will not be fenced until quorum is " 607 "attained or no-quorum-policy is set to ignore");
611 if (dc_down != NULL) {
630 }
else if (fencing_ops != NULL) {
640 g_list_free(fencing_ops);
641 g_list_free(shutdown_ops);
655 all = g_list_prepend(all, (gpointer)
"*");
663 out->
message(out, crm_map_element_name(rsc->
xml), 0, rsc, all, all);
708 crm_trace(
"Required but unrunnable actions:");
710 iter != NULL; iter = iter->next) {
731 const char* localhost_save = NULL;
734 crm_trace(
"Reusing previously calculated cluster status");
753 if (localhost_save) {
796 schedule_resource_actions(
data_set);
803 schedule_fencing_and_shutdowns(
data_set);
void(* end_list)(pcmk__output_t *out)
#define crm_notice(fmt, args...)
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,...)
void pe__foreach_param_check(pe_working_set_t *data_set, void(*cb)(pe_resource_t *, pe_node_t *, const xmlNode *, enum pe_check_parameters))
#define pe_flag_concurrent_fencing
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__log_action(const char *pre_text, const pe_action_t *action, bool details)
gboolean exclusive_discover
G_GNUC_INTERNAL void pcmk__apply_node_health(pe_working_set_t *data_set)
#define pe_flag_have_status
const pe_resource_t * pe__const_top_resource(const pe_resource_t *rsc, bool include_bundle)
pe_node_t * partial_migration_target
void resource_location(pe_resource_t *rsc, const pe_node_t *node, int score, const char *tag, pe_working_set_t *data_set)
void pcmk__output_set_log_level(pcmk__output_t *out, uint8_t log_level)
#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
pe_node_t *(* assign)(pe_resource_t *rsc, const pe_node_t *prefer)
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
G_GNUC_INTERNAL bool pcmk__check_action_config(pe_resource_t *rsc, pe_node_t *node, const xmlNode *xml_op)
bool pe_can_fence(const pe_working_set_t *data_set, const pe_node_t *node)
bool pe__is_guest_node(const pe_node_t *node)
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.
CRM_TRACE_INIT_DATA(pacemaker)
pe_action_t * pe__clear_failcount(pe_resource_t *rsc, const pe_node_t *node, const char *reason, pe_working_set_t *data_set)
Schedule a controller operation to clear a fail count.
void set_working_set_defaults(pe_working_set_t *data_set)
struct pe_node_shared_s * details
gboolean order_actions(pe_action_t *lh_action, pe_action_t *rh_action, enum pe_ordering order)
void pcmk__register_lib_messages(pcmk__output_t *out)
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)
void(* create_actions)(pe_resource_t *rsc)
#define pe_flag_stonith_enabled
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)
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)
void pe__register_messages(pcmk__output_t *out)
const char * placement_strategy
void pe__free_param_checks(pe_working_set_t *data_set)
void pcmk__output_free(pcmk__output_t *out)
G_GNUC_INTERNAL void pcmk__fence_guest(pe_node_t *node)
unsigned int get_crm_log_level(void)
void pcmk__schedule_actions(xmlNode *cib, unsigned long long flags, pe_working_set_t *data_set)
#define pe_flag_quick_location
Cluster status and scheduling.
G_GNUC_INTERNAL void pcmk__handle_rsc_config_changes(pe_working_set_t *data_set)
G_GNUC_INTERNAL pe_action_t * pcmk__new_shutdown_action(pe_node_t *node)
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)
G_GNUC_INTERNAL bool pcmk__threshold_reached(pe_resource_t *rsc, const pe_node_t *node, pe_resource_t **failed)
pe_working_set_t * cluster
G_GNUC_INTERNAL void pcmk__sort_resources(pe_working_set_t *data_set)
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.
int pe_get_failcount(const pe_node_t *node, pe_resource_t *rsc, time_t *last_failure, uint32_t flags, const xmlNode *xml_op)
op_digest_cache_t * rsc_action_digest_cmp(pe_resource_t *rsc, const xmlNode *xml_op, pe_node_t *node, pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__apply_orderings(pe_working_set_t *data_set)
int pcmk__log_output_new(pcmk__output_t **out)
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