pacemaker  2.1.7-0f7f88312f
Scalable High-Availability cluster resource manager
nodes.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_NODES__H
11 # define PCMK__CRM_COMMON_NODES__H
12 
13 #include <glib.h> // gboolean, GList, GHashTable
14 
15 #include <crm/common/scheduler_types.h> // pcmk_resource_t, pcmk_scheduler_t
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
27 // Special node attributes
28 
29 #define PCMK_NODE_ATTR_TERMINATE "terminate"
30 
31 
33 enum node_type {
36 
37  node_ping = 0,
38 #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
41 
44 #endif
45 };
46 
52 
53 #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
56 
59 
62 #endif
63 };
64 
67  const char *id;
68  const char *uname;
69  enum node_type type;
70 
71  // @TODO Convert these into a flag group
72  gboolean online;
73  gboolean standby;
74  gboolean standby_onfail;
75  gboolean pending;
76  gboolean unclean;
77  gboolean unseen;
78  gboolean shutdown;
79  gboolean expected_up;
80  gboolean is_dc;
81  gboolean maintenance;
83 
89 
95 
101 
102  gboolean unpacked;
103 
109 
112 
113  GList *running_rsc;
114  GList *allocated_rsc;
115  GHashTable *attrs;
116  GHashTable *utilization;
117  GHashTable *digest_cache;
118 
124  int priority;
125 
127 };
128 
130 struct pe_node_s {
131  int weight;
132  gboolean fixed;
133  int count;
135 
136  // @COMPAT This should be enum pe_discover_e
138 };
139 
140 #ifdef __cplusplus
141 }
142 #endif
143 
144 #endif // PCMK__CRM_COMMON_NODES__H
GHashTable * attrs
Node attributes.
Definition: nodes.h:115
gboolean unseen
Whether node has never joined cluster.
Definition: nodes.h:77
node_type
Possible node types.
Definition: nodes.h:33
gboolean fixed
Definition: nodes.h:132
Type aliases needed to define scheduler objects.
int count
Counter reused by assignment and promotion code.
Definition: nodes.h:133
gboolean pending
Whether controller membership is pending.
Definition: nodes.h:75
Cluster layer node.
Definition: nodes.h:34
pcmk_scheduler_t * data_set
Cluster that node is part of.
Definition: nodes.h:126
Always probe resource on node.
Definition: nodes.h:50
gboolean remote_was_fenced
Definition: nodes.h:94
Implementation of pcmk_scheduler_t.
Definition: scheduler.h:172
gboolean remote_requires_reset
Definition: nodes.h:88
gboolean remote_maintenance
Definition: nodes.h:100
gboolean is_dc
Whether node is cluster&#39;s DC.
Definition: nodes.h:80
int weight
Node score for a given resource.
Definition: nodes.h:131
Implementation of pcmk_resource_t.
Definition: resources.h:399
Probe only on designated nodes.
Definition: nodes.h:55
gboolean unpacked
Whether node history has been unpacked.
Definition: nodes.h:102
int num_resources
Definition: nodes.h:108
struct pe_node_shared_s * details
Basic node information.
Definition: nodes.h:134
const char * uname
Node name in cluster.
Definition: nodes.h:68
Never probe resource on node.
Definition: nodes.h:51
gboolean standby
Whether in standby mode.
Definition: nodes.h:73
gboolean expected_up
Whether expected join state is member.
Definition: nodes.h:79
Implementation of pcmk_node_t.
Definition: nodes.h:130
int rsc_discover_mode
Probe mode (enum pe_discover_e)
Definition: nodes.h:137
const char * id
Node ID at the cluster layer.
Definition: nodes.h:67
GList * running_rsc
List of resources active on node.
Definition: nodes.h:113
gboolean rsc_discovery_enabled
Whether probes are allowed on node.
Definition: nodes.h:82
Pacemaker Remote node.
Definition: nodes.h:35
Basic node information (all node objects for the same node share this)
Definition: nodes.h:66
pe_discover_e
When to probe a resource on a node (as specified in location constraints)
Definition: nodes.h:48
GHashTable * utilization
Node utilization attributes.
Definition: nodes.h:116
gboolean shutdown
Whether shutting down.
Definition: nodes.h:78
gboolean maintenance
Whether in maintenance mode.
Definition: nodes.h:81
GHashTable * digest_cache
Cache of calculated resource digests.
Definition: nodes.h:117
GList * allocated_rsc
List of resources assigned to node.
Definition: nodes.h:114
gboolean standby_onfail
Whether in standby mode due to on-fail.
Definition: nodes.h:74
gboolean unclean
Whether node requires fencing.
Definition: nodes.h:76
enum node_type type
Node variant.
Definition: nodes.h:69
gboolean online
Whether online.
Definition: nodes.h:72
pcmk_resource_t * remote_rsc
Remote connection resource for node, if it is a Pacemaker Remote node.
Definition: nodes.h:111