pacemaker  2.1.6-802a72226b
Scalable High-Availability cluster resource manager
libpacemaker_private.h
Go to the documentation of this file.
1 /*
2  * Copyright 2021-2023 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 #ifndef PCMK__LIBPACEMAKER_PRIVATE__H
11 # define PCMK__LIBPACEMAKER_PRIVATE__H
12 
13 /* This header is for the sole use of libpacemaker, so that functions can be
14  * declared with G_GNUC_INTERNAL for efficiency.
15  */
16 
17 #include <crm/pengine/pe_types.h> // pe_action_t, pe_node_t, pe_working_set_t
18 
19 // Flags to modify the behavior of add_colocated_node_scores()
21  // With no other flags, apply all "with this" colocations
23 
24  // Apply "this with" colocations instead of "with this" colocations
26 
27  // Apply only colocations with non-negative scores
29 
30  // Apply only colocations with at least one matching node
32 };
33 
34 // Flags the update_ordered_actions() method can return
36  pcmk__updated_none = 0, // Nothing changed
37  pcmk__updated_first = (1 << 0), // First action was updated
38  pcmk__updated_then = (1 << 1), // Then action was updated
39 };
40 
41 #define pcmk__set_updated_flags(au_flags, action, flags_to_set) do { \
42  au_flags = pcmk__set_flags_as(__func__, __LINE__, \
43  LOG_TRACE, "Action update", \
44  (action)->uuid, au_flags, \
45  (flags_to_set), #flags_to_set); \
46  } while (0)
47 
48 #define pcmk__clear_updated_flags(au_flags, action, flags_to_clear) do { \
49  au_flags = pcmk__clear_flags_as(__func__, __LINE__, \
50  LOG_TRACE, "Action update", \
51  (action)->uuid, au_flags, \
52  (flags_to_clear), #flags_to_clear); \
53  } while (0)
54 
55 // Resource allocation methods
66  pe_node_t *(*assign)(pe_resource_t *rsc, const pe_node_t *prefer);
67 
75 
85  bool (*create_probe)(pe_resource_t *rsc, pe_node_t *node);
86 
94 
108  void (*apply_coloc_score) (pe_resource_t *dependent,
109  const pe_resource_t *primary,
110  const pcmk__colocation_t *colocation,
111  bool for_dependent);
112 
130  GList *(*colocated_resources)(const pe_resource_t *rsc,
131  const pe_resource_t *orig_rsc,
132  GList *colocated_rscs);
133 
152  const pe_resource_t *orig_rsc, GList **list);
153 
173  const pe_resource_t *orig_rsc, GList **list);
174 
192  void (*add_colocated_node_scores)(pe_resource_t *rsc, const char *log_id,
193  GHashTable **nodes, const char *attr,
194  float factor, uint32_t flags);
195 
203  void (*apply_location)(pe_resource_t *rsc, pe__location_t *location);
204 
218  const pe_node_t *node);
219 
243  uint32_t (*update_ordered_actions)(pe_action_t *first, pe_action_t *then,
244  const pe_node_t *node, uint32_t flags,
245  uint32_t filter, uint32_t type,
247 
249 
257 
268  void (*add_graph_meta)(const pe_resource_t *rsc, xmlNode *xml);
269 
285  void (*add_utilization)(const pe_resource_t *rsc,
286  const pe_resource_t *orig_rsc, GList *all_rscs,
287  GHashTable *utilization);
288 
296 };
297 
298 // Actions (pcmk_sched_actions.c)
299 
300 G_GNUC_INTERNAL
303 
304 G_GNUC_INTERNAL
306  const pe_node_t *node, uint32_t flags,
307  uint32_t filter, uint32_t type,
309 
310 G_GNUC_INTERNAL
311 void pcmk__log_action(const char *pre_text, const pe_action_t *action,
312  bool details);
313 
314 G_GNUC_INTERNAL
316  guint interval_ms, const pe_node_t *node);
317 
318 G_GNUC_INTERNAL
320 
321 G_GNUC_INTERNAL
323 
324 G_GNUC_INTERNAL
326 
327 G_GNUC_INTERNAL
329 
330 G_GNUC_INTERNAL
332  const xmlNode *xml_op);
333 
334 G_GNUC_INTERNAL
336 
337 
338 // Recurring actions (pcmk_sched_recurring.c)
339 
340 G_GNUC_INTERNAL
342 
343 G_GNUC_INTERNAL
344 void pcmk__schedule_cancel(pe_resource_t *rsc, const char *call_id,
345  const char *task, guint interval_ms,
346  const pe_node_t *node, const char *reason);
347 
348 G_GNUC_INTERNAL
349 void pcmk__reschedule_recurring(pe_resource_t *rsc, const char *task,
350  guint interval_ms, pe_node_t *node);
351 
352 G_GNUC_INTERNAL
354 
355 
356 // Producing transition graphs (pcmk_graph_producer.c)
357 
358 G_GNUC_INTERNAL
359 bool pcmk__graph_has_loop(const pe_action_t *init_action,
360  const pe_action_t *action,
362 
363 G_GNUC_INTERNAL
365 
366 G_GNUC_INTERNAL
368 
369 
370 // Fencing (pcmk_sched_fencing.c)
371 
372 G_GNUC_INTERNAL
374 
375 G_GNUC_INTERNAL
376 void pcmk__order_vs_unfence(const pe_resource_t *rsc, pe_node_t *node,
377  pe_action_t *action, enum pe_ordering order);
378 
379 G_GNUC_INTERNAL
380 void pcmk__fence_guest(pe_node_t *node);
381 
382 G_GNUC_INTERNAL
383 bool pcmk__node_unfenced(const pe_node_t *node);
384 
385 G_GNUC_INTERNAL
386 void pcmk__order_restart_vs_unfence(gpointer data, gpointer user_data);
387 
388 
389 // Injected scheduler inputs (pcmk_sched_injections.c)
390 
392  const pcmk_injections_t *injections);
393 
394 
395 // Constraints of any type (pcmk_sched_constraints.c)
396 
397 G_GNUC_INTERNAL
398 pe_resource_t *pcmk__find_constraint_resource(GList *rsc_list, const char *id);
399 
400 G_GNUC_INTERNAL
401 xmlNode *pcmk__expand_tags_in_sets(xmlNode *xml_obj,
402  const pe_working_set_t *data_set);
403 
404 G_GNUC_INTERNAL
406  const char *id, pe_resource_t **rsc,
407  pe_tag_t **tag);
408 
409 G_GNUC_INTERNAL
410 bool pcmk__tag_to_set(xmlNode *xml_obj, xmlNode **rsc_set, const char *attr,
411  bool convert_rsc, const pe_working_set_t *data_set);
412 
413 G_GNUC_INTERNAL
415 
416 
417 // Location constraints
418 
419 G_GNUC_INTERNAL
420 void pcmk__unpack_location(xmlNode *xml_obj, pe_working_set_t *data_set);
421 
422 G_GNUC_INTERNAL
423 pe__location_t *pcmk__new_location(const char *id, pe_resource_t *rsc,
424  int node_weight, const char *discover_mode,
425  pe_node_t *foo_node,
427 
428 G_GNUC_INTERNAL
430 
431 G_GNUC_INTERNAL
432 void pcmk__apply_location(pe_resource_t *rsc, pe__location_t *constraint);
433 
434 
435 // Colocation constraints (pcmk_sched_colocation.c)
436 
441 };
442 
443 G_GNUC_INTERNAL
445  const pe_resource_t *primary,
446  const pcmk__colocation_t *colocation,
447  bool preview);
448 
449 G_GNUC_INTERNAL
451  const pe_resource_t *primary,
452  const pcmk__colocation_t *colocation);
453 
454 G_GNUC_INTERNAL
456  const pe_resource_t *primary,
457  const pcmk__colocation_t *colocation);
458 
459 G_GNUC_INTERNAL
460 void pcmk__add_colocated_node_scores(pe_resource_t *rsc, const char *log_id,
461  GHashTable **nodes, const char *attr,
462  float factor, uint32_t flags);
463 
464 G_GNUC_INTERNAL
465 void pcmk__add_dependent_scores(gpointer data, gpointer user_data);
466 
467 G_GNUC_INTERNAL
468 void pcmk__unpack_colocation(xmlNode *xml_obj, pe_working_set_t *data_set);
469 
470 G_GNUC_INTERNAL
471 void pcmk__add_this_with(GList **list, const pcmk__colocation_t *colocation);
472 
473 G_GNUC_INTERNAL
474 void pcmk__add_this_with_list(GList **list, GList *addition);
475 
476 G_GNUC_INTERNAL
477 void pcmk__add_with_this(GList **list, const pcmk__colocation_t *colocation);
478 
479 G_GNUC_INTERNAL
480 void pcmk__add_with_this_list(GList **list, GList *addition);
481 
482 G_GNUC_INTERNAL
483 void pcmk__new_colocation(const char *id, const char *node_attr, int score,
484  pe_resource_t *dependent, pe_resource_t *primary,
485  const char *dependent_role, const char *primary_role,
486  bool influence, pe_working_set_t *data_set);
487 
488 G_GNUC_INTERNAL
491 
504 static inline bool
505 pcmk__colocation_has_influence(const pcmk__colocation_t *colocation,
506  const pe_resource_t *rsc)
507 {
508  if (rsc == NULL) {
509  rsc = colocation->primary;
510  }
511 
512  /* A bundle replica colocates its remote connection with its container,
513  * using a finite score so that the container can run on Pacemaker Remote
514  * nodes.
515  *
516  * Moving a connection is lightweight and does not interrupt the service,
517  * while moving a container is heavyweight and does interrupt the service,
518  * so don't move a clean, active container based solely on the preferences
519  * of its connection.
520  *
521  * This also avoids problematic scenarios where two containers want to
522  * perpetually swap places.
523  */
525  && !pcmk_is_set(rsc->flags, pe_rsc_failed)
526  && pcmk__list_of_1(rsc->running_on)) {
527  return false;
528  }
529 
530  /* The dependent in a colocation influences the primary's location
531  * if the influence option is true or the primary is not yet active.
532  */
533  return colocation->influence || (rsc->running_on == NULL);
534 }
535 
536 
537 // Ordering constraints (pcmk_sched_ordering.c)
538 
539 G_GNUC_INTERNAL
540 void pcmk__new_ordering(pe_resource_t *first_rsc, char *first_task,
541  pe_action_t *first_action, pe_resource_t *then_rsc,
542  char *then_task, pe_action_t *then_action,
543  uint32_t flags, pe_working_set_t *data_set);
544 
545 G_GNUC_INTERNAL
546 void pcmk__unpack_ordering(xmlNode *xml_obj, pe_working_set_t *data_set);
547 
548 G_GNUC_INTERNAL
550 
551 G_GNUC_INTERNAL
553  pe_action_t *shutdown_op);
554 
555 G_GNUC_INTERNAL
557 
558 G_GNUC_INTERNAL
559 void pcmk__order_after_each(pe_action_t *after, GList *list);
560 
561 
572 #define pcmk__order_resource_actions(first_rsc, first_task, \
573  then_rsc, then_task, flags) \
574  pcmk__new_ordering((first_rsc), \
575  pcmk__op_key((first_rsc)->id, (first_task), 0), \
576  NULL, \
577  (then_rsc), \
578  pcmk__op_key((then_rsc)->id, (then_task), 0), \
579  NULL, (flags), (first_rsc)->cluster)
580 
581 #define pcmk__order_starts(rsc1, rsc2, flags) \
582  pcmk__order_resource_actions((rsc1), CRMD_ACTION_START, \
583  (rsc2), CRMD_ACTION_START, (flags))
584 
585 #define pcmk__order_stops(rsc1, rsc2, flags) \
586  pcmk__order_resource_actions((rsc1), CRMD_ACTION_STOP, \
587  (rsc2), CRMD_ACTION_STOP, (flags))
588 
589 
590 // Ticket constraints (pcmk_sched_tickets.c)
591 
592 G_GNUC_INTERNAL
593 void pcmk__unpack_rsc_ticket(xmlNode *xml_obj, pe_working_set_t *data_set);
594 
595 
596 // Promotable clone resources (pcmk_sched_promotable.c)
597 
598 G_GNUC_INTERNAL
600 
601 G_GNUC_INTERNAL
603 
604 G_GNUC_INTERNAL
606 
607 G_GNUC_INTERNAL
609 
610 G_GNUC_INTERNAL
612 
613 G_GNUC_INTERNAL
615 
616 G_GNUC_INTERNAL
618  pe_resource_t *dependent,
619  const pcmk__colocation_t *colocation);
620 
621 G_GNUC_INTERNAL
623  pe_resource_t *dependent,
624  const pcmk__colocation_t *colocation);
625 
626 
627 // Pacemaker Remote nodes (pcmk_sched_remote.c)
628 
629 G_GNUC_INTERNAL
630 bool pcmk__is_failed_remote_node(const pe_node_t *node);
631 
632 G_GNUC_INTERNAL
634 
635 G_GNUC_INTERNAL
637  const pe_node_t *node);
638 
639 G_GNUC_INTERNAL
641 
642 G_GNUC_INTERNAL
643 void pcmk__substitute_remote_addr(pe_resource_t *rsc, GHashTable *params);
644 
645 G_GNUC_INTERNAL
646 void pcmk__add_bundle_meta_to_xml(xmlNode *args_xml, const pe_action_t *action);
647 
648 
649 // Primitives (pcmk_sched_primitive.c)
650 
651 G_GNUC_INTERNAL
653 
654 G_GNUC_INTERNAL
656 
657 G_GNUC_INTERNAL
659 
660 G_GNUC_INTERNAL
662  const pe_node_t *node);
663 
664 G_GNUC_INTERNAL
666  const pe_resource_t *primary,
667  const pcmk__colocation_t *colocation,
668  bool for_dependent);
669 
670 G_GNUC_INTERNAL
672  const pe_resource_t *orig_rsc,
673  GList **list);
674 
675 G_GNUC_INTERNAL
677  const pe_resource_t *orig_rsc,
678  GList **list);
679 
680 G_GNUC_INTERNAL
681 void pcmk__schedule_cleanup(pe_resource_t *rsc, const pe_node_t *node,
682  bool optional);
683 
684 G_GNUC_INTERNAL
685 void pcmk__primitive_add_graph_meta(const pe_resource_t *rsc, xmlNode *xml);
686 
687 G_GNUC_INTERNAL
689  const pe_resource_t *orig_rsc,
690  GList *all_rscs, GHashTable *utilization);
691 
692 G_GNUC_INTERNAL
694 
695 
696 // Groups (pcmk_sched_group.c)
697 
698 G_GNUC_INTERNAL
700 
701 G_GNUC_INTERNAL
703 
704 G_GNUC_INTERNAL
706 
707 G_GNUC_INTERNAL
709  const pe_resource_t *primary,
710  const pcmk__colocation_t *colocation,
711  bool for_dependent);
712 
713 G_GNUC_INTERNAL
715  const pe_resource_t *orig_rsc, GList **list);
716 
717 G_GNUC_INTERNAL
719  const pe_resource_t *orig_rsc, GList **list);
720 
721 G_GNUC_INTERNAL
723  const char *log_id,
724  GHashTable **nodes, const char *attr,
725  float factor, uint32_t flags);
726 
727 G_GNUC_INTERNAL
729 
730 G_GNUC_INTERNAL
732  const pe_node_t *node);
733 
734 G_GNUC_INTERNAL
736  pe_action_t *then,
737  const pe_node_t *node,
738  uint32_t flags, uint32_t filter,
739  uint32_t type,
741 
742 G_GNUC_INTERNAL
744  const pe_resource_t *orig_rsc,
745  GList *colocated_rscs);
746 
747 G_GNUC_INTERNAL
749  const pe_resource_t *orig_rsc, GList *all_rscs,
750  GHashTable *utilization);
751 
752 G_GNUC_INTERNAL
754 
755 
756 // Clones (pcmk_sched_clone.c)
757 
758 G_GNUC_INTERNAL
760 
761 G_GNUC_INTERNAL
763  const pe_resource_t *primary,
764  const pcmk__colocation_t *colocation,
765  bool for_dependent);
766 
767 G_GNUC_INTERNAL
769  const pe_resource_t *orig_rsc, GList **list);
770 
771 G_GNUC_INTERNAL
773  const pe_resource_t *orig_rsc, GList **list);
774 
775 // Bundles (pcmk_sched_bundle.c)
776 
777 G_GNUC_INTERNAL
779 
780 G_GNUC_INTERNAL
782  const pe_resource_t *primary,
783  const pcmk__colocation_t *colocation,
784  bool for_dependent);
785 
786 G_GNUC_INTERNAL
788  const pe_resource_t *orig_rsc, GList **list);
789 
790 G_GNUC_INTERNAL
792  const pe_resource_t *orig_rsc, GList **list);
793 
794 G_GNUC_INTERNAL
796 
797 
798 // Clone instances or bundle replica containers (pcmk_sched_instances.c)
799 
800 G_GNUC_INTERNAL
801 void pcmk__assign_instances(pe_resource_t *collective, GList *instances,
802  int max_total, int max_per_node);
803 
804 G_GNUC_INTERNAL
805 void pcmk__create_instance_actions(pe_resource_t *rsc, GList *instances);
806 
807 G_GNUC_INTERNAL
808 bool pcmk__instance_matches(const pe_resource_t *instance,
809  const pe_node_t *node, enum rsc_role_e role,
810  bool current);
811 
812 G_GNUC_INTERNAL
814  const pe_resource_t *rsc,
815  enum rsc_role_e role,
816  bool current);
817 
818 G_GNUC_INTERNAL
820  pe_action_t *then,
821  const pe_node_t *node,
822  uint32_t flags, uint32_t filter,
823  uint32_t type,
825 
826 G_GNUC_INTERNAL
828  const GList *instances,
829  const pe_node_t *node);
830 
831 G_GNUC_INTERNAL
832 void pcmk__add_collective_constraints(GList **list,
833  const pe_resource_t *instance,
834  const pe_resource_t *collective,
835  bool with_this);
836 
837 
838 // Injections (pcmk_injections.c)
839 
840 G_GNUC_INTERNAL
841 xmlNode *pcmk__inject_node(cib_t *cib_conn, const char *node, const char *uuid);
842 
843 G_GNUC_INTERNAL
844 xmlNode *pcmk__inject_node_state_change(cib_t *cib_conn, const char *node,
845  bool up);
846 
847 G_GNUC_INTERNAL
848 xmlNode *pcmk__inject_resource_history(pcmk__output_t *out, xmlNode *cib_node,
849  const char *resource,
850  const char *lrm_name,
851  const char *rclass,
852  const char *rtype,
853  const char *rprovider);
854 
855 G_GNUC_INTERNAL
856 void pcmk__inject_failcount(pcmk__output_t *out, xmlNode *cib_node,
857  const char *resource, const char *task,
858  guint interval_ms, int rc);
859 
860 G_GNUC_INTERNAL
861 xmlNode *pcmk__inject_action_result(xmlNode *cib_resource,
862  lrmd_event_data_t *op, int target_rc);
863 
864 
865 // Nodes (pcmk_sched_nodes.c)
866 
867 G_GNUC_INTERNAL
868 bool pcmk__node_available(const pe_node_t *node, bool consider_score,
869  bool consider_guest);
870 
871 G_GNUC_INTERNAL
872 bool pcmk__any_node_available(GHashTable *nodes);
873 
874 G_GNUC_INTERNAL
875 GHashTable *pcmk__copy_node_table(GHashTable *nodes);
876 
877 G_GNUC_INTERNAL
878 GList *pcmk__sort_nodes(GList *nodes, pe_node_t *active_node);
879 
880 G_GNUC_INTERNAL
882 
883 G_GNUC_INTERNAL
885  const pe_node_t *node);
886 
887 
888 // Functions applying to more than one variant (pcmk_sched_resource.c)
889 
890 G_GNUC_INTERNAL
892 
893 G_GNUC_INTERNAL
895  const xmlNode *rsc_entry, bool active_on_node);
896 
897 G_GNUC_INTERNAL
898 GList *pcmk__rscs_matching_id(const char *id, const pe_working_set_t *data_set);
899 
900 G_GNUC_INTERNAL
901 GList *pcmk__colocated_resources(const pe_resource_t *rsc,
902  const pe_resource_t *orig_rsc,
903  GList *colocated_rscs);
904 
905 G_GNUC_INTERNAL
906 void pcmk__noop_add_graph_meta(const pe_resource_t *rsc, xmlNode *xml);
907 
908 G_GNUC_INTERNAL
910 
911 G_GNUC_INTERNAL
913  bool force);
914 
915 G_GNUC_INTERNAL
916 bool pcmk__assign_resource(pe_resource_t *rsc, pe_node_t *node, bool force);
917 
918 G_GNUC_INTERNAL
920 
921 G_GNUC_INTERNAL
922 bool pcmk__threshold_reached(pe_resource_t *rsc, const pe_node_t *node,
923  pe_resource_t **failed);
924 
925 G_GNUC_INTERNAL
927 
928 G_GNUC_INTERNAL
929 gint pcmk__cmp_instance(gconstpointer a, gconstpointer b);
930 
931 G_GNUC_INTERNAL
932 gint pcmk__cmp_instance_number(gconstpointer a, gconstpointer b);
933 
934 
935 // Functions related to probes (pcmk_sched_probes.c)
936 
937 G_GNUC_INTERNAL
939 
940 G_GNUC_INTERNAL
942 
943 G_GNUC_INTERNAL
944 bool pcmk__probe_resource_list(GList *rscs, pe_node_t *node);
945 
946 G_GNUC_INTERNAL
948 
949 
950 // Functions related to live migration (pcmk_sched_migration.c)
951 
953  const pe_node_t *current);
954 
955 void pcmk__abort_dangling_migration(void *data, void *user_data);
956 
957 bool pcmk__rsc_can_migrate(const pe_resource_t *rsc, const pe_node_t *current);
958 
960 
961 
962 // Functions related to node utilization (pcmk_sched_utilization.c)
963 
964 G_GNUC_INTERNAL
966  const pe_node_t *node2);
967 
968 G_GNUC_INTERNAL
969 void pcmk__consume_node_capacity(GHashTable *current_utilization,
970  const pe_resource_t *rsc);
971 
972 G_GNUC_INTERNAL
973 void pcmk__release_node_capacity(GHashTable *current_utilization,
974  const pe_resource_t *rsc);
975 
976 G_GNUC_INTERNAL
978 
979 G_GNUC_INTERNAL
981  const GList *allowed_nodes);
982 
983 G_GNUC_INTERNAL
984 void pcmk__show_node_capacities(const char *desc, pe_working_set_t *data_set);
985 
986 #endif // PCMK__LIBPACEMAKER_PRIVATE__H
G_GNUC_INTERNAL bool pcmk__action_locks_rsc_to_node(const pe_action_t *action)
G_GNUC_INTERNAL pe_node_t * pcmk__primitive_assign(pe_resource_t *rsc, const pe_node_t *prefer)
G_GNUC_INTERNAL GList * pcmk__group_colocated_resources(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList *colocated_rscs)
G_GNUC_INTERNAL void pcmk__add_this_with_list(GList **list, GList *addition)
G_GNUC_INTERNAL void pcmk__release_node_capacity(GHashTable *current_utilization, const pe_resource_t *rsc)
G_GNUC_INTERNAL void pcmk__add_rsc_actions_to_graph(pe_resource_t *rsc)
char data[0]
Definition: cpg.c:55
G_GNUC_INTERNAL void pcmk__schedule_cleanup(pe_resource_t *rsc, const pe_node_t *node, bool optional)
G_GNUC_INTERNAL uint32_t pcmk__update_ordered_actions(pe_action_t *first, pe_action_t *then, const pe_node_t *node, uint32_t flags, uint32_t filter, uint32_t type, pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__primitive_apply_coloc_score(pe_resource_t *dependent, const pe_resource_t *primary, const pcmk__colocation_t *colocation, bool for_dependent)
G_GNUC_INTERNAL void pcmk__deduplicate_action_inputs(pe_action_t *action)
pcmk__coloc_affects
G_GNUC_INTERNAL void pcmk__show_node_capacities(const char *desc, pe_working_set_t *data_set)
const char * name
Definition: cib.c:24
void(* internal_constraints)(pe_resource_t *rsc)
G_GNUC_INTERNAL pe_resource_t * pcmk__find_compatible_instance(const pe_resource_t *match_rsc, const pe_resource_t *rsc, enum rsc_role_e role, bool current)
G_GNUC_INTERNAL void pcmk__with_bundle_colocations(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList **list)
G_GNUC_INTERNAL bool pcmk__any_node_available(GHashTable *nodes)
G_GNUC_INTERNAL void pcmk__set_allocation_methods(pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__with_group_colocations(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList **list)
G_GNUC_INTERNAL void pcmk__log_action(const char *pre_text, const pe_action_t *action, bool details)
G_GNUC_INTERNAL xmlNode * pcmk__inject_node_state_change(cib_t *cib_conn, const char *node, bool up)
G_GNUC_INTERNAL void pcmk__inject_failcount(pcmk__output_t *out, xmlNode *cib_node, const char *resource, const char *task, guint interval_ms, int rc)
void(* with_this_colocations)(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList **list)
G_GNUC_INTERNAL void pcmk__clone_with_colocations(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList **list)
G_GNUC_INTERNAL void pcmk__set_instance_roles(pe_resource_t *rsc)
G_GNUC_INTERNAL void pcmk__group_with_colocations(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList **list)
G_GNUC_INTERNAL void pcmk__with_clone_colocations(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList **list)
G_GNUC_INTERNAL enum pe_action_flags pcmk__group_action_flags(pe_action_t *action, const pe_node_t *node)
pe_resource_t * dependent
G_GNUC_INTERNAL pe_node_t * pcmk__connection_host_for_action(const pe_action_t *action)
G_GNUC_INTERNAL xmlNode * pcmk__inject_node(cib_t *cib_conn, const char *node, const char *uuid)
G_GNUC_INTERNAL void pcmk__apply_node_health(pe_working_set_t *data_set)
G_GNUC_INTERNAL GList * pcmk__sort_nodes(GList *nodes, pe_node_t *active_node)
G_GNUC_INTERNAL void pcmk__disable_invalid_orderings(pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__group_apply_coloc_score(pe_resource_t *dependent, const pe_resource_t *primary, const pcmk__colocation_t *colocation, bool for_dependent)
bool pcmk__rsc_can_migrate(const pe_resource_t *rsc, const pe_node_t *current)
G_GNUC_INTERNAL void pcmk__consume_node_capacity(GHashTable *current_utilization, const pe_resource_t *rsc)
enum crm_ais_msg_types type
Definition: cpg.c:48
void(* add_graph_meta)(const pe_resource_t *rsc, xmlNode *xml)
G_GNUC_INTERNAL xmlNode * pcmk__expand_tags_in_sets(xmlNode *xml_obj, const pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__order_probes(pe_working_set_t *data_set)
G_GNUC_INTERNAL uint32_t pcmk__group_update_ordered_actions(pe_action_t *first, pe_action_t *then, const pe_node_t *node, uint32_t flags, uint32_t filter, uint32_t type, pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__add_colocated_node_scores(pe_resource_t *rsc, const char *log_id, GHashTable **nodes, const char *attr, float factor, uint32_t flags)
#define pe_rsc_allow_remote_remotes
Definition: pe_types.h:289
G_GNUC_INTERNAL pe_node_t * pcmk__clone_assign(pe_resource_t *rsc, const pe_node_t *prefer)
G_GNUC_INTERNAL void pcmk__order_vs_fence(pe_action_t *stonith_op, pe_working_set_t *data_set)
void(* add_actions_to_graph)(pe_resource_t *rsc)
G_GNUC_INTERNAL bool pcmk__tag_to_set(xmlNode *xml_obj, xmlNode **rsc_set, const char *attr, bool convert_rsc, const pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__apply_coloc_to_priority(pe_resource_t *dependent, const pe_resource_t *primary, const pcmk__colocation_t *colocation)
const char * action
Definition: pcmk_fence.c:30
G_GNUC_INTERNAL bool pcmk__instance_matches(const pe_resource_t *instance, const pe_node_t *node, enum rsc_role_e role, bool current)
G_GNUC_INTERNAL void pcmk__substitute_remote_addr(pe_resource_t *rsc, GHashTable *params)
G_GNUC_INTERNAL void pcmk__new_colocation(const char *id, const char *node_attr, int score, pe_resource_t *dependent, pe_resource_t *primary, const char *dependent_role, const char *primary_role, bool influence, pe_working_set_t *data_set)
enum pe_action_flags(* action_flags)(pe_action_t *action, const pe_node_t *node)
G_GNUC_INTERNAL void pcmk__apply_locations(pe_working_set_t *data_set)
G_GNUC_INTERNAL pe_action_t * pcmk__new_cancel_action(pe_resource_t *rsc, const char *name, guint interval_ms, const pe_node_t *node)
G_GNUC_INTERNAL bool pcmk__valid_resource_or_tag(const pe_working_set_t *data_set, const char *id, pe_resource_t **rsc, pe_tag_t **tag)
G_GNUC_INTERNAL void pcmk__schedule_probes(pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__add_with_this(GList **list, const pcmk__colocation_t *colocation)
G_GNUC_INTERNAL bool pcmk__check_action_config(pe_resource_t *rsc, pe_node_t *node, const xmlNode *xml_op)
pe_action_flags
Definition: pe_types.h:316
G_GNUC_INTERNAL const pe_node_t * pcmk__ban_insufficient_capacity(pe_resource_t *rsc)
G_GNUC_INTERNAL bool pcmk__is_failed_remote_node(const pe_node_t *node)
#define pe_rsc_failed
Definition: pe_types.h:292
G_GNUC_INTERNAL bool pcmk__node_available(const pe_node_t *node, bool consider_score, bool consider_guest)
G_GNUC_INTERNAL uint32_t pcmk__instance_update_ordered_actions(pe_action_t *first, pe_action_t *then, const pe_node_t *node, uint32_t flags, uint32_t filter, uint32_t type, pe_working_set_t *data_set)
pe_resource_t * primary
G_GNUC_INTERNAL void pcmk__order_promotable_instances(pe_resource_t *clone)
G_GNUC_INTERNAL const pe_resource_t * pcmk__get_rsc_in_container(const pe_resource_t *instance)
G_GNUC_INTERNAL void pcmk__order_remote_connection_actions(pe_working_set_t *data_set)
G_GNUC_INTERNAL pe_node_t * pcmk__group_assign(pe_resource_t *rsc, const pe_node_t *prefer)
G_GNUC_INTERNAL bool pcmk__probe_resource_list(GList *rscs, pe_node_t *node)
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
Definition: util.h:121
G_GNUC_INTERNAL bool pcmk__finalize_assignment(pe_resource_t *rsc, pe_node_t *chosen, bool force)
G_GNUC_INTERNAL void pcmk__with_primitive_colocations(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList **list)
G_GNUC_INTERNAL gint pcmk__cmp_instance(gconstpointer a, gconstpointer b)
unsigned long long flags
Definition: pe_types.h:373
pe_working_set_t * data_set
G_GNUC_INTERNAL void pcmk__primitive_add_graph_meta(const pe_resource_t *rsc, xmlNode *xml)
void(* output_actions)(pe_resource_t *rsc)
void(* create_actions)(pe_resource_t *rsc)
G_GNUC_INTERNAL bool pcmk__node_unfenced(const pe_node_t *node)
G_GNUC_INTERNAL void pcmk__new_ordering(pe_resource_t *first_rsc, char *first_task, pe_action_t *first_action, pe_resource_t *then_rsc, char *then_task, pe_action_t *then_action, uint32_t flags, pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__create_internal_constraints(pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__order_after_each(pe_action_t *after, GList *list)
pe_node_t node1
G_GNUC_INTERNAL void pcmk__output_actions(pe_working_set_t *data_set)
G_GNUC_INTERNAL bool pcmk__probe_rsc_on_node(pe_resource_t *rsc, pe_node_t *node)
G_GNUC_INTERNAL void pcmk__add_with_this_list(GList **list, GList *addition)
G_GNUC_INTERNAL gint pcmk__cmp_instance_number(gconstpointer a, gconstpointer b)
void(* add_utilization)(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList *all_rscs, GHashTable *utilization)
void(* this_with_colocations)(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList **list)
G_GNUC_INTERNAL bool pcmk__action_is_recurring(const pe_action_t *action)
G_GNUC_INTERNAL pe_resource_t * pcmk__find_constraint_resource(GList *rsc_list, const char *id)
pe_node_t node2
G_GNUC_INTERNAL void pcmk__unassign_resource(pe_resource_t *rsc)
G_GNUC_INTERNAL void pcmk__order_restart_vs_unfence(gpointer data, gpointer user_data)
G_GNUC_INTERNAL GList * pcmk__rscs_matching_id(const char *id, const pe_working_set_t *data_set)
void pcmk__create_migration_actions(pe_resource_t *rsc, const pe_node_t *current)
G_GNUC_INTERNAL void pcmk__reschedule_recurring(pe_resource_t *rsc, const char *task, guint interval_ms, pe_node_t *node)
G_GNUC_INTERNAL void pcmk__order_stops_before_shutdown(pe_node_t *node, pe_action_t *shutdown_op)
void(* apply_coloc_score)(pe_resource_t *dependent, const pe_resource_t *primary, const pcmk__colocation_t *colocation, bool for_dependent)
G_GNUC_INTERNAL void pcmk__output_bundle_actions(pe_resource_t *rsc)
G_GNUC_INTERNAL void pcmk__fence_guest(pe_node_t *node)
G_GNUC_INTERNAL void pcmk__primitive_internal_constraints(pe_resource_t *rsc)
G_GNUC_INTERNAL void pcmk__clone_apply_coloc_score(pe_resource_t *dependent, const pe_resource_t *primary, const pcmk__colocation_t *colocation, bool for_dependent)
G_GNUC_INTERNAL void pcmk__update_dependent_with_promotable(const pe_resource_t *primary, pe_resource_t *dependent, const pcmk__colocation_t *colocation)
Update dependent for a colocation with a promotable clone.
G_GNUC_INTERNAL void pcmk__apply_location(pe_resource_t *rsc, pe__location_t *constraint)
G_GNUC_INTERNAL pe__location_t * pcmk__new_location(const char *id, pe_resource_t *rsc, int node_weight, const char *discover_mode, pe_node_t *foo_node, pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__group_shutdown_lock(pe_resource_t *rsc)
bool(* create_probe)(pe_resource_t *rsc, pe_node_t *node)
G_GNUC_INTERNAL void pcmk__require_promotion_tickets(pe_resource_t *rsc)
G_GNUC_INTERNAL void pcmk__update_action_for_orderings(pe_action_t *action, pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__create_utilization_constraints(pe_resource_t *rsc, const GList *allowed_nodes)
G_GNUC_INTERNAL bool pcmk__graph_has_loop(const pe_action_t *init_action, const pe_action_t *action, pe_action_wrapper_t *input)
G_GNUC_INTERNAL bool pcmk__rsc_agent_changed(pe_resource_t *rsc, pe_node_t *node, const xmlNode *rsc_entry, bool active_on_node)
G_GNUC_INTERNAL void pcmk__add_dependent_scores(gpointer data, gpointer user_data)
G_GNUC_INTERNAL void pcmk__handle_rsc_config_changes(pe_working_set_t *data_set)
G_GNUC_INTERNAL GList * pcmk__colocated_resources(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList *colocated_rscs)
G_GNUC_INTERNAL GHashTable * pcmk__copy_node_table(GHashTable *nodes)
G_GNUC_INTERNAL void pcmk__create_recurring_actions(pe_resource_t *rsc)
G_GNUC_INTERNAL pe_action_t * pcmk__new_shutdown_action(pe_node_t *node)
G_GNUC_INTERNAL void pcmk__primitive_with_colocations(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList **list)
G_GNUC_INTERNAL void pcmk__noop_add_graph_meta(const pe_resource_t *rsc, xmlNode *xml)
G_GNUC_INTERNAL void pcmk__group_internal_constraints(pe_resource_t *rsc)
G_GNUC_INTERNAL void pcmk__group_create_actions(pe_resource_t *rsc)
G_GNUC_INTERNAL int pcmk__compare_node_capacities(const pe_node_t *node1, const pe_node_t *node2)
G_GNUC_INTERNAL void pcmk__group_add_colocated_node_scores(pe_resource_t *rsc, const char *log_id, GHashTable **nodes, const char *attr, float factor, uint32_t flags)
G_GNUC_INTERNAL pe_node_t * pcmk__top_allowed_node(const pe_resource_t *rsc, const pe_node_t *node)
G_GNUC_INTERNAL void pcmk__add_this_with(GList **list, const pcmk__colocation_t *colocation)
G_GNUC_INTERNAL void pcmk__primitive_shutdown_lock(pe_resource_t *rsc)
xmlNode * input
G_GNUC_INTERNAL void pcmk__unpack_ordering(xmlNode *xml_obj, pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__create_promotable_actions(pe_resource_t *clone)
Synthetic cluster events that can be injected into the cluster for running simulations.
Definition: pacemaker.h:50
G_GNUC_INTERNAL void pcmk__update_promotable_dependent_priority(const pe_resource_t *primary, pe_resource_t *dependent, const pcmk__colocation_t *colocation)
G_GNUC_INTERNAL bool pcmk__assign_resource(pe_resource_t *rsc, pe_node_t *node, bool force)
G_GNUC_INTERNAL void pcmk__create_instance_actions(pe_resource_t *rsc, GList *instances)
This structure contains everything that makes up a single output formatter.
G_GNUC_INTERNAL void pcmk__create_graph(pe_working_set_t *data_set)
pcmk__coloc_select
G_GNUC_INTERNAL void pcmk__primitive_add_utilization(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList *all_rscs, GHashTable *utilization)
G_GNUC_INTERNAL void pcmk__bundle_with_colocations(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList **list)
G_GNUC_INTERNAL void pcmk__promotable_restart_ordering(pe_resource_t *rsc)
G_GNUC_INTERNAL void pcmk__add_promotion_scores(pe_resource_t *rsc)
G_GNUC_INTERNAL void pcmk__output_resource_actions(pe_resource_t *rsc)
G_GNUC_INTERNAL void pcmk__schedule_cancel(pe_resource_t *rsc, const char *call_id, const char *task, guint interval_ms, const pe_node_t *node, const char *reason)
rsc_role_e
Possible roles that a resource can be in.
Definition: common.h:92
G_GNUC_INTERNAL void pcmk__bundle_apply_coloc_score(pe_resource_t *dependent, const pe_resource_t *primary, const pcmk__colocation_t *colocation, bool for_dependent)
G_GNUC_INTERNAL void pcmk__group_add_utilization(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList *all_rscs, GHashTable *utilization)
G_GNUC_INTERNAL bool pcmk__threshold_reached(pe_resource_t *rsc, const pe_node_t *node, pe_resource_t **failed)
GList * running_on
Definition: pe_types.h:398
G_GNUC_INTERNAL void pcmk__assign_instances(pe_resource_t *collective, GList *instances, int max_total, int max_per_node)
G_GNUC_INTERNAL void pcmk__sort_resources(pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__group_apply_location(pe_resource_t *rsc, pe__location_t *location)
G_GNUC_INTERNAL void pcmk__unpack_colocation(xmlNode *xml_obj, pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__order_vs_unfence(const pe_resource_t *rsc, pe_node_t *node, pe_action_t *action, enum pe_ordering order)
G_GNUC_INTERNAL xmlNode * pcmk__inject_action_result(xmlNode *cib_resource, lrmd_event_data_t *op, int target_rc)
G_GNUC_INTERNAL void pcmk__unpack_location(xmlNode *xml_obj, pe_working_set_t *data_set)
G_GNUC_INTERNAL xmlNode * pcmk__inject_resource_history(pcmk__output_t *out, xmlNode *cib_node, const char *resource, const char *lrm_name, const char *rclass, const char *rtype, const char *rprovider)
Data types for cluster status.
void(* shutdown_lock)(pe_resource_t *rsc)
G_GNUC_INTERNAL void pcmk__unpack_rsc_ticket(xmlNode *xml_obj, pe_working_set_t *data_set)
void(* apply_location)(pe_resource_t *rsc, pe__location_t *location)
G_GNUC_INTERNAL void pcmk__primitive_create_actions(pe_resource_t *rsc)
void pcmk__inject_scheduler_input(pe_working_set_t *data_set, cib_t *cib, const pcmk_injections_t *injections)
uint32_t(* update_ordered_actions)(pe_action_t *first, pe_action_t *then, const pe_node_t *node, uint32_t flags, uint32_t filter, uint32_t type, pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__block_colocation_dependents(pe_action_t *action, pe_working_set_t *data_set)
G_GNUC_INTERNAL void pcmk__add_collective_constraints(GList **list, const pe_resource_t *instance, const pe_resource_t *collective, bool with_this)
G_GNUC_INTERNAL enum pcmk__coloc_affects pcmk__colocation_affects(const pe_resource_t *dependent, const pe_resource_t *primary, const pcmk__colocation_t *colocation, bool preview)
G_GNUC_INTERNAL void pcmk__apply_coloc_to_weights(pe_resource_t *dependent, const pe_resource_t *primary, const pcmk__colocation_t *colocation)
G_GNUC_INTERNAL void pcmk__apply_orderings(pe_working_set_t *data_set)
void pcmk__abort_dangling_migration(void *data, void *user_data)
G_GNUC_INTERNAL bool pcmk__rsc_corresponds_to_guest(const pe_resource_t *rsc, const pe_node_t *node)
pe_ordering
Definition: pe_types.h:506
void pcmk__order_migration_equivalents(pe__ordering_t *order)
uint64_t flags
Definition: remote.c:215
void(* add_colocated_node_scores)(pe_resource_t *rsc, const char *log_id, GHashTable **nodes, const char *attr, float factor, uint32_t flags)
G_GNUC_INTERNAL void pcmk__add_bundle_meta_to_xml(xmlNode *args_xml, const pe_action_t *action)
Add special bundle meta-attributes to XML.
G_GNUC_INTERNAL enum pe_action_flags pcmk__primitive_action_flags(pe_action_t *action, const pe_node_t *node)
G_GNUC_INTERNAL enum pe_action_flags pcmk__collective_action_flags(pe_action_t *action, const GList *instances, const pe_node_t *node)