46 const char *reason = NULL;
54 reason =
"action definition changed";
61 switch (digest_data->
rc) {
63 crm_trace(
"Resource %s history entry %s on %s has " 64 "no digest to compare",
70 reason =
"resource parameters have changed";
91 failcount_clear_action_exists(
const pcmk_node_t *node,
112 check_failure_threshold(gpointer
data, gpointer user_data)
119 g_list_foreach(rsc->
children, check_failure_threshold, user_data);
123 if (!failcount_clear_action_exists(node, rsc)) {
156 apply_exclusive_discovery(gpointer
data, gpointer user_data)
166 g_list_foreach(rsc->
children, apply_exclusive_discovery, user_data);
184 apply_stickiness(gpointer
data, gpointer user_data)
191 g_list_foreach(rsc->
children, apply_stickiness, NULL);
214 "Ignoring %s stickiness because the cluster is " 215 "asymmetric and %s is not explicitly allowed",
216 rsc->
id, pe__node_name(node));
220 pe_rsc_debug(rsc,
"Resource %s has %d stickiness on %s",
258 for (GList *iter =
scheduler->
nodes; iter != NULL; iter = iter->next) {
280 crm_trace(
"Applying node-specific scheduling criteria");
287 node_iter = node_iter->next) {
289 rsc_iter = rsc_iter->next) {
290 check_failure_threshold(rsc_iter->data, node_iter->data);
291 apply_exclusive_discovery(rsc_iter->data, node_iter->data);
307 crm_trace(
"Assigning resources to nodes");
324 pe_rsc_trace(rsc,
"Assigning remote connection resource '%s'",
337 rsc->
xml->name, rsc->
id);
353 clear_failcounts_if_orphaned(gpointer
data, gpointer user_data)
360 crm_trace(
"Clear fail counts for orphaned resource %s", rsc->
id);
366 for (GList *iter = rsc->
cluster->
nodes; iter != NULL; iter = iter->next) {
411 crm_trace(
"Scheduling resource actions");
433 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
453 iter != NULL; iter = iter->next) {
471 needs_fencing(
const pcmk_node_t *node,
bool have_managed)
520 return g_list_prepend(list,
action);
535 pe_warn(
"Scheduling node %s for fencing", pe__node_name(node));
550 bool integrity_lost =
false;
551 bool have_managed = any_managed_resources(
scheduler);
552 GList *fencing_ops = NULL;
553 GList *shutdown_ops = NULL;
555 crm_trace(
"Scheduling fencing and shutdowns as needed");
557 crm_notice(
"No fencing will be done until there are resources " 562 for (GList *iter =
scheduler->
nodes; iter != NULL; iter = iter->next) {
577 if (needs_fencing(node, have_managed)) {
578 fencing = schedule_fencing(node);
584 fencing_ops = add_nondc_fencing(fencing_ops, fencing,
588 }
else if (needs_shutdown(node)) {
595 shutdown_ops = g_list_prepend(shutdown_ops, down_op);
600 integrity_lost =
true;
601 pe_warn(
"Node %s is unclean but cannot be fenced",
602 pe__node_name(node));
606 if (integrity_lost) {
608 pe_warn(
"Resource functionality and data integrity cannot be " 609 "guaranteed (configure, enable, and test fencing to " 613 crm_notice(
"Unclean nodes will not be fenced until quorum is " 614 "attained or no-quorum-policy is set to ignore");
618 if (dc_down != NULL) {
638 }
else if (fencing_ops != NULL) {
648 g_list_free(fencing_ops);
649 g_list_free(shutdown_ops);
662 all = g_list_prepend(all, (gpointer)
"*");
670 out->
message(out, crm_map_element_name(rsc->
xml), 0, rsc, all, all);
717 crm_trace(
"Required but unrunnable actions:");
719 iter != NULL; iter = iter->next) {
740 const char* localhost_save = NULL;
743 crm_trace(
"Reusing previously calculated cluster status");
762 if (localhost_save) {
812 schedule_fencing_and_shutdowns(
scheduler);
pcmk_assignment_methods_t * cmds
Resource assignment methods.
const pcmk_resource_t * pe__const_top_resource(const pcmk_resource_t *rsc, bool include_bundle)
void(* end_list)(pcmk__output_t *out)
bool pe_can_fence(const pcmk_scheduler_t *scheduler, const pcmk_node_t *node)
G_GNUC_INTERNAL void pcmk__order_after_each(pcmk_action_t *after, GList *list)
G_GNUC_INTERNAL void pcmk__show_node_capacities(const char *desc, pcmk_scheduler_t *scheduler)
#define crm_notice(fmt, args...)
bool pe__is_guest_or_remote_node(const pcmk_node_t *node)
pcmk_scheduler_t * cluster
Cluster that resource is part of.
#define pe_rsc_debug(rsc, fmt, args...)
Whether action should not be executed.
void(* create_actions)(pcmk_resource_t *rsc)
pcmk_node_t * partial_migration_target
The destination node, if migrate_to completed but migrate_from has not.
G_GNUC_INTERNAL void pcmk__new_ordering(pcmk_resource_t *first_rsc, char *first_task, pcmk_action_t *first_action, pcmk_resource_t *then_rsc, char *then_task, pcmk_action_t *then_action, uint32_t flags, pcmk_scheduler_t *sched)
int(* message)(pcmk__output_t *out, const char *message_id,...)
Whether cluster is symmetric (via symmetric-cluster property)
enum rsc_role_e role
Resource's current role.
Whether partition has quorum (via have-quorum property)
G_GNUC_INTERNAL bool pcmk__threshold_reached(pcmk_resource_t *rsc, const pcmk_node_t *node, pcmk_resource_t **failed)
GList * children
Resource's child resources, if any.
enum pcmk__digest_result rc
gboolean order_actions(pcmk_action_t *lh_action, pcmk_action_t *rh_action, uint32_t flags)
xmlNode * xml
Resource configuration (possibly expanded from template)
gboolean exclusive_discover
Whether exclusive probing is enabled.
Implementation of pcmk_action_t.
G_GNUC_INTERNAL void pcmk__apply_locations(pcmk_scheduler_t *scheduler)
pcmk_action_t * pe_fence_op(pcmk_node_t *node, const char *op, bool optional, const char *reason, bool priority_delay, pcmk_scheduler_t *scheduler)
op_digest_cache_t * rsc_action_digest_cmp(pcmk_resource_t *rsc, const xmlNode *xml_op, pcmk_node_t *node, pcmk_scheduler_t *scheduler)
G_GNUC_INTERNAL void pcmk__handle_rsc_config_changes(pcmk_scheduler_t *scheduler)
#define pe__set_working_set_flags(scheduler, flags_to_set)
#define PCMK_ACTION_DO_SHUTDOWN
Whether the CIB status section has been parsed yet.
Whether concurrent fencing is allowed (via concurrent-fencing property)
GList * actions
Scheduled actions.
pcmk_node_t *(* assign)(pcmk_resource_t *rsc, const pcmk_node_t *prefer, bool stop_if_fail)
pcmk_action_t * pe__clear_failcount(pcmk_resource_t *rsc, const pcmk_node_t *node, const char *reason, pcmk_scheduler_t *scheduler)
Schedule a controller operation to clear a fail count.
#define PCMK_ACTION_CLEAR_FAILCOUNT
G_GNUC_INTERNAL void pcmk__sort_resources(pcmk_scheduler_t *scheduler)
GList * pe__resource_actions(const pcmk_resource_t *rsc, const pcmk_node_t *node, const char *task, bool require_node)
Find all actions of given type for a resource.
pcmk_scheduler_t * data_set
Cluster that node is part of.
void pcmk__output_set_log_level(pcmk__output_t *out, uint8_t log_level)
void pe__foreach_param_check(pcmk_scheduler_t *scheduler, void(*cb)(pcmk_resource_t *, pcmk_node_t *, const xmlNode *, enum pcmk__check_parameters))
Implementation of pcmk_scheduler_t.
gboolean cluster_status(pcmk_scheduler_t *scheduler)
gboolean remote_requires_reset
G_GNUC_INTERNAL void pcmk__create_graph(pcmk_scheduler_t *scheduler)
int pe_get_failcount(const pcmk_node_t *node, pcmk_resource_t *rsc, time_t *last_failure, uint32_t flags, const xmlNode *xml_op)
GList * resources
Resources in cluster.
GList * nodes
Nodes in cluster.
gboolean is_dc
Whether node is cluster's DC.
int weight
Node score for a given resource.
Implementation of pcmk_resource_t.
Actions are ordered (optionally, if no other flags are set)
void pcmk__unpack_constraints(pcmk_scheduler_t *scheduler)
G_GNUC_INTERNAL void pcmk__log_action(const char *pre_text, const pcmk_action_t *action, bool details)
void resource_location(pcmk_resource_t *rsc, const pcmk_node_t *node, int score, const char *tag, pcmk_scheduler_t *scheduler)
void pe__free_param_checks(pcmk_scheduler_t *scheduler)
Whether the cluster includes any Pacemaker Remote nodes (via CIB)
#define crm_trace(fmt, args...)
void * priv
For Pacemaker use only.
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
CRM_TRACE_INIT_DATA(pacemaker)
struct pe_node_shared_s * details
Basic node information.
void(* shutdown_lock)(pcmk_resource_t *rsc)
void set_working_set_defaults(pcmk_scheduler_t *scheduler)
unsigned long long flags
Group of enum pcmk_rsc_flags.
void pcmk__register_lib_messages(pcmk__output_t *out)
Wrappers for and extensions to libxml2.
void(* finish)(pcmk__output_t *out, crm_exit_t exit_status, bool print, void **copy_dest)
Never probe resource on node.
G_GNUC_INTERNAL void pcmk__output_actions(pcmk_scheduler_t *scheduler)
G_GNUC_INTERNAL pcmk_action_t * pcmk__new_shutdown_action(pcmk_node_t *node)
void pe__register_messages(pcmk__output_t *out)
Implementation of pcmk_node_t.
const char * placement_strategy
Value of placement-strategy property.
int rsc_discover_mode
Probe mode (enum pe_discover_e)
const char * id
Node ID at the cluster layer.
void pcmk__output_free(pcmk__output_t *out)
bool pe__is_guest_node(const pcmk_node_t *node)
unsigned int get_crm_log_level(void)
G_GNUC_INTERNAL void pcmk__set_assignment_methods(pcmk_scheduler_t *scheduler)
G_GNUC_INTERNAL void pcmk__apply_node_health(pcmk_scheduler_t *scheduler)
Cluster status and scheduling.
gboolean is_remote_node
Whether this is a remote connection.
Whether action is runnable.
void pcmk__schedule_actions(xmlNode *cib, unsigned long long flags, pcmk_scheduler_t *scheduler)
Whether fencing is enabled (via stonith-enabled property)
G_GNUC_INTERNAL void pcmk__order_remote_connection_actions(pcmk_scheduler_t *scheduler)
pcmk_scheduler_t * scheduler
Whether action does not require invoking an agent.
G_GNUC_INTERNAL void pcmk__apply_orderings(pcmk_scheduler_t *sched)
G_GNUC_INTERNAL void pcmk__schedule_probes(pcmk_scheduler_t *scheduler)
This structure contains everything that makes up a single output formatter.
gboolean shutdown
Whether shutting down.
void(* begin_list)(pcmk__output_t *out, const char *singular_noun, const char *plural_noun, const char *format,...) G_GNUC_PRINTF(4
GList * running_on
Nodes where resource may be active.
G_GNUC_INTERNAL void pcmk__order_vs_fence(pcmk_action_t *stonith_op, pcmk_scheduler_t *scheduler)
G_GNUC_INTERNAL void pcmk__fence_guest(pcmk_node_t *node)
G_GNUC_INTERNAL bool pcmk__check_action_config(pcmk_resource_t *rsc, pcmk_node_t *node, const xmlNode *xml_op)
#define pe_rsc_trace(rsc, fmt, args...)
unsigned long long flags
Group of enum pcmk_scheduler_flags.
int stickiness
Extra preference for current node.
Whether resource is managed.
gboolean unclean
Whether node requires fencing.
Whether resource has been removed from the configuration.
enum node_type type
Node variant.
G_GNUC_INTERNAL void pcmk__create_internal_constraints(pcmk_scheduler_t *scheduler)
gboolean online
Whether online.
int pcmk__log_output_new(pcmk__output_t **out)
char * id
Resource ID in configuration.
GHashTable * allowed_nodes
Nodes where resource may run (key is node ID, not name)