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", NULL,
"0", &
check_number,
"", NULL },
93 {
"is-managed-default",
"is_managed_default",
"boolean", NULL,
"true", &
check_boolean,
94 "Should the cluster start/stop resources as required", NULL },
95 {
"maintenance-mode", NULL,
"boolean", NULL,
"false", &
check_boolean,
96 "Should the cluster monitor resources and start/stop them as required", NULL },
97 {
"start-failure-is-fatal", NULL,
"boolean", NULL,
"true", &
check_boolean,
"Always treat start failures as fatal",
98 "This was the old default. However when set to FALSE, the cluster will instead use the resource's failcount and value for resource-failure-stickiness" },
99 {
"enable-startup-probes", NULL,
"boolean", NULL,
"true", &
check_boolean,
100 "Should the cluster check for active resources during startup", NULL },
103 {
"stonith-enabled",
"stonith_enabled",
"boolean", NULL,
"true", &
check_boolean,
104 "Failed nodes are STONITH'd", NULL },
105 {
"stonith-action",
"stonith_action",
"enum",
"reboot, poweroff, off",
"reboot", &check_stonith_action,
106 "Action to send to STONITH device", NULL },
107 {
"stonith-timeout", NULL,
"time", NULL,
"60s", &
check_timer,
108 "How long to wait for the STONITH action (reboot,on,off) to complete", NULL },
110 "Enable watchdog integration",
"Set automatically by the cluster if SBD is detected. User configured values are ignored." },
111 {
"concurrent-fencing", NULL,
"boolean", NULL,
"false", &
check_boolean,
112 "Allow performing fencing operations in parallel", NULL },
113 {
"startup-fencing",
"startup_fencing",
"boolean", NULL,
"true", &
check_boolean,
114 "STONITH unseen nodes",
"Advanced Use Only! Not using the default is very unsafe!" },
117 {
"cluster-delay",
"transition_idle_timeout",
"time", NULL,
"60s", &
check_time,
118 "Round trip delay over the network (excluding action execution)",
119 "The \"correct\" value will depend on the speed and load of your network and cluster nodes." },
120 {
"batch-limit", NULL,
"integer", NULL,
"0", &
check_number,
121 "The number of jobs that the TE is allowed to execute in parallel",
122 "The \"correct\" value will depend on the speed and load of your network and cluster nodes." },
123 {
"migration-limit", NULL,
"integer", NULL,
"-1", &
check_number,
124 "The number of migration jobs that the TE is allowed to execute in parallel on a node"},
125 {
"default-action-timeout",
"default_action_timeout",
"time", NULL,
"20s", &
check_time,
126 "How long to wait for actions to complete", NULL },
129 {
"stop-all-resources", NULL,
"boolean", NULL,
"false", &
check_boolean,
130 "Should the cluster stop all active resources (except those needed for fencing)", NULL },
131 {
"stop-orphan-resources",
"stop_orphan_resources",
"boolean", NULL,
"true", &
check_boolean,
132 "Should deleted resources be stopped", NULL },
133 {
"stop-orphan-actions",
"stop_orphan_actions",
"boolean", NULL,
"true", &
check_boolean,
134 "Should deleted actions be cancelled", NULL },
135 {
"remove-after-stop",
"remove_after_stop",
"boolean", NULL,
"false", &
check_boolean,
136 "Remove resources from the LRM after they are stopped",
137 "Always set this to false. Other values are, at best, poorly tested and potentially dangerous." },
141 {
"pe-error-series-max", NULL,
"integer", NULL,
"-1", &
check_number,
142 "The number of PE inputs resulting in ERRORs to save",
"Zero to disable, -1 to store unlimited." },
143 {
"pe-warn-series-max", NULL,
"integer", NULL,
"5000", &
check_number,
144 "The number of PE inputs resulting in WARNINGs to save",
"Zero to disable, -1 to store unlimited." },
145 {
"pe-input-series-max", NULL,
"integer", NULL,
"4000", &
check_number,
146 "The number of other PE inputs to save",
"Zero to disable, -1 to store unlimited." },
149 {
"node-health-strategy", NULL,
"enum",
"none, migrate-on-red, only-green, progressive, custom",
"none", &check_health,
150 "The strategy combining node attributes to determine overall node health.",
151 "Requires external entities to create node attributes (named with the prefix '#health') with values: 'red', 'yellow' or 'green'."},
152 {
"node-health-green", NULL,
"integer", NULL,
"0", &
check_number,
153 "The score 'green' translates to in rsc_location constraints",
154 "Only used when node-health-strategy is set to custom or progressive." },
155 {
"node-health-yellow", NULL,
"integer", NULL,
"0", &
check_number,
156 "The score 'yellow' translates to in rsc_location constraints",
157 "Only used when node-health-strategy is set to custom or progressive." },
158 {
"node-health-red", NULL,
"integer", NULL,
"-INFINITY", &
check_number,
159 "The score 'red' translates to in rsc_location constraints",
160 "Only used when node-health-strategy is set to custom or progressive." },
163 {
"placement-strategy", NULL,
"enum",
"default, utilization, minimal, balanced",
"default", &check_placement_strategy,
164 "The strategy to determine resource placement", NULL},
172 "Policy Engine Options",
173 "This is a fake resource that details the options that can be configured for the Policy Engine.",
174 pe_opts,
DIMOF(pe_opts));
184 pe_pref(GHashTable * options,
const char *name)
192 const char *result =
"<unknown>";
217 result =
"restart-container";
220 result =
"reset-remote";
275 }
else if (
safe_str_eq(task,
"stonith_complete")) {
280 crm_trace(
"Unsupported action: %s", task);
289 const char *result =
"<unknown>";
293 result =
"no_action";
374 crm_err(
"Unknown role: %s", role);
381 int result = w1 + w2;
385 crm_trace(
"-INFINITY + INFINITY == -INFINITY");
395 if (w1 <= 0 && w2 < 0) {
399 }
else if (w1 > 0 && w2 > 0) {
411 crm_trace(
"%d + %d = %d", w1, w2, result);
421 if (name == NULL || value == NULL) {
427 }
else if (g_hash_table_lookup(hash, name) == NULL) {
428 g_hash_table_insert(hash, strdup(name), strdup(value));
#define CRM_CHECK(expr, failure_action)
void add_hash_param(GHashTable *hash, const char *name, const char *value)
#define CRMD_ACTION_MIGRATED
int merge_weights(int w1, int w2)
#define RSC_ROLE_STARTED_S
#define CRMD_ACTION_NOTIFY
#define CRMD_ACTION_PROMOTE
const char * task2text(enum action_tasks task)
gboolean check_number(const char *value)
gboolean was_processing_error
gboolean was_processing_warning
#define CRMD_ACTION_START
enum rsc_role_e text2role(const char *role)
#define CRM_OP_LRM_REFRESH
#define CRMD_ACTION_DEMOTED
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
const char * role2text(enum rsc_role_e role)
gboolean check_quorum(const char *value)
#define crm_trace(fmt, args...)
Wrappers for and extensions to libxml2.
gboolean check_time(const char *value)
#define RSC_ROLE_MASTER_S
#define CRMD_ACTION_PROMOTED
gboolean check_boolean(const char *value)
void verify_pe_options(GHashTable *options)
const char * pe_pref(GHashTable *options, const char *name)
#define CRMD_ACTION_STOPPED
#define crm_err(fmt, args...)
#define XML_ATTR_HAVE_WATCHDOG
#define CRMD_ACTION_MIGRATE
#define RSC_ROLE_STOPPED_S
void verify_all_options(GHashTable *options, pe_cluster_option *option_list, int len)
enum action_tasks text2task(const char *task)
#define RSC_ROLE_UNKNOWN_S
gboolean check_timer(const char *value)
#define CRMD_ACTION_NOTIFIED
#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)
const char * fail2text(enum action_fail_response fail)
#define CRMD_ACTION_STARTED
#define CRMD_ACTION_CANCEL
#define CRMD_ACTION_DELETE
#define CRMD_ACTION_STATUS