pacemaker  2.0.3-4b1f869f0f
Scalable High-Availability cluster resource manager
pcmki_scheduler.h
Go to the documentation of this file.
1 /*
2  * Copyright 2014-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 PENGINE__H
11 # define PENGINE__H
12 
14 typedef struct rsc_ticket_s rsc_ticket_t;
15 typedef struct lrm_agent_s lrm_agent_t;
16 
17 # include <glib.h>
18 # include <crm/crm.h>
19 # include <crm/common/iso8601.h>
20 # include <crm/pengine/rules.h>
21 # include <crm/pengine/common.h>
22 # include <crm/pengine/status.h>
23 
24 # include <crm/pengine/complex.h>
25 
30 };
31 
32 enum pe_weights {
38 };
39 
41  const char *id;
42  const char *node_attribute;
45 
46  int role_lh;
47  int role_rh;
48 
49  int score;
50 };
51 
57 };
58 
59 struct rsc_ticket_s {
60  const char *id;
64 
65  int role_lh;
66 };
67 
68 extern gboolean stage0(pe_working_set_t * data_set);
69 extern gboolean probe_resources(pe_working_set_t * data_set);
70 extern gboolean stage2(pe_working_set_t * data_set);
71 extern gboolean stage3(pe_working_set_t * data_set);
72 extern gboolean stage4(pe_working_set_t * data_set);
73 extern gboolean stage5(pe_working_set_t * data_set);
74 extern gboolean stage6(pe_working_set_t * data_set);
75 extern gboolean stage7(pe_working_set_t * data_set);
76 extern gboolean stage8(pe_working_set_t * data_set);
77 
78 extern gboolean summary(GListPtr resources);
79 
80 extern gboolean unpack_constraints(xmlNode * xml_constraints, pe_working_set_t * data_set);
81 
82 extern gboolean shutdown_constraints(node_t * node, action_t * shutdown_op,
83  pe_working_set_t * data_set);
84 
85 extern gboolean stonith_constraints(node_t * node, action_t * stonith_op,
86  pe_working_set_t * data_set);
87 
88 extern int custom_action_order(resource_t * lh_rsc, char *lh_task, action_t * lh_action,
89  resource_t * rh_rsc, char *rh_task, action_t * rh_action,
90  enum pe_ordering type, pe_working_set_t * data_set);
91 
92 extern int new_rsc_order(resource_t * lh_rsc, const char *lh_task,
93  resource_t * rh_rsc, const char *rh_task,
94  enum pe_ordering type, pe_working_set_t * data_set);
95 
96 # define order_start_start(rsc1,rsc2, type) \
97  new_rsc_order(rsc1, CRMD_ACTION_START, rsc2, CRMD_ACTION_START, type, data_set)
98 # define order_stop_stop(rsc1, rsc2, type) \
99  new_rsc_order(rsc1, CRMD_ACTION_STOP, rsc2, CRMD_ACTION_STOP, type, data_set)
100 
101 extern void graph_element_from_action(action_t * action, pe_working_set_t * data_set);
102 extern void add_maintenance_update(pe_working_set_t *data_set);
103 xmlNode *pcmk__schedule_actions(pe_working_set_t *data_set, xmlNode *xml_input,
104  crm_time_t *now);
106 
107 extern gboolean show_scores;
108 extern int scores_log_level;
109 extern gboolean show_utilization;
110 extern int utilization_log_level;
111 extern const char *transition_idle_timeout;
112 
113 #endif
show_scores
gboolean show_scores
Definition: pcmk_sched_messages.c:25
pe_weights_rollback
Definition: pcmki_scheduler.h:37
GListPtr
GList * GListPtr
Definition: crm.h:214
rsc_colocation_s::role_lh
int role_lh
Definition: pcmki_scheduler.h:46
loss_ticket_policy_e
loss_ticket_policy_e
Definition: pcmki_scheduler.h:52
stage8
gboolean stage8(pe_working_set_t *data_set)
Definition: pcmk_sched_allocate.c:2824
new_rsc_order
int new_rsc_order(resource_t *lh_rsc, const char *lh_task, resource_t *rh_rsc, const char *rh_task, enum pe_ordering type, pe_working_set_t *data_set)
Definition: pcmk_sched_constraints.c:1398
stonith_constraints
gboolean stonith_constraints(node_t *node, action_t *stonith_op, pe_working_set_t *data_set)
Definition: pcmk_sched_graph.c:762
pe_stop_fail
pe_stop_fail
Definition: pcmki_scheduler.h:26
pe_weights_init
Definition: pcmki_scheduler.h:34
rsc_ticket_s::role_lh
int role_lh
Definition: pcmki_scheduler.h:65
graph_element_from_action
void graph_element_from_action(action_t *action, pe_working_set_t *data_set)
Definition: pcmk_sched_graph.c:1754
pesf_block
Definition: pcmki_scheduler.h:27
rsc_colocation_s::rsc_lh
resource_t * rsc_lh
Definition: pcmki_scheduler.h:43
rsc_colocation_s::node_attribute
const char * node_attribute
Definition: pcmki_scheduler.h:42
type
enum crm_ais_msg_types type
Definition: internal.h:83
pe_weights_forward
Definition: pcmki_scheduler.h:35
rsc_colocation_s::score
int score
Definition: pcmki_scheduler.h:49
pe_ticket_s
Definition: pe_types.h:419
rsc_colocation_s::id
const char * id
Definition: pcmki_scheduler.h:41
stage6
gboolean stage6(pe_working_set_t *data_set)
Definition: pcmk_sched_allocate.c:1526
stage4
gboolean stage4(pe_working_set_t *data_set)
Definition: pcmk_sched_allocate.c:1053
pe_action_wrapper_s
Definition: pe_types.h:489
loss_ticket_stop
Definition: pcmki_scheduler.h:53
rsc_colocation_s::rsc_rh
resource_t * rsc_rh
Definition: pcmki_scheduler.h:44
custom_action_order
int custom_action_order(resource_t *lh_rsc, char *lh_task, action_t *lh_action, resource_t *rh_rsc, char *rh_task, action_t *rh_action, enum pe_ordering type, pe_working_set_t *data_set)
Definition: pcmk_sched_constraints.c:1564
stage7
gboolean stage7(pe_working_set_t *data_set)
Definition: pcmk_sched_allocate.c:2714
complex.h
pe_weights
pe_weights
Definition: pcmki_scheduler.h:32
rsc_ticket_s::loss_policy
enum loss_ticket_policy_e loss_policy
Definition: pcmki_scheduler.h:63
pe_action_s
Definition: pe_types.h:369
stage0
gboolean stage0(pe_working_set_t *data_set)
Definition: pcmk_sched_allocate.c:898
rsc_ticket_s::ticket
ticket_t * ticket
Definition: pcmki_scheduler.h:62
probe_resources
gboolean probe_resources(pe_working_set_t *data_set)
Definition: pcmk_sched_allocate.c:922
show_utilization
gboolean show_utilization
Definition: pcmk_sched_messages.c:27
rsc_ticket_s::rsc_lh
resource_t * rsc_lh
Definition: pcmki_scheduler.h:61
iso8601.h
ISO_8601 Date handling.
summary
gboolean summary(GListPtr resources)
pe_working_set_s
Definition: pe_types.h:117
rsc_colocation_s::role_rh
int role_rh
Definition: pcmki_scheduler.h:47
loss_ticket_demote
Definition: pcmki_scheduler.h:54
utilization_log_level
int utilization_log_level
Definition: pcmk_sched_messages.c:28
rules.h
shutdown_constraints
gboolean shutdown_constraints(node_t *node, action_t *shutdown_op, pe_working_set_t *data_set)
Definition: pcmk_sched_graph.c:706
pcmk__ordering_is_invalid
bool pcmk__ordering_is_invalid(pe_action_t *action, pe_action_wrapper_t *input)
Definition: pcmk_sched_graph.c:1669
pesf_ignore
Definition: pcmki_scheduler.h:29
stage2
gboolean stage2(pe_working_set_t *data_set)
Definition: pcmk_sched_allocate.c:993
stage3
gboolean stage3(pe_working_set_t *data_set)
Definition: pcmk_sched_allocate.c:1035
add_maintenance_update
void add_maintenance_update(pe_working_set_t *data_set)
Definition: pcmk_sched_graph.c:924
stage5
gboolean stage5(pe_working_set_t *data_set)
Definition: pcmk_sched_allocate.c:1297
lrm_agent_t
struct lrm_agent_s lrm_agent_t
Definition: pcmki_scheduler.h:15
common.h
rsc_colocation_s
Definition: pcmki_scheduler.h:40
pesf_stonith
Definition: pcmki_scheduler.h:28
rsc_ticket_s::id
const char * id
Definition: pcmki_scheduler.h:60
unpack_constraints
gboolean unpack_constraints(xmlNode *xml_constraints, pe_working_set_t *data_set)
Definition: pcmk_sched_constraints.c:71
pcmk__schedule_actions
xmlNode * pcmk__schedule_actions(pe_working_set_t *data_set, xmlNode *xml_input, crm_time_t *now)
Definition: pcmk_sched_messages.c:39
loss_ticket_fence
Definition: pcmki_scheduler.h:55
transition_idle_timeout
const char * transition_idle_timeout
pe_weights_none
Definition: pcmki_scheduler.h:33
pe_resource_s
Definition: pe_types.h:291
rsc_ticket_s
Definition: pcmki_scheduler.h:59
loss_ticket_freeze
Definition: pcmki_scheduler.h:56
pe_weights_positive
Definition: pcmki_scheduler.h:36
pe_node_s
Definition: pe_types.h:216
status.h
Cluster status and scheduling.
crm.h
A dumping ground.
scores_log_level
int scores_log_level
Definition: pcmk_sched_messages.c:26
crm_time_t
struct crm_time_s crm_time_t
Definition: iso8601.h:32
pe_ordering
pe_ordering
Definition: pe_types.h:446