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 %s is not explicitly allowed",
208 rsc->
id, pe__node_name(node));
212 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) {
401 (GFunc) clear_failcounts_if_orphaned,
data_set);
404 crm_trace(
"Scheduling resource actions");
426 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
511 return g_list_prepend(list,
action);
527 pe_warn(
"Scheduling node %s for fencing", pe__node_name(node));
542 bool integrity_lost =
false;
543 bool have_managed = any_managed_resources(
data_set);
544 GList *fencing_ops = NULL;
545 GList *shutdown_ops = NULL;
547 crm_trace(
"Scheduling fencing and shutdowns as needed");
549 crm_notice(
"No fencing will be done until there are resources to manage");
553 for (GList *iter =
data_set->
nodes; iter != NULL; iter = iter->next) {
568 if (needs_fencing(node, have_managed,
data_set)) {
569 fencing = schedule_fencing(node,
data_set);
575 fencing_ops = add_nondc_fencing(fencing_ops, fencing,
data_set);
578 }
else if (needs_shutdown(node)) {
585 shutdown_ops = g_list_prepend(shutdown_ops, down_op);
590 integrity_lost =
true;
591 pe_warn(
"Node %s is unclean but cannot be fenced",
592 pe__node_name(node));
596 if (integrity_lost) {
598 pe_warn(
"Resource functionality and data integrity cannot be " 599 "guaranteed (configure, enable, and test fencing to " 603 crm_notice(
"Unclean nodes will not be fenced until quorum is " 604 "attained or no-quorum-policy is set to ignore");
608 if (dc_down != NULL) {
627 }
else if (fencing_ops != NULL) {
637 g_list_free(fencing_ops);
638 g_list_free(shutdown_ops);
652 all = g_list_prepend(all, (gpointer)
"*");
660 out->
message(out, crm_map_element_name(rsc->
xml), 0, rsc, all, all);
705 crm_trace(
"Required but unrunnable actions:");
706 for (GList *iter =
data_set->
actions; iter != NULL; iter = iter->next) {
726 const char* localhost_save = NULL;
729 crm_trace(
"Reusing previously calculated cluster status");
748 if (localhost_save) {
791 schedule_resource_actions(
data_set);
798 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...)
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 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
#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
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
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)
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)
G_GNUC_INTERNAL pe_action_t * pcmk__new_shutdown_action(pe_node_t *node)
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)
pe_working_set_t * cluster
G_GNUC_INTERNAL void pcmk__sort_resources(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 pcmk__log_output_new(pcmk__output_t **out)
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