pacemaker  2.0.4-2deceaa3ae
Scalable High-Availability cluster resource manager
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, demote, 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_demote:
330  result = "demote";
331  break;
332  case action_fail_block:
333  result = "block";
334  break;
335  case action_fail_recover:
336  result = "recover";
337  break;
338  case action_fail_migrate:
339  result = "migrate";
340  break;
341  case action_fail_stop:
342  result = "stop";
343  break;
344  case action_fail_fence:
345  result = "fence";
346  break;
347  case action_fail_standby:
348  result = "standby";
349  break;
351  result = "restart-container";
352  break;
354  result = "reset-remote";
355  break;
356  }
357  return result;
358 }
359 
360 enum action_tasks
361 text2task(const char *task)
362 {
363  if (safe_str_eq(task, CRMD_ACTION_STOP)) {
364  return stop_rsc;
365  } else if (safe_str_eq(task, CRMD_ACTION_STOPPED)) {
366  return stopped_rsc;
367  } else if (safe_str_eq(task, CRMD_ACTION_START)) {
368  return start_rsc;
369  } else if (safe_str_eq(task, CRMD_ACTION_STARTED)) {
370  return started_rsc;
371  } else if (safe_str_eq(task, CRM_OP_SHUTDOWN)) {
372  return shutdown_crm;
373  } else if (safe_str_eq(task, CRM_OP_FENCE)) {
374  return stonith_node;
375  } else if (safe_str_eq(task, CRMD_ACTION_STATUS)) {
376  return monitor_rsc;
377  } else if (safe_str_eq(task, CRMD_ACTION_NOTIFY)) {
378  return action_notify;
379  } else if (safe_str_eq(task, CRMD_ACTION_NOTIFIED)) {
380  return action_notified;
381  } else if (safe_str_eq(task, CRMD_ACTION_PROMOTE)) {
382  return action_promote;
383  } else if (safe_str_eq(task, CRMD_ACTION_DEMOTE)) {
384  return action_demote;
385  } else if (safe_str_eq(task, CRMD_ACTION_PROMOTED)) {
386  return action_promoted;
387  } else if (safe_str_eq(task, CRMD_ACTION_DEMOTED)) {
388  return action_demoted;
389  }
390 #if SUPPORT_TRACING
391  if (safe_str_eq(task, CRMD_ACTION_CANCEL)) {
392  return no_action;
393  } else if (safe_str_eq(task, CRMD_ACTION_DELETE)) {
394  return no_action;
395  } else if (safe_str_eq(task, CRMD_ACTION_STATUS)) {
396  return no_action;
397  } else if (safe_str_eq(task, CRM_OP_PROBED)) {
398  return no_action;
399  } else if (safe_str_eq(task, CRM_OP_LRM_REFRESH)) {
400  return no_action;
401  } else if (safe_str_eq(task, CRMD_ACTION_MIGRATE)) {
402  return no_action;
403  } else if (safe_str_eq(task, CRMD_ACTION_MIGRATED)) {
404  return no_action;
405  }
406  crm_trace("Unsupported action: %s", task);
407 #endif
408 
409  return no_action;
410 }
411 
412 const char *
414 {
415  const char *result = "<unknown>";
416 
417  switch (task) {
418  case no_action:
419  result = "no_action";
420  break;
421  case stop_rsc:
422  result = CRMD_ACTION_STOP;
423  break;
424  case stopped_rsc:
425  result = CRMD_ACTION_STOPPED;
426  break;
427  case start_rsc:
428  result = CRMD_ACTION_START;
429  break;
430  case started_rsc:
431  result = CRMD_ACTION_STARTED;
432  break;
433  case shutdown_crm:
434  result = CRM_OP_SHUTDOWN;
435  break;
436  case stonith_node:
437  result = CRM_OP_FENCE;
438  break;
439  case monitor_rsc:
440  result = CRMD_ACTION_STATUS;
441  break;
442  case action_notify:
443  result = CRMD_ACTION_NOTIFY;
444  break;
445  case action_notified:
446  result = CRMD_ACTION_NOTIFIED;
447  break;
448  case action_promote:
449  result = CRMD_ACTION_PROMOTE;
450  break;
451  case action_promoted:
452  result = CRMD_ACTION_PROMOTED;
453  break;
454  case action_demote:
455  result = CRMD_ACTION_DEMOTE;
456  break;
457  case action_demoted:
458  result = CRMD_ACTION_DEMOTED;
459  break;
460  }
461 
462  return result;
463 }
464 
465 const char *
467 {
468  switch (role) {
469  case RSC_ROLE_UNKNOWN:
470  return RSC_ROLE_UNKNOWN_S;
471  case RSC_ROLE_STOPPED:
472  return RSC_ROLE_STOPPED_S;
473  case RSC_ROLE_STARTED:
474  return RSC_ROLE_STARTED_S;
475  case RSC_ROLE_SLAVE:
476  return RSC_ROLE_SLAVE_S;
477  case RSC_ROLE_MASTER:
478  return RSC_ROLE_MASTER_S;
479  }
481  CRM_CHECK(role < RSC_ROLE_MAX, return RSC_ROLE_UNKNOWN_S);
482  // coverity[dead_error_line]
483  return RSC_ROLE_UNKNOWN_S;
484 }
485 
486 enum rsc_role_e
487 text2role(const char *role)
488 {
489  CRM_ASSERT(role != NULL);
490  if (safe_str_eq(role, RSC_ROLE_STOPPED_S)) {
491  return RSC_ROLE_STOPPED;
492  } else if (safe_str_eq(role, RSC_ROLE_STARTED_S)) {
493  return RSC_ROLE_STARTED;
494  } else if (safe_str_eq(role, RSC_ROLE_SLAVE_S)) {
495  return RSC_ROLE_SLAVE;
496  } else if (safe_str_eq(role, RSC_ROLE_MASTER_S)) {
497  return RSC_ROLE_MASTER;
498  } else if (safe_str_eq(role, RSC_ROLE_UNKNOWN_S)) {
499  return RSC_ROLE_UNKNOWN;
500  }
501  crm_err("Unknown role: %s", role);
502  return RSC_ROLE_UNKNOWN;
503 }
504 
512 int
513 pe__add_scores(int score1, int score2)
514 {
515  int result = score1 + score2;
516 
517  // First handle the cases where one or both is infinite
518 
519  if (score1 <= -CRM_SCORE_INFINITY) {
520 
521  if (score2 <= -CRM_SCORE_INFINITY) {
522  crm_trace("-INFINITY + -INFINITY = -INFINITY");
523  } else if (score2 >= CRM_SCORE_INFINITY) {
524  crm_trace("-INFINITY + +INFINITY = -INFINITY");
525  } else {
526  crm_trace("-INFINITY + %d = -INFINITY", score2);
527  }
528 
529  return -CRM_SCORE_INFINITY;
530 
531  } else if (score2 <= -CRM_SCORE_INFINITY) {
532 
533  if (score1 >= CRM_SCORE_INFINITY) {
534  crm_trace("+INFINITY + -INFINITY = -INFINITY");
535  } else {
536  crm_trace("%d + -INFINITY = -INFINITY", score1);
537  }
538 
539  return -CRM_SCORE_INFINITY;
540 
541  } else if (score1 >= CRM_SCORE_INFINITY) {
542 
543  if (score2 >= CRM_SCORE_INFINITY) {
544  crm_trace("+INFINITY + +INFINITY = +INFINITY");
545  } else {
546  crm_trace("+INFINITY + %d = +INFINITY", score2);
547  }
548 
549  return CRM_SCORE_INFINITY;
550 
551  } else if (score2 >= CRM_SCORE_INFINITY) {
552  crm_trace("%d + +INFINITY = +INFINITY", score1);
553  return CRM_SCORE_INFINITY;
554  }
555 
556  /* As long as CRM_SCORE_INFINITY is less than half of the maximum integer,
557  * we can ignore the possibility of integer overflow
558  */
559 
560  // Bound result to infinity
561 
562  if (result >= CRM_SCORE_INFINITY) {
563  crm_trace("%d + %d = +INFINITY", score1, score2);
564  return CRM_SCORE_INFINITY;
565 
566  } else if (result <= -CRM_SCORE_INFINITY) {
567  crm_trace("%d + %d = -INFINITY", score1, score2);
568  return -CRM_SCORE_INFINITY;
569  }
570 
571  crm_trace("%d + %d = %d", score1, score2, result);
572  return result;
573 }
574 
575 void
576 add_hash_param(GHashTable * hash, const char *name, const char *value)
577 {
578  CRM_CHECK(hash != NULL, return);
579 
580  crm_trace("adding: name=%s value=%s", crm_str(name), crm_str(value));
581  if (name == NULL || value == NULL) {
582  return;
583 
584  } else if (safe_str_eq(value, "#default")) {
585  return;
586 
587  } else if (g_hash_table_lookup(hash, name) == NULL) {
588  g_hash_table_insert(hash, strdup(name), strdup(value));
589  }
590 }
591 
592 const char *
593 pe_node_attribute_calculated(const pe_node_t *node, const char *name,
594  const pe_resource_t *rsc)
595 {
596  const char *source;
597 
598  if(node == NULL) {
599  return NULL;
600 
601  } else if(rsc == NULL) {
602  return g_hash_table_lookup(node->details->attrs, name);
603  }
604 
605  source = g_hash_table_lookup(rsc->meta, XML_RSC_ATTR_TARGET);
606  if(source == NULL || safe_str_eq("host", source) == FALSE) {
607  return g_hash_table_lookup(node->details->attrs, name);
608  }
609 
610  /* Use attributes set for the containers location
611  * instead of for the container itself
612  *
613  * Useful when the container is using the host's local
614  * storage
615  */
616 
617  CRM_ASSERT(node->details->remote_rsc);
619 
620  if(node->details->remote_rsc->container->running_on) {
622  pe_rsc_trace(rsc, "%s: Looking for %s on the container host %s", rsc->id, name, host->details->uname);
623  return g_hash_table_lookup(host->details->attrs, name);
624  }
625 
626  pe_rsc_trace(rsc, "%s: Not looking for %s on the container host: %s is inactive",
627  rsc->id, name, node->details->remote_rsc->container->id);
628  return NULL;
629 }
630 
631 const char *
633 {
634  if(node == NULL) {
635  return NULL;
636  }
637  return g_hash_table_lookup(node->details->attrs, name);
638 }
RSC_ROLE_STARTED_S
#define RSC_ROLE_STARTED_S
Definition: common.h:100
action_fail_response
action_fail_response
Definition: common.h:31
CRMD_ACTION_DEMOTED
#define CRMD_ACTION_DEMOTED
Definition: crm.h:181
CRMD_ACTION_PROMOTED
#define CRMD_ACTION_PROMOTED
Definition: crm.h:179
action_fail_standby
@ action_fail_standby
Definition: common.h:40
pe_node_attribute_raw
const char * pe_node_attribute_raw(pe_node_t *node, const char *name)
Definition: common.c:632
msg_xml.h
RSC_ROLE_STOPPED
@ RSC_ROLE_STOPPED
Definition: common.h:90
CRMD_ACTION_STARTED
#define CRMD_ACTION_STARTED
Definition: crm.h:173
action_demote
@ action_demote
Definition: common.h:70
action_fail_stop
@ action_fail_stop
Definition: common.h:39
pe_node_shared_s::remote_rsc
pe_resource_t * remote_rsc
Definition: pe_types.h:218
RSC_ROLE_MASTER
@ RSC_ROLE_MASTER
Definition: common.h:93
CRMD_ACTION_NOTIFY
#define CRMD_ACTION_NOTIFY
Definition: crm.h:183
started_rsc
@ started_rsc
Definition: common.h:65
action_fail_demote
@ action_fail_demote
Definition: common.h:55
pcmk__print_option_metadata
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:559
pcmk__cluster_option
const char * pcmk__cluster_option(GHashTable *options, pcmk__cluster_option_t *option_list, int len, const char *name)
Definition: options.c:540
CRMD_ACTION_DELETE
#define CRMD_ACTION_DELETE
Definition: crm.h:165
pcmk__cluster_option_s
Definition: options_internal.h:78
pe_resource_s::id
char * id
Definition: pe_types.h:307
rsc_role_e
rsc_role_e
Definition: common.h:88
stop_rsc
@ stop_rsc
Definition: common.h:62
CRMD_ACTION_STOPPED
#define CRMD_ACTION_STOPPED
Definition: crm.h:176
fail2text
const char * fail2text(enum action_fail_response fail)
Definition: common.c:321
CRM_CHECK
#define CRM_CHECK(expr, failure_action)
Definition: logging.h:233
task2text
const char * task2text(enum action_tasks task)
Definition: common.c:413
pe_node_s::details
struct pe_node_shared_s * details
Definition: pe_types.h:232
stopped_rsc
@ stopped_rsc
Definition: common.h:63
action_fail_recover
@ action_fail_recover
Definition: common.h:34
crm_err
#define crm_err(fmt, args...)
Definition: logging.h:363
internal.h
crm_trace
#define crm_trace(fmt, args...)
Definition: logging.h:369
pe_resource_s::meta
GHashTable * meta
Definition: pe_types.h:359
CRM_OP_PROBED
#define CRM_OP_PROBED
Definition: crm.h:150
safe_str_eq
#define safe_str_eq(a, b)
Definition: util.h:65
action_notify
@ action_notify
Definition: common.h:66
was_processing_error
gboolean was_processing_error
Definition: common.c:20
pe_resource_s::running_on
GListPtr running_on
Definition: pe_types.h:352
pe_node_attribute_calculated
const char * pe_node_attribute_calculated(const pe_node_t *node, const char *name, const pe_resource_t *rsc)
Definition: common.c:593
xml.h
Wrappers for and extensions to libxml2.
pcmk__valid_quorum
bool pcmk__valid_quorum(const char *value)
Definition: options.c:405
CRMD_ACTION_CANCEL
#define CRMD_ACTION_CANCEL
Definition: crm.h:166
CRM_OP_SHUTDOWN
#define CRM_OP_SHUTDOWN
Definition: crm.h:141
XML_CONFIG_ATTR_SHUTDOWN_LOCK
#define XML_CONFIG_ATTR_SHUTDOWN_LOCK
Definition: msg_xml.h:349
add_hash_param
void add_hash_param(GHashTable *hash, const char *name, const char *value)
Definition: common.c:576
text2role
enum rsc_role_e text2role(const char *role)
Definition: common.c:487
action_fail_block
@ action_fail_block
Definition: common.h:38
RSC_ROLE_SLAVE
@ RSC_ROLE_SLAVE
Definition: common.h:92
pcmk__valid_number
bool pcmk__valid_number(const char *value)
Definition: options.c:382
CRM_OP_LRM_REFRESH
#define CRM_OP_LRM_REFRESH
Definition: crm.h:146
XML_CONFIG_ATTR_PRIORITY_FENCING_DELAY
#define XML_CONFIG_ATTR_PRIORITY_FENCING_DELAY
Definition: msg_xml.h:351
action_notified
@ action_notified
Definition: common.h:67
action_fail_fence
@ action_fail_fence
Definition: common.h:41
CRMD_ACTION_MIGRATED
#define CRMD_ACTION_MIGRATED
Definition: crm.h:170
pe__add_scores
int pe__add_scores(int score1, int score2)
Definition: common.c:513
pcmk__valid_boolean
bool pcmk__valid_boolean(const char *value)
Definition: options.c:374
action_fail_migrate
@ action_fail_migrate
Definition: common.h:37
action_fail_reset_remote
@ action_fail_reset_remote
Definition: common.h:53
CRMD_ACTION_START
#define CRMD_ACTION_START
Definition: crm.h:172
RSC_ROLE_UNKNOWN
@ RSC_ROLE_UNKNOWN
Definition: common.h:89
DIMOF
#define DIMOF(a)
Definition: crm.h:58
CRMD_ACTION_MIGRATE
#define CRMD_ACTION_MIGRATE
Definition: crm.h:169
action_demoted
@ action_demoted
Definition: common.h:71
RSC_ROLE_MASTER_S
#define RSC_ROLE_MASTER_S
Definition: common.h:102
CRMD_ACTION_STOP
#define CRMD_ACTION_STOP
Definition: crm.h:175
role2text
const char * role2text(enum rsc_role_e role)
Definition: common.c:466
shutdown_crm
@ shutdown_crm
Definition: common.h:72
action_fail_restart_container
@ action_fail_restart_container
Definition: common.h:45
crm_ais_host_s::uname
char uname[MAX_NAME]
Definition: internal.h:24
action_promoted
@ action_promoted
Definition: common.h:69
was_processing_warning
gboolean was_processing_warning
Definition: common.c:21
RSC_ROLE_MAX
#define RSC_ROLE_MAX
Definition: common.h:96
pe_pref
const char * pe_pref(GHashTable *options, const char *name)
Definition: common.c:315
verify_pe_options
void verify_pe_options(GHashTable *options)
Definition: common.c:309
CRMD_ACTION_NOTIFIED
#define CRMD_ACTION_NOTIFIED
Definition: crm.h:184
pe_resource_s::container
pe_resource_t * container
Definition: pe_types.h:366
CRM_OP_FENCE
#define CRM_OP_FENCE
Definition: crm.h:142
RSC_ROLE_SLAVE_S
#define RSC_ROLE_SLAVE_S
Definition: common.h:101
RSC_ROLE_STOPPED_S
#define RSC_ROLE_STOPPED_S
Definition: common.h:99
host
AIS_Host host
Definition: internal.h:4
XML_CONFIG_ATTR_SHUTDOWN_LOCK_LIMIT
#define XML_CONFIG_ATTR_SHUTDOWN_LOCK_LIMIT
Definition: msg_xml.h:350
CRM_SCORE_INFINITY
#define CRM_SCORE_INFINITY
Definition: crm.h:82
crm_str
#define crm_str(x)
Definition: logging.h:389
action_promote
@ action_promote
Definition: common.h:68
RSC_ROLE_UNKNOWN_S
#define RSC_ROLE_UNKNOWN_S
Definition: common.h:98
pcmk__validate_cluster_options
void pcmk__validate_cluster_options(GHashTable *options, pcmk__cluster_option_t *option_list, int len)
Definition: options.c:597
pe_rsc_trace
#define pe_rsc_trace(rsc, fmt, args...)
Definition: internal.h:19
CRM_ASSERT
#define CRM_ASSERT(expr)
Definition: results.h:42
start_rsc
@ start_rsc
Definition: common.h:64
CRMD_ACTION_DEMOTE
#define CRMD_ACTION_DEMOTE
Definition: crm.h:180
action_fail_ignore
@ action_fail_ignore
Definition: common.h:32
CRMD_ACTION_STATUS
#define CRMD_ACTION_STATUS
Definition: crm.h:186
pe_metadata
void pe_metadata(void)
Definition: common.c:299
text2task
enum action_tasks text2task(const char *task)
Definition: common.c:361
pe_resource_s
Definition: pe_types.h:306
XML_ATTR_HAVE_WATCHDOG
#define XML_ATTR_HAVE_WATCHDOG
Definition: msg_xml.h:86
RSC_ROLE_STARTED
@ RSC_ROLE_STARTED
Definition: common.h:91
stonith_node
@ stonith_node
Definition: common.h:73
pcmk__valid_interval_spec
bool pcmk__valid_interval_spec(const char *value)
Definition: options.c:367
crm_internal.h
action_tasks
action_tasks
Definition: common.h:59
util.h
Utility functions.
pe_node_s
Definition: pe_types.h:228
name
char * name
Definition: pcmk_fence.c:30
monitor_rsc
@ monitor_rsc
Definition: common.h:61
crm.h
A dumping ground.
CRMD_ACTION_PROMOTE
#define CRMD_ACTION_PROMOTE
Definition: crm.h:178
no_action
@ no_action
Definition: common.h:60
pe_node_shared_s::attrs
GHashTable * attrs
Definition: pe_types.h:222
XML_RSC_ATTR_TARGET
#define XML_RSC_ATTR_TARGET
Definition: msg_xml.h:182