32 check_health(
const char *value)
53 check_stonith_action(
const char *value)
68 check_placement_strategy(
const char *value)
88 {
"no-quorum-policy",
"no_quorum_policy",
"enum",
"stop, freeze, ignore, suicide",
"stop", &
check_quorum,
89 "What to do when the cluster does not have quorum", NULL },
90 {
"symmetric-cluster",
"symmetric_cluster",
"boolean", NULL,
"true", &
check_boolean,
91 "All resources can run anywhere by default", NULL },
92 {
"default-resource-stickiness",
"default_resource_stickiness",
"integer",
94 "Deprecated (use resource-stickiness in rsc_defaults instead)", NULL },
95 {
"is-managed-default",
"is_managed_default",
"boolean", NULL, NULL,
96 &
check_boolean,
"Deprecated (use is-managed in rsc_defaults instead)",
98 {
"maintenance-mode", NULL,
"boolean", NULL,
"false", &
check_boolean,
99 "Should the cluster monitor resources and start/stop them as required", NULL },
100 {
"start-failure-is-fatal", NULL,
"boolean", NULL,
"true", &
check_boolean,
"Always treat start failures as fatal",
101 "When set to TRUE, the cluster will immediately ban a resource from a node if it fails to start there. When FALSE, the cluster will instead check the resource's fail count against its migration-threshold." },
102 {
"enable-startup-probes", NULL,
"boolean", NULL,
"true", &
check_boolean,
103 "Should the cluster check for active resources during startup", NULL },
106 {
"stonith-enabled",
"stonith_enabled",
"boolean", NULL,
"true", &
check_boolean,
107 "Failed nodes are STONITH'd", NULL },
108 {
"stonith-action",
"stonith_action",
"enum",
"reboot, poweroff, off",
"reboot", &check_stonith_action,
109 "Action to send to STONITH device", NULL },
110 {
"stonith-timeout", NULL,
"time", NULL,
"60s", &
check_timer,
111 "How long to wait for the STONITH action (reboot,on,off) to complete", NULL },
113 "Enable watchdog integration",
"Set automatically by the cluster if SBD is detected. User configured values are ignored." },
114 {
"concurrent-fencing", NULL,
"boolean", NULL,
"false", &
check_boolean,
115 "Allow performing fencing operations in parallel", NULL },
116 {
"startup-fencing",
"startup_fencing",
"boolean", NULL,
"true", &
check_boolean,
117 "STONITH unseen nodes",
"Advanced Use Only! Not using the default is very unsafe!" },
120 {
"cluster-delay",
"transition_idle_timeout",
"time", NULL,
"60s", &
check_time,
121 "Round trip delay over the network (excluding action execution)",
122 "The \"correct\" value will depend on the speed and load of your network and cluster nodes." },
123 {
"batch-limit", NULL,
"integer", NULL,
"0", &
check_number,
124 "The number of jobs that the TE is allowed to execute in parallel",
125 "The \"correct\" value will depend on the speed and load of your network and cluster nodes." },
126 {
"migration-limit", NULL,
"integer", NULL,
"-1", &
check_number,
127 "The number of migration jobs that the TE is allowed to execute in parallel on a node"},
128 {
"default-action-timeout",
"default_action_timeout",
"time", NULL, NULL,
129 &
check_time,
"Deprecated (use 'timeout' in op_defaults instead)", NULL },
132 {
"stop-all-resources", NULL,
"boolean", NULL,
"false", &
check_boolean,
133 "Should the cluster stop all active resources (except those needed for fencing)", NULL },
134 {
"stop-orphan-resources",
"stop_orphan_resources",
"boolean", NULL,
"true", &
check_boolean,
135 "Should deleted resources be stopped", NULL },
136 {
"stop-orphan-actions",
"stop_orphan_actions",
"boolean", NULL,
"true", &
check_boolean,
137 "Should deleted actions be cancelled", NULL },
138 {
"remove-after-stop",
"remove_after_stop",
"boolean", NULL,
"false", &
check_boolean,
139 "Remove resources from the LRM after they are stopped",
140 "Always set this to false. Other values are, at best, poorly tested and potentially dangerous." },
144 {
"pe-error-series-max", NULL,
"integer", NULL,
"-1", &
check_number,
145 "The number of PE inputs resulting in ERRORs to save",
"Zero to disable, -1 to store unlimited." },
146 {
"pe-warn-series-max", NULL,
"integer", NULL,
"5000", &
check_number,
147 "The number of PE inputs resulting in WARNINGs to save",
"Zero to disable, -1 to store unlimited." },
148 {
"pe-input-series-max", NULL,
"integer", NULL,
"4000", &
check_number,
149 "The number of other PE inputs to save",
"Zero to disable, -1 to store unlimited." },
152 {
"node-health-strategy", NULL,
"enum",
"none, migrate-on-red, only-green, progressive, custom",
"none", &check_health,
153 "The strategy combining node attributes to determine overall node health.",
154 "Requires external entities to create node attributes (named with the prefix '#health') with values: 'red', 'yellow' or 'green'."},
155 {
"node-health-base", NULL,
"integer", NULL,
"0", &
check_number,
156 "The base score assigned to a node",
157 "Only used when node-health-strategy is set to progressive." },
158 {
"node-health-green", NULL,
"integer", NULL,
"0", &
check_number,
159 "The score 'green' translates to in rsc_location constraints",
160 "Only used when node-health-strategy is set to custom or progressive." },
161 {
"node-health-yellow", NULL,
"integer", NULL,
"0", &
check_number,
162 "The score 'yellow' translates to in rsc_location constraints",
163 "Only used when node-health-strategy is set to custom or progressive." },
164 {
"node-health-red", NULL,
"integer", NULL,
"-INFINITY", &
check_number,
165 "The score 'red' translates to in rsc_location constraints",
166 "Only used when node-health-strategy is set to custom or progressive." },
169 {
"placement-strategy", NULL,
"enum",
"default, utilization, minimal, balanced",
"default", &check_placement_strategy,
170 "The strategy to determine resource placement", NULL},
178 "Policy Engine Options",
179 "This is a fake resource that details the options that can be configured for the Policy Engine.",
180 pe_opts,
DIMOF(pe_opts));
190 pe_pref(GHashTable * options,
const char *name)
198 const char *result =
"<unknown>";
223 result =
"restart-container";
226 result =
"reset-remote";
281 }
else if (
safe_str_eq(task,
"stonith_complete")) {
286 crm_trace(
"Unsupported action: %s", task);
295 const char *result =
"<unknown>";
299 result =
"no_action";
381 crm_err(
"Unknown role: %s", role);
388 int result = w1 + w2;
392 crm_trace(
"-INFINITY + INFINITY == -INFINITY");
402 if (w1 <= 0 && w2 < 0) {
406 }
else if (w1 > 0 && w2 > 0) {
418 crm_trace(
"%d + %d = %d", w1, w2, result);
428 if (name == NULL || value == NULL) {
434 }
else if (g_hash_table_lookup(hash, name) == NULL) {
435 g_hash_table_insert(hash, strdup(name), strdup(value));
447 }
else if(rsc == NULL) {
452 if(source == NULL ||
safe_str_eq(
"host", source) == FALSE) {
472 pe_rsc_trace(rsc,
"%s: Not looking for %s on the container host: %s is inactive",
#define CRM_CHECK(expr, failure_action)
void verify_pe_options(GHashTable *options)
const char * task2text(enum action_tasks task)
#define CRMD_ACTION_MIGRATED
#define RSC_ROLE_STARTED_S
#define CRMD_ACTION_NOTIFY
#define CRMD_ACTION_PROMOTE
enum action_tasks text2task(const char *task)
const char * pe_pref(GHashTable *options, const char *name)
gboolean check_number(const char *value)
#define XML_RSC_ATTR_TARGET
#define CRMD_ACTION_START
#define CRM_OP_LRM_REFRESH
const char * role2text(enum rsc_role_e role)
#define CRMD_ACTION_DEMOTED
struct node_shared_s * details
void config_metadata(const char *name, const char *version, const char *desc_short, const char *desc_long, pe_cluster_option *option_list, int len)
#define CRMD_ACTION_DEMOTE
gboolean check_quorum(const char *value)
#define crm_trace(fmt, args...)
Wrappers for and extensions to libxml2.
const char * pe_node_attribute_raw(pe_node_t *node, const char *name)
gboolean check_time(const char *value)
#define RSC_ROLE_MASTER_S
#define CRMD_ACTION_PROMOTED
gboolean check_boolean(const char *value)
enum rsc_role_e text2role(const char *role)
#define CRMD_ACTION_STOPPED
const char * pe_node_attribute_calculated(pe_node_t *node, const char *name, resource_t *rsc)
const char * fail2text(enum action_fail_response fail)
void add_hash_param(GHashTable *hash, const char *name, const char *value)
#define crm_err(fmt, args...)
#define XML_ATTR_HAVE_WATCHDOG
int merge_weights(int w1, int w2)
#define CRMD_ACTION_MIGRATE
#define RSC_ROLE_STOPPED_S
void verify_all_options(GHashTable *options, pe_cluster_option *option_list, int len)
#define RSC_ROLE_UNKNOWN_S
gboolean check_timer(const char *value)
#define CRMD_ACTION_NOTIFIED
#define pe_rsc_trace(rsc, fmt, args...)
gboolean was_processing_error
#define safe_str_eq(a, b)
pe_cluster_option pe_opts[]
const char * get_cluster_pref(GHashTable *options, pe_cluster_option *option_list, int len, const char *name)
gboolean was_processing_warning
#define CRMD_ACTION_STARTED
#define CRMD_ACTION_CANCEL
#define CRMD_ACTION_DELETE
#define CRMD_ACTION_STATUS