pacemaker  2.1.4-dc6eb4362
Scalable High-Availability cluster resource manager
pcmki_scheduler.h
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2022 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__PCMKI_PCMKI_SCHEDULER__H
11 # define PCMK__PCMKI_PCMKI_SCHEDULER__H
12 
13 typedef struct rsc_ticket_s rsc_ticket_t;
14 
15 # include <glib.h>
16 # include <crm/crm.h>
17 # include <crm/common/iso8601.h>
18 # include <crm/pengine/rules.h>
19 # include <crm/pengine/common.h>
20 # include <crm/pengine/status.h>
21 
22 # include <crm/pengine/complex.h>
23 
24 enum pe_weights {
30 };
31 
32 typedef struct {
33  const char *id;
34  const char *node_attribute;
35  pe_resource_t *dependent; // The resource being colocated
36  pe_resource_t *primary; // The resource the dependent is colocated with
37 
38  int dependent_role; // Colocation applies only if dependent has this role
39  int primary_role; // Colocation applies only if primary has this role
40 
41  int score;
42  bool influence; // Whether dependent influences active primary placement
44 
50 };
51 
52 struct rsc_ticket_s {
53  const char *id;
57 
58  int role_lh;
59 };
60 
62 
64 void pcmk__schedule_actions(xmlNode *cib, unsigned long long flags,
66 
67 extern const char *transition_idle_timeout;
68 
81 static inline bool
82 pcmk__colocation_has_influence(const pcmk__colocation_t *colocation,
83  const pe_resource_t *rsc)
84 {
85  if (rsc == NULL) {
86  rsc = colocation->primary;
87  }
88 
89  /* The left hand of a colocation influences the right hand's location
90  * if the influence option is true, or the right hand is not yet active.
91  */
92  return colocation->influence || (rsc->running_on == NULL);
93 }
94 
95 #endif
pe_resource_t * rsc_lh
A dumping ground.
void add_maintenance_update(pe_working_set_t *data_set)
pe_resource_t * dependent
pe_ticket_t * ticket
pe_resource_t * primary
loss_ticket_policy_e
enum loss_ticket_policy_e loss_policy
pe_working_set_t * data_set
void pcmk__unpack_constraints(pe_working_set_t *data_set)
ISO_8601 Date handling.
const char * transition_idle_timeout
Cluster status and scheduling.
pe_weights
GList * running_on
Definition: pe_types.h:380
const char * node_attribute
const char * id
void pcmk__schedule_actions(xmlNode *cib, unsigned long long flags, pe_working_set_t *data_set)
uint64_t flags
Definition: remote.c:149