pacemaker  2.1.7-0f7f88312f
Scalable High-Availability cluster resource manager
scheduler.h
Go to the documentation of this file.
1 /*
2  * Copyright 2004-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__CRM_COMMON_SCHEDULER__H
11 # define PCMK__CRM_COMMON_SCHEDULER__H
12 
13 #include <sys/types.h> // time_t
14 #include <libxml/tree.h> // xmlNode
15 #include <glib.h> // guint, GList, GHashTable
16 
17 #include <crm/common/iso8601.h> // crm_time_t
18 
19 #include <crm/common/actions.h>
20 #include <crm/common/nodes.h>
21 #include <crm/common/resources.h>
22 #include <crm/common/roles.h>
24 #include <crm/common/tags.h>
25 #include <crm/common/tickets.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
37 enum pe_quorum_policy {
39  pcmk_no_quorum_freeze, //<! Do not recover resources from outside partition
40  pcmk_no_quorum_stop, //<! Stop all resources in partition
41  pcmk_no_quorum_ignore, //<! Act as if partition still holds quorum
42  pcmk_no_quorum_fence, //<! Fence all nodes in partition
43  pcmk_no_quorum_demote, //<! Demote promotable resources and stop all others
44 
45 #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
48 
51 
54 
57 
60 #endif
61 };
62 
67 
68  // These flags are dynamically determined conditions
69 
71  pcmk_sched_quorate = (1ULL << 0),
72 
75 
78 
81 
83  pcmk_sched_have_fencing = (1ULL << 5),
84 
87 
90 
96 
102 
104  pcmk_sched_stop_all = (1ULL << 10),
105 
111 
114 
117 
122  pcmk_sched_shutdown_lock = (1ULL << 15),
123 
129 
131  pcmk_sched_have_status = (1ULL << 17),
132 
135 
136  // The remaining flags are scheduling options that must be set explicitly
137 
143  pcmk_sched_location_only = (1ULL << 20),
144 
146  pcmk_sched_sanitized = (1ULL << 21),
147 
149  pcmk_sched_no_counts = (1ULL << 23),
150 
155  pcmk_sched_no_compat = (1ULL << 24),
156 
158  pcmk_sched_output_scores = (1ULL << 25),
159 
162 
168  pcmk_sched_validate_only = (1ULL << 27),
169 };
170 
173  // Be careful about when each piece of information is available and final
174 
175  xmlNode *input;
177  char *dc_uuid;
179  const char *stonith_action;
180  const char *placement_strategy;
181 
182  // @COMPAT Change to uint64_t at a compatibility break
183  unsigned long long flags;
184 
187  GHashTable *config_hash;
188 
190  GHashTable *tickets;
191 
193  GHashTable *singletons;
194 
195  GList *nodes;
196  GList *resources;
200 
203 
204  GList *actions;
205  xmlNode *failed;
206  xmlNode *op_defaults;
207  xmlNode *rsc_defaults;
210  int order_id;
211  int action_id;
212  xmlNode *graph;
213  GHashTable *template_rsc_sets;
214 
215  // @COMPAT Replace this with a fencer variable (only place it's used)
216  const char *localhost;
217 
218  GHashTable *tags;
221  GList *param_check;
222  GList *stop_needed;
223  time_t recheck_by;
227 
228  // pcmk__output_t *
229  void *priv;
230 
232 };
233 
234 #ifdef __cplusplus
235 }
236 #endif
237 
238 #endif // PCMK__CRM_COMMON_SCHEDULER__H
GHashTable * tags
Configuration tags (ID -> pcmk_tag_t *)
Definition: scheduler.h:218
enum pe_quorum_policy no_quorum_policy
Response to loss of quorum.
Definition: scheduler.h:186
xmlNode * failed
History entries of failed actions.
Definition: scheduler.h:205
Scheduler API for resources.
Type aliases needed to define scheduler objects.
Whether cluster is symmetric (via symmetric-cluster property)
Definition: scheduler.h:74
struct crm_time_s crm_time_t
Definition: iso8601.h:32
Whether partition has quorum (via have-quorum property)
Definition: scheduler.h:71
int priority_fencing_delay
Priority fencing delay.
Definition: scheduler.h:226
xmlNode * op_defaults
Configured operation defaults.
Definition: scheduler.h:206
APIs related to actions.
Whether node scores should be output instead of logged.
Definition: scheduler.h:158
Whether unseen nodes should be fenced (via startup-fencing property)
Definition: scheduler.h:116
Whether the CIB status section has been parsed yet.
Definition: scheduler.h:131
Whether concurrent fencing is allowed (via concurrent-fencing property)
Definition: scheduler.h:89
GList * actions
Scheduled actions.
Definition: scheduler.h:204
int order_id
ID to use for next created ordering.
Definition: scheduler.h:210
GHashTable * tickets
Definition: scheduler.h:190
Implementation of pcmk_scheduler_t.
Definition: scheduler.h:172
char * dc_uuid
Node ID of designated controller.
Definition: scheduler.h:177
int ninstances
Total number of resource instances.
Definition: scheduler.h:224
pe_quorum_policy
Possible responses to loss of quorum.
Definition: scheduler.h:38
GList * resources
Resources in cluster.
Definition: scheduler.h:196
int stonith_timeout
Value of stonith-timeout property.
Definition: scheduler.h:185
GList * nodes
Nodes in cluster.
Definition: scheduler.h:195
Whether to show node and resource utilization (in log or output)
Definition: scheduler.h:161
GList * ticket_constraints
Definition: scheduler.h:202
Whether any resource provides or requires unfencing (via CIB resources)
Definition: scheduler.h:86
Scheduler API for resource roles.
xmlNode * rsc_defaults
Configured resource defaults.
Definition: scheduler.h:207
Whether the cluster includes any Pacemaker Remote nodes (via CIB)
Definition: scheduler.h:134
void * priv
For Pacemaker use only.
Definition: scheduler.h:229
int blocked_resources
Number of blocked resources in cluster.
Definition: scheduler.h:219
int action_id
ID to use for next created action.
Definition: scheduler.h:211
const char * stonith_action
Default fencing action.
Definition: scheduler.h:179
GHashTable * config_hash
Cluster properties.
Definition: scheduler.h:187
ISO_8601 Date handling.
time_t recheck_by
Hint to controller when to reschedule.
Definition: scheduler.h:223
Implementation of pcmk_node_t.
Definition: nodes.h:130
xmlNode * input
CIB XML.
Definition: scheduler.h:175
const char * placement_strategy
Value of placement-strategy property.
Definition: scheduler.h:180
Whether sensitive resource attributes have been masked.
Definition: scheduler.h:146
guint shutdown_lock
How long to lock resources (seconds)
Definition: scheduler.h:225
Scheduler API for nodes.
const char * localhost
Definition: scheduler.h:216
GList * ordering_constraints
Ordering constraints.
Definition: scheduler.h:198
guint node_pending_timeout
Pending join times out after this (ms)
Definition: scheduler.h:231
Whether to stop all resources (via stop-all-resources property)
Definition: scheduler.h:104
Whether fencing is enabled (via stonith-enabled property)
Definition: scheduler.h:80
GList * param_check
History entries that need to be checked.
Definition: scheduler.h:221
int disabled_resources
Number of disabled resources in cluster.
Definition: scheduler.h:220
GList * colocation_constraints
Colocation constraints.
Definition: scheduler.h:199
Skip counting of total, disabled, and blocked resource instances.
Definition: scheduler.h:149
Scheduler API for configuration tags.
Scheduler API for tickets.
GList * placement_constraints
Location constraints.
Definition: scheduler.h:197
Whether cluster has a fencing resource (via CIB resources)
Definition: scheduler.h:83
GHashTable * singletons
Actions for which there can be only one (such as "fence node X")
Definition: scheduler.h:193
unsigned long long flags
Group of enum pcmk_scheduler_flags.
Definition: scheduler.h:183
No scheduler flags set (compare with equality rather than bit set)
Definition: scheduler.h:66
Whether cluster is in maintenance mode (via maintenance-mode property)
Definition: scheduler.h:77
pcmk_scheduler_flags
Scheduling options and conditions.
Definition: scheduler.h:64
crm_time_t * now
Current time for evaluation purposes.
Definition: scheduler.h:176
GHashTable * template_rsc_sets
Mappings of template ID to resource ID.
Definition: scheduler.h:213
pcmk_node_t * dc_node
Node object for DC.
Definition: scheduler.h:178
GList * stop_needed
Containers that need stop actions.
Definition: scheduler.h:222
int num_synapse
Number of transition graph synapses.
Definition: scheduler.h:208
xmlNode * graph
Transition graph.
Definition: scheduler.h:212