pacemaker  1.1.17-b36b869ca8
Scalable High-Availability cluster resource manager
variant.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2004 Andrew Beekhof <andrew@beekhof.net>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 #ifndef PE_VARIANT__H
19 # define PE_VARIANT__H
20 
21 # if VARIANT_CLONE
22 
23 typedef struct clone_variant_data_s {
24  int clone_max;
25  int clone_node_max;
26 
27  int master_max;
28  int master_node_max;
29 
30  int total_clones;
31  int active_clones;
32  int max_nodes;
33 
34  int masters_active;
35  int masters_allocated;
36 
37  gboolean interleave;
38  gboolean ordered;
39  gboolean applied_master_prefs;
40  gboolean merged_master_weights;
41 
42  notify_data_t *stop_notify;
43  notify_data_t *start_notify;
44  notify_data_t *demote_notify;
45  notify_data_t *promote_notify;
46 
47  xmlNode *xml_obj_child;
48 
49  gboolean notify_confirm;
50 
51 } clone_variant_data_t;
52 
53 # define get_clone_variant_data(data, rsc) \
54  CRM_ASSERT(rsc != NULL); \
55  CRM_ASSERT(rsc->variant == pe_clone || rsc->variant == pe_master); \
56  data = (clone_variant_data_t *)rsc->variant_opaque;
57 
58 # elif VARIANT_CONTAINER
59 
60 typedef struct
61 {
62  int offset;
63  node_t *node;
64  char *ipaddr;
65  resource_t *ip;
66  resource_t *child;
67  resource_t *docker;
68  resource_t *remote;
69 
70 } container_grouping_t;
71 
72 typedef struct
73 {
74  char *source;
75  char *target;
76  char *options;
77  int flags;
78 
79 } container_mount_t;
80 
81 typedef struct
82 {
83  char *source;
84  char *target;
85 
86 } container_port_t;
87 
88 typedef struct container_variant_data_s {
89  int masters;
90  int replicas;
91  int replicas_per_host;
92  char *prefix;
93  char *image;
94  const char *ip_last;
95  char *host_network;
96  char *host_netmask;
97  char *control_port;
98  char *docker_network;
99  char *ip_range_start;
100  char *docker_host_options;
101  char *docker_run_options;
102  char *docker_run_command;
103 
104  resource_t *child;
105 
106  GListPtr tuples; /* container_grouping_t * */
107  GListPtr ports; /* */
108  GListPtr mounts; /* */
109 
110 
111 } container_variant_data_t;
112 
113 # define get_container_variant_data(data, rsc) \
114  CRM_ASSERT(rsc != NULL); \
115  CRM_ASSERT(rsc->variant == pe_container); \
116  CRM_ASSERT(rsc->variant_opaque != NULL); \
117  data = (container_variant_data_t *)rsc->variant_opaque; \
118 
119 # elif VARIANT_GROUP
120 
121 typedef struct group_variant_data_s {
122  int num_children;
123  resource_t *first_child;
124  resource_t *last_child;
125 
126  gboolean colocated;
127  gboolean ordered;
128 
129  gboolean child_starting;
130  gboolean child_stopping;
131 
132 } group_variant_data_t;
133 
134 # define get_group_variant_data(data, rsc) \
135  CRM_ASSERT(rsc != NULL); \
136  CRM_ASSERT(rsc->variant == pe_group); \
137  CRM_ASSERT(rsc->variant_opaque != NULL); \
138  data = (group_variant_data_t *)rsc->variant_opaque; \
139 
140 # elif VARIANT_NATIVE
141 
142 typedef struct native_variant_data_s {
143  int dummy;
144 } native_variant_data_t;
145 
146 # define get_native_variant_data(data, rsc) \
147  CRM_ASSERT(rsc != NULL); \
148  CRM_ASSERT(rsc->variant == pe_native); \
149  CRM_ASSERT(rsc->variant_opaque != NULL); \
150  data = (native_variant_data_t *)rsc->variant_opaque;
151 
152 # endif
153 
154 #endif
Definition: status.h:169
GList * GListPtr
Definition: crm.h:202
uint64_t flags
Definition: remote.c:156