iallocator: fix incomplete refactoring
[ganeti-local] / man / gnt-node.rst
1 gnt-node(8) Ganeti | Version @GANETI_VERSION@
2 =============================================
3
4 Name
5 ----
6
7 gnt-node - Node administration
8
9 Synopsis
10 --------
11
12 **gnt-node** {command} [arguments...]
13
14 DESCRIPTION
15 -----------
16
17 The **gnt-node** is used for managing the (physical) nodes in the
18 Ganeti system.
19
20 COMMANDS
21 --------
22
23 ADD
24 ~~~
25
26 | **add** [--readd] [{-s|--secondary-ip} *secondary\_ip*]
27 | [{-g|--node-group} *nodegroup*]
28 | [--master-capable=``yes|no``] [--vm-capable=``yes|no``]
29 | [--node-parameters *ndparams*]
30 | {*nodename*}
31
32 Adds the given node to the cluster.
33
34 This command is used to join a new node to the cluster. You will
35 have to provide the password for root of the node to be able to add
36 the node in the cluster. The command needs to be run on the Ganeti
37 master.
38
39 Note that the command is potentially destructive, as it will
40 forcibly join the specified host the cluster, not paying attention
41 to its current status (it could be already in a cluster, etc.)
42
43 The ``-s (--secondary-ip)`` is used in dual-home clusters and
44 specifies the new node's IP in the secondary network. See the
45 discussion in **gnt-cluster**(8) for more information.
46
47 In case you're readding a node after hardware failure, you can use
48 the ``--readd`` parameter. In this case, you don't need to pass the
49 secondary IP again, it will reused from the cluster. Also, the
50 drained and offline flags of the node will be cleared before
51 re-adding it.
52
53 The ``--force-join`` option is to proceed with adding a node even if it already
54 appears to belong to another cluster. This is used during cluster merging, for
55 example.
56
57 The ``-g (--node-group)`` option is used to add the new node into a
58 specific node group, specified by UUID or name. If only one node group
59 exists you can skip this option, otherwise it's mandatory.
60
61 The ``vm_capable``, ``master_capable`` and ``ndparams`` options are
62 described in **ganeti**(7), and are used to set the properties of the
63 new node.
64
65 Example::
66
67     # gnt-node add node5.example.com
68     # gnt-node add -s 192.0.2.5 node5.example.com
69     # gnt-node add -g group2 -s 192.0.2.9 node9.group2.example.com
70
71
72 ADD-TAGS
73 ~~~~~~~~
74
75 **add-tags** [--from *file*] {*nodename*} {*tag*...}
76
77 Add tags to the given node. If any of the tags contains invalid
78 characters, the entire operation will abort.
79
80 If the ``--from`` option is given, the list of tags will be
81 extended with the contents of that file (each line becomes a tag).
82 In this case, there is not need to pass tags on the command line
83 (if you do, both sources will be used). A file name of - will be
84 interpreted as stdin.
85
86 EVACUATE
87 ~~~~~~~~
88
89 **evacuate** [-f] [--early-release] [--iallocator *NAME* \|
90 --new-secondary *destination\_node*] {*node*...}
91
92 This command will move all secondary instances away from the given
93 node(s). It works only for instances having a drbd disk template.
94
95 The new location for the instances can be specified in two ways:
96
97 - as a single node for all instances, via the ``-n (--new-secondary)``
98   option
99
100 - or via the ``-I (--iallocator)`` option, giving a script name as
101   parameter, so each instance will be in turn placed on the (per the
102   script) optimal node
103
104
105 The ``--early-release`` changes the code so that the old storage on
106 node being evacuated is removed early (before the resync is
107 completed) and the internal Ganeti locks are also released for both
108 the current secondary and the new secondary, thus allowing more
109 parallelism in the cluster operation. This should be used only when
110 recovering from a disk failure on the current secondary (thus the
111 old storage is already broken) or when the storage on the primary
112 node is known to be fine (thus we won't need the old storage for
113 potential recovery).
114
115 Example::
116
117     # gnt-node evacuate -I hail node3.example.com
118
119
120 FAILOVER
121 ~~~~~~~~
122
123 **failover** [-f] [--ignore-consistency] {*node*}
124
125 This command will fail over all instances having the given node as
126 primary to their secondary nodes. This works only for instances having
127 a drbd disk template.
128
129 Normally the failover will check the consistency of the disks before
130 failing over the instance. If you are trying to migrate instances off
131 a dead node, this will fail. Use the ``--ignore-consistency`` option
132 for this purpose.
133
134 Example::
135
136     # gnt-node failover node1.example.com
137
138
139 INFO
140 ~~~~
141
142 **info** [*node*...]
143
144 Show detailed information about the nodes in the cluster. If you
145 don't give any arguments, all nodes will be shows, otherwise the
146 output will be restricted to the given names.
147
148 LIST
149 ~~~~
150
151 | **list**
152 | [--no-headers] [--separator=*SEPARATOR*]
153 | [--units=*UNITS*] [-v] [{-o|--output} *[+]FIELD,...*]
154 | [--filter]
155 | [node...]
156
157 Lists the nodes in the cluster.
158
159 The ``--no-headers`` option will skip the initial header line. The
160 ``--separator`` option takes an argument which denotes what will be
161 used between the output fields. Both these options are to help
162 scripting.
163
164 The units used to display the numeric values in the output varies,
165 depending on the options given. By default, the values will be
166 formatted in the most appropriate unit. If the ``--separator``
167 option is given, then the values are shown in mebibytes to allow
168 parsing by scripts. In both cases, the ``--units`` option can be
169 used to enforce a given output unit.
170
171 Queries of nodes will be done in parallel with any running jobs. This might
172 give inconsistent results for the free disk/memory.
173
174 The ``-v`` option activates verbose mode, which changes the display of
175 special field states (see **ganeti(7)**).
176
177 The ``-o (--output)`` option takes a comma-separated list of output
178 fields. The available fields and their meaning are:
179
180 @QUERY_FIELDS_NODE@
181
182 If the value of the option starts with the character ``+``, the new
183 fields will be added to the default list. This allows to quickly
184 see the default list plus a few other fields, instead of retyping
185 the entire list of fields.
186
187 Note that some of these fields are known from the configuration of the
188 cluster (e.g. ``name``, ``pinst``, ``sinst``, ``pip``, ``sip``) and thus
189 the master does not need to contact the node for this data (making the
190 listing fast if only fields from this set are selected), whereas the
191 other fields are "live" fields and require a query to the cluster nodes.
192
193 Depending on the virtualization type and implementation details, the
194 ``mtotal``, ``mnode`` and ``mfree`` fields may have slighly varying
195 meanings. For example, some solutions share the node memory with the
196 pool of memory used for instances (KVM), whereas others have separate
197 memory for the node and for the instances (Xen).
198
199 If exactly one argument is given and it appears to be a query filter
200 (see **ganeti(7)**), the query result is filtered accordingly. For
201 ambiguous cases (e.g. a single field name as a filter) the ``--filter``
202 (``-F``) option forces the argument to be treated as a filter (e.g.
203 ``gnt-node list -F master_candidate``).
204
205 If no node names are given, then all nodes are queried. Otherwise,
206 only the given nodes will be listed.
207
208
209 LIST-FIELDS
210 ~~~~~~~~~~~
211
212 **list-fields** [field...]
213
214 Lists available fields for nodes.
215
216
217 LIST-TAGS
218 ~~~~~~~~~
219
220 **list-tags** {*nodename*}
221
222 List the tags of the given node.
223
224 MIGRATE
225 ~~~~~~~
226
227 **migrate** [-f] [--non-live] [--migration-mode=live\|non-live]
228 {*node*}
229
230 This command will migrate all instances having the given node as
231 primary to their secondary nodes. This works only for instances
232 having a drbd disk template.
233
234 As for the **gnt-instance migrate** command, the options
235 ``--no-live`` and ``--migration-mode`` can be given to influence
236 the migration type.
237
238 Example::
239
240     # gnt-node migrate node1.example.com
241
242
243 MODIFY
244 ~~~~~~
245
246 | **modify** [-f] [--submit]
247 | [{-C|--master-candidate} ``yes|no``]
248 | [{-D|--drained} ``yes|no``] [{-O|--offline} ``yes|no``]
249 | [--master-capable=``yes|no``] [--vm-capable=``yes|no``] [--auto-promote]
250 | [{-s|--secondary-ip} *secondary_ip*]
251 | [--node-parameters *ndparams*]
252 | [--node-powered=``yes|no``]
253 | {*node*}
254
255 This command changes the role of the node. Each options takes
256 either a literal yes or no, and only one option should be given as
257 yes. The meaning of the roles and flags are described in the
258 manpage **ganeti**(7).
259
260 The option ``--node-powered`` can be used to modify state-of-record if
261 it doesn't reflect the reality anymore.
262
263 In case a node is demoted from the master candidate role, the
264 operation will be refused unless you pass the ``--auto-promote``
265 option. This option will cause the operation to lock all cluster nodes
266 (thus it will not be able to run in parallel with most other jobs),
267 but it allows automated maintenance of the cluster candidate pool. If
268 locking all cluster node is too expensive, another option is to
269 promote manually another node to master candidate before demoting the
270 current one.
271
272 Example (setting a node offline, which will demote it from master
273 candidate role if is in that role)::
274
275     # gnt-node modify --offline=yes node1.example.com
276
277 The ``-s (--secondary-ip)`` option can be used to change the node's
278 secondary ip. No drbd instances can be running on the node, while this
279 operation is taking place.
280
281 Example (setting the node back to online and master candidate)::
282
283     # gnt-node modify --offline=no --master-candidate=yes node1.example.com
284
285
286 REMOVE
287 ~~~~~~
288
289 **remove** {*nodename*}
290
291 Removes a node from the cluster. Instances must be removed or
292 migrated to another cluster before.
293
294 Example::
295
296     # gnt-node remove node5.example.com
297
298
299 REMOVE-TAGS
300 ~~~~~~~~~~~
301
302 **remove-tags** [--from *file*] {*nodename*} {*tag*...}
303
304 Remove tags from the given node. If any of the tags are not
305 existing on the node, the entire operation will abort.
306
307 If the ``--from`` option is given, the list of tags to be removed will
308 be extended with the contents of that file (each line becomes a tag).
309 In this case, there is not need to pass tags on the command line (if
310 you do, tags from both sources will be removed). A file name of - will
311 be interpreted as stdin.
312
313 VOLUMES
314 ~~~~~~~
315
316 | **volumes** [--no-headers] [--human-readable]
317 | [--separator=*SEPARATOR*] [{-o|--output} *FIELDS*]
318 | [*node*...]
319
320 Lists all logical volumes and their physical disks from the node(s)
321 provided.
322
323 The ``--no-headers`` option will skip the initial header line. The
324 ``--separator`` option takes an argument which denotes what will be
325 used between the output fields. Both these options are to help
326 scripting.
327
328 The units used to display the numeric values in the output varies,
329 depending on the options given. By default, the values will be
330 formatted in the most appropriate unit. If the ``--separator``
331 option is given, then the values are shown in mebibytes to allow
332 parsing by scripts. In both cases, the ``--units`` option can be
333 used to enforce a given output unit.
334
335 The ``-o (--output)`` option takes a comma-separated list of output
336 fields. The available fields and their meaning are:
337
338 node
339     the node name on which the volume exists
340
341 phys
342     the physical drive (on which the LVM physical volume lives)
343
344 vg
345     the volume group name
346
347 name
348     the logical volume name
349
350 size
351     the logical volume size
352
353 instance
354     The name of the instance to which this volume belongs, or (in case
355     it's an orphan volume) the character "-"
356
357
358 Example::
359
360     # gnt-node volumes node5.example.com
361     Node              PhysDev   VG    Name                                 Size Instance
362     node1.example.com /dev/hdc1 xenvg instance1.example.com-sda_11000.meta 128  instance1.example.com
363     node1.example.com /dev/hdc1 xenvg instance1.example.com-sda_11001.data 256  instance1.example.com
364
365
366 LIST-STORAGE
367 ~~~~~~~~~~~~
368
369 | **list-storage** [--no-headers] [--human-readable]
370 | [--separator=*SEPARATOR*] [--storage-type=*STORAGE\_TYPE*]
371 | [{-o|--output} *FIELDS*]
372 | [*node*...]
373
374 Lists the available storage units and their details for the given
375 node(s).
376
377 The ``--no-headers`` option will skip the initial header line. The
378 ``--separator`` option takes an argument which denotes what will be
379 used between the output fields. Both these options are to help
380 scripting.
381
382 The units used to display the numeric values in the output varies,
383 depending on the options given. By default, the values will be
384 formatted in the most appropriate unit. If the ``--separator``
385 option is given, then the values are shown in mebibytes to allow
386 parsing by scripts. In both cases, the ``--units`` option can be
387 used to enforce a given output unit.
388
389 The ``--storage-type`` option can be used to choose a storage unit
390 type. Possible choices are lvm-pv, lvm-vg or file.
391
392 The ``-o (--output)`` option takes a comma-separated list of output
393 fields. The available fields and their meaning are:
394
395 node
396     the node name on which the volume exists
397
398 type
399     the type of the storage unit (currently just what is passed in via
400     ``--storage-type``)
401
402 name
403     the path/identifier of the storage unit
404
405 size
406     total size of the unit; for the file type see a note below
407
408 used
409     used space in the unit; for the file type see a note below
410
411 free
412     available disk space
413
414 allocatable
415     whether we the unit is available for allocation (only lvm-pv can
416     change this setting, the other types always report true)
417
418
419 Note that for the "file" type, the total disk space might not equal
420 to the sum of used and free, due to the method Ganeti uses to
421 compute each of them. The total and free values are computed as the
422 total and free space values for the filesystem to which the
423 directory belongs, but the used space is computed from the used
424 space under that directory *only*, which might not be necessarily
425 the root of the filesystem, and as such there could be files
426 outside the file storage directory using disk space and causing a
427 mismatch in the values.
428
429 Example::
430
431     node1# gnt-node list-storage node2
432     Node  Type   Name        Size Used   Free Allocatable
433     node2 lvm-pv /dev/sda7 673.8G 1.5G 672.3G Y
434     node2 lvm-pv /dev/sdb1 698.6G   0M 698.6G Y
435
436
437 MODIFY-STORAGE
438 ~~~~~~~~~~~~~~
439
440 **modify-storage** [``--allocatable=yes|no``]
441 {*node*} {*storage-type*} {*volume-name*}
442
443 Modifies storage volumes on a node. Only LVM physical volumes can
444 be modified at the moment. They have a storage type of "lvm-pv".
445
446 Example::
447
448     # gnt-node modify-storage --allocatable no node5.example.com lvm-pv /dev/sdb1
449
450
451 REPAIR-STORAGE
452 ~~~~~~~~~~~~~~
453
454 **repair-storage** [--ignore-consistency] {*node*} {*storage-type*}
455 {*volume-name*}
456
457 Repairs a storage volume on a node. Only LVM volume groups can be
458 repaired at this time. They have the storage type "lvm-vg".
459
460 On LVM volume groups, **repair-storage** runs "vgreduce
461 --removemissing".
462
463
464
465 **Caution:** Running this command can lead to data loss. Use it with
466 care.
467
468 The ``--ignore-consistency`` option will ignore any inconsistent
469 disks (on the nodes paired with this one). Use of this option is
470 most likely to lead to data-loss.
471
472 Example::
473
474     # gnt-node repair-storage node5.example.com lvm-vg xenvg
475
476
477 POWERCYCLE
478 ~~~~~~~~~~
479
480 **powercycle** [``--yes``] [``--force``] {*node*}
481
482 This commands (tries to) forcefully reboot a node. It is a command
483 that can be used if the node environemnt is broken, such that the
484 admin can no longer login over ssh, but the Ganeti node daemon is
485 still working.
486
487 Note that this command is not guaranteed to work; it depends on the
488 hypervisor how effective is the reboot attempt. For Linux, this
489 command require that the kernel option CONFIG\_MAGIC\_SYSRQ is
490 enabled.
491
492 The ``--yes`` option can be used to skip confirmation, while the
493 ``--force`` option is needed if the target node is the master
494 node.
495
496 POWER
497 ~~~~~
498
499 **power** [``--force``] [``--ignore-status``] [``--all``]
500 [``--power-delay``] on|off|cycle|status [*nodes*]
501
502 This commands calls out to out-of-band management to change the power
503 state of given node. With ``status`` you get the power status as reported
504 by the out-of-band managment script.
505
506 Note that this command will only work if the out-of-band functionality
507 is configured and enabled on the cluster. If this is not the case,
508 please use the **powercycle** command above.
509
510 Using ``--force`` you skip the confirmation to do the operation.
511 Currently this only has effect on ``off`` and ``cycle``. On those two
512 you can *not* operate on the master. However, the command will provide
513 you with the command to invoke to operate on the master nerver-mind.
514 This is considered harmful and Ganeti does not support the use of it.
515
516 Providing ``--ignore-status`` will ignore the offline=N state of a node
517 and continue with power off.
518
519 ``--power-delay`` specifies the time in seconds (factions allowed)
520 waited between powering on the next node. This is by default 2 seconds
521 but can increased if needed with this option.
522
523 *nodes* are optional. If not provided it will call out for every node in
524 the cluster. Except for the ``off`` and ``cycle`` command where you've
525 to explicit use ``--all`` to select all.
526
527
528 HEALTH
529 ~~~~~~
530
531 **health** [*nodes*]
532
533 This commands calls out to out-pf-band management to ask for the health status
534 of all or given nodes. The health contains the node name and then the items
535 element with their status in a ``item=status`` manner. Where ``item`` is script
536 specific and ``status`` can be one of ``OK``, ``WARNING``, ``CRITICAL`` or
537 ``UNKNOWN``. Items with status ``WARNING`` or ``CRITICAL`` are logged and
538 annotated in the command line output.
539
540 .. vim: set textwidth=72 :
541 .. Local Variables:
542 .. mode: rst
543 .. fill-column: 72
544 .. End: