pacemaker  2.0.4-2deceaa
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
common.c
Go to the documentation of this file.
1 /*
2  * Copyright 2004-2020 the Pacemaker project contributors
3  *
4  * The version control history for this file may have further details.
5  *
6  * This source code is licensed under the GNU Lesser General Public License
7  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8  */
9 
10 #include <crm_internal.h>
11 #include <crm/crm.h>
12 #include <crm/msg_xml.h>
13 #include <crm/common/xml.h>
14 #include <crm/common/util.h>
15 
16 #include <glib.h>
17 
18 #include <crm/pengine/internal.h>
19 
20 gboolean was_processing_error = FALSE;
21 gboolean was_processing_warning = FALSE;
22 
23 static bool
24 check_health(const char *value)
25 {
26  return safe_str_eq(value, "none")
27  || safe_str_eq(value, "custom")
28  || safe_str_eq(value, "only-green")
29  || safe_str_eq(value, "progressive")
30  || safe_str_eq(value, "migrate-on-red");
31 }
32 
33 static bool
34 check_stonith_action(const char *value)
35 {
36  return safe_str_eq(value, "reboot")
37  || safe_str_eq(value, "poweroff")
38  || safe_str_eq(value, "off");
39 }
40 
41 static bool
42 check_placement_strategy(const char *value)
43 {
44  return safe_str_eq(value, "default")
45  || safe_str_eq(value, "utilization")
46  || safe_str_eq(value, "minimal")
47  || safe_str_eq(value, "balanced");
48 }
49 
50 static pcmk__cluster_option_t pe_opts[] = {
51  /* name, old name, type, allowed values,
52  * default value, validator,
53  * short description,
54  * long description
55  */
56  {
57  "no-quorum-policy", NULL, "enum", "stop, freeze, ignore, suicide",
58  "stop", pcmk__valid_quorum,
59  "What to do when the cluster does not have quorum",
60  NULL
61  },
62  {
63  "symmetric-cluster", NULL, "boolean", NULL,
64  "true", pcmk__valid_boolean,
65  "Whether resources can run on any node by default",
66  NULL
67  },
68  {
69  "maintenance-mode", NULL, "boolean", NULL,
70  "false", pcmk__valid_boolean,
71  "Whether the cluster should refrain from monitoring, starting, "
72  "and stopping resources",
73  NULL
74  },
75  {
76  "start-failure-is-fatal", NULL, "boolean", NULL,
77  "true", pcmk__valid_boolean,
78  "Whether a start failure should prevent a resource from being "
79  "recovered on the same node",
80  "When true, the cluster will immediately ban a resource from a node "
81  "if it fails to start there. When false, the cluster will instead "
82  "check the resource's fail count against its migration-threshold."
83  },
84  {
85  "enable-startup-probes", NULL, "boolean", NULL,
86  "true", pcmk__valid_boolean,
87  "Whether the cluster should check for active resources during start-up",
88  NULL
89  },
90  {
91  XML_CONFIG_ATTR_SHUTDOWN_LOCK, NULL, "boolean", NULL,
92  "false", pcmk__valid_boolean,
93  "Whether to lock resources to a cleanly shut down node",
94  "When true, resources active on a node when it is cleanly shut down "
95  "are kept \"locked\" to that node (not allowed to run elsewhere) "
96  "until they start again on that node after it rejoins (or for at "
97  "most shutdown-lock-limit, if set). Stonith resources and "
98  "Pacemaker Remote connections are never locked. Clone and bundle "
99  "instances and the master role of promotable clones are currently "
100  "never locked, though support could be added in a future release."
101  },
102  {
103  XML_CONFIG_ATTR_SHUTDOWN_LOCK_LIMIT, NULL, "time", NULL,
105  "Do not lock resources to a cleanly shut down node longer than this",
106  "If shutdown-lock is true and this is set to a nonzero time duration, "
107  "shutdown locks will expire after this much time has passed since "
108  "the shutdown was initiated, even if the node has not rejoined."
109  },
110 
111  // Fencing-related options
112  {
113  "stonith-enabled", NULL, "boolean", NULL,
114  "true", pcmk__valid_boolean,
115  "*** Advanced Use Only *** "
116  "Whether nodes may be fenced as part of recovery",
117  "If false, unresponsive nodes are immediately assumed to be harmless, "
118  "and resources that were active on them may be recovered "
119  "elsewhere. This can result in a \"split-brain\" situation, "
120  "potentially leading to data loss and/or service unavailability."
121  },
122  {
123  "stonith-action", NULL, "enum", "reboot, off, poweroff",
124  "reboot", check_stonith_action,
125  "Action to send to fence device when a node needs to be fenced "
126  "(\"poweroff\" is a deprecated alias for \"off\")",
127  NULL
128  },
129  {
130  "stonith-timeout", NULL, "time", NULL,
132  "*** Advanced Use Only *** Unused by Pacemaker",
133  "This value is not used by Pacemaker, but is kept for backward "
134  "compatibility, and certain legacy fence agents might use it."
135  },
136  {
137  XML_ATTR_HAVE_WATCHDOG, NULL, "boolean", NULL,
138  "false", pcmk__valid_boolean,
139  "Whether watchdog integration is enabled",
140  "This is set automatically by the cluster according to whether SBD "
141  "is detected to be in use. User-configured values are ignored."
142  },
143  {
144  "concurrent-fencing", NULL, "boolean", NULL,
145 #ifdef DEFAULT_CONCURRENT_FENCING_TRUE
146  "true",
147 #else
148  "false",
149 #endif
151  "Allow performing fencing operations in parallel",
152  NULL
153  },
154  {
155  "startup-fencing", NULL, "boolean", NULL,
156  "true", pcmk__valid_boolean,
157  "*** Advanced Use Only *** Whether to fence unseen nodes at start-up",
158  "Setting this to false may lead to a \"split-brain\" situation,"
159  "potentially leading to data loss and/or service unavailability."
160  },
161  {
162  XML_CONFIG_ATTR_PRIORITY_FENCING_DELAY, NULL, "time", NULL,
164  "Apply fencing delay targeting the lost nodes with the highest total resource priority",
165  "Apply specified delay for the fencings that are targeting the lost "
166  "nodes with the highest total resource priority in case we don't "
167  "have the majority of the nodes in our cluster partition, so that "
168  "the more significant nodes potentially win any fencing match, "
169  "which is especially meaningful under split-brain of 2-node "
170  "cluster. A promoted resource instance takes the base priority + 1 "
171  "on calculation if the base priority is not 0. Any static/random "
172  "delays that are introduced by `pcmk_delay_base/max` configured "
173  "for the corresponding fencing resources will be added to this "
174  "delay. This delay should be significantly greater than, safely "
175  "twice, the maximum `pcmk_delay_base/max`. By default, priority "
176  "fencing delay is disabled."
177  },
178 
179  {
180  "cluster-delay", NULL, "time", NULL,
182  "Maximum time for node-to-node communication",
183  "The node elected Designated Controller (DC) will consider an action "
184  "failed if it does not get a response from the node executing the "
185  "action within this time (after considering the action's own "
186  "timeout). The \"correct\" value will depend on the speed and "
187  "load of your network and cluster nodes."
188  },
189  {
190  "batch-limit", NULL, "integer", NULL,
191  "0", pcmk__valid_number,
192  "Maximum number of jobs that the cluster may execute in parallel "
193  "across all nodes",
194  "The \"correct\" value will depend on the speed and load of your "
195  "network and cluster nodes. If set to 0, the cluster will "
196  "impose a dynamically calculated limit when any node has a "
197  "high load."
198  },
199  {
200  "migration-limit", NULL, "integer", NULL,
201  "-1", pcmk__valid_number,
202  "The number of live migration actions that the cluster is allowed "
203  "to execute in parallel on a node (-1 means no limit)"
204  },
205 
206  /* Orphans and stopping */
207  {
208  "stop-all-resources", NULL, "boolean", NULL,
209  "false", pcmk__valid_boolean,
210  "Whether the cluster should stop all active resources",
211  NULL
212  },
213  {
214  "stop-orphan-resources", NULL, "boolean", NULL,
215  "true", pcmk__valid_boolean,
216  "Whether to stop resources that were removed from the configuration",
217  NULL
218  },
219  {
220  "stop-orphan-actions", NULL, "boolean", NULL,
221  "true", pcmk__valid_boolean,
222  "Whether to cancel recurring actions removed from the configuration",
223  NULL
224  },
225  {
226  "remove-after-stop", NULL, "boolean", NULL,
227  "false", pcmk__valid_boolean,
228  "*** Advanced Use Only *** Whether to remove stopped resources from "
229  "the executor",
230  "Values other than default are poorly tested and potentially dangerous."
231  },
232 
233  /* Storing inputs */
234  {
235  "pe-error-series-max", NULL, "integer", NULL,
236  "-1", pcmk__valid_number,
237  "The number of scheduler inputs resulting in errors to save",
238  "Zero to disable, -1 to store unlimited."
239  },
240  {
241  "pe-warn-series-max", NULL, "integer", NULL,
242  "5000", pcmk__valid_number,
243  "The number of scheduler inputs resulting in warnings to save",
244  "Zero to disable, -1 to store unlimited."
245  },
246  {
247  "pe-input-series-max", NULL, "integer", NULL,
248  "4000", pcmk__valid_number,
249  "The number of scheduler inputs without errors or warnings to save",
250  "Zero to disable, -1 to store unlimited."
251  },
252 
253  /* Node health */
254  {
255  "node-health-strategy", NULL, "enum",
256  "none, migrate-on-red, only-green, progressive, custom",
257  "none", check_health,
258  "How cluster should react to node health attributes",
259  "Requires external entities to create node attributes (named with "
260  "the prefix \"#health\") with values \"red\", \"yellow\" or "
261  "\"green\"."
262  },
263  {
264  "node-health-base", NULL, "integer", NULL,
265  "0", pcmk__valid_number,
266  "Base health score assigned to a node",
267  "Only used when node-health-strategy is set to progressive."
268  },
269  {
270  "node-health-green", NULL, "integer", NULL,
271  "0", pcmk__valid_number,
272  "The score to use for a node health attribute whose value is \"green\"",
273  "Only used when node-health-strategy is set to custom or progressive."
274  },
275  {
276  "node-health-yellow", NULL, "integer", NULL,
277  "0", pcmk__valid_number,
278  "The score to use for a node health attribute whose value is \"yellow\"",
279  "Only used when node-health-strategy is set to custom or progressive."
280  },
281  {
282  "node-health-red", NULL, "integer", NULL,
283  "-INFINITY", pcmk__valid_number,
284  "The score to use for a node health attribute whose value is \"red\"",
285  "Only used when node-health-strategy is set to custom or progressive."
286  },
287 
288  /*Placement Strategy*/
289  {
290  "placement-strategy", NULL, "enum",
291  "default, utilization, minimal, balanced",
292  "default", check_placement_strategy,
293  "How the cluster should allocate resources to nodes",
294  NULL
295  },
296 };
297 
298 void
300 {
301  pcmk__print_option_metadata("pacemaker-schedulerd", "1.0",
302  "Pacemaker scheduler options",
303  "Cluster options used by Pacemaker's scheduler"
304  " (formerly called pengine)",
305  pe_opts, DIMOF(pe_opts));
306 }
307 
308 void
309 verify_pe_options(GHashTable * options)
310 {
311  pcmk__validate_cluster_options(options, pe_opts, DIMOF(pe_opts));
312 }
313 
314 const char *
315 pe_pref(GHashTable * options, const char *name)
316 {
317  return pcmk__cluster_option(options, pe_opts, DIMOF(pe_opts), name);
318 }
319 
320 const char *
322 {
323  const char *result = "<unknown>";
324 
325  switch (fail) {
326  case action_fail_ignore:
327  result = "ignore";
328  break;
329  case action_fail_block:
330  result = "block";
331  break;
332  case action_fail_recover:
333  result = "recover";
334  break;
335  case action_fail_migrate:
336  result = "migrate";
337  break;
338  case action_fail_stop:
339  result = "stop";
340  break;
341  case action_fail_fence:
342  result = "fence";
343  break;
344  case action_fail_standby:
345  result = "standby";
346  break;
348  result = "restart-container";
349  break;
351  result = "reset-remote";
352  break;
353  }
354  return result;
355 }
356 
357 enum action_tasks
358 text2task(const char *task)
359 {
360  if (safe_str_eq(task, CRMD_ACTION_STOP)) {
361  return stop_rsc;
362  } else if (safe_str_eq(task, CRMD_ACTION_STOPPED)) {
363  return stopped_rsc;
364  } else if (safe_str_eq(task, CRMD_ACTION_START)) {
365  return start_rsc;
366  } else if (safe_str_eq(task, CRMD_ACTION_STARTED)) {
367  return started_rsc;
368  } else if (safe_str_eq(task, CRM_OP_SHUTDOWN)) {
369  return shutdown_crm;
370  } else if (safe_str_eq(task, CRM_OP_FENCE)) {
371  return stonith_node;
372  } else if (safe_str_eq(task, CRMD_ACTION_STATUS)) {
373  return monitor_rsc;
374  } else if (safe_str_eq(task, CRMD_ACTION_NOTIFY)) {
375  return action_notify;
376  } else if (safe_str_eq(task, CRMD_ACTION_NOTIFIED)) {
377  return action_notified;
378  } else if (safe_str_eq(task, CRMD_ACTION_PROMOTE)) {
379  return action_promote;
380  } else if (safe_str_eq(task, CRMD_ACTION_DEMOTE)) {
381  return action_demote;
382  } else if (safe_str_eq(task, CRMD_ACTION_PROMOTED)) {
383  return action_promoted;
384  } else if (safe_str_eq(task, CRMD_ACTION_DEMOTED)) {
385  return action_demoted;
386  }
387 #if SUPPORT_TRACING
388  if (safe_str_eq(task, CRMD_ACTION_CANCEL)) {
389  return no_action;
390  } else if (safe_str_eq(task, CRMD_ACTION_DELETE)) {
391  return no_action;
392  } else if (safe_str_eq(task, CRMD_ACTION_STATUS)) {
393  return no_action;
394  } else if (safe_str_eq(task, CRM_OP_PROBED)) {
395  return no_action;
396  } else if (safe_str_eq(task, CRM_OP_LRM_REFRESH)) {
397  return no_action;
398  } else if (safe_str_eq(task, CRMD_ACTION_MIGRATE)) {
399  return no_action;
400  } else if (safe_str_eq(task, CRMD_ACTION_MIGRATED)) {
401  return no_action;
402  }
403  crm_trace("Unsupported action: %s", task);
404 #endif
405 
406  return no_action;
407 }
408 
409 const char *
411 {
412  const char *result = "<unknown>";
413 
414  switch (task) {
415  case no_action:
416  result = "no_action";
417  break;
418  case stop_rsc:
419  result = CRMD_ACTION_STOP;
420  break;
421  case stopped_rsc:
422  result = CRMD_ACTION_STOPPED;
423  break;
424  case start_rsc:
425  result = CRMD_ACTION_START;
426  break;
427  case started_rsc:
428  result = CRMD_ACTION_STARTED;
429  break;
430  case shutdown_crm:
431  result = CRM_OP_SHUTDOWN;
432  break;
433  case stonith_node:
434  result = CRM_OP_FENCE;
435  break;
436  case monitor_rsc:
437  result = CRMD_ACTION_STATUS;
438  break;
439  case action_notify:
440  result = CRMD_ACTION_NOTIFY;
441  break;
442  case action_notified:
443  result = CRMD_ACTION_NOTIFIED;
444  break;
445  case action_promote:
446  result = CRMD_ACTION_PROMOTE;
447  break;
448  case action_promoted:
449  result = CRMD_ACTION_PROMOTED;
450  break;
451  case action_demote:
452  result = CRMD_ACTION_DEMOTE;
453  break;
454  case action_demoted:
455  result = CRMD_ACTION_DEMOTED;
456  break;
457  }
458 
459  return result;
460 }
461 
462 const char *
464 {
465  switch (role) {
466  case RSC_ROLE_UNKNOWN:
467  return RSC_ROLE_UNKNOWN_S;
468  case RSC_ROLE_STOPPED:
469  return RSC_ROLE_STOPPED_S;
470  case RSC_ROLE_STARTED:
471  return RSC_ROLE_STARTED_S;
472  case RSC_ROLE_SLAVE:
473  return RSC_ROLE_SLAVE_S;
474  case RSC_ROLE_MASTER:
475  return RSC_ROLE_MASTER_S;
476  }
478  CRM_CHECK(role < RSC_ROLE_MAX, return RSC_ROLE_UNKNOWN_S);
479  // coverity[dead_error_line]
480  return RSC_ROLE_UNKNOWN_S;
481 }
482 
483 enum rsc_role_e
484 text2role(const char *role)
485 {
486  CRM_ASSERT(role != NULL);
487  if (safe_str_eq(role, RSC_ROLE_STOPPED_S)) {
488  return RSC_ROLE_STOPPED;
489  } else if (safe_str_eq(role, RSC_ROLE_STARTED_S)) {
490  return RSC_ROLE_STARTED;
491  } else if (safe_str_eq(role, RSC_ROLE_SLAVE_S)) {
492  return RSC_ROLE_SLAVE;
493  } else if (safe_str_eq(role, RSC_ROLE_MASTER_S)) {
494  return RSC_ROLE_MASTER;
495  } else if (safe_str_eq(role, RSC_ROLE_UNKNOWN_S)) {
496  return RSC_ROLE_UNKNOWN;
497  }
498  crm_err("Unknown role: %s", role);
499  return RSC_ROLE_UNKNOWN;
500 }
501 
509 int
510 pe__add_scores(int score1, int score2)
511 {
512  int result = score1 + score2;
513 
514  // First handle the cases where one or both is infinite
515 
516  if (score1 <= -CRM_SCORE_INFINITY) {
517 
518  if (score2 <= -CRM_SCORE_INFINITY) {
519  crm_trace("-INFINITY + -INFINITY = -INFINITY");
520  } else if (score2 >= CRM_SCORE_INFINITY) {
521  crm_trace("-INFINITY + +INFINITY = -INFINITY");
522  } else {
523  crm_trace("-INFINITY + %d = -INFINITY", score2);
524  }
525 
526  return -CRM_SCORE_INFINITY;
527 
528  } else if (score2 <= -CRM_SCORE_INFINITY) {
529 
530  if (score1 >= CRM_SCORE_INFINITY) {
531  crm_trace("+INFINITY + -INFINITY = -INFINITY");
532  } else {
533  crm_trace("%d + -INFINITY = -INFINITY", score1);
534  }
535 
536  return -CRM_SCORE_INFINITY;
537 
538  } else if (score1 >= CRM_SCORE_INFINITY) {
539 
540  if (score2 >= CRM_SCORE_INFINITY) {
541  crm_trace("+INFINITY + +INFINITY = +INFINITY");
542  } else {
543  crm_trace("+INFINITY + %d = +INFINITY", score2);
544  }
545 
546  return CRM_SCORE_INFINITY;
547 
548  } else if (score2 >= CRM_SCORE_INFINITY) {
549  crm_trace("%d + +INFINITY = +INFINITY", score1);
550  return CRM_SCORE_INFINITY;
551  }
552 
553  /* As long as CRM_SCORE_INFINITY is less than half of the maximum integer,
554  * we can ignore the possibility of integer overflow
555  */
556 
557  // Bound result to infinity
558 
559  if (result >= CRM_SCORE_INFINITY) {
560  crm_trace("%d + %d = +INFINITY", score1, score2);
561  return CRM_SCORE_INFINITY;
562 
563  } else if (result <= -CRM_SCORE_INFINITY) {
564  crm_trace("%d + %d = -INFINITY", score1, score2);
565  return -CRM_SCORE_INFINITY;
566  }
567 
568  crm_trace("%d + %d = %d", score1, score2, result);
569  return result;
570 }
571 
572 void
573 add_hash_param(GHashTable * hash, const char *name, const char *value)
574 {
575  CRM_CHECK(hash != NULL, return);
576 
577  crm_trace("adding: name=%s value=%s", crm_str(name), crm_str(value));
578  if (name == NULL || value == NULL) {
579  return;
580 
581  } else if (safe_str_eq(value, "#default")) {
582  return;
583 
584  } else if (g_hash_table_lookup(hash, name) == NULL) {
585  g_hash_table_insert(hash, strdup(name), strdup(value));
586  }
587 }
588 
589 const char *
590 pe_node_attribute_calculated(const pe_node_t *node, const char *name,
591  const pe_resource_t *rsc)
592 {
593  const char *source;
594 
595  if(node == NULL) {
596  return NULL;
597 
598  } else if(rsc == NULL) {
599  return g_hash_table_lookup(node->details->attrs, name);
600  }
601 
602  source = g_hash_table_lookup(rsc->meta, XML_RSC_ATTR_TARGET);
603  if(source == NULL || safe_str_eq("host", source) == FALSE) {
604  return g_hash_table_lookup(node->details->attrs, name);
605  }
606 
607  /* Use attributes set for the containers location
608  * instead of for the container itself
609  *
610  * Useful when the container is using the host's local
611  * storage
612  */
613 
614  CRM_ASSERT(node->details->remote_rsc);
616 
617  if(node->details->remote_rsc->container->running_on) {
619  pe_rsc_trace(rsc, "%s: Looking for %s on the container host %s", rsc->id, name, host->details->uname);
620  return g_hash_table_lookup(host->details->attrs, name);
621  }
622 
623  pe_rsc_trace(rsc, "%s: Not looking for %s on the container host: %s is inactive",
624  rsc->id, name, node->details->remote_rsc->container->id);
625  return NULL;
626 }
627 
628 const char *
630 {
631  if(node == NULL) {
632  return NULL;
633  }
634  return g_hash_table_lookup(node->details->attrs, name);
635 }
#define CRM_CHECK(expr, failure_action)
Definition: logging.h:233
void verify_pe_options(GHashTable *options)
Definition: common.c:309
const char * task2text(enum action_tasks task)
Definition: common.c:410
A dumping ground.
#define CRMD_ACTION_MIGRATED
Definition: crm.h:169
GHashTable * attrs
Definition: pe_types.h:221
const char * pe_node_attribute_calculated(const pe_node_t *node, const char *name, const pe_resource_t *rsc)
Definition: common.c:590
#define XML_CONFIG_ATTR_SHUTDOWN_LOCK
Definition: msg_xml.h:349
#define CRM_OP_FENCE
Definition: crm.h:141
void pe_metadata(void)
Definition: common.c:299
pe_resource_t * container
Definition: pe_types.h:364
#define XML_CONFIG_ATTR_PRIORITY_FENCING_DELAY
Definition: msg_xml.h:351
#define RSC_ROLE_STARTED_S
Definition: common.h:88
pe_resource_t * remote_rsc
Definition: pe_types.h:217
#define CRMD_ACTION_NOTIFY
Definition: crm.h:182
GHashTable * meta
Definition: pe_types.h:357
#define CRMD_ACTION_PROMOTE
Definition: crm.h:177
AIS_Host host
Definition: internal.h:84
enum action_tasks text2task(const char *task)
Definition: common.c:358
const char * pe_pref(GHashTable *options, const char *name)
Definition: common.c:315
#define CRM_SCORE_INFINITY
Definition: crm.h:81
#define XML_RSC_ATTR_TARGET
Definition: msg_xml.h:182
action_fail_response
Definition: common.h:26
#define CRMD_ACTION_START
Definition: crm.h:171
#define CRM_OP_LRM_REFRESH
Definition: crm.h:145
const char * role2text(enum rsc_role_e role)
Definition: common.c:463
#define CRMD_ACTION_DEMOTED
Definition: crm.h:180
#define CRMD_ACTION_STOP
Definition: crm.h:174
bool pcmk__valid_quorum(const char *value)
Definition: options.c:405
#define XML_CONFIG_ATTR_SHUTDOWN_LOCK_LIMIT
Definition: msg_xml.h:350
#define CRMD_ACTION_DEMOTE
Definition: crm.h:179
bool pcmk__valid_interval_spec(const char *value)
Definition: options.c:367
Utility functions.
#define crm_trace(fmt, args...)
Definition: logging.h:369
struct pe_node_shared_s * details
Definition: pe_types.h:231
GListPtr running_on
Definition: pe_types.h:350
const char * uname
Definition: pe_types.h:196
Wrappers for and extensions to libxml2.
const char * pe_node_attribute_raw(pe_node_t *node, const char *name)
Definition: common.c:629
#define RSC_ROLE_MASTER_S
Definition: common.h:90
#define CRMD_ACTION_PROMOTED
Definition: crm.h:178
const char * pcmk__cluster_option(GHashTable *options, pcmk__cluster_option_t *option_list, int len, const char *name)
Definition: options.c:539
enum rsc_role_e text2role(const char *role)
Definition: common.c:484
void pcmk__print_option_metadata(const char *name, const char *version, const char *desc_short, const char *desc_long, pcmk__cluster_option_t *option_list, int len)
Definition: options.c:558
#define CRM_OP_SHUTDOWN
Definition: crm.h:140
#define CRMD_ACTION_STOPPED
Definition: crm.h:175
bool pcmk__valid_boolean(const char *value)
Definition: options.c:374
const char * fail2text(enum action_fail_response fail)
Definition: common.c:321
void add_hash_param(GHashTable *hash, const char *name, const char *value)
Definition: common.c:573
int pe__add_scores(int score1, int score2)
Definition: common.c:510
#define crm_err(fmt, args...)
Definition: logging.h:363
#define CRM_ASSERT(expr)
Definition: results.h:42
#define XML_ATTR_HAVE_WATCHDOG
Definition: msg_xml.h:86
#define RSC_ROLE_SLAVE_S
Definition: common.h:89
bool pcmk__valid_number(const char *value)
Definition: options.c:382
#define DIMOF(a)
Definition: crm.h:57
#define CRMD_ACTION_MIGRATE
Definition: crm.h:168
#define RSC_ROLE_STOPPED_S
Definition: common.h:87
#define crm_str(x)
Definition: logging.h:389
rsc_role_e
Definition: common.h:76
#define CRM_OP_PROBED
Definition: crm.h:149
#define RSC_ROLE_UNKNOWN_S
Definition: common.h:86
void pcmk__validate_cluster_options(GHashTable *options, pcmk__cluster_option_t *option_list, int len)
Definition: options.c:596
#define RSC_ROLE_MAX
Definition: common.h:84
#define CRMD_ACTION_NOTIFIED
Definition: crm.h:183
#define pe_rsc_trace(rsc, fmt, args...)
Definition: internal.h:19
gboolean was_processing_error
Definition: common.c:20
#define safe_str_eq(a, b)
Definition: util.h:65
char * name
Definition: pcmk_fence.c:30
gboolean was_processing_warning
Definition: common.c:21
#define CRMD_ACTION_STARTED
Definition: crm.h:172
#define CRMD_ACTION_CANCEL
Definition: crm.h:165
action_tasks
Definition: common.h:47
#define CRMD_ACTION_DELETE
Definition: crm.h:164
char * id
Definition: pe_types.h:305
#define CRMD_ACTION_STATUS
Definition: crm.h:185