31#define RSC_ROLE_MAX (pcmk_role_promoted + 1)
174 if (prefer == NULL) {
175 prefer = most_free_node;
184 nodes = sorted_allowed_nodes(rsc);
189 if ((prefer != NULL) && (nodes != NULL)) {
193 if (chosen == NULL) {
194 pe_rsc_trace(rsc,
"Preferred node %s for %s was unknown",
195 pe__node_name(prefer), rsc->
id);
204 pe_rsc_trace(rsc,
"Preferred node %s for %s was unsuitable",
205 pe__node_name(chosen), rsc->
id);
209 pe_rsc_trace(rsc,
"Preferred node %s for %s was unavailable",
210 pe__node_name(chosen), rsc->
id);
215 "Chose preferred node %s for %s "
216 "(ignoring %d candidates)",
217 pe__node_name(chosen), rsc->
id, g_list_length(nodes));
221 if ((chosen == NULL) && (best != NULL)) {
228 if (!pe_rsc_is_unique_clone(rsc->
parent)
242 if (running == NULL) {
247 "Current node for %s (%s) can't run resources",
248 rsc->
id, pe__node_name(running));
251 int nodes_with_best_score = 1;
253 for (GList *iter = nodes->next; iter; iter = iter->next) {
256 if (allowed->weight != chosen->
weight) {
260 if (pe__same_node(allowed, running)) {
264 nodes_with_best_score++;
267 if (nodes_with_best_score > 1) {
268 uint8_t log_level = LOG_INFO;
271 log_level = LOG_WARNING;
274 "Chose %s for %s from %d nodes with score %s",
275 pe__node_name(chosen), rsc->
id,
276 nodes_with_best_score,
283 pe__node_name(chosen), rsc->
id, g_list_length(nodes));
301 GHashTable *archive = NULL;
312 "%s: Assigning colocation %s primary %s first"
313 "(score=%d role=%s)",
314 rsc->
id, colocation->
id, other->
id,
321 if ((archive != NULL)
324 "%s: Reverting scores from colocation with %s "
325 "because no nodes allowed",
331 if (archive != NULL) {
332 g_hash_table_destroy(archive);
353 crm_trace(
"Pacemaker Remote node %s will be online",
362 crm_trace(
"Pacemaker Remote node %s will be shut down "
363 "(%sassigned connection's next role is %s)",
393 GList *this_with_colocations = NULL;
394 GList *with_this_colocations = NULL;
410 const char *node_name =
"no node";
421 pe_rsc_debug(rsc,
"Breaking assignment loop involving %s", rsc->
id);
433 for (iter = this_with_colocations; iter != NULL; iter = iter->next) {
434 colocation = iter->data;
438 apply_this_with(colocation, rsc);
441 for (iter = with_this_colocations; iter != NULL; iter = iter->next) {
442 colocation = iter->data;
454 for (iter = this_with_colocations; iter != NULL; iter = iter->next) {
455 colocation = iter->data;
459 apply_this_with(colocation, rsc);
462 for (iter = with_this_colocations; iter != NULL; iter = iter->next) {
463 colocation = iter->data;
471 g_list_free(this_with_colocations);
472 g_list_free(with_this_colocations);
476 "Banning %s from all nodes because it will be stopped",
484 crm_notice(
"Resource %s cannot be elevated from %s to %s due to "
485 "no-quorum-policy=freeze",
502 const char *reason = NULL;
506 assign_to = pe__current_node(rsc);
507 if (assign_to == NULL) {
516 pe_rsc_info(rsc,
"Unmanaged resource %s assigned to %s: %s", rsc->
id,
517 (assign_to? assign_to->
details->
uname :
"no node"), reason);
523 pe_rsc_debug(rsc,
"Forcing %s to stop: stop-all-resources",
528 }
else if (!assign_best_node(rsc, prefer, stop_if_fail)) {
531 pe_rsc_info(rsc,
"Resource %s cannot run anywhere", rsc->
id);
532 }
else if ((rsc->
running_on != NULL) && stop_if_fail) {
540 remote_connection_assigned(rsc);
559 bool need_stop,
bool need_promote)
570 pe_rsc_trace(rsc,
"Creating %s action to take %s down from %s to %s",
571 (need_stop?
"required" :
"optional"), rsc->
id,
573 fn = rsc_action_matrix[role][next_role];
577 fn(rsc, current, !need_stop);
584 bool required = need_stop;
586 next_role = rsc_state_matrix[role][rsc->
role];
590 pe_rsc_trace(rsc,
"Creating %s action to take %s up from %s to %s",
591 (required?
"required" :
"optional"), rsc->
id,
593 fn = rsc_action_matrix[role][next_role];
639 "Creating action for %s to represent already pending start",
661 "Creating action to take %s from %s to %s (ending at %s)",
664 fn = rsc_action_matrix[role][next_role];
682 bool need_stop =
false;
683 bool need_promote =
false;
684 bool is_moving =
false;
685 bool allow_migrate =
false;
686 bool multiply_active =
false;
689 unsigned int num_all_active = 0;
690 unsigned int num_clean_active = 0;
691 const char *next_role_source = NULL;
695 next_role_source = set_default_next_role(rsc);
697 "Creating all actions for %s transition from %s to %s "
702 current = rsc->
fns->
active_node(rsc, &num_all_active, &num_clean_active);
712 rsc->
id, pe__node_name(current),
724 && allow_migrate && (num_all_active == 2)
730 pe_rsc_trace(rsc,
"Partial migration of %s from %s to %s will continue",
738 if (num_all_active > 2) {
740 crm_notice(
"Forcing recovery of %s because it is migrating "
741 "from %s to %s and possibly active elsewhere",
746 crm_notice(
"Forcing recovery of %s because it can no longer "
747 "migrate from %s to %s",
753 allow_migrate =
false;
756 multiply_active = (num_all_active > 1);
765 multiply_active = (num_clean_active > 1);
768 if (multiply_active) {
772 pe_proc_err(
"%s resource %s might be active on %u nodes (%s)",
773 pcmk__s(
class,
"Untyped"), rsc->id, num_all_active,
774 recovery2text(rsc->recovery_type));
775 crm_notice(
"See https://wiki.clusterlabs.org/wiki/FAQ"
776 "#Resource_is_Too_Active for more information");
778 switch (rsc->recovery_type) {
795 create_pending_start(rsc);
820 pe_rsc_trace(rsc,
"Creating start action for promoted resource %s",
825 pe_rsc_trace(rsc,
"%s restart is required for recovery", rsc->
id);
831 schedule_restart_actions(rsc, current, need_stop, need_promote);
834 schedule_role_transition_actions(rsc);
856 while (g_hash_table_iter_next(&iter, NULL, (
void **) &node)) {
857 if (node->details->remote_rsc != NULL) {
879 GList *allowed_nodes = NULL;
889 return allowed_nodes;
901 GList *allowed_nodes = NULL;
902 bool check_unfencing =
false;
903 bool check_utilization =
false;
909 "Skipping implicit constraints for unmanaged resource %s",
921 check_utilization = (g_hash_table_size(rsc->
utilization) > 0)
960 if (check_unfencing || check_utilization || (rsc->
container != NULL)) {
961 allowed_nodes = allowed_nodes_as_list(rsc);
964 if (check_unfencing) {
968 if (check_utilization) {
1009 if (remote_rsc != NULL) {
1013 for (GList *item = allowed_nodes; item; item = item->next) {
1028 crm_trace(
"Order and colocate %s relative to its container %s",
1065 rsc_avoids_remote_nodes(rsc);
1067 g_list_free(allowed_nodes);
1091 CRM_ASSERT((dependent != NULL) && (primary != NULL)
1092 && (colocation != NULL));
1094 if (for_dependent) {
1102 pe_rsc_trace(dependent,
"%s %s with %s (%s, score=%d, filter=%d)",
1103 ((colocation->
score > 0)?
"Colocating" :
"Anti-colocating"),
1104 dependent->
id, primary->
id, colocation->
id, colocation->
score,
1107 switch (filter_results) {
1129 if (rsc == orig_rsc) {
1134 if (rsc->
parent != NULL) {
1139 for (GList *iter = rsc->
rsc_cons_lhs; iter != NULL; iter = iter->next) {
1159 if (rsc == orig_rsc) {
1164 if (rsc->
parent != NULL) {
1169 for (GList *iter = rsc->
rsc_cons; iter != NULL; iter = iter->next) {
1192 return (uint32_t)
action->flags;
1211 return pcmk_all_flags_set(rsc->
flags,
1228 for (GList *iter = rsc->
running_on; iter != NULL; iter = iter->next) {
1232 if (is_expected_node(rsc, current)) {
1238 "Skipping stop of multiply active resource %s "
1239 "on expected node %s",
1240 rsc->
id, pe__node_name(current));
1249 "Skipping stop of %s on %s "
1250 "because partial migration there will continue",
1251 rsc->
id, pe__node_name(current));
1255 "Forcing stop of %s on %s "
1256 "because migration target changed",
1257 rsc->
id, pe__node_name(current));
1263 rsc->
id, pe__node_name(current));
1291 pe_proc_err(
"Stopping %s until %s can be unfenced",
1292 rsc->
id, pe__node_name(current));
1313 pe_rsc_trace(rsc,
"Scheduling %s start of %s on %s (score %d)",
1314 (optional?
"optional" :
"required"), rsc->
id,
1315 pe__node_name(node), node->weight);
1324 if (is_expected_node(rsc, node)) {
1329 "Start of multiply active resource %s "
1330 "on expected node %s will be a pseudo-action",
1331 rsc->
id, pe__node_name(node));
1348 GList *action_list = NULL;
1349 bool runnable =
true;
1355 for (iter = action_list; iter != NULL; iter = iter->next) {
1362 g_list_free(action_list);
1367 pe_rsc_trace(rsc,
"Scheduling %s promotion of %s on %s",
1368 (optional?
"optional" :
"required"), rsc->
id,
1369 pe__node_name(node));
1371 if (is_expected_node(rsc, node)) {
1376 "Promotion of multiply active resource %s "
1377 "on expected node %s will be a pseudo-action",
1378 rsc->
id, pe__node_name(node));
1382 pe_rsc_trace(rsc,
"Not promoting %s on %s: start unrunnable",
1383 rsc->
id, pe__node_name(node));
1386 for (iter = action_list; iter != NULL; iter = iter->next) {
1391 g_list_free(action_list);
1411 for (GList *iter = rsc->
running_on; iter != NULL; iter = iter->next) {
1414 if (is_expected_node(rsc, current)) {
1416 "Skipping demote of multiply active resource %s "
1417 "on expected node %s",
1418 rsc->
id, pe__node_name(current));
1420 pe_rsc_trace(rsc,
"Scheduling %s demotion of %s on %s",
1421 (optional?
"optional" :
"required"), rsc->
id,
1422 pe__node_name(current));
1453 CRM_CHECK((rsc != NULL) && (node != NULL),
return);
1456 pe_rsc_trace(rsc,
"Skipping clean-up of %s on %s: resource failed",
1457 rsc->
id, pe__node_name(node));
1462 pe_rsc_trace(rsc,
"Skipping clean-up of %s on %s: node unavailable",
1463 rsc->
id, pe__node_name(node));
1467 crm_notice(
"Scheduling clean-up of %s on %s", rsc->
id, pe__node_name(node));
1499 if (value != NULL) {
1507 if (value != NULL) {
1518 if (
parent->container != NULL) {
1528 value = g_hash_table_lookup(rsc->
meta,
"external-ip");
1529 if (value != NULL) {
1538 GList *all_rscs, GHashTable *utilization)
1541 && (orig_rsc != NULL) && (utilization != NULL));
1547 pe_rsc_trace(orig_rsc,
"%s: Adding primitive %s as colocated utilization",
1548 orig_rsc->
id, rsc->
id);
1566 if (shutdown != NULL) {
1567 long long result_ll;
1570 result = (time_t) result_ll;
1584ban_if_not_locked(gpointer
data, gpointer user_data)
1599 const char *
class = NULL;
1620 "Cancelling shutdown lock because %s is already active",
1628 }
else if (pcmk__list_of_1(rsc->
running_on)) {
1633 pe_rsc_debug(rsc,
"Not locking %s to unclean %s for shutdown",
1634 rsc->
id, pe__node_name(node));
1650 pe_rsc_info(rsc,
"Locking %s to %s due to shutdown (expires @%lld)",
1652 (
long long) lock_expiration);
1654 "shutdown lock expiration");
1656 pe_rsc_info(rsc,
"Locking %s to %s due to shutdown",
1661 g_list_foreach(rsc->
cluster->
nodes, ban_if_not_locked, rsc);
@ pcmk__ar_if_on_same_node
Relation applies only if actions are on same node.
@ pcmk__ar_first_implies_then
@ pcmk__ar_then_implies_first
@ pcmk__ar_intermediate_stop
@ pcmk__ar_promoted_then_implies_first
@ pcmk__ar_unrunnable_first_blocks
'then' is runnable (and migratable) only if 'first' is runnable
@ pcmk__ar_ordered
Actions are ordered (optionally, if no other flags are set)
@ pcmk__ar_then_cancels_first
If 'then' action becomes required, 'first' becomes optional.
#define PCMK_ACTION_PROMOTE
#define PCMK_ACTION_LRM_DELETE
#define PCMK_ACTION_START
#define PCMK_ACTION_DELETE
@ pcmk_action_runnable
Whether action is runnable.
@ pcmk_action_pseudo
Whether action does not require invoking an agent.
@ pcmk_action_optional
Whether action should not be executed.
@ pcmk_action_always_in_graph
Whether action should be added to transition graph even if optional.
#define PCMK_ACTION_MONITOR
#define PCMK_ACTION_DEMOTE
char * pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms)
Generate an operation key (RESOURCE_ACTION_INTERVAL)
#define PCMK_RESOURCE_CLASS_STONITH
const char * pcmk_readable_score(int score)
Return a displayable static string for a score value.
char * crm_meta_name(const char *field)
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
const char * role2text(enum rsc_role_e role)
#define CRM_SCORE_INFINITY
G_GNUC_INTERNAL void pcmk__apply_coloc_to_priority(pcmk_resource_t *dependent, const pcmk_resource_t *primary, const pcmk__colocation_t *colocation)
G_GNUC_INTERNAL enum pcmk__coloc_affects pcmk__colocation_affects(const pcmk_resource_t *dependent, const pcmk_resource_t *primary, const pcmk__colocation_t *colocation, bool preview)
G_GNUC_INTERNAL void pcmk__add_this_with_list(GList **list, GList *addition, const pcmk_resource_t *rsc)
void pcmk__abort_dangling_migration(void *data, void *user_data)
void pcmk__create_migration_actions(pcmk_resource_t *rsc, const pcmk_node_t *current)
G_GNUC_INTERNAL void pcmk__create_recurring_actions(pcmk_resource_t *rsc)
G_GNUC_INTERNAL void pcmk__new_colocation(const char *id, const char *node_attr, int score, pcmk_resource_t *dependent, pcmk_resource_t *primary, const char *dependent_role, const char *primary_role, uint32_t flags)
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)
G_GNUC_INTERNAL bool pcmk__any_node_available(GHashTable *nodes)
#define pcmk__order_resource_actions(first_rsc, first_task, then_rsc, then_task, flags)
G_GNUC_INTERNAL void pcmk__apply_coloc_to_scores(pcmk_resource_t *dependent, const pcmk_resource_t *primary, const pcmk__colocation_t *colocation)
@ pcmk__coloc_affects_location
@ pcmk__coloc_affects_role
G_GNUC_INTERNAL bool pcmk__assign_resource(pcmk_resource_t *rsc, pcmk_node_t *node, bool force, bool stop_if_fail)
G_GNUC_INTERNAL void pcmk__order_vs_unfence(const pcmk_resource_t *rsc, pcmk_node_t *node, pcmk_action_t *action, enum pcmk__action_relation_flags order)
G_GNUC_INTERNAL GList * pcmk__with_this_colocations(const pcmk_resource_t *rsc)
G_GNUC_INTERNAL void pcmk__add_this_with(GList **list, const pcmk__colocation_t *colocation, const pcmk_resource_t *rsc)
G_GNUC_INTERNAL GList * pcmk__sort_nodes(GList *nodes, pcmk_node_t *active_node)
G_GNUC_INTERNAL void pcmk__add_with_this_list(GList **list, GList *addition, const pcmk_resource_t *rsc)
G_GNUC_INTERNAL void pcmk__order_restart_vs_unfence(gpointer data, gpointer user_data)
G_GNUC_INTERNAL void pcmk__add_with_this(GList **list, const pcmk__colocation_t *colocation, const pcmk_resource_t *rsc)
G_GNUC_INTERNAL void pcmk__create_utilization_constraints(pcmk_resource_t *rsc, const GList *allowed_nodes)
G_GNUC_INTERNAL const pcmk_node_t * pcmk__ban_insufficient_capacity(pcmk_resource_t *rsc)
G_GNUC_INTERNAL void pcmk__add_dependent_scores(gpointer data, gpointer user_data)
G_GNUC_INTERNAL GList * pcmk__this_with_colocations(const pcmk_resource_t *rsc)
bool pcmk__rsc_can_migrate(const pcmk_resource_t *rsc, const pcmk_node_t *current)
G_GNUC_INTERNAL bool pcmk__node_unfenced(const pcmk_node_t *node)
G_GNUC_INTERNAL void pcmk__release_node_capacity(GHashTable *current_utilization, const pcmk_resource_t *rsc)
G_GNUC_INTERNAL bool pcmk__node_available(const pcmk_node_t *node, bool consider_score, bool consider_guest)
G_GNUC_INTERNAL GHashTable * pcmk__copy_node_table(GHashTable *nodes)
#define do_crm_log(level, fmt, args...)
Log a message.
#define crm_notice(fmt, args...)
#define CRM_CHECK(expr, failure_action)
#define crm_trace(fmt, args...)
#define XML_RSC_ATTR_TARGET_ROLE
#define XML_RSC_ATTR_REMOTE_NODE
#define XML_RSC_ATTR_CONTAINER
#define XML_CONFIG_ATTR_SHUTDOWN_LOCK
#define XML_RSC_ATTR_INCARNATION
#define XML_AGENT_ATTR_CLASS
#define XML_CIB_ATTR_SHUTDOWN
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
pcmk__action_result_t result
pcmk_node_t * pcmk__primitive_assign(pcmk_resource_t *rsc, const pcmk_node_t *prefer, bool stop_if_fail)
void pcmk__primitive_internal_constraints(pcmk_resource_t *rsc)
void pcmk__primitive_add_utilization(const pcmk_resource_t *rsc, const pcmk_resource_t *orig_rsc, GList *all_rscs, GHashTable *utilization)
void pcmk__primitive_add_graph_meta(const pcmk_resource_t *rsc, xmlNode *xml)
void pcmk__primitive_apply_coloc_score(pcmk_resource_t *dependent, const pcmk_resource_t *primary, const pcmk__colocation_t *colocation, bool for_dependent)
void(* rsc_transition_fn)(pcmk_resource_t *rsc, pcmk_node_t *node, bool optional)
void pcmk__with_primitive_colocations(const pcmk_resource_t *rsc, const pcmk_resource_t *orig_rsc, GList **list)
uint32_t pcmk__primitive_action_flags(pcmk_action_t *action, const pcmk_node_t *node)
void pcmk__primitive_create_actions(pcmk_resource_t *rsc)
void pcmk__schedule_cleanup(pcmk_resource_t *rsc, const pcmk_node_t *node, bool optional)
void pcmk__primitive_with_colocations(const pcmk_resource_t *rsc, const pcmk_resource_t *orig_rsc, GList **list)
void pcmk__primitive_shutdown_lock(pcmk_resource_t *rsc)
#define delete_action(rsc, node, optional)
time_t get_effective_time(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.
#define demote_action(rsc, node, optional)
const pcmk_resource_t * pe__const_top_resource(const pcmk_resource_t *rsc, bool include_bundle)
gboolean order_actions(pcmk_action_t *lh_action, pcmk_action_t *rh_action, uint32_t flags)
#define pe__show_node_scores(level, rsc, text, nodes, scheduler)
#define start_action(rsc, node, optional)
void resource_location(pcmk_resource_t *rsc, const pcmk_node_t *node, int score, const char *tag, pcmk_scheduler_t *scheduler)
#define pe__clear_resource_flags(resource, flags_to_clear)
#define pe_rsc_debug(rsc, fmt, args...)
void pe__update_recheck_time(time_t recheck, pcmk_scheduler_t *scheduler, const char *reason)
gint pe__cmp_node_name(gconstpointer a, gconstpointer b)
#define pe_rsc_trace(rsc, fmt, args...)
void pe_action_set_reason(pcmk_action_t *action, const char *reason, bool overwrite)
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)
#define pe__set_resource_flags(resource, flags_to_set)
void pe__set_next_role(pcmk_resource_t *rsc, enum rsc_role_e role, const char *why)
#define stop_action(rsc, node, optional)
#define pe_rsc_info(rsc, fmt, args...)
#define pe_proc_err(fmt...)
#define pe__clear_action_flags(action, flags_to_clear)
void pe__clear_resource_history(pcmk_resource_t *rsc, const pcmk_node_t *node)
#define promote_action(rsc, node, optional)
const char * pe_node_attribute_raw(const pcmk_node_t *node, const char *name)
#define pe__set_action_flags(action, flags_to_set)
bool pe__resource_is_remote_conn(const pcmk_resource_t *rsc)
pcmk_resource_t * pe__resource_contains_guest_node(const pcmk_scheduler_t *scheduler, const pcmk_resource_t *rsc)
@ pcmk_multiply_active_restart
Stop on all, start on desired.
@ pcmk_multiply_active_unexpected
Stop unexpected instances.
@ pcmk_rsc_variant_primitive
Primitive resource.
@ pcmk_rsc_promotable
Whether resource can be promoted and demoted.
@ pcmk_rsc_unassigned
Whether resource has not yet been assigned to a node.
@ pcmk_rsc_assigning
Whether resource is in the process of being assigned to a node.
@ pcmk_rsc_stop_if_failed
Whether resource must be stopped (instead of demoted) if it is failed.
@ pcmk_rsc_needs_fencing
Whether resource requires fencing before recovery if on unclean node.
@ pcmk_rsc_needs_unfencing
Whether resource can be started or promoted only on unfenced nodes.
@ pcmk_rsc_removed
Whether resource has been removed from the configuration.
@ pcmk_rsc_remote_nesting_allowed
Whether resource is a remote connection allowed to run on a remote node.
@ pcmk_rsc_start_pending
Whether resource has pending start action in history.
@ pcmk_rsc_blocked
Whether resource is blocked from further action.
@ pcmk_rsc_restarting
Whether resource is in the process of scheduling actions to restart.
@ pcmk_rsc_fence_device
Whether resource's class is "stonith".
@ pcmk_rsc_stop_unexpected
Whether resource is multiply active with recovery set to stop_unexpected.
@ pcmk_rsc_managed
Whether resource is managed.
@ pcmk_rsc_failed
Whether resource is considered failed.
@ pcmk_role_started
Started.
@ pcmk_role_unknown
Resource role is unknown.
@ pcmk_role_unpromoted
Unpromoted.
@ pcmk_role_promoted
Promoted.
@ pcmk_role_stopped
Stopped.
@ pcmk_sched_fencing_enabled
Whether fencing is enabled (via stonith-enabled property)
@ pcmk_sched_have_fencing
Whether cluster has a fencing resource (via CIB resources)
@ pcmk_sched_quorate
Whether partition has quorum (via have-quorum property)
@ pcmk_sched_output_scores
Whether node scores should be output instead of logged.
@ pcmk_sched_enable_unfencing
Whether any resource provides or requires unfencing (via CIB resources)
@ pcmk_sched_remove_after_stop
@ pcmk_sched_stop_all
Whether to stop all resources (via stop-all-resources property)
pcmk_node_t * pe_find_node(const GList *node_list, const char *node_name)
Find a node by name in a list of nodes.
int pcmk__scan_ll(const char *text, long long *result, long long default_value)
pcmk_resource_t * primary
Implementation of pcmk_action_t.
enum pe_action_flags flags
Group of enum pe_action_flags.
Implementation of pcmk_node_t.
int weight
Node score for a given resource.
struct pe_node_shared_s * details
Basic node information.
gboolean shutdown
Whether shutting down.
const char * id
Node ID at the cluster layer.
gboolean online
Whether online.
const char * uname
Node name in cluster.
pcmk_scheduler_t * data_set
Cluster that node is part of.
gboolean unclean
Whether node requires fencing.
pcmk_resource_t * remote_rsc
Remote connection resource for node, if it is a Pacemaker Remote node.
gboolean unseen
Whether node has never joined cluster.
Implementation of pcmk_resource_t.
pcmk_assignment_methods_t * cmds
Resource assignment methods.
GList * running_on
Nodes where resource may be active.
enum pe_obj_types variant
Resource variant.
pcmk_node_t * partial_migration_target
The destination node, if migrate_to completed but migrate_from has not.
GHashTable * meta
Resource's meta-attributes.
pcmk_scheduler_t * cluster
Cluster that resource is part of.
pcmk_node_t * partial_migration_source
The source node, if migrate_to completed but migrate_from has not.
pcmk_resource_t * container
Resource containing this one, if any.
pcmk_rsc_methods_t * fns
Resource object methods.
gboolean is_remote_node
Whether this is a remote connection.
char * id
Resource ID in configuration.
pcmk_node_t * allocated_to
Node resource is assigned to.
GHashTable * utilization
Resource's utilization attributes.
GHashTable * allowed_nodes
Nodes where resource may run (key is node ID, not name)
GList * dangling_migrations
pcmk_node_t * lock_node
Resource shutdown-locked to this node.
unsigned long long flags
Group of enum pcmk_rsc_flags.
enum rsc_role_e next_role
Resource's scheduled next role.
enum rsc_role_e role
Resource's current role.
pcmk_resource_t * parent
Resource's parent resource, if any.
time_t lock_time
When shutdown lock started.
const char * placement_strategy
Value of placement-strategy property.
guint shutdown_lock
How long to lock resources (seconds)
unsigned long long flags
Group of enum pcmk_scheduler_flags.
enum pe_quorum_policy no_quorum_policy
Response to loss of quorum.
GList * nodes
Nodes in cluster.
void(* this_with_colocations)(const pcmk_resource_t *rsc, const pcmk_resource_t *orig_rsc, GList **list)
void(* with_this_colocations)(const pcmk_resource_t *rsc, const pcmk_resource_t *orig_rsc, GList **list)
pcmk_node_t *(* assign)(pcmk_resource_t *rsc, const pcmk_node_t *prefer, bool stop_if_fail)
void(* apply_coloc_score)(pcmk_resource_t *dependent, const pcmk_resource_t *primary, const pcmk__colocation_t *colocation, bool for_dependent)
pcmk_node_t *(* active_node)(const pcmk_resource_t *rsc, unsigned int *count_all, unsigned int *count_clean)
Find a node (and optionally count all) where resource is active.