pacemaker  2.1.2-ada5c3b36
Scalable High-Availability cluster resource manager
pcmki_scheduler.h
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2021 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 
13 typedef struct rsc_ticket_s rsc_ticket_t;
14 typedef struct lrm_agent_s lrm_agent_t;
15 
16 # include <glib.h>
17 # include <crm/crm.h>
18 # include <crm/common/iso8601.h>
19 # include <crm/pengine/rules.h>
20 # include <crm/pengine/common.h>
21 # include <crm/pengine/status.h>
22 
23 # include <crm/pengine/complex.h>
24 
29 };
30 
31 enum pe_weights {
37 };
38 
39 typedef struct {
40  const char *id;
41  const char *node_attribute;
42  pe_resource_t *dependent; // The resource being colocated
43  pe_resource_t *primary; // The resource the dependent is colocated with
44 
45  int dependent_role; // Colocation applies only if dependent has this role
46  int primary_role; // Colocation applies only if primary has this role
47 
48  int score;
49  bool influence; // Whether dependent influences active primary placement
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 stage4(pe_working_set_t * data_set);
72 extern gboolean stage5(pe_working_set_t * data_set);
73 extern gboolean stage6(pe_working_set_t * data_set);
74 extern gboolean stage8(pe_working_set_t * data_set);
75 
77 
79 extern void add_maintenance_update(pe_working_set_t *data_set);
80 xmlNode *pcmk__schedule_actions(pe_working_set_t *data_set, xmlNode *xml_input,
81  crm_time_t *now);
82 
83 extern const char *transition_idle_timeout;
84 
97 static inline bool
98 pcmk__colocation_has_influence(const pcmk__colocation_t *colocation,
99  const pe_resource_t *rsc)
100 {
101  if (rsc == NULL) {
102  rsc = colocation->primary;
103  }
104 
105  /* The left hand of a colocation influences the right hand's location
106  * if the influence option is true, or the right hand is not yet active.
107  */
108  return colocation->influence || (rsc->running_on == NULL);
109 }
110 
111 #endif
pe_resource_t * rsc_lh
A dumping ground.
gboolean stage2(pe_working_set_t *data_set)
gboolean stage5(pe_working_set_t *data_set)
struct crm_time_s crm_time_t
Definition: iso8601.h:32
gboolean stage0(pe_working_set_t *data_set)
void add_maintenance_update(pe_working_set_t *data_set)
pe_resource_t * dependent
pe_ticket_t * ticket
xmlNode * pcmk__schedule_actions(pe_working_set_t *data_set, xmlNode *xml_input, crm_time_t *now)
const char * action
Definition: pcmk_fence.c:30
gboolean stage8(pe_working_set_t *data_set)
pe_resource_t * primary
gboolean stage4(pe_working_set_t *data_set)
loss_ticket_policy_e
enum loss_ticket_policy_e loss_policy
void pcmk__unpack_constraints(pe_working_set_t *data_set)
ISO_8601 Date handling.
const char * transition_idle_timeout
pe_stop_fail
Cluster status and scheduling.
pe_weights
gboolean stage6(pe_working_set_t *data_set)
GList * running_on
Definition: pe_types.h:366
const char * node_attribute
const char * id
gboolean probe_resources(pe_working_set_t *data_set)
void graph_element_from_action(pe_action_t *action, pe_working_set_t *data_set)
struct lrm_agent_s lrm_agent_t