pacemaker  1.1.24-3850484742
Scalable High-Availability cluster resource manager
clone.c
Go to the documentation of this file.
1 /*
2  * Copyright 2004-2018 Andrew Beekhof <andrew@beekhof.net>
3  *
4  * This source code is licensed under the GNU Lesser General Public License
5  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
6  */
7 
8 #include <crm_internal.h>
9 
10 #include <crm/pengine/rules.h>
11 #include <crm/pengine/status.h>
12 #include <crm/pengine/internal.h>
13 #include <unpack.h>
14 #include <pe_status_private.h>
15 #include <crm/msg_xml.h>
16 
17 #define VARIANT_CLONE 1
18 #include "./variant.h"
19 
20 void
21 pe__force_anon(const char *standard, pe_resource_t *rsc, const char *rid,
22  pe_working_set_t *data_set)
23 {
24  if (pe_rsc_is_clone(rsc)) {
25  clone_variant_data_t *clone_data = NULL;
26 
27  get_clone_variant_data(clone_data, rsc);
28 
29  pe_warn("Ignoring " XML_RSC_ATTR_UNIQUE " for %s because %s resources "
30  "such as %s can be used only as anonymous clones",
31  rsc->id, standard, rid);
32 
33  clone_data->clone_node_max = 1;
34  clone_data->clone_max = QB_MIN(clone_data->clone_max,
35  g_list_length(data_set->nodes));
36  }
37 }
38 
39 resource_t *
40 find_clone_instance(resource_t * rsc, const char *sub_id, pe_working_set_t * data_set)
41 {
42  char *child_id = NULL;
43  resource_t *child = NULL;
44  const char *child_base = NULL;
45  clone_variant_data_t *clone_data = NULL;
46 
47  get_clone_variant_data(clone_data, rsc);
48 
49  child_base = ID(clone_data->xml_obj_child);
50  child_id = crm_concat(child_base, sub_id, ':');
51  child = pe_find_resource(rsc->children, child_id);
52 
53  free(child_id);
54  return child;
55 }
56 
59 {
60  gboolean as_orphan = FALSE;
61  char *inc_num = NULL;
62  char *inc_max = NULL;
63  resource_t *child_rsc = NULL;
64  xmlNode *child_copy = NULL;
65  clone_variant_data_t *clone_data = NULL;
66 
67  get_clone_variant_data(clone_data, rsc);
68 
69  CRM_CHECK(clone_data->xml_obj_child != NULL, return FALSE);
70 
71  if (clone_data->total_clones >= clone_data->clone_max) {
72  // If we've already used all available instances, this is an orphan
73  as_orphan = TRUE;
74  }
75 
76  // Allocate instance numbers in numerical order (starting at 0)
77  inc_num = crm_itoa(clone_data->total_clones);
78  inc_max = crm_itoa(clone_data->clone_max);
79 
80  child_copy = copy_xml(clone_data->xml_obj_child);
81 
82  crm_xml_add(child_copy, XML_RSC_ATTR_INCARNATION, inc_num);
83 
84  if (common_unpack(child_copy, &child_rsc, rsc, data_set) == FALSE) {
85  pe_err("Failed unpacking resource %s", crm_element_value(child_copy, XML_ATTR_ID));
86  child_rsc = NULL;
87  goto bail;
88  }
89 /* child_rsc->globally_unique = rsc->globally_unique; */
90 
91  CRM_ASSERT(child_rsc);
92  clone_data->total_clones += 1;
93  pe_rsc_trace(child_rsc, "Setting clone attributes for: %s", child_rsc->id);
94  rsc->children = g_list_append(rsc->children, child_rsc);
95  if (as_orphan) {
96  set_bit_recursive(child_rsc, pe_rsc_orphan);
97  }
98 
99  add_hash_param(child_rsc->meta, XML_RSC_ATTR_INCARNATION_MAX, inc_max);
100  pe_rsc_trace(rsc, "Added %s instance %s", rsc->id, child_rsc->id);
101 
102  bail:
103  free(inc_num);
104  free(inc_max);
105 
106  return child_rsc;
107 }
108 
109 gboolean
111 {
112  const char *master_max = g_hash_table_lookup(rsc->meta, XML_RSC_ATTR_MASTER_MAX);
113  const char *master_node_max = g_hash_table_lookup(rsc->meta, XML_RSC_ATTR_MASTER_NODEMAX);
114 
115  g_hash_table_replace(rsc->meta, strdup("stateful"), strdup(XML_BOOLEAN_TRUE));
116  if (clone_unpack(rsc, data_set)) {
117  clone_variant_data_t *clone_data = NULL;
118 
119  get_clone_variant_data(clone_data, rsc);
120  clone_data->master_max = crm_parse_int(master_max, "1");
121  clone_data->master_node_max = crm_parse_int(master_node_max, "1");
122  return TRUE;
123  }
124  return FALSE;
125 }
126 
127 gboolean
129 {
130  int lpc = 0;
131  xmlNode *a_child = NULL;
132  xmlNode *xml_obj = rsc->xml;
133  clone_variant_data_t *clone_data = NULL;
134 
135  const char *ordered = g_hash_table_lookup(rsc->meta, XML_RSC_ATTR_ORDERED);
136  const char *interleave = g_hash_table_lookup(rsc->meta, XML_RSC_ATTR_INTERLEAVE);
137  const char *max_clones = g_hash_table_lookup(rsc->meta, XML_RSC_ATTR_INCARNATION_MAX);
138  const char *max_clones_node = g_hash_table_lookup(rsc->meta, XML_RSC_ATTR_INCARNATION_NODEMAX);
139 
140  pe_rsc_trace(rsc, "Processing resource %s...", rsc->id);
141 
142  clone_data = calloc(1, sizeof(clone_variant_data_t));
143  rsc->variant_opaque = clone_data;
144 
145  clone_data->active_clones = 0;
146  clone_data->xml_obj_child = NULL;
147  clone_data->clone_node_max = crm_parse_int(max_clones_node, "1");
148 
149  if (max_clones) {
150  clone_data->clone_max = crm_parse_int(max_clones, "1");
151 
152  } else if (g_list_length(data_set->nodes) > 0) {
153  clone_data->clone_max = g_list_length(data_set->nodes);
154 
155  } else {
156  clone_data->clone_max = 1; /* Handy during crm_verify */
157  }
158 
159  clone_data->interleave = crm_is_true(interleave);
160  clone_data->ordered = crm_is_true(ordered);
161 
162  if ((rsc->flags & pe_rsc_unique) == 0 && clone_data->clone_node_max > 1) {
163  crm_config_err("Anonymous clones (%s) may only support one copy per node", rsc->id);
164  clone_data->clone_node_max = 1;
165  }
166 
167  pe_rsc_trace(rsc, "Options for %s", rsc->id);
168  pe_rsc_trace(rsc, "\tClone max: %d", clone_data->clone_max);
169  pe_rsc_trace(rsc, "\tClone node max: %d", clone_data->clone_node_max);
170  pe_rsc_trace(rsc, "\tClone is unique: %s",
171  is_set(rsc->flags, pe_rsc_unique) ? "true" : "false");
172 
173  // Clones may contain a single group or primitive
174  for (a_child = __xml_first_child_element(xml_obj); a_child != NULL;
175  a_child = __xml_next_element(a_child)) {
176 
177  if (crm_str_eq((const char *)a_child->name, XML_CIB_TAG_RESOURCE, TRUE)
178  || crm_str_eq((const char *)a_child->name, XML_CIB_TAG_GROUP, TRUE)) {
179  clone_data->xml_obj_child = a_child;
180  break;
181  }
182  }
183 
184  if (clone_data->xml_obj_child == NULL) {
185  crm_config_err("%s has nothing to clone", rsc->id);
186  return FALSE;
187  }
188 
189  /*
190  * Make clones ever so slightly sticky by default
191  *
192  * This helps ensure clone instances are not shuffled around the cluster
193  * for no benefit in situations when pre-allocation is not appropriate
194  */
195  if (g_hash_table_lookup(rsc->meta, XML_RSC_ATTR_STICKINESS) == NULL) {
197  }
198 
199  clone_data->notify_confirm = is_set(rsc->flags, pe_rsc_notify);
200  /* This ensures that the globally-unique value always exists for children to
201  * inherit when being unpacked, as well as in resource agents' environment.
202  */
205 
206  if (clone_data->clone_max <= 0) {
207  /* Create one child instance so that unpack_find_resource() will hook up
208  * any orphans up to the parent correctly.
209  */
210  if (pe__create_clone_child(rsc, data_set) == NULL) {
211  return FALSE;
212  }
213 
214  } else {
215  // Create a child instance for each available instance number
216  for (lpc = 0; lpc < clone_data->clone_max; lpc++) {
217  if (pe__create_clone_child(rsc, data_set) == NULL) {
218  return FALSE;
219  }
220  }
221  }
222 
223  pe_rsc_trace(rsc, "Added %d children to resource %s...", clone_data->clone_max, rsc->id);
224  return TRUE;
225 }
226 
227 gboolean
228 clone_active(resource_t * rsc, gboolean all)
229 {
230  GListPtr gIter = rsc->children;
231 
232  for (; gIter != NULL; gIter = gIter->next) {
233  resource_t *child_rsc = (resource_t *) gIter->data;
234  gboolean child_active = child_rsc->fns->active(child_rsc, all);
235 
236  if (all == FALSE && child_active) {
237  return TRUE;
238  } else if (all && child_active == FALSE) {
239  return FALSE;
240  }
241  }
242 
243  if (all) {
244  return TRUE;
245  } else {
246  return FALSE;
247  }
248 }
249 
250 static void
251 short_print(char *list, const char *prefix, const char *type, const char *suffix, long options, void *print_data)
252 {
253  if(suffix == NULL) {
254  suffix = "";
255  }
256 
257  if (list) {
258  if (options & pe_print_html) {
259  status_print("<li>");
260  }
261  status_print("%s%s: [%s ]%s", prefix, type, list, suffix);
262 
263  if (options & pe_print_html) {
264  status_print("</li>\n");
265 
266  } else if (options & pe_print_suppres_nl) {
267  /* nothing */
268  } else if ((options & pe_print_printf) || (options & pe_print_ncurses)) {
269  status_print("\n");
270  }
271 
272  }
273 }
274 
275 static const char *
276 configured_role_str(resource_t * rsc)
277 {
278  const char *target_role = g_hash_table_lookup(rsc->meta,
280 
281  if ((target_role == NULL) && rsc->children && rsc->children->data) {
282  target_role = g_hash_table_lookup(((resource_t*)rsc->children->data)->meta,
284  }
285  return target_role;
286 }
287 
288 static enum rsc_role_e
289 configured_role(resource_t * rsc)
290 {
291  const char *target_role = configured_role_str(rsc);
292 
293  if (target_role) {
294  return text2role(target_role);
295  }
296  return RSC_ROLE_UNKNOWN;
297 }
298 
299 static void
300 clone_print_xml(resource_t * rsc, const char *pre_text, long options, void *print_data)
301 {
302  int is_master_slave = rsc->variant == pe_master ? 1 : 0;
303  char *child_text = crm_concat(pre_text, " ", ' ');
304  const char *target_role = configured_role_str(rsc);
305  GListPtr gIter = rsc->children;
306 
307  status_print("%s<clone ", pre_text);
308  status_print("id=\"%s\" ", rsc->id);
309  status_print("multi_state=\"%s\" ", is_master_slave ? "true" : "false");
310  status_print("unique=\"%s\" ", is_set(rsc->flags, pe_rsc_unique) ? "true" : "false");
311  status_print("managed=\"%s\" ", is_set(rsc->flags, pe_rsc_managed) ? "true" : "false");
312  status_print("failed=\"%s\" ", is_set(rsc->flags, pe_rsc_failed) ? "true" : "false");
313  status_print("failure_ignored=\"%s\" ",
314  is_set(rsc->flags, pe_rsc_failure_ignored) ? "true" : "false");
315  if (target_role) {
316  status_print("target_role=\"%s\" ", target_role);
317  }
318  status_print(">\n");
319 
320  for (; gIter != NULL; gIter = gIter->next) {
321  resource_t *child_rsc = (resource_t *) gIter->data;
322 
323  child_rsc->fns->print(child_rsc, child_text, options, print_data);
324  }
325 
326  status_print("%s</clone>\n", pre_text);
327  free(child_text);
328 }
329 
330 bool is_set_recursive(resource_t * rsc, long long flag, bool any)
331 {
332  GListPtr gIter;
333  bool all = !any;
334 
335  if(is_set(rsc->flags, flag)) {
336  if(any) {
337  return TRUE;
338  }
339  } else if(all) {
340  return FALSE;
341  }
342 
343  for (gIter = rsc->children; gIter != NULL; gIter = gIter->next) {
344  if(is_set_recursive(gIter->data, flag, any)) {
345  if(any) {
346  return TRUE;
347  }
348 
349  } else if(all) {
350  return FALSE;
351  }
352  }
353 
354  if(all) {
355  return TRUE;
356  }
357  return FALSE;
358 }
359 
360 void
361 clone_print(resource_t * rsc, const char *pre_text, long options, void *print_data)
362 {
363  char *list_text = NULL;
364  char *child_text = NULL;
365  char *stopped_list = NULL;
366  const char *type = "Clone";
367 
368  GListPtr master_list = NULL;
369  GListPtr started_list = NULL;
370  GListPtr gIter = rsc->children;
371 
372  clone_variant_data_t *clone_data = NULL;
373  int active_instances = 0;
374 
375  if (pre_text == NULL) {
376  pre_text = " ";
377  }
378 
379  if (options & pe_print_xml) {
380  clone_print_xml(rsc, pre_text, options, print_data);
381  return;
382  }
383 
384  get_clone_variant_data(clone_data, rsc);
385 
386  child_text = crm_concat(pre_text, " ", ' ');
387 
388  if (rsc->variant == pe_master) {
389  type = "Master/Slave";
390  }
391 
392  status_print("%s%s Set: %s [%s]%s%s",
393  pre_text ? pre_text : "", type, rsc->id, ID(clone_data->xml_obj_child),
394  is_set(rsc->flags, pe_rsc_unique) ? " (unique)" : "",
395  is_set(rsc->flags, pe_rsc_managed) ? "" : " (unmanaged)");
396 
397  if (options & pe_print_html) {
398  status_print("\n<ul>\n");
399 
400  } else if ((options & pe_print_log) == 0) {
401  status_print("\n");
402  }
403 
404  for (; gIter != NULL; gIter = gIter->next) {
405  gboolean print_full = FALSE;
406  resource_t *child_rsc = (resource_t *) gIter->data;
407  gboolean partially_active = child_rsc->fns->active(child_rsc, FALSE);
408 
409  if (options & pe_print_clone_details) {
410  print_full = TRUE;
411  }
412 
413  if (is_set(rsc->flags, pe_rsc_unique)) {
414  // Print individual instance when unique (except stopped orphans)
415  if (partially_active || is_not_set(rsc->flags, pe_rsc_orphan)) {
416  print_full = TRUE;
417  }
418 
419  // Everything else in this block is for anonymous clones
420 
421  } else if (is_set(options, pe_print_pending)
422  && (child_rsc->pending_task != NULL)
423  && strcmp(child_rsc->pending_task, "probe")) {
424  // Print individual instance when non-probe action is pending
425  print_full = TRUE;
426 
427  } else if (partially_active == FALSE) {
428  // List stopped instances when requested (except orphans)
429  if (is_not_set(child_rsc->flags, pe_rsc_orphan)
430  && is_not_set(options, pe_print_clone_active)) {
431  stopped_list = add_list_element(stopped_list, child_rsc->id);
432  }
433 
434  } else if (is_set_recursive(child_rsc, pe_rsc_orphan, TRUE)
435  || is_set_recursive(child_rsc, pe_rsc_managed, FALSE) == FALSE
436  || is_set_recursive(child_rsc, pe_rsc_failed, TRUE)) {
437 
438  // Print individual instance when active orphaned/unmanaged/failed
439  print_full = TRUE;
440 
441  } else if (child_rsc->fns->active(child_rsc, TRUE)) {
442  // Instance of fully active anonymous clone
443 
444  node_t *location = child_rsc->fns->location(child_rsc, NULL, TRUE);
445 
446  if (location) {
447  // Instance is active on a single node
448 
449  enum rsc_role_e a_role = child_rsc->fns->state(child_rsc, TRUE);
450 
451  if (location->details->online == FALSE && location->details->unclean) {
452  print_full = TRUE;
453 
454  } else if (a_role > RSC_ROLE_SLAVE) {
455  master_list = g_list_append(master_list, location);
456 
457  } else {
458  started_list = g_list_append(started_list, location);
459  }
460 
461  } else {
462  /* uncolocated group - bleh */
463  print_full = TRUE;
464  }
465 
466  } else {
467  // Instance of partially active anonymous clone
468  print_full = TRUE;
469  }
470 
471  if (print_full) {
472  if (options & pe_print_html) {
473  status_print("<li>\n");
474  }
475  child_rsc->fns->print(child_rsc, child_text, options, print_data);
476  if (options & pe_print_html) {
477  status_print("</li>\n");
478  }
479  }
480  }
481 
482  /* Masters */
483  master_list = g_list_sort(master_list, sort_node_uname);
484  for (gIter = master_list; gIter; gIter = gIter->next) {
485  node_t *host = gIter->data;
486 
487  list_text = add_list_element(list_text, host->details->uname);
488  active_instances++;
489  }
490 
491  short_print(list_text, child_text, "Masters", NULL, options, print_data);
492  g_list_free(master_list);
493  free(list_text);
494  list_text = NULL;
495 
496  /* Started/Slaves */
497  started_list = g_list_sort(started_list, sort_node_uname);
498  for (gIter = started_list; gIter; gIter = gIter->next) {
499  node_t *host = gIter->data;
500 
501  list_text = add_list_element(list_text, host->details->uname);
502  active_instances++;
503  }
504 
505  if(rsc->variant == pe_master) {
506  enum rsc_role_e role = configured_role(rsc);
507 
508  if(role == RSC_ROLE_SLAVE) {
509  short_print(list_text, child_text, "Slaves (target-role)", NULL, options, print_data);
510  } else {
511  short_print(list_text, child_text, "Slaves", NULL, options, print_data);
512  }
513 
514  } else {
515  short_print(list_text, child_text, "Started", NULL, options, print_data);
516  }
517 
518  g_list_free(started_list);
519  free(list_text);
520  list_text = NULL;
521 
522  if (is_not_set(options, pe_print_clone_active)) {
523  const char *state = "Stopped";
524  enum rsc_role_e role = configured_role(rsc);
525 
526  if (role == RSC_ROLE_STOPPED) {
527  state = "Stopped (disabled)";
528  }
529 
530  if (is_not_set(rsc->flags, pe_rsc_unique)
531  && (clone_data->clone_max > active_instances)) {
532 
533  GListPtr nIter;
534  GListPtr list = g_hash_table_get_values(rsc->allowed_nodes);
535 
536  /* Custom stopped list for non-unique clones */
537  free(stopped_list); stopped_list = NULL;
538 
539  if (g_list_length(list) == 0) {
540  /* Clusters with symmetrical=false haven't calculated allowed_nodes yet
541  * If we've not probed for them yet, the Stopped list will be empty
542  */
543  list = g_hash_table_get_values(rsc->known_on);
544  }
545 
546  list = g_list_sort(list, sort_node_uname);
547  for (nIter = list; nIter != NULL; nIter = nIter->next) {
548  node_t *node = (node_t *)nIter->data;
549 
550  if (pe_find_node(rsc->running_on, node->details->uname) == NULL) {
551  stopped_list = add_list_element(stopped_list, node->details->uname);
552  }
553  }
554  g_list_free(list);
555  }
556 
557  short_print(stopped_list, child_text, state, NULL, options, print_data);
558  free(stopped_list);
559  }
560 
561  if (options & pe_print_html) {
562  status_print("</ul>\n");
563  }
564 
565  free(child_text);
566 }
567 
568 void
570 {
571  clone_variant_data_t *clone_data = NULL;
572 
573  get_clone_variant_data(clone_data, rsc);
574 
575  pe_rsc_trace(rsc, "Freeing %s", rsc->id);
576 
577  for (GListPtr gIter = rsc->children; gIter != NULL; gIter = gIter->next) {
578  resource_t *child_rsc = (resource_t *) gIter->data;
579 
580  CRM_ASSERT(child_rsc);
581  pe_rsc_trace(child_rsc, "Freeing child %s", child_rsc->id);
582  free_xml(child_rsc->xml);
583  child_rsc->xml = NULL;
584  /* There could be a saved unexpanded xml */
585  free_xml(child_rsc->orig_xml);
586  child_rsc->orig_xml = NULL;
587  child_rsc->fns->free(child_rsc);
588  }
589 
590  g_list_free(rsc->children);
591 
592  if (clone_data) {
593  CRM_ASSERT(clone_data->demote_notify == NULL);
594  CRM_ASSERT(clone_data->stop_notify == NULL);
595  CRM_ASSERT(clone_data->start_notify == NULL);
596  CRM_ASSERT(clone_data->promote_notify == NULL);
597  }
598 
599  common_free(rsc);
600 }
601 
602 enum rsc_role_e
603 clone_resource_state(const resource_t * rsc, gboolean current)
604 {
605  enum rsc_role_e clone_role = RSC_ROLE_UNKNOWN;
606  GListPtr gIter = rsc->children;
607 
608  for (; gIter != NULL; gIter = gIter->next) {
609  resource_t *child_rsc = (resource_t *) gIter->data;
610  enum rsc_role_e a_role = child_rsc->fns->state(child_rsc, current);
611 
612  if (a_role > clone_role) {
613  clone_role = a_role;
614  }
615  }
616 
617  pe_rsc_trace(rsc, "%s role: %s", rsc->id, role2text(clone_role));
618  return clone_role;
619 }
#define CRM_CHECK(expr, failure_action)
Definition: logging.h:190
GListPtr nodes
Definition: status.h:125
const char * uname
Definition: status.h:173
xmlNode * xml
Definition: status.h:294
gboolean clone_unpack(resource_t *rsc, pe_working_set_t *data_set)
Definition: clone.c:128
void(* free)(resource_t *)
Definition: complex.h:41
#define XML_BOOLEAN_FALSE
Definition: msg_xml.h:118
#define crm_config_err(fmt...)
Definition: crm_internal.h:225
#define XML_RSC_ATTR_INCARNATION
Definition: msg_xml.h:212
#define pe_rsc_orphan
Definition: status.h:219
void pe__force_anon(const char *standard, pe_resource_t *rsc, const char *rid, pe_working_set_t *data_set)
Definition: clone.c:21
gboolean common_unpack(xmlNode *xml_obj, resource_t **rsc, resource_t *parent, pe_working_set_t *data_set)
Definition: complex.c:463
enum pe_obj_types variant
Definition: status.h:300
void common_free(resource_t *rsc)
Definition: complex.c:918
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
Definition: nvpair.c:216
#define status_print(fmt, args...)
Definition: unpack.h:79
int crm_parse_int(const char *text, const char *default_text)
Parse an integer value from a string.
Definition: strings.c:157
enum rsc_role_e(* state)(const resource_t *, gboolean)
Definition: complex.h:39
node_t * pe_find_node(GListPtr node_list, const char *uname)
Definition: status.c:444
AIS_Host host
Definition: internal.h:80
#define XML_RSC_ATTR_STICKINESS
Definition: msg_xml.h:223
gboolean master_unpack(resource_t *rsc, pe_working_set_t *data_set)
Definition: clone.c:110
xmlNode * orig_xml
Definition: status.h:295
void set_bit_recursive(resource_t *rsc, unsigned long long flag)
Definition: utils.c:2313
gboolean clone_active(resource_t *rsc, gboolean all)
Definition: clone.c:228
#define XML_RSC_ATTR_MASTER_NODEMAX
Definition: msg_xml.h:217
#define XML_RSC_ATTR_INCARNATION_MAX
Definition: msg_xml.h:213
GListPtr children
Definition: status.h:337
char * id
Definition: status.h:292
xmlNode * copy_xml(xmlNode *src_node)
Definition: xml.c:2114
const char * role2text(enum rsc_role_e role)
Definition: common.c:365
pe_node_t *(* location)(const pe_resource_t *, GList **, int)
Definition: complex.h:40
#define pe_warn(fmt...)
Definition: internal.h:19
struct node_shared_s * details
Definition: status.h:213
gboolean unclean
Definition: status.h:180
void clone_free(resource_t *rsc)
Definition: clone.c:569
enum rsc_role_e clone_resource_state(const resource_t *rsc, gboolean current)
Definition: clone.c:603
char * add_list_element(char *list, const char *value)
Definition: strings.c:426
#define XML_ATTR_ID
Definition: msg_xml.h:102
char * pending_task
Definition: status.h:346
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
Definition: nvpair.c:393
#define XML_CIB_TAG_RESOURCE
Definition: msg_xml.h:196
#define XML_BOOLEAN_TRUE
Definition: msg_xml.h:117
#define pe_rsc_failed
Definition: status.h:237
resource_object_functions_t * fns
Definition: status.h:301
GHashTable * allowed_nodes
Definition: status.h:328
void * variant_opaque
Definition: status.h:299
#define XML_RSC_ATTR_ORDERED
Definition: msg_xml.h:210
unsigned long long flags
Definition: status.h:316
#define XML_RSC_ATTR_INCARNATION_NODEMAX
Definition: msg_xml.h:215
pe_resource_t * pe__create_clone_child(pe_resource_t *rsc, pe_working_set_t *data_set)
Definition: clone.c:58
#define XML_RSC_ATTR_TARGET_ROLE
Definition: msg_xml.h:220
void free_xml(xmlNode *child)
Definition: xml.c:2108
enum rsc_role_e text2role(const char *role)
Definition: common.c:386
gboolean crm_str_eq(const char *a, const char *b, gboolean use_case)
Definition: strings.c:245
#define XML_RSC_ATTR_UNIQUE
Definition: msg_xml.h:221
void clone_print(resource_t *rsc, const char *pre_text, long options, void *print_data)
Definition: clone.c:361
gboolean(* active)(resource_t *, gboolean)
Definition: complex.h:38
#define XML_RSC_ATTR_MASTER_MAX
Definition: msg_xml.h:216
void(* print)(resource_t *, const char *, long, void *)
Definition: complex.h:37
#define pe_rsc_unique
Definition: status.h:225
GHashTable * meta
Definition: status.h:333
Cluster status and scheduling.
void add_hash_param(GHashTable *hash, const char *name, const char *value)
Definition: common.c:442
gboolean online
Definition: status.h:176
#define pe_rsc_failure_ignored
Definition: status.h:247
resource_t * find_clone_instance(resource_t *rsc, const char *sub_id, pe_working_set_t *data_set)
Definition: clone.c:40
bool is_set_recursive(resource_t *rsc, long long flag, bool any)
Definition: clone.c:330
#define pe_rsc_managed
Definition: status.h:220
#define CRM_ASSERT(expr)
Definition: error.h:20
rsc_role_e
Definition: common.h:81
GHashTable * known_on
Definition: status.h:327
Definition: status.h:209
gboolean crm_is_true(const char *s)
Definition: strings.c:197
#define XML_CIB_TAG_GROUP
Definition: msg_xml.h:197
#define pe_rsc_trace(rsc, fmt, args...)
Definition: internal.h:16
char * crm_concat(const char *prefix, const char *suffix, char join)
Definition: strings.c:33
#define ID(x)
Definition: msg_xml.h:452
#define pe_err(fmt...)
Definition: internal.h:18
char * crm_itoa(int an_int)
Definition: strings.c:61
resource_t * pe_find_resource(GListPtr rsc_list, const char *id_rh)
Definition: status.c:392
#define XML_RSC_ATTR_INTERLEAVE
Definition: msg_xml.h:211
gint sort_node_uname(gconstpointer a, gconstpointer b)
Definition: utils.c:239
GList * GListPtr
Definition: crm.h:210
#define pe_rsc_notify
Definition: status.h:224
enum crm_ais_msg_types type
Definition: internal.h:79
GListPtr running_on
Definition: status.h:326