root / doc / hooks.rst @ 7eda951b
History | View | Annotate | Download (18.7 kB)
1 | 4d6443f4 | Iustin Pop | Ganeti customisation using hooks |
---|---|---|---|
2 | 4d6443f4 | Iustin Pop | ================================ |
3 | 4d6443f4 | Iustin Pop | |
4 | 9f604ab8 | Michael Hanselmann | Documents Ganeti version 2.5 |
5 | 4d6443f4 | Iustin Pop | |
6 | 4d6443f4 | Iustin Pop | .. contents:: |
7 | 4d6443f4 | Iustin Pop | |
8 | 4d6443f4 | Iustin Pop | Introduction |
9 | 4d6443f4 | Iustin Pop | ------------ |
10 | 4d6443f4 | Iustin Pop | |
11 | 4d6443f4 | Iustin Pop | |
12 | 4d6443f4 | Iustin Pop | In order to allow customisation of operations, ganeti runs scripts |
13 | 4d6443f4 | Iustin Pop | under ``/etc/ganeti/hooks`` based on certain rules. |
14 | 4d6443f4 | Iustin Pop | |
15 | 4d6443f4 | Iustin Pop | |
16 | 4d6443f4 | Iustin Pop | This is similar to the ``/etc/network/`` structure present in Debian |
17 | 4d6443f4 | Iustin Pop | for network interface handling. |
18 | 4d6443f4 | Iustin Pop | |
19 | 4d6443f4 | Iustin Pop | Organisation |
20 | 4d6443f4 | Iustin Pop | ------------ |
21 | 4d6443f4 | Iustin Pop | |
22 | 4d6443f4 | Iustin Pop | For every operation, two sets of scripts are run: |
23 | 4d6443f4 | Iustin Pop | |
24 | 4d6443f4 | Iustin Pop | - pre phase (for authorization/checking) |
25 | 4d6443f4 | Iustin Pop | - post phase (for logging) |
26 | 4d6443f4 | Iustin Pop | |
27 | 4d6443f4 | Iustin Pop | Also, for each operation, the scripts are run on one or more nodes, |
28 | 4d6443f4 | Iustin Pop | depending on the operation type. |
29 | 4d6443f4 | Iustin Pop | |
30 | 4d6443f4 | Iustin Pop | Note that, even though we call them scripts, we are actually talking |
31 | 4d6443f4 | Iustin Pop | about any executable. |
32 | 4d6443f4 | Iustin Pop | |
33 | 4d6443f4 | Iustin Pop | *pre* scripts |
34 | 4d6443f4 | Iustin Pop | ~~~~~~~~~~~~~ |
35 | 4d6443f4 | Iustin Pop | |
36 | 4d6443f4 | Iustin Pop | The *pre* scripts have a definite target: to check that the operation |
37 | 4d6443f4 | Iustin Pop | is allowed given the site-specific constraints. You could have, for |
38 | 4d6443f4 | Iustin Pop | example, a rule that says every new instance is required to exists in |
39 | 4d6443f4 | Iustin Pop | a database; to implement this, you could write a script that checks |
40 | 4d6443f4 | Iustin Pop | the new instance parameters against your database. |
41 | 4d6443f4 | Iustin Pop | |
42 | 4d6443f4 | Iustin Pop | The objective of these scripts should be their return code (zero or |
43 | 4d6443f4 | Iustin Pop | non-zero for success and failure). However, if they modify the |
44 | 4d6443f4 | Iustin Pop | environment in any way, they should be idempotent, as failed |
45 | 4d6443f4 | Iustin Pop | executions could be restarted and thus the script(s) run again with |
46 | 4d6443f4 | Iustin Pop | exactly the same parameters. |
47 | 4d6443f4 | Iustin Pop | |
48 | 4d6443f4 | Iustin Pop | Note that if a node is unreachable at the time a hooks is run, this |
49 | 4d6443f4 | Iustin Pop | will not be interpreted as a deny for the execution. In other words, |
50 | 4d6443f4 | Iustin Pop | only an actual error returned from a script will cause abort, and not |
51 | 4d6443f4 | Iustin Pop | an unreachable node. |
52 | 4d6443f4 | Iustin Pop | |
53 | 4d6443f4 | Iustin Pop | Therefore, if you want to guarantee that a hook script is run and |
54 | 4d6443f4 | Iustin Pop | denies an action, it's best to put it on the master node. |
55 | 4d6443f4 | Iustin Pop | |
56 | 4d6443f4 | Iustin Pop | *post* scripts |
57 | 4d6443f4 | Iustin Pop | ~~~~~~~~~~~~~~ |
58 | 4d6443f4 | Iustin Pop | |
59 | 4d6443f4 | Iustin Pop | These scripts should do whatever you need as a reaction to the |
60 | 4d6443f4 | Iustin Pop | completion of an operation. Their return code is not checked (but |
61 | 4d6443f4 | Iustin Pop | logged), and they should not depend on the fact that the *pre* scripts |
62 | 4d6443f4 | Iustin Pop | have been run. |
63 | 4d6443f4 | Iustin Pop | |
64 | 4d6443f4 | Iustin Pop | Naming |
65 | 4d6443f4 | Iustin Pop | ~~~~~~ |
66 | 4d6443f4 | Iustin Pop | |
67 | dd7f6776 | Michael Hanselmann | The allowed names for the scripts consist of (similar to *run-parts*) |
68 | 4d6443f4 | Iustin Pop | upper and lower case, digits, underscores and hyphens. In other words, |
69 | 4d6443f4 | Iustin Pop | the regexp ``^[a-zA-Z0-9_-]+$``. Also, non-executable scripts will be |
70 | 4d6443f4 | Iustin Pop | ignored. |
71 | 4d6443f4 | Iustin Pop | |
72 | 4d6443f4 | Iustin Pop | |
73 | 4d6443f4 | Iustin Pop | Order of execution |
74 | 4d6443f4 | Iustin Pop | ~~~~~~~~~~~~~~~~~~ |
75 | 4d6443f4 | Iustin Pop | |
76 | 4d6443f4 | Iustin Pop | On a single node, the scripts in a directory are run in lexicographic |
77 | 4d6443f4 | Iustin Pop | order (more exactly, the python string comparison order). It is |
78 | 4d6443f4 | Iustin Pop | advisable to implement the usual *NN-name* convention where *NN* is a |
79 | 4d6443f4 | Iustin Pop | two digit number. |
80 | 4d6443f4 | Iustin Pop | |
81 | 4d6443f4 | Iustin Pop | For an operation whose hooks are run on multiple nodes, there is no |
82 | 4d6443f4 | Iustin Pop | specific ordering of nodes with regard to hooks execution; you should |
83 | 4d6443f4 | Iustin Pop | assume that the scripts are run in parallel on the target nodes |
84 | 4d6443f4 | Iustin Pop | (keeping on each node the above specified ordering). If you need any |
85 | 4d6443f4 | Iustin Pop | kind of inter-node synchronisation, you have to implement it yourself |
86 | 4d6443f4 | Iustin Pop | in the scripts. |
87 | 4d6443f4 | Iustin Pop | |
88 | 4d6443f4 | Iustin Pop | Execution environment |
89 | 4d6443f4 | Iustin Pop | ~~~~~~~~~~~~~~~~~~~~~ |
90 | 4d6443f4 | Iustin Pop | |
91 | 4d6443f4 | Iustin Pop | The scripts will be run as follows: |
92 | 4d6443f4 | Iustin Pop | |
93 | 4d6443f4 | Iustin Pop | - no command line arguments |
94 | 4d6443f4 | Iustin Pop | |
95 | 4d6443f4 | Iustin Pop | - no controlling *tty* |
96 | 4d6443f4 | Iustin Pop | |
97 | 4d6443f4 | Iustin Pop | - stdin is actually */dev/null* |
98 | 4d6443f4 | Iustin Pop | |
99 | 4d6443f4 | Iustin Pop | - stdout and stderr are directed to files |
100 | 4d6443f4 | Iustin Pop | |
101 | 4d6443f4 | Iustin Pop | - PATH is reset to ``/sbin:/bin:/usr/sbin:/usr/bin`` |
102 | 4d6443f4 | Iustin Pop | |
103 | 4d6443f4 | Iustin Pop | - the environment is cleared, and only ganeti-specific variables will |
104 | 4d6443f4 | Iustin Pop | be left |
105 | 4d6443f4 | Iustin Pop | |
106 | 4d6443f4 | Iustin Pop | |
107 | 5bbd3f7f | Michael Hanselmann | All information about the cluster is passed using environment |
108 | 4d6443f4 | Iustin Pop | variables. Different operations will have sligthly different |
109 | 4d6443f4 | Iustin Pop | environments, but most of the variables are common. |
110 | 4d6443f4 | Iustin Pop | |
111 | 4d6443f4 | Iustin Pop | Operation list |
112 | 4d6443f4 | Iustin Pop | -------------- |
113 | 4d6443f4 | Iustin Pop | |
114 | 4d6443f4 | Iustin Pop | Node operations |
115 | 4d6443f4 | Iustin Pop | ~~~~~~~~~~~~~~~ |
116 | 4d6443f4 | Iustin Pop | |
117 | 8ac5c5d7 | Michael Hanselmann | OP_NODE_ADD |
118 | 4d6443f4 | Iustin Pop | +++++++++++ |
119 | 4d6443f4 | Iustin Pop | |
120 | 4d6443f4 | Iustin Pop | Adds a node to the cluster. |
121 | 4d6443f4 | Iustin Pop | |
122 | 4d6443f4 | Iustin Pop | :directory: node-add |
123 | 49e4c837 | David Knowles | :env. vars: NODE_NAME, NODE_PIP, NODE_SIP, MASTER_CAPABLE, VM_CAPABLE |
124 | 4d6443f4 | Iustin Pop | :pre-execution: all existing nodes |
125 | 4d6443f4 | Iustin Pop | :post-execution: all nodes plus the new node |
126 | 4d6443f4 | Iustin Pop | |
127 | 4d6443f4 | Iustin Pop | |
128 | 8ac5c5d7 | Michael Hanselmann | OP_NODE_REMOVE |
129 | 4d6443f4 | Iustin Pop | ++++++++++++++ |
130 | 4d6443f4 | Iustin Pop | |
131 | 7faf5110 | Michael Hanselmann | Removes a node from the cluster. On the removed node the hooks are |
132 | 7faf5110 | Michael Hanselmann | called during the execution of the operation and not after its |
133 | 7faf5110 | Michael Hanselmann | completion. |
134 | 4d6443f4 | Iustin Pop | |
135 | 4d6443f4 | Iustin Pop | :directory: node-remove |
136 | 4d6443f4 | Iustin Pop | :env. vars: NODE_NAME |
137 | 4d6443f4 | Iustin Pop | :pre-execution: all existing nodes except the removed node |
138 | cd46f3b4 | Luca Bigliardi | :post-execution: all existing nodes |
139 | 4d6443f4 | Iustin Pop | |
140 | 4d6443f4 | Iustin Pop | OP_NODE_SET_PARAMS |
141 | 4d6443f4 | Iustin Pop | ++++++++++++++++++ |
142 | 4d6443f4 | Iustin Pop | |
143 | 4d6443f4 | Iustin Pop | Changes a node's parameters. |
144 | 4d6443f4 | Iustin Pop | |
145 | 4d6443f4 | Iustin Pop | :directory: node-modify |
146 | 49e4c837 | David Knowles | :env. vars: MASTER_CANDIDATE, OFFLINE, DRAINED, MASTER_CAPABLE, VM_CAPABLE |
147 | 4d6443f4 | Iustin Pop | :pre-execution: master node, the target node |
148 | 4d6443f4 | Iustin Pop | :post-execution: master node, the target node |
149 | 4d6443f4 | Iustin Pop | |
150 | 7ffc5a86 | Michael Hanselmann | OP_NODE_EVACUATE |
151 | 7ffc5a86 | Michael Hanselmann | ++++++++++++++++ |
152 | 7ffc5a86 | Michael Hanselmann | |
153 | 7ffc5a86 | Michael Hanselmann | Relocate secondary instances from a node. |
154 | 7ffc5a86 | Michael Hanselmann | |
155 | 7ffc5a86 | Michael Hanselmann | :directory: node-evacuate |
156 | 7ffc5a86 | Michael Hanselmann | :env. vars: NEW_SECONDARY, NODE_NAME |
157 | 7ffc5a86 | Michael Hanselmann | :pre-execution: master node, target node |
158 | 7ffc5a86 | Michael Hanselmann | :post-execution: master node, target node |
159 | 7ffc5a86 | Michael Hanselmann | |
160 | 6c6b7f8a | Michael Hanselmann | OP_NODE_MIGRATE |
161 | 6c6b7f8a | Michael Hanselmann | ++++++++++++++++ |
162 | 6c6b7f8a | Michael Hanselmann | |
163 | 6c6b7f8a | Michael Hanselmann | Relocate secondary instances from a node. |
164 | 6c6b7f8a | Michael Hanselmann | |
165 | 6c6b7f8a | Michael Hanselmann | :directory: node-migrate |
166 | 6c6b7f8a | Michael Hanselmann | :env. vars: NODE_NAME |
167 | 6c6b7f8a | Michael Hanselmann | :pre-execution: master node |
168 | 6c6b7f8a | Michael Hanselmann | :post-execution: master node |
169 | 6c6b7f8a | Michael Hanselmann | |
170 | 4d6443f4 | Iustin Pop | |
171 | b1ee5610 | Adeodato Simo | Node group operations |
172 | b1ee5610 | Adeodato Simo | ~~~~~~~~~~~~~~~~~~~~~ |
173 | b1ee5610 | Adeodato Simo | |
174 | 8ac5c5d7 | Michael Hanselmann | OP_GROUP_ADD |
175 | b1ee5610 | Adeodato Simo | ++++++++++++ |
176 | b1ee5610 | Adeodato Simo | |
177 | b1ee5610 | Adeodato Simo | Adds a node group to the cluster. |
178 | b1ee5610 | Adeodato Simo | |
179 | b1ee5610 | Adeodato Simo | :directory: group-add |
180 | b1ee5610 | Adeodato Simo | :env. vars: GROUP_NAME |
181 | b1ee5610 | Adeodato Simo | :pre-execution: master node |
182 | b1ee5610 | Adeodato Simo | :post-execution: master node |
183 | b1ee5610 | Adeodato Simo | |
184 | 90e99856 | Adeodato Simo | OP_GROUP_SET_PARAMS |
185 | 90e99856 | Adeodato Simo | +++++++++++++++++++ |
186 | 90e99856 | Adeodato Simo | |
187 | 90e99856 | Adeodato Simo | Changes a node group's parameters. |
188 | 90e99856 | Adeodato Simo | |
189 | 90e99856 | Adeodato Simo | :directory: group-modify |
190 | 90e99856 | Adeodato Simo | :env. vars: GROUP_NAME, NEW_ALLOC_POLICY |
191 | 90e99856 | Adeodato Simo | :pre-execution: master node |
192 | 90e99856 | Adeodato Simo | :post-execution: master node |
193 | 90e99856 | Adeodato Simo | |
194 | 8ac5c5d7 | Michael Hanselmann | OP_GROUP_REMOVE |
195 | 94bd652a | Adeodato Simo | +++++++++++++++ |
196 | 94bd652a | Adeodato Simo | |
197 | 94bd652a | Adeodato Simo | Removes a node group from the cluster. Since the node group must be |
198 | 94bd652a | Adeodato Simo | empty for removal to succeed, the concept of "nodes in the group" does |
199 | 94bd652a | Adeodato Simo | not exist, and the hook is only executed in the master node. |
200 | 94bd652a | Adeodato Simo | |
201 | 94bd652a | Adeodato Simo | :directory: group-remove |
202 | 94bd652a | Adeodato Simo | :env. vars: GROUP_NAME |
203 | 94bd652a | Adeodato Simo | :pre-execution: master node |
204 | 94bd652a | Adeodato Simo | :post-execution: master node |
205 | 94bd652a | Adeodato Simo | |
206 | 8ac5c5d7 | Michael Hanselmann | OP_GROUP_RENAME |
207 | 4fe5cf90 | Adeodato Simo | +++++++++++++++ |
208 | 4fe5cf90 | Adeodato Simo | |
209 | 4fe5cf90 | Adeodato Simo | Renames a node group. |
210 | 4fe5cf90 | Adeodato Simo | |
211 | 4fe5cf90 | Adeodato Simo | :directory: group-rename |
212 | 4fe5cf90 | Adeodato Simo | :env. vars: OLD_NAME, NEW_NAME |
213 | 4fe5cf90 | Adeodato Simo | :pre-execution: master node and all nodes in the group |
214 | 4fe5cf90 | Adeodato Simo | :post-execution: master node and all nodes in the group |
215 | 4fe5cf90 | Adeodato Simo | |
216 | 08f8c82c | Michael Hanselmann | OP_GROUP_EVACUATE |
217 | 08f8c82c | Michael Hanselmann | +++++++++++++++++ |
218 | 08f8c82c | Michael Hanselmann | |
219 | 08f8c82c | Michael Hanselmann | Evacuates a node group. |
220 | 08f8c82c | Michael Hanselmann | |
221 | 08f8c82c | Michael Hanselmann | :directory: group-evacuate |
222 | 08f8c82c | Michael Hanselmann | :env. vars: GROUP_NAME, TARGET_GROUPS |
223 | 08f8c82c | Michael Hanselmann | :pre-execution: master node and all nodes in the group |
224 | 08f8c82c | Michael Hanselmann | :post-execution: master node and all nodes in the group |
225 | 08f8c82c | Michael Hanselmann | |
226 | b1ee5610 | Adeodato Simo | |
227 | 4d6443f4 | Iustin Pop | Instance operations |
228 | 4d6443f4 | Iustin Pop | ~~~~~~~~~~~~~~~~~~~ |
229 | 4d6443f4 | Iustin Pop | |
230 | 4d6443f4 | Iustin Pop | All instance operations take at least the following variables: |
231 | dd5e7794 | David Knowles | INSTANCE_NAME, INSTANCE_PRIMARY, INSTANCE_SECONDARY, |
232 | 4d6443f4 | Iustin Pop | INSTANCE_OS_TYPE, INSTANCE_DISK_TEMPLATE, INSTANCE_MEMORY, |
233 | 4d6443f4 | Iustin Pop | INSTANCE_DISK_SIZES, INSTANCE_VCPUS, INSTANCE_NIC_COUNT, |
234 | 4d6443f4 | Iustin Pop | INSTANCE_NICn_IP, INSTANCE_NICn_BRIDGE, INSTANCE_NICn_MAC, |
235 | 4d6443f4 | Iustin Pop | INSTANCE_DISK_COUNT, INSTANCE_DISKn_SIZE, INSTANCE_DISKn_MODE. |
236 | 4d6443f4 | Iustin Pop | |
237 | 4d6443f4 | Iustin Pop | The INSTANCE_NICn_* and INSTANCE_DISKn_* variables represent the |
238 | 4d6443f4 | Iustin Pop | properties of the *n* -th NIC and disk, and are zero-indexed. |
239 | 4d6443f4 | Iustin Pop | |
240 | 4d6443f4 | Iustin Pop | |
241 | 8ac5c5d7 | Michael Hanselmann | OP_INSTANCE_CREATE |
242 | 8ac5c5d7 | Michael Hanselmann | ++++++++++++++++++ |
243 | 4d6443f4 | Iustin Pop | |
244 | 4d6443f4 | Iustin Pop | Creates a new instance. |
245 | 4d6443f4 | Iustin Pop | |
246 | 4d6443f4 | Iustin Pop | :directory: instance-add |
247 | 4d6443f4 | Iustin Pop | :env. vars: ADD_MODE, SRC_NODE, SRC_PATH, SRC_IMAGES |
248 | 4d6443f4 | Iustin Pop | :pre-execution: master node, primary and secondary nodes |
249 | 4d6443f4 | Iustin Pop | :post-execution: master node, primary and secondary nodes |
250 | 4d6443f4 | Iustin Pop | |
251 | 4d6443f4 | Iustin Pop | OP_INSTANCE_REINSTALL |
252 | 4d6443f4 | Iustin Pop | +++++++++++++++++++++ |
253 | 4d6443f4 | Iustin Pop | |
254 | 4d6443f4 | Iustin Pop | Reinstalls an instance. |
255 | 4d6443f4 | Iustin Pop | |
256 | 4d6443f4 | Iustin Pop | :directory: instance-reinstall |
257 | 4d6443f4 | Iustin Pop | :env. vars: only the standard instance vars |
258 | 4d6443f4 | Iustin Pop | :pre-execution: master node, primary and secondary nodes |
259 | 4d6443f4 | Iustin Pop | :post-execution: master node, primary and secondary nodes |
260 | 4d6443f4 | Iustin Pop | |
261 | 4d6443f4 | Iustin Pop | OP_BACKUP_EXPORT |
262 | 4d6443f4 | Iustin Pop | ++++++++++++++++ |
263 | 4d6443f4 | Iustin Pop | |
264 | 4d6443f4 | Iustin Pop | Exports the instance. |
265 | 4d6443f4 | Iustin Pop | |
266 | 4d6443f4 | Iustin Pop | :directory: instance-export |
267 | 49e4c837 | David Knowles | :env. vars: EXPORT_MODE, EXPORT_NODE, EXPORT_DO_SHUTDOWN, REMOVE_INSTANCE |
268 | 4d6443f4 | Iustin Pop | :pre-execution: master node, primary and secondary nodes |
269 | 4d6443f4 | Iustin Pop | :post-execution: master node, primary and secondary nodes |
270 | 4d6443f4 | Iustin Pop | |
271 | dd5e7794 | David Knowles | OP_INSTANCE_STARTUP |
272 | 18009c1e | Iustin Pop | +++++++++++++++++++ |
273 | 4d6443f4 | Iustin Pop | |
274 | 4d6443f4 | Iustin Pop | Starts an instance. |
275 | 4d6443f4 | Iustin Pop | |
276 | 4d6443f4 | Iustin Pop | :directory: instance-start |
277 | 454fe3cd | Luca Bigliardi | :env. vars: FORCE |
278 | 4d6443f4 | Iustin Pop | :pre-execution: master node, primary and secondary nodes |
279 | 4d6443f4 | Iustin Pop | :post-execution: master node, primary and secondary nodes |
280 | 4d6443f4 | Iustin Pop | |
281 | 4d6443f4 | Iustin Pop | OP_INSTANCE_SHUTDOWN |
282 | 4d6443f4 | Iustin Pop | ++++++++++++++++++++ |
283 | 4d6443f4 | Iustin Pop | |
284 | 4d6443f4 | Iustin Pop | Stops an instance. |
285 | 4d6443f4 | Iustin Pop | |
286 | 6c6b7f8a | Michael Hanselmann | :directory: instance-stop |
287 | 49e4c837 | David Knowles | :env. vars: TIMEOUT |
288 | 4d6443f4 | Iustin Pop | :pre-execution: master node, primary and secondary nodes |
289 | 4d6443f4 | Iustin Pop | :post-execution: master node, primary and secondary nodes |
290 | 4d6443f4 | Iustin Pop | |
291 | 4d6443f4 | Iustin Pop | OP_INSTANCE_REBOOT |
292 | 4d6443f4 | Iustin Pop | ++++++++++++++++++ |
293 | 4d6443f4 | Iustin Pop | |
294 | 4d6443f4 | Iustin Pop | Reboots an instance. |
295 | 4d6443f4 | Iustin Pop | |
296 | 4d6443f4 | Iustin Pop | :directory: instance-reboot |
297 | 49e4c837 | David Knowles | :env. vars: IGNORE_SECONDARIES, REBOOT_TYPE, SHUTDOWN_TIMEOUT |
298 | 4d6443f4 | Iustin Pop | :pre-execution: master node, primary and secondary nodes |
299 | 4d6443f4 | Iustin Pop | :post-execution: master node, primary and secondary nodes |
300 | 4d6443f4 | Iustin Pop | |
301 | dd5e7794 | David Knowles | OP_INSTANCE_SET_PARAMS |
302 | 18009c1e | Iustin Pop | ++++++++++++++++++++++ |
303 | 4d6443f4 | Iustin Pop | |
304 | 4d6443f4 | Iustin Pop | Modifies the instance parameters. |
305 | 4d6443f4 | Iustin Pop | |
306 | 4d6443f4 | Iustin Pop | :directory: instance-modify |
307 | 49e4c837 | David Knowles | :env. vars: NEW_DISK_TEMPLATE |
308 | 4d6443f4 | Iustin Pop | :pre-execution: master node, primary and secondary nodes |
309 | 4d6443f4 | Iustin Pop | :post-execution: master node, primary and secondary nodes |
310 | 4d6443f4 | Iustin Pop | |
311 | 4d6443f4 | Iustin Pop | OP_INSTANCE_FAILOVER |
312 | 4d6443f4 | Iustin Pop | ++++++++++++++++++++ |
313 | 4d6443f4 | Iustin Pop | |
314 | e73a5804 | Luca Bigliardi | Failovers an instance. In the post phase INSTANCE_PRIMARY and |
315 | dd5e7794 | David Knowles | INSTANCE_SECONDARY refer to the nodes that were repectively primary |
316 | e73a5804 | Luca Bigliardi | and secondary before failover. |
317 | 4d6443f4 | Iustin Pop | |
318 | 4d6443f4 | Iustin Pop | :directory: instance-failover |
319 | 49e4c837 | David Knowles | :env. vars: IGNORE_CONSISTENCY, SHUTDOWN_TIMEOUT, OLD_PRIMARY, OLD_SECONDARY, NEW_PRIMARY, NEW_SECONDARY |
320 | 4d6443f4 | Iustin Pop | :pre-execution: master node, secondary node |
321 | abd8e836 | Iustin Pop | :post-execution: master node, primary and secondary nodes |
322 | 4d6443f4 | Iustin Pop | |
323 | 4d6443f4 | Iustin Pop | OP_INSTANCE_MIGRATE |
324 | 4d6443f4 | Iustin Pop | ++++++++++++++++++++ |
325 | 4d6443f4 | Iustin Pop | |
326 | e73a5804 | Luca Bigliardi | Migrates an instance. In the post phase INSTANCE_PRIMARY and |
327 | dd5e7794 | David Knowles | INSTANCE_SECONDARY refer to the nodes that were repectively primary |
328 | e73a5804 | Luca Bigliardi | and secondary before migration. |
329 | 4d6443f4 | Iustin Pop | |
330 | 6c6b7f8a | Michael Hanselmann | :directory: instance-migrate |
331 | 49e4c837 | David Knowles | :env. vars: MIGRATE_LIVE, MIGRATE_CLEANUP, OLD_PRIMARY, OLD_SECONDARY, NEW_PRIMARY, NEW_SECONDARY |
332 | 4d6443f4 | Iustin Pop | :pre-execution: master node, secondary node |
333 | abd8e836 | Iustin Pop | :post-execution: master node, primary and secondary nodes |
334 | 4d6443f4 | Iustin Pop | |
335 | 4d6443f4 | Iustin Pop | |
336 | 4d6443f4 | Iustin Pop | OP_INSTANCE_REMOVE |
337 | 4d6443f4 | Iustin Pop | ++++++++++++++++++ |
338 | 4d6443f4 | Iustin Pop | |
339 | 4d6443f4 | Iustin Pop | Remove an instance. |
340 | 4d6443f4 | Iustin Pop | |
341 | 4d6443f4 | Iustin Pop | :directory: instance-remove |
342 | 49e4c837 | David Knowles | :env. vars: SHUTDOWN_TIMEOUT |
343 | 4d6443f4 | Iustin Pop | :pre-execution: master node |
344 | abd8e836 | Iustin Pop | :post-execution: master node, primary and secondary nodes |
345 | 4d6443f4 | Iustin Pop | |
346 | 4d6443f4 | Iustin Pop | OP_INSTANCE_REPLACE_DISKS |
347 | 4d6443f4 | Iustin Pop | +++++++++++++++++++++++++ |
348 | 4d6443f4 | Iustin Pop | |
349 | 4d6443f4 | Iustin Pop | Replace an instance's disks. |
350 | 4d6443f4 | Iustin Pop | |
351 | 4d6443f4 | Iustin Pop | :directory: mirror-replace |
352 | 4d6443f4 | Iustin Pop | :env. vars: MODE, NEW_SECONDARY, OLD_SECONDARY |
353 | 4d6443f4 | Iustin Pop | :pre-execution: master node, primary and secondary nodes |
354 | 4d6443f4 | Iustin Pop | :post-execution: master node, primary and secondary nodes |
355 | 4d6443f4 | Iustin Pop | |
356 | 4d6443f4 | Iustin Pop | OP_INSTANCE_GROW_DISK |
357 | 4d6443f4 | Iustin Pop | +++++++++++++++++++++ |
358 | 4d6443f4 | Iustin Pop | |
359 | 4d6443f4 | Iustin Pop | Grows the disk of an instance. |
360 | 4d6443f4 | Iustin Pop | |
361 | 4d6443f4 | Iustin Pop | :directory: disk-grow |
362 | 4d6443f4 | Iustin Pop | :env. vars: DISK, AMOUNT |
363 | abd8e836 | Iustin Pop | :pre-execution: master node, primary and secondary nodes |
364 | abd8e836 | Iustin Pop | :post-execution: master node, primary and secondary nodes |
365 | 4d6443f4 | Iustin Pop | |
366 | 4d6443f4 | Iustin Pop | OP_INSTANCE_RENAME |
367 | 4d6443f4 | Iustin Pop | ++++++++++++++++++ |
368 | 4d6443f4 | Iustin Pop | |
369 | 4d6443f4 | Iustin Pop | Renames an instance. |
370 | 4d6443f4 | Iustin Pop | |
371 | 4d6443f4 | Iustin Pop | :directory: instance-rename |
372 | 4d6443f4 | Iustin Pop | :env. vars: INSTANCE_NEW_NAME |
373 | 4d6443f4 | Iustin Pop | :pre-execution: master node, primary and secondary nodes |
374 | 4d6443f4 | Iustin Pop | :post-execution: master node, primary and secondary nodes |
375 | 4d6443f4 | Iustin Pop | |
376 | 6c6b7f8a | Michael Hanselmann | OP_INSTANCE_MOVE |
377 | 6c6b7f8a | Michael Hanselmann | ++++++++++++++++ |
378 | 6c6b7f8a | Michael Hanselmann | |
379 | 6c6b7f8a | Michael Hanselmann | Move an instance by data-copying. |
380 | 6c6b7f8a | Michael Hanselmann | |
381 | 6c6b7f8a | Michael Hanselmann | :directory: instance-move |
382 | 49e4c837 | David Knowles | :env. vars: TARGET_NODE, SHUTDOWN_TIMEOUT |
383 | 6c6b7f8a | Michael Hanselmann | :pre-execution: master node, primary and target nodes |
384 | 6c6b7f8a | Michael Hanselmann | :post-execution: master node, primary and target nodes |
385 | 6c6b7f8a | Michael Hanselmann | |
386 | 6c6b7f8a | Michael Hanselmann | OP_INSTANCE_RECREATE_DISKS |
387 | 6c6b7f8a | Michael Hanselmann | ++++++++++++++++++++++++++ |
388 | 6c6b7f8a | Michael Hanselmann | |
389 | 6c6b7f8a | Michael Hanselmann | Recreate an instance's missing disks. |
390 | 6c6b7f8a | Michael Hanselmann | |
391 | 6c6b7f8a | Michael Hanselmann | :directory: instance-recreate-disks |
392 | 6c6b7f8a | Michael Hanselmann | :env. vars: only the standard instance vars |
393 | 6c6b7f8a | Michael Hanselmann | :pre-execution: master node, primary and secondary nodes |
394 | 6c6b7f8a | Michael Hanselmann | :post-execution: master node, primary and secondary nodes |
395 | 6c6b7f8a | Michael Hanselmann | |
396 | 6c6b7f8a | Michael Hanselmann | OP_INSTANCE_REPLACE_DISKS |
397 | 6c6b7f8a | Michael Hanselmann | +++++++++++++++++++++++++ |
398 | 6c6b7f8a | Michael Hanselmann | |
399 | 6c6b7f8a | Michael Hanselmann | Replace the disks of an instance. |
400 | 6c6b7f8a | Michael Hanselmann | |
401 | 6c6b7f8a | Michael Hanselmann | :directory: mirrors-replace |
402 | 6c6b7f8a | Michael Hanselmann | :env. vars: MODE, NEW_SECONDARY, OLD_SECONDARY |
403 | 6c6b7f8a | Michael Hanselmann | :pre-execution: master node, primary and new secondary nodes |
404 | 6c6b7f8a | Michael Hanselmann | :post-execution: master node, primary and new secondary nodes |
405 | 6c6b7f8a | Michael Hanselmann | |
406 | 1aef3df8 | Michael Hanselmann | OP_INSTANCE_CHANGE_GROUP |
407 | 1aef3df8 | Michael Hanselmann | ++++++++++++++++++++++++ |
408 | 1aef3df8 | Michael Hanselmann | |
409 | 1aef3df8 | Michael Hanselmann | Moves an instance to another group. |
410 | 1aef3df8 | Michael Hanselmann | |
411 | 1aef3df8 | Michael Hanselmann | :directory: instance-change-group |
412 | 1aef3df8 | Michael Hanselmann | :env. vars: TARGET_GROUPS |
413 | 1aef3df8 | Michael Hanselmann | :pre-execution: master node |
414 | 1aef3df8 | Michael Hanselmann | :post-execution: master node |
415 | 1aef3df8 | Michael Hanselmann | |
416 | 6c6b7f8a | Michael Hanselmann | |
417 | 4d6443f4 | Iustin Pop | Cluster operations |
418 | 4d6443f4 | Iustin Pop | ~~~~~~~~~~~~~~~~~~ |
419 | 4d6443f4 | Iustin Pop | |
420 | 8ac5c5d7 | Michael Hanselmann | OP_CLUSTER_POST_INIT |
421 | 035a7783 | Luca Bigliardi | ++++++++++++++++++++ |
422 | 035a7783 | Luca Bigliardi | |
423 | 7faf5110 | Michael Hanselmann | This hook is called via a special "empty" LU right after cluster |
424 | 7faf5110 | Michael Hanselmann | initialization. |
425 | 035a7783 | Luca Bigliardi | |
426 | 035a7783 | Luca Bigliardi | :directory: cluster-init |
427 | 035a7783 | Luca Bigliardi | :env. vars: none |
428 | 035a7783 | Luca Bigliardi | :pre-execution: none |
429 | 035a7783 | Luca Bigliardi | :post-execution: master node |
430 | 035a7783 | Luca Bigliardi | |
431 | 8ac5c5d7 | Michael Hanselmann | OP_CLUSTER_DESTROY |
432 | d87e1814 | Luca Bigliardi | ++++++++++++++++++ |
433 | d87e1814 | Luca Bigliardi | |
434 | 7faf5110 | Michael Hanselmann | The post phase of this hook is called during the execution of destroy |
435 | 7faf5110 | Michael Hanselmann | operation and not after its completion. |
436 | d87e1814 | Luca Bigliardi | |
437 | d87e1814 | Luca Bigliardi | :directory: cluster-destroy |
438 | d87e1814 | Luca Bigliardi | :env. vars: none |
439 | d87e1814 | Luca Bigliardi | :pre-execution: none |
440 | d87e1814 | Luca Bigliardi | :post-execution: master node |
441 | d87e1814 | Luca Bigliardi | |
442 | 56372573 | Guido Trotter | OP_CLUSTER_VERIFY_GROUP |
443 | 56372573 | Guido Trotter | +++++++++++++++++++++++ |
444 | 4d6443f4 | Iustin Pop | |
445 | 56372573 | Guido Trotter | Verifies all nodes in a group. This is a special LU with regard to |
446 | 4d6443f4 | Iustin Pop | hooks, as the result of the opcode will be combined with the result of |
447 | 4d6443f4 | Iustin Pop | post-execution hooks, in order to allow administrators to enhance the |
448 | 4d6443f4 | Iustin Pop | cluster verification procedure. |
449 | 4d6443f4 | Iustin Pop | |
450 | 4d6443f4 | Iustin Pop | :directory: cluster-verify |
451 | 35e994e9 | Iustin Pop | :env. vars: CLUSTER, MASTER, CLUSTER_TAGS, NODE_TAGS_<name> |
452 | 4d6443f4 | Iustin Pop | :pre-execution: none |
453 | 56372573 | Guido Trotter | :post-execution: all nodes in a group |
454 | 4d6443f4 | Iustin Pop | |
455 | 4d6443f4 | Iustin Pop | OP_CLUSTER_RENAME |
456 | 4d6443f4 | Iustin Pop | +++++++++++++++++ |
457 | 4d6443f4 | Iustin Pop | |
458 | 4d6443f4 | Iustin Pop | Renames the cluster. |
459 | 4d6443f4 | Iustin Pop | |
460 | 4d6443f4 | Iustin Pop | :directory: cluster-rename |
461 | 4d6443f4 | Iustin Pop | :env. vars: NEW_NAME |
462 | 4d6443f4 | Iustin Pop | :pre-execution: master-node |
463 | 4d6443f4 | Iustin Pop | :post-execution: master-node |
464 | 4d6443f4 | Iustin Pop | |
465 | 4d6443f4 | Iustin Pop | OP_CLUSTER_SET_PARAMS |
466 | 4d6443f4 | Iustin Pop | +++++++++++++++++++++ |
467 | 4d6443f4 | Iustin Pop | |
468 | 4d6443f4 | Iustin Pop | Modifies the cluster parameters. |
469 | 4d6443f4 | Iustin Pop | |
470 | 4d6443f4 | Iustin Pop | :directory: cluster-modify |
471 | 4d6443f4 | Iustin Pop | :env. vars: NEW_VG_NAME |
472 | 4d6443f4 | Iustin Pop | :pre-execution: master node |
473 | 4d6443f4 | Iustin Pop | :post-execution: master node |
474 | 4d6443f4 | Iustin Pop | |
475 | 4d6443f4 | Iustin Pop | |
476 | 4d6443f4 | Iustin Pop | Obsolete operations |
477 | 4d6443f4 | Iustin Pop | ~~~~~~~~~~~~~~~~~~~ |
478 | 4d6443f4 | Iustin Pop | |
479 | 4d6443f4 | Iustin Pop | The following operations are no longer present or don't execute hooks |
480 | 4d6443f4 | Iustin Pop | anymore in Ganeti 2.0: |
481 | 4d6443f4 | Iustin Pop | |
482 | 4d6443f4 | Iustin Pop | - OP_INIT_CLUSTER |
483 | 4d6443f4 | Iustin Pop | - OP_MASTER_FAILOVER |
484 | 4d6443f4 | Iustin Pop | - OP_INSTANCE_ADD_MDDRBD |
485 | 4d6443f4 | Iustin Pop | - OP_INSTANCE_REMOVE_MDDRBD |
486 | 4d6443f4 | Iustin Pop | |
487 | 4d6443f4 | Iustin Pop | |
488 | 4d6443f4 | Iustin Pop | Environment variables |
489 | 4d6443f4 | Iustin Pop | --------------------- |
490 | 4d6443f4 | Iustin Pop | |
491 | dd7f6776 | Michael Hanselmann | Note that all variables listed here are actually prefixed with *GANETI_* |
492 | dd7f6776 | Michael Hanselmann | in order to provide a clear namespace. In addition, post-execution |
493 | dd7f6776 | Michael Hanselmann | scripts receive another set of variables, prefixed with *GANETI_POST_*, |
494 | dd7f6776 | Michael Hanselmann | representing the status after the opcode executed. |
495 | 4d6443f4 | Iustin Pop | |
496 | 4d6443f4 | Iustin Pop | Common variables |
497 | 4d6443f4 | Iustin Pop | ~~~~~~~~~~~~~~~~ |
498 | 4d6443f4 | Iustin Pop | |
499 | 4d6443f4 | Iustin Pop | This is the list of environment variables supported by all operations: |
500 | 4d6443f4 | Iustin Pop | |
501 | 4d6443f4 | Iustin Pop | HOOKS_VERSION |
502 | 4d6443f4 | Iustin Pop | Documents the hooks interface version. In case this doesnt match |
503 | 4d6443f4 | Iustin Pop | what the script expects, it should not run. The documents conforms |
504 | 4d6443f4 | Iustin Pop | to the version 2. |
505 | 4d6443f4 | Iustin Pop | |
506 | 4d6443f4 | Iustin Pop | HOOKS_PHASE |
507 | 4d6443f4 | Iustin Pop | One of *PRE* or *POST* denoting which phase are we in. |
508 | 4d6443f4 | Iustin Pop | |
509 | 4d6443f4 | Iustin Pop | CLUSTER |
510 | 4d6443f4 | Iustin Pop | The cluster name. |
511 | 4d6443f4 | Iustin Pop | |
512 | 4d6443f4 | Iustin Pop | MASTER |
513 | 4d6443f4 | Iustin Pop | The master node. |
514 | 4d6443f4 | Iustin Pop | |
515 | 4d6443f4 | Iustin Pop | OP_CODE |
516 | 4d6443f4 | Iustin Pop | One of the *OP_* values from the list of operations. |
517 | 4d6443f4 | Iustin Pop | |
518 | 4d6443f4 | Iustin Pop | OBJECT_TYPE |
519 | 4d6443f4 | Iustin Pop | One of ``INSTANCE``, ``NODE``, ``CLUSTER``. |
520 | 4d6443f4 | Iustin Pop | |
521 | 4d6443f4 | Iustin Pop | DATA_DIR |
522 | 4d6443f4 | Iustin Pop | The path to the Ganeti configuration directory (to read, for |
523 | 4d6443f4 | Iustin Pop | example, the *ssconf* files). |
524 | 4d6443f4 | Iustin Pop | |
525 | 4d6443f4 | Iustin Pop | |
526 | 4d6443f4 | Iustin Pop | Specialised variables |
527 | 4d6443f4 | Iustin Pop | ~~~~~~~~~~~~~~~~~~~~~ |
528 | 4d6443f4 | Iustin Pop | |
529 | 4d6443f4 | Iustin Pop | This is the list of variables which are specific to one or more |
530 | 4d6443f4 | Iustin Pop | operations. |
531 | 4d6443f4 | Iustin Pop | |
532 | 4d6443f4 | Iustin Pop | INSTANCE_NAME |
533 | 4d6443f4 | Iustin Pop | The name of the instance which is the target of the operation. |
534 | 4d6443f4 | Iustin Pop | |
535 | 49e4c837 | David Knowles | INSTANCE_BE_x,y,z,... |
536 | 49e4c837 | David Knowles | Instance BE params. There is one variable per BE param. For instance, GANETI_INSTANCE_BE_auto_balance |
537 | 49e4c837 | David Knowles | |
538 | 4d6443f4 | Iustin Pop | INSTANCE_DISK_TEMPLATE |
539 | 4d6443f4 | Iustin Pop | The disk type for the instance. |
540 | 4d6443f4 | Iustin Pop | |
541 | 49e4c837 | David Knowles | NEW_DISK_TEMPLATE |
542 | 49e4c837 | David Knowles | The new disk type for the instance. |
543 | 49e4c837 | David Knowles | |
544 | 4d6443f4 | Iustin Pop | INSTANCE_DISK_COUNT |
545 | 4d6443f4 | Iustin Pop | The number of disks for the instance. |
546 | 4d6443f4 | Iustin Pop | |
547 | 4d6443f4 | Iustin Pop | INSTANCE_DISKn_SIZE |
548 | 4d6443f4 | Iustin Pop | The size of disk *n* for the instance. |
549 | 4d6443f4 | Iustin Pop | |
550 | 4d6443f4 | Iustin Pop | INSTANCE_DISKn_MODE |
551 | 4d6443f4 | Iustin Pop | Either *rw* for a read-write disk or *ro* for a read-only one. |
552 | 4d6443f4 | Iustin Pop | |
553 | 49e4c837 | David Knowles | INSTANCE_HV_x,y,z,... |
554 | 49e4c837 | David Knowles | Instance hypervisor options. There is one variable per option. For instance, GANETI_INSTANCE_HV_use_bootloader |
555 | 49e4c837 | David Knowles | |
556 | 49e4c837 | David Knowles | INSTANCE_HYPERVISOR |
557 | 49e4c837 | David Knowles | The instance hypervisor. |
558 | 49e4c837 | David Knowles | |
559 | 4d6443f4 | Iustin Pop | INSTANCE_NIC_COUNT |
560 | 4d6443f4 | Iustin Pop | The number of NICs for the instance. |
561 | 4d6443f4 | Iustin Pop | |
562 | 4d6443f4 | Iustin Pop | INSTANCE_NICn_BRIDGE |
563 | 4d6443f4 | Iustin Pop | The bridge to which the *n* -th NIC of the instance is attached. |
564 | 4d6443f4 | Iustin Pop | |
565 | 4d6443f4 | Iustin Pop | INSTANCE_NICn_IP |
566 | 4d6443f4 | Iustin Pop | The IP (if any) of the *n* -th NIC of the instance. |
567 | 4d6443f4 | Iustin Pop | |
568 | 4d6443f4 | Iustin Pop | INSTANCE_NICn_MAC |
569 | 4d6443f4 | Iustin Pop | The MAC address of the *n* -th NIC of the instance. |
570 | 4d6443f4 | Iustin Pop | |
571 | 49e4c837 | David Knowles | INSTANCE_NICn_MODE |
572 | 49e4c837 | David Knowles | The mode of the *n* -th NIC of the instance. |
573 | 49e4c837 | David Knowles | |
574 | 4d6443f4 | Iustin Pop | INSTANCE_OS_TYPE |
575 | 4d6443f4 | Iustin Pop | The name of the instance OS. |
576 | 4d6443f4 | Iustin Pop | |
577 | 4d6443f4 | Iustin Pop | INSTANCE_PRIMARY |
578 | 08eec276 | Iustin Pop | The name of the node which is the primary for the instance. Note that |
579 | 08eec276 | Iustin Pop | for migrations/failovers, you shouldn't rely on this variable since |
580 | 08eec276 | Iustin Pop | the nodes change during the exectution, but on the |
581 | 08eec276 | Iustin Pop | OLD_PRIMARY/NEW_PRIMARY values. |
582 | 4d6443f4 | Iustin Pop | |
583 | dd5e7794 | David Knowles | INSTANCE_SECONDARY |
584 | 08eec276 | Iustin Pop | Space-separated list of secondary nodes for the instance. Note that |
585 | 08eec276 | Iustin Pop | for migrations/failovers, you shouldn't rely on this variable since |
586 | 08eec276 | Iustin Pop | the nodes change during the exectution, but on the |
587 | 08eec276 | Iustin Pop | OLD_SECONDARY/NEW_SECONDARY values. |
588 | 4d6443f4 | Iustin Pop | |
589 | 4d6443f4 | Iustin Pop | INSTANCE_MEMORY |
590 | 4d6443f4 | Iustin Pop | The memory size (in MiBs) of the instance. |
591 | 4d6443f4 | Iustin Pop | |
592 | 4d6443f4 | Iustin Pop | INSTANCE_VCPUS |
593 | 4d6443f4 | Iustin Pop | The number of virtual CPUs for the instance. |
594 | 4d6443f4 | Iustin Pop | |
595 | 4d6443f4 | Iustin Pop | INSTANCE_STATUS |
596 | 4d6443f4 | Iustin Pop | The run status of the instance. |
597 | 4d6443f4 | Iustin Pop | |
598 | 49e4c837 | David Knowles | MASTER_CAPABLE |
599 | 49e4c837 | David Knowles | Whether a node is capable of being promoted to master. |
600 | 49e4c837 | David Knowles | |
601 | 49e4c837 | David Knowles | VM_CAPABLE |
602 | 49e4c837 | David Knowles | Whether the node can host instances. |
603 | 49e4c837 | David Knowles | |
604 | 9dfa16fc | Apollon Oikonomopoulos | INSTANCE_TAGS |
605 | 9dfa16fc | Apollon Oikonomopoulos | A space-delimited list of the instance's tags. |
606 | 9dfa16fc | Apollon Oikonomopoulos | |
607 | 4d6443f4 | Iustin Pop | NODE_NAME |
608 | 4d6443f4 | Iustin Pop | The target node of this operation (not the node on which the hook |
609 | 4d6443f4 | Iustin Pop | runs). |
610 | 4d6443f4 | Iustin Pop | |
611 | 4d6443f4 | Iustin Pop | NODE_PIP |
612 | 4d6443f4 | Iustin Pop | The primary IP of the target node (the one over which inter-node |
613 | 4d6443f4 | Iustin Pop | communication is done). |
614 | 4d6443f4 | Iustin Pop | |
615 | 4d6443f4 | Iustin Pop | NODE_SIP |
616 | 4d6443f4 | Iustin Pop | The secondary IP of the target node (the one over which drbd |
617 | 4d6443f4 | Iustin Pop | replication is done). This can be equal to the primary ip, in case |
618 | 4d6443f4 | Iustin Pop | the cluster is not dual-homed. |
619 | 4d6443f4 | Iustin Pop | |
620 | 4d6443f4 | Iustin Pop | FORCE |
621 | 4d6443f4 | Iustin Pop | This is provided by some operations when the user gave this flag. |
622 | 4d6443f4 | Iustin Pop | |
623 | 4d6443f4 | Iustin Pop | IGNORE_CONSISTENCY |
624 | 4d6443f4 | Iustin Pop | The user has specified this flag. It is used when failing over |
625 | 4d6443f4 | Iustin Pop | instances in case the primary node is down. |
626 | 4d6443f4 | Iustin Pop | |
627 | 4d6443f4 | Iustin Pop | ADD_MODE |
628 | 4d6443f4 | Iustin Pop | The mode of the instance create: either *create* for create from |
629 | 4d6443f4 | Iustin Pop | scratch or *import* for restoring from an exported image. |
630 | 4d6443f4 | Iustin Pop | |
631 | 4d6443f4 | Iustin Pop | SRC_NODE, SRC_PATH, SRC_IMAGE |
632 | 4d6443f4 | Iustin Pop | In case the instance has been added by import, these variables are |
633 | 4d6443f4 | Iustin Pop | defined and point to the source node, source path (the directory |
634 | 4d6443f4 | Iustin Pop | containing the image and the config file) and the source disk image |
635 | 4d6443f4 | Iustin Pop | file. |
636 | 4d6443f4 | Iustin Pop | |
637 | 4d6443f4 | Iustin Pop | NEW_SECONDARY |
638 | 4d6443f4 | Iustin Pop | The name of the node on which the new mirror component is being |
639 | 08eec276 | Iustin Pop | added (for replace disk). This can be the name of the current |
640 | 08eec276 | Iustin Pop | secondary, if the new mirror is on the same secondary. For |
641 | 08eec276 | Iustin Pop | migrations/failovers, this is the old primary node. |
642 | 4d6443f4 | Iustin Pop | |
643 | 4d6443f4 | Iustin Pop | OLD_SECONDARY |
644 | 08eec276 | Iustin Pop | The name of the old secondary in the replace-disks command. Note that |
645 | 4d6443f4 | Iustin Pop | this can be equal to the new secondary if the secondary node hasn't |
646 | 08eec276 | Iustin Pop | actually changed. For migrations/failovers, this is the new primary |
647 | 08eec276 | Iustin Pop | node. |
648 | 08eec276 | Iustin Pop | |
649 | 08eec276 | Iustin Pop | OLD_PRIMARY, NEW_PRIMARY |
650 | 08eec276 | Iustin Pop | For migrations/failovers, the old and respectively new primary |
651 | 08eec276 | Iustin Pop | nodes. These two mirror the NEW_SECONDARY/OLD_SECONDARY variables |
652 | 4d6443f4 | Iustin Pop | |
653 | 49e4c837 | David Knowles | EXPORT_MODE |
654 | 49e4c837 | David Knowles | The instance export mode. Either "remote" or "local". |
655 | 49e4c837 | David Knowles | |
656 | 4d6443f4 | Iustin Pop | EXPORT_NODE |
657 | 4d6443f4 | Iustin Pop | The node on which the exported image of the instance was done. |
658 | 4d6443f4 | Iustin Pop | |
659 | 4d6443f4 | Iustin Pop | EXPORT_DO_SHUTDOWN |
660 | 4d6443f4 | Iustin Pop | This variable tells if the instance has been shutdown or not while |
661 | 4d6443f4 | Iustin Pop | doing the export. In the "was shutdown" case, it's likely that the |
662 | 4d6443f4 | Iustin Pop | filesystem is consistent, whereas in the "did not shutdown" case, |
663 | 4d6443f4 | Iustin Pop | the filesystem would need a check (journal replay or full fsck) in |
664 | 4d6443f4 | Iustin Pop | order to guarantee consistency. |
665 | 4d6443f4 | Iustin Pop | |
666 | 49e4c837 | David Knowles | REMOVE_INSTANCE |
667 | 49e4c837 | David Knowles | Whether the instance was removed from the node. |
668 | 49e4c837 | David Knowles | |
669 | 49e4c837 | David Knowles | SHUTDOWN_TIMEOUT |
670 | 49e4c837 | David Knowles | Amount of time to wait for the instance to shutdown. |
671 | 49e4c837 | David Knowles | |
672 | 49e4c837 | David Knowles | TIMEOUT |
673 | 49e4c837 | David Knowles | Amount of time to wait before aborting the op. |
674 | 49e4c837 | David Knowles | |
675 | 49e4c837 | David Knowles | OLD_NAME, NEW_NAME |
676 | 49e4c837 | David Knowles | Old/new name of the node group. |
677 | 49e4c837 | David Knowles | |
678 | 49e4c837 | David Knowles | GROUP_NAME |
679 | 49e4c837 | David Knowles | The name of the node group. |
680 | 49e4c837 | David Knowles | |
681 | 49e4c837 | David Knowles | NEW_ALLOC_POLICY |
682 | 49e4c837 | David Knowles | The new allocation policy for the node group. |
683 | 49e4c837 | David Knowles | |
684 | 35e994e9 | Iustin Pop | CLUSTER_TAGS |
685 | 35e994e9 | Iustin Pop | The list of cluster tags, space separated. |
686 | 35e994e9 | Iustin Pop | |
687 | 35e994e9 | Iustin Pop | NODE_TAGS_<name> |
688 | 35e994e9 | Iustin Pop | The list of tags for node *<name>*, space separated. |
689 | 35e994e9 | Iustin Pop | |
690 | 4d6443f4 | Iustin Pop | Examples |
691 | 4d6443f4 | Iustin Pop | -------- |
692 | 4d6443f4 | Iustin Pop | |
693 | 4d6443f4 | Iustin Pop | The startup of an instance will pass this environment to the hook |
694 | 4d6443f4 | Iustin Pop | script:: |
695 | 4d6443f4 | Iustin Pop | |
696 | 4d6443f4 | Iustin Pop | GANETI_CLUSTER=cluster1.example.com |
697 | 4d6443f4 | Iustin Pop | GANETI_DATA_DIR=/var/lib/ganeti |
698 | 4d6443f4 | Iustin Pop | GANETI_FORCE=False |
699 | 4d6443f4 | Iustin Pop | GANETI_HOOKS_PATH=instance-start |
700 | 4d6443f4 | Iustin Pop | GANETI_HOOKS_PHASE=post |
701 | 4d6443f4 | Iustin Pop | GANETI_HOOKS_VERSION=2 |
702 | 4d6443f4 | Iustin Pop | GANETI_INSTANCE_DISK0_MODE=rw |
703 | 4d6443f4 | Iustin Pop | GANETI_INSTANCE_DISK0_SIZE=128 |
704 | 4d6443f4 | Iustin Pop | GANETI_INSTANCE_DISK_COUNT=1 |
705 | 4d6443f4 | Iustin Pop | GANETI_INSTANCE_DISK_TEMPLATE=drbd |
706 | 4d6443f4 | Iustin Pop | GANETI_INSTANCE_MEMORY=128 |
707 | 4d6443f4 | Iustin Pop | GANETI_INSTANCE_NAME=instance2.example.com |
708 | 4d6443f4 | Iustin Pop | GANETI_INSTANCE_NIC0_BRIDGE=xen-br0 |
709 | 4d6443f4 | Iustin Pop | GANETI_INSTANCE_NIC0_IP= |
710 | 4d6443f4 | Iustin Pop | GANETI_INSTANCE_NIC0_MAC=aa:00:00:a5:91:58 |
711 | 4d6443f4 | Iustin Pop | GANETI_INSTANCE_NIC_COUNT=1 |
712 | 4d6443f4 | Iustin Pop | GANETI_INSTANCE_OS_TYPE=debootstrap |
713 | 4d6443f4 | Iustin Pop | GANETI_INSTANCE_PRIMARY=node3.example.com |
714 | dd5e7794 | David Knowles | GANETI_INSTANCE_SECONDARY=node5.example.com |
715 | 4d6443f4 | Iustin Pop | GANETI_INSTANCE_STATUS=down |
716 | 4d6443f4 | Iustin Pop | GANETI_INSTANCE_VCPUS=1 |
717 | 4d6443f4 | Iustin Pop | GANETI_MASTER=node1.example.com |
718 | 4d6443f4 | Iustin Pop | GANETI_OBJECT_TYPE=INSTANCE |
719 | 4d6443f4 | Iustin Pop | GANETI_OP_CODE=OP_INSTANCE_STARTUP |
720 | 4d6443f4 | Iustin Pop | GANETI_OP_TARGET=instance2.example.com |
721 | 558fd122 | Michael Hanselmann | |
722 | 558fd122 | Michael Hanselmann | .. vim: set textwidth=72 : |
723 | 08eec276 | Iustin Pop | .. Local Variables: |
724 | 08eec276 | Iustin Pop | .. mode: rst |
725 | 08eec276 | Iustin Pop | .. fill-column: 72 |
726 | 08eec276 | Iustin Pop | .. End: |