pacemaker  2.0.2-debe490
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pcmki_sched_allocate.h
Go to the documentation of this file.
1 /*
2  * Copyright 2004-2019 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 SCHED_ALLOCATE__H
11 # define SCHED_ALLOCATE__H
12 
13 # include <glib.h>
14 # include <crm/common/xml.h>
15 # include <crm/pengine/status.h>
16 # include <crm/pengine/complex.h>
17 # include <crm/pengine/internal.h>
18 # include <pcmki/pcmki_scheduler.h>
19 
21  GHashTable *(*merge_weights) (resource_t *, const char *, GHashTable *, const char *, float,
22  enum pe_weights);
23  node_t *(*allocate) (resource_t *, node_t *, pe_working_set_t *);
25  gboolean(*create_probe) (resource_t *, node_t *, action_t *, gboolean, pe_working_set_t *);
27 
32 
34 
37  pe_node_t *, enum pe_action_flags,
38  enum pe_action_flags,
39  enum pe_ordering,
40  pe_working_set_t *data_set);
41 
43  void (*append_meta) (resource_t * rsc, xmlNode * xml);
44 };
45 
46 extern GHashTable *rsc_merge_weights(resource_t * rsc, const char *rhs, GHashTable * nodes,
47  const char *attr, float factor, enum pe_weights flags);
48 
49 extern GHashTable *clone_merge_weights(resource_t * rsc, const char *rhs, GHashTable * nodes,
50  const char *attr, float factor, enum pe_weights flags);
51 
52 GHashTable *pcmk__bundle_merge_weights(pe_resource_t *rsc, const char *rhs,
53  GHashTable *nodes, const char *attr,
54  float factor, enum pe_weights flags);
55 
56 extern GHashTable *native_merge_weights(resource_t * rsc, const char *rhs, GHashTable * nodes,
57  const char *attr, float factor, enum pe_weights flags);
58 
59 extern GHashTable *group_merge_weights(resource_t * rsc, const char *rhs, GHashTable * nodes,
60  const char *attr, float factor, enum pe_weights flags);
61 
62 extern node_t *native_color(resource_t * rsc, node_t * preferred, pe_working_set_t * data_set);
63 extern void native_create_actions(resource_t * rsc, pe_working_set_t * data_set);
64 extern void native_internal_constraints(resource_t * rsc, pe_working_set_t * data_set);
66  rsc_colocation_t *constraint,
67  pe_working_set_t *data_set);
69  rsc_colocation_t *constraint,
70  pe_working_set_t *data_set);
71 extern void rsc_ticket_constraint(resource_t * lh_rsc, rsc_ticket_t * rsc_ticket,
72  pe_working_set_t * data_set);
73 extern enum pe_action_flags native_action_flags(action_t * action, node_t * node);
74 
75 void native_rsc_location(pe_resource_t *rsc, pe__location_t *constraint);
76 extern void native_expand(resource_t * rsc, pe_working_set_t * data_set);
77 extern gboolean native_create_probe(resource_t * rsc, node_t * node, action_t * complete,
78  gboolean force, pe_working_set_t * data_set);
79 extern void native_append_meta(resource_t * rsc, xmlNode * xml);
80 
81 extern node_t *group_color(resource_t * rsc, node_t * preferred, pe_working_set_t * data_set);
82 extern void group_create_actions(resource_t * rsc, pe_working_set_t * data_set);
83 extern void group_internal_constraints(resource_t * rsc, pe_working_set_t * data_set);
85  rsc_colocation_t *constraint,
86  pe_working_set_t *data_set);
88  rsc_colocation_t *constraint,
89  pe_working_set_t *data_set);
90 extern enum pe_action_flags group_action_flags(action_t * action, node_t * node);
91 void group_rsc_location(pe_resource_t *rsc, pe__location_t *constraint);
92 extern void group_expand(resource_t * rsc, pe_working_set_t * data_set);
93 extern void group_append_meta(resource_t * rsc, xmlNode * xml);
94 
96  pe_working_set_t *data_set);
98  pe_working_set_t *data_set);
100  pe_action_t *complete, gboolean force,
101  pe_working_set_t *data_set);
103  pe_working_set_t *data_set);
105  pe_resource_t *rh_rsc,
106  rsc_colocation_t *constraint,
107  pe_working_set_t *data_set);
109  pe_resource_t *rh_rsc,
110  rsc_colocation_t *constraint,
111  pe_working_set_t *data_set);
114  pe_node_t *node);
116 void pcmk__bundle_append_meta(pe_resource_t *rsc, xmlNode *xml);
117 
118 extern node_t *clone_color(resource_t * rsc, node_t * preferred, pe_working_set_t * data_set);
119 extern void clone_create_actions(resource_t * rsc, pe_working_set_t * data_set);
120 extern void clone_internal_constraints(resource_t * rsc, pe_working_set_t * data_set);
122  rsc_colocation_t *constraint,
123  pe_working_set_t *data_set);
125  rsc_colocation_t *constraint,
126  pe_working_set_t *data_set);
127 void clone_rsc_location(pe_resource_t *rsc, pe__location_t *constraint);
128 extern enum pe_action_flags clone_action_flags(action_t * action, node_t * node);
129 extern void clone_expand(resource_t * rsc, pe_working_set_t * data_set);
130 extern gboolean clone_create_probe(resource_t * rsc, node_t * node, action_t * complete,
131  gboolean force, pe_working_set_t * data_set);
132 extern void clone_append_meta(resource_t * rsc, xmlNode * xml);
133 
134 void apply_master_prefs(resource_t *rsc);
139 void promotable_colocation_rh(resource_t *lh_rsc, resource_t *rh_rsc,
140  rsc_colocation_t *constraint,
141  pe_working_set_t *data_set);
142 
143 /* extern resource_object_functions_t resource_variants[]; */
145 gboolean is_active(pe__location_t *cons);
146 
147 extern gboolean unpack_rsc_order(xmlNode * xml_obj, pe_working_set_t * data_set);
148 
149 extern gboolean unpack_rsc_colocation(xmlNode * xml_obj, pe_working_set_t * data_set);
150 
151 extern gboolean unpack_location(xmlNode * xml_obj, pe_working_set_t * data_set);
152 
153 extern gboolean unpack_rsc_ticket(xmlNode * xml_obj, pe_working_set_t * data_set);
154 
155 void LogNodeActions(pe_working_set_t * data_set, gboolean terminal);
156 void LogActions(resource_t * rsc, pe_working_set_t * data_set, gboolean terminal);
158  gboolean terminal);
159 
160 extern void rsc_stonith_ordering(resource_t * rsc, action_t * stonith_op,
161  pe_working_set_t * data_set);
162 
164  pe_node_t *node,
165  enum pe_action_flags flags,
166  enum pe_action_flags filter,
167  enum pe_ordering type,
168  pe_working_set_t *data_set);
170  pe_node_t *node,
171  enum pe_action_flags flags,
172  enum pe_action_flags filter,
173  enum pe_ordering type,
174  pe_working_set_t *data_set);
176  pe_action_t *then,
177  pe_node_t *node,
178  enum pe_action_flags flags,
179  enum pe_action_flags filter,
180  enum pe_ordering type,
181  pe_working_set_t *data_set);
182 
183 gboolean update_action_flags(action_t * action, enum pe_action_flags flags, const char *source, int line);
184 gboolean update_action(pe_action_t *action, pe_working_set_t *data_set);
185 void complex_set_cmds(resource_t * rsc);
186 void pcmk__log_transition_summary(const char *filename);
188  resource_t * rsc, GListPtr children, notify_data_t **start_notify, notify_data_t **stop_notify, pe_working_set_t * data_set);
189 #endif
node_t * group_color(resource_t *rsc, node_t *preferred, pe_working_set_t *data_set)
void group_internal_constraints(resource_t *rsc, pe_working_set_t *data_set)
pe_node_t * pcmk__bundle_color(pe_resource_t *rsc, pe_node_t *preferred, pe_working_set_t *data_set)
enum pe_action_flags(* action_flags)(action_t *, node_t *)
GHashTable * pcmk__bundle_merge_weights(pe_resource_t *rsc, const char *rhs, GHashTable *nodes, const char *attr, float factor, enum pe_weights flags)
void native_expand(resource_t *rsc, pe_working_set_t *data_set)
enum pe_action_flags pcmk__bundle_action_flags(pe_action_t *action, pe_node_t *node)
void native_internal_constraints(resource_t *rsc, pe_working_set_t *data_set)
gboolean is_active(pe__location_t *cons)
void create_promotable_actions(resource_t *rsc, pe_working_set_t *data_set)
node_t * clone_color(resource_t *rsc, node_t *preferred, pe_working_set_t *data_set)
void promotable_colocation_rh(resource_t *lh_rsc, resource_t *rh_rsc, rsc_colocation_t *constraint, pe_working_set_t *data_set)
void group_expand(resource_t *rsc, pe_working_set_t *data_set)
void(* expand)(resource_t *, pe_working_set_t *)
GHashTable * clone_merge_weights(resource_t *rsc, const char *rhs, GHashTable *nodes, const char *attr, float factor, enum pe_weights flags)
void pcmk__log_transition_summary(const char *filename)
gboolean unpack_rsc_order(xmlNode *xml_obj, pe_working_set_t *data_set)
gboolean unpack_rsc_ticket(xmlNode *xml_obj, pe_working_set_t *data_set)
void clone_rsc_colocation_lh(pe_resource_t *lh_rsc, pe_resource_t *rh_rsc, rsc_colocation_t *constraint, pe_working_set_t *data_set)
resource_alloc_functions_t resource_class_alloc_functions[]
void pcmk__bundle_log_actions(pe_resource_t *rsc, pe_working_set_t *data_set, gboolean terminal)
void(* rsc_colocation_lh)(pe_resource_t *, pe_resource_t *, rsc_colocation_t *, pe_working_set_t *)
void pcmk__bundle_rsc_colocation_rh(pe_resource_t *lh_rsc, pe_resource_t *rh_rsc, rsc_colocation_t *constraint, pe_working_set_t *data_set)
enum pe_graph_flags(* update_actions)(pe_action_t *, pe_action_t *, pe_node_t *, enum pe_action_flags, enum pe_action_flags, enum pe_ordering, pe_working_set_t *data_set)
gboolean clone_create_probe(resource_t *rsc, node_t *node, action_t *complete, gboolean force, pe_working_set_t *data_set)
void group_rsc_location(pe_resource_t *rsc, pe__location_t *constraint)
void native_create_actions(resource_t *rsc, pe_working_set_t *data_set)
void(* create_actions)(resource_t *, pe_working_set_t *)
enum pe_action_flags clone_action_flags(action_t *action, node_t *node)
enum pe_graph_flags native_update_actions(pe_action_t *first, pe_action_t *then, pe_node_t *node, enum pe_action_flags flags, enum pe_action_flags filter, enum pe_ordering type, pe_working_set_t *data_set)
void rsc_ticket_constraint(resource_t *lh_rsc, rsc_ticket_t *rsc_ticket, pe_working_set_t *data_set)
void native_rsc_location(pe_resource_t *rsc, pe__location_t *constraint)
gboolean unpack_rsc_colocation(xmlNode *xml_obj, pe_working_set_t *data_set)
void(* rsc_colocation_rh)(pe_resource_t *, pe_resource_t *, rsc_colocation_t *, pe_working_set_t *)
node_t * color_promotable(resource_t *rsc, pe_working_set_t *data_set)
void promote_demote_constraints(resource_t *rsc, pe_working_set_t *data_set)
void group_rsc_colocation_lh(pe_resource_t *lh_rsc, pe_resource_t *rh_rsc, rsc_colocation_t *constraint, pe_working_set_t *data_set)
void native_rsc_colocation_lh(pe_resource_t *lh_rsc, pe_resource_t *rh_rsc, rsc_colocation_t *constraint, pe_working_set_t *data_set)
void native_append_meta(resource_t *rsc, xmlNode *xml)
GHashTable * group_merge_weights(resource_t *rsc, const char *rhs, GHashTable *nodes, const char *attr, float factor, enum pe_weights flags)
pe_action_flags
Definition: pe_types.h:258
void clone_create_pseudo_actions(resource_t *rsc, GListPtr children, notify_data_t **start_notify, notify_data_t **stop_notify, pe_working_set_t *data_set)
void clone_expand(resource_t *rsc, pe_working_set_t *data_set)
void promotable_constraints(resource_t *rsc, pe_working_set_t *data_set)
enum pe_graph_flags group_update_actions(pe_action_t *first, pe_action_t *then, pe_node_t *node, enum pe_action_flags flags, enum pe_action_flags filter, enum pe_ordering type, pe_working_set_t *data_set)
void group_rsc_colocation_rh(pe_resource_t *lh_rsc, pe_resource_t *rh_rsc, rsc_colocation_t *constraint, pe_working_set_t *data_set)
gboolean update_action(pe_action_t *action, pe_working_set_t *data_set)
GHashTable * rsc_merge_weights(resource_t *rsc, const char *rhs, GHashTable *nodes, const char *attr, float factor, enum pe_weights flags)
void LogActions(resource_t *rsc, pe_working_set_t *data_set, gboolean terminal)
Wrappers for and extensions to libxml2.
void LogNodeActions(pe_working_set_t *data_set, gboolean terminal)
pe_graph_flags
Definition: pe_types.h:250
void clone_internal_constraints(resource_t *rsc, pe_working_set_t *data_set)
gboolean native_create_probe(resource_t *rsc, node_t *node, action_t *complete, gboolean force, pe_working_set_t *data_set)
void(* rsc_location)(pe_resource_t *, pe__location_t *)
gboolean pcmk__bundle_create_probe(pe_resource_t *rsc, pe_node_t *node, pe_action_t *complete, gboolean force, pe_working_set_t *data_set)
enum pe_action_flags group_action_flags(action_t *action, node_t *node)
node_t * native_color(resource_t *rsc, node_t *preferred, pe_working_set_t *data_set)
Cluster status and scheduling.
void complex_set_cmds(resource_t *rsc)
void(* internal_constraints)(resource_t *, pe_working_set_t *)
void pcmk__bundle_rsc_location(pe_resource_t *rsc, pe__location_t *constraint)
gboolean update_action_flags(action_t *action, enum pe_action_flags flags, const char *source, int line)
void clone_rsc_location(pe_resource_t *rsc, pe__location_t *constraint)
void clone_rsc_colocation_rh(pe_resource_t *lh_rsc, pe_resource_t *rh_rsc, rsc_colocation_t *constraint, pe_working_set_t *data_set)
void group_create_actions(resource_t *rsc, pe_working_set_t *data_set)
pe_weights
GHashTable * native_merge_weights(resource_t *rsc, const char *rhs, GHashTable *nodes, const char *attr, float factor, enum pe_weights flags)
void pcmk__bundle_expand(pe_resource_t *rsc, pe_working_set_t *data_set)
gboolean(* create_probe)(resource_t *, node_t *, action_t *, gboolean, pe_working_set_t *)
void clone_append_meta(resource_t *rsc, xmlNode *xml)
void group_append_meta(resource_t *rsc, xmlNode *xml)
void apply_master_prefs(resource_t *rsc)
void clone_create_actions(resource_t *rsc, pe_working_set_t *data_set)
void rsc_stonith_ordering(resource_t *rsc, action_t *stonith_op, pe_working_set_t *data_set)
GList * GListPtr
Definition: crm.h:192
void pcmk__bundle_create_actions(pe_resource_t *rsc, pe_working_set_t *data_set)
gboolean unpack_location(xmlNode *xml_obj, pe_working_set_t *data_set)
enum pe_graph_flags pcmk__multi_update_actions(pe_action_t *first, pe_action_t *then, pe_node_t *node, enum pe_action_flags flags, enum pe_action_flags filter, enum pe_ordering type, pe_working_set_t *data_set)
void pcmk__bundle_internal_constraints(pe_resource_t *rsc, pe_working_set_t *data_set)
void pcmk__bundle_append_meta(pe_resource_t *rsc, xmlNode *xml)
pe_ordering
Definition: pe_types.h:437
void(* append_meta)(resource_t *rsc, xmlNode *xml)
uint64_t flags
Definition: remote.c:148
enum pe_action_flags native_action_flags(action_t *action, node_t *node)
enum crm_ais_msg_types type
Definition: internal.h:85
void pcmk__bundle_rsc_colocation_lh(pe_resource_t *lh_rsc, pe_resource_t *rh_rsc, rsc_colocation_t *constraint, pe_working_set_t *data_set)
void native_rsc_colocation_rh(pe_resource_t *lh_rsc, pe_resource_t *rh_rsc, rsc_colocation_t *constraint, pe_working_set_t *data_set)