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