Statistics
| Branch: | Tag: | Revision:

root / man / gnt-node.rst @ 87f2f426

History | View | Annotate | Download (21.7 kB)

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 ``-g (--node-group)`` option is used to add the new node into a
56
specific node group, specified by UUID or name. If only one node group
57
exists you can skip this option, otherwise it's mandatory.
58

    
59
The ``vm_capable``, ``master_capable``, ``ndparams``, ``diskstate`` and
60
``hvstate`` options are described in **ganeti**\(7), and are used to set
61
the properties of the new node.
62

    
63
The command performs some operations that change the state of the master
64
and the new node, like copying certificates and starting the node daemon
65
on the new node, or updating ``/etc/hosts`` on the master node.  If the
66
command fails at a later stage, it doesn't undo such changes.  This
67
should not be a problem, as a successful run of ``gnt-node add`` will
68
bring everything back in sync.
69

    
70
If the node was previously part of another cluster and still has daemons
71
running, the ``node-cleanup`` tool can be run on the machine to be added
72
to clean remains of the previous cluster from the node.
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
EVACUATE
82
~~~~~~~~
83

    
84
| **evacuate** [-f] [\--early-release] [\--submit] [\--print-job-id]
85
| [{-I|\--iallocator} *NAME* \| {-n|\--new-secondary} *destination\_node*]
86
| [{-p|\--primary-only} \| {-s|\--secondary-only} ]
87
|  {*node*}
88

    
89
This command will move instances away from the given node. If
90
``--primary-only`` is given, only primary instances are evacuated, with
91
``--secondary-only`` only secondaries. If neither is given, all
92
instances are evacuated. It works only for instances having a drbd disk
93
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 (or ``.`` to use the default allocator), so each instance
102
  will be in turn placed on the (per the script) optimal node
103

    
104
The ``--early-release`` changes the code so that the old storage on
105
node being evacuated is removed early (before the resync is
106
completed) and the internal Ganeti locks are also released for both
107
the current secondary and the new secondary, thus allowing more
108
parallelism in the cluster operation. This should be used only when
109
recovering from a disk failure on the current secondary (thus the
110
old storage is already broken) or when the storage on the primary
111
node is known to be fine (thus we won't need the old storage for
112
potential recovery).
113

    
114
Note that this command is equivalent to using per-instance commands for
115
each affected instance individually:
116

    
117
- ``--primary-only`` is equivalent to performing ``gnt-instance
118
  migrate`` for every primary instance running on the node that can be
119
  migrated and ``gnt-instance failover`` for every primary instance that
120
  cannot be migrated.
121
- ``--secondary-only`` is equivalent to ``gnt-instance replace-disks``
122
  in secondary node change mode (``--new-secondary``) for every DRBD
123
  instance that the node is a secondary for.
124
- when neither of the above is done a combination of the two cases is run
125

    
126
See **ganeti**\(7) for a description of ``--submit`` and other common
127
options.
128

    
129
Example::
130

    
131
    # gnt-node evacuate -I hail node3.example.com
132

    
133
Note that, due to an issue with the iallocator interface, evacuation of
134
all instances at once is not yet implemented. Full evacuation can
135
currently be achieved by sequentially evacuating primaries and
136
secondaries.
137
::
138

    
139
    # gnt-node evacuate -p node3.example.com
140
    # gnt-node evacuate -s node3.example.com
141

    
142

    
143
FAILOVER
144
~~~~~~~~
145

    
146
**failover** [-f] [\--ignore-consistency] {*node*}
147

    
148
This command will fail over all instances having the given node as
149
primary to their secondary nodes. This works only for instances having
150
a drbd disk template.
151

    
152
Note that failover will stop any running instances on the given node and
153
restart them again on the new primary.
154
See also FAILOVER in **gnt-instance**\(8).
155

    
156
Normally the failover will check the consistency of the disks before
157
failing over the instance. If you are trying to migrate instances off
158
a dead node, this will fail. Use the ``--ignore-consistency`` option
159
for this purpose.
160

    
161
Example::
162

    
163
    # gnt-node failover node1.example.com
164

    
165

    
166
INFO
167
~~~~
168

    
169
**info** [*node*...]
170

    
171
Show detailed information about the nodes in the cluster. If you
172
don't give any arguments, all nodes will be shows, otherwise the
173
output will be restricted to the given names.
174

    
175
LIST
176
~~~~
177

    
178
| **list**
179
| [\--no-headers] [\--separator=*SEPARATOR*]
180
| [\--units=*UNITS*] [-v] [{-o|\--output} *[+]FIELD,...*]
181
| [\--filter]
182
| [node...]
183

    
184
Lists the nodes in the cluster.
185

    
186
The ``--no-headers`` option will skip the initial header line. The
187
``--separator`` option takes an argument which denotes what will be
188
used between the output fields. Both these options are to help
189
scripting.
190

    
191
The units used to display the numeric values in the output varies,
192
depending on the options given. By default, the values will be
193
formatted in the most appropriate unit. If the ``--separator``
194
option is given, then the values are shown in mebibytes to allow
195
parsing by scripts. In both cases, the ``--units`` option can be
196
used to enforce a given output unit.
197

    
198
Queries of nodes will be done in parallel with any running jobs. This might
199
give inconsistent results for the free disk/memory.
200

    
201
The ``-v`` option activates verbose mode, which changes the display of
202
special field states (see **ganeti**\(7)).
203

    
204
The ``-o (--output)`` option takes a comma-separated list of output
205
fields. The available fields and their meaning are:
206

    
207
@QUERY_FIELDS_NODE@
208

    
209
If the value of the option starts with the character ``+``, the new
210
fields will be added to the default list. This allows one to quickly
211
see the default list plus a few other fields, instead of retyping
212
the entire list of fields.
213

    
214
Note that some of these fields are known from the configuration of the
215
cluster (e.g. ``name``, ``pinst``, ``sinst``, ``pip``, ``sip``) and thus
216
the master does not need to contact the node for this data (making the
217
listing fast if only fields from this set are selected), whereas the
218
other fields are "live" fields and require a query to the cluster nodes.
219

    
220
Depending on the virtualization type and implementation details, the
221
``mtotal``, ``mnode`` and ``mfree`` fields may have slightly varying
222
meanings. For example, some solutions share the node memory with the
223
pool of memory used for instances (KVM), whereas others have separate
224
memory for the node and for the instances (Xen).
225

    
226
If exactly one argument is given and it appears to be a query filter
227
(see **ganeti**\(7)), the query result is filtered accordingly. For
228
ambiguous cases (e.g. a single field name as a filter) the ``--filter``
229
(``-F``) option forces the argument to be treated as a filter (e.g.
230
``gnt-node list -F master_candidate``).
231

    
232
If no node names are given, then all nodes are queried. Otherwise,
233
only the given nodes will be listed.
234

    
235

    
236
LIST-DRBD
237
~~~~~~~~~
238

    
239
**list-drbd** [\--no-headers] [\--separator=*SEPARATOR*] node
240

    
241
Lists the mapping of DRBD minors for a given node. This outputs a static
242
list of fields (it doesn't accept the ``--output`` option), as follows:
243

    
244
``Node``
245
  The (full) name of the node we are querying
246
``Minor``
247
  The DRBD minor
248
``Instance``
249
  The instance the DRBD minor belongs to
250
``Disk``
251
  The disk index that the DRBD minor belongs to
252
``Role``
253
  Either ``primary`` or ``secondary``, denoting the role of the node for
254
  the instance (note: this is not the live status of the DRBD device,
255
  but the configuration value)
256
``PeerNode``
257
  The node that the minor is connected to on the other end
258

    
259
This command can be used as a reverse lookup (from node and minor) to a
260
given instance, which can be useful when debugging DRBD issues.
261

    
262
Note that this command queries Ganeti via **ganeti-confd**\(8), so
263
it won't be available if support for ``confd`` has not been enabled at
264
build time; furthermore, in Ganeti 2.6 this is only available via the
265
Haskell version of confd (again selected at build time).
266

    
267
LIST-FIELDS
268
~~~~~~~~~~~
269

    
270
**list-fields** [field...]
271

    
272
Lists available fields for nodes.
273

    
274

    
275
MIGRATE
276
~~~~~~~
277

    
278
| **migrate** [-f] [\--non-live] [\--migration-mode=live\|non-live]
279
| [\--ignore-ipolicy] [\--submit] [\--print-job-id] {*node*}
280

    
281
This command will migrate all instances having the given node as
282
primary to their secondary nodes. This works only for instances
283
having a drbd disk template.
284

    
285
As for the **gnt-instance migrate** command, the options
286
``--no-live``, ``--migration-mode`` and ``--no-runtime-changes``
287
can be given to influence the migration type.
288

    
289
If ``--ignore-ipolicy`` is given any instance policy violations
290
occurring during this operation are ignored.
291

    
292
See **ganeti**\(7) for a description of ``--submit`` and other common
293
options.
294

    
295
Example::
296

    
297
    # gnt-node migrate node1.example.com
298

    
299

    
300
MODIFY
301
~~~~~~
302

    
303
| **modify** [-f] [\--submit] [\--print-job-id]
304
| [{-C|\--master-candidate} ``yes|no``]
305
| [{-D|\--drained} ``yes|no``] [{-O|\--offline} ``yes|no``]
306
| [\--master-capable=``yes|no``] [\--vm-capable=``yes|no``] [\--auto-promote]
307
| [{-s|\--secondary-ip} *secondary_ip*]
308
| [\--node-parameters *ndparams*]
309
| [\--node-powered=``yes|no``]
310
| [\--hypervisor-state *hvstate*]
311
| [\--disk-state *diskstate*]
312
| {*node*}
313

    
314
This command changes the role of the node. Each options takes
315
either a literal yes or no, and only one option should be given as
316
yes. The meaning of the roles and flags are described in the
317
manpage **ganeti**\(7).
318

    
319
The option ``--node-powered`` can be used to modify state-of-record if
320
it doesn't reflect the reality anymore.
321

    
322
In case a node is demoted from the master candidate role, the
323
operation will be refused unless you pass the ``--auto-promote``
324
option. This option will cause the operation to lock all cluster nodes
325
(thus it will not be able to run in parallel with most other jobs),
326
but it allows automated maintenance of the cluster candidate pool. If
327
locking all cluster node is too expensive, another option is to
328
promote manually another node to master candidate before demoting the
329
current one.
330

    
331
Example (setting a node offline, which will demote it from master
332
candidate role if is in that role)::
333

    
334
    # gnt-node modify --offline=yes node1.example.com
335

    
336
The ``-s (--secondary-ip)`` option can be used to change the node's
337
secondary ip. No drbd instances can be running on the node, while this
338
operation is taking place. Remember that the secondary ip must be
339
reachable from the master secondary ip, when being changed, so be sure
340
that the node has the new IP already configured and active. In order to
341
convert a cluster from single homed to multi-homed or vice versa
342
``--force`` is needed as well, and the target node for the first change
343
must be the master.
344

    
345
See **ganeti**\(7) for a description of ``--submit`` and other common
346
options.
347

    
348
Example (setting the node back to online and master candidate)::
349

    
350
    # gnt-node modify --offline=no --master-candidate=yes node1.example.com
351

    
352

    
353
REMOVE
354
~~~~~~
355

    
356
**remove** {*nodename*}
357

    
358
Removes a node from the cluster. Instances must be removed or
359
migrated to another cluster before.
360

    
361
Example::
362

    
363
    # gnt-node remove node5.example.com
364

    
365

    
366
VOLUMES
367
~~~~~~~
368

    
369
| **volumes** [\--no-headers] [\--human-readable]
370
| [\--separator=*SEPARATOR*] [{-o|\--output} *FIELDS*]
371
| [*node*...]
372

    
373
Lists all logical volumes and their physical disks from the node(s)
374
provided.
375

    
376
The ``--no-headers`` option will skip the initial header line. The
377
``--separator`` option takes an argument which denotes what will be
378
used between the output fields. Both these options are to help
379
scripting.
380

    
381
The units used to display the numeric values in the output varies,
382
depending on the options given. By default, the values will be
383
formatted in the most appropriate unit. If the ``--separator``
384
option is given, then the values are shown in mebibytes to allow
385
parsing by scripts. In both cases, the ``--units`` option can be
386
used to enforce a given output unit.
387

    
388
The ``-o (--output)`` option takes a comma-separated list of output
389
fields. The available fields and their meaning are:
390

    
391
node
392
    the node name on which the volume exists
393

    
394
phys
395
    the physical drive (on which the LVM physical volume lives)
396

    
397
vg
398
    the volume group name
399

    
400
name
401
    the logical volume name
402

    
403
size
404
    the logical volume size
405

    
406
instance
407
    The name of the instance to which this volume belongs, or (in case
408
    it's an orphan volume) the character "-"
409

    
410

    
411
Example::
412

    
413
    # gnt-node volumes node5.example.com
414
    Node              PhysDev   VG    Name                                 Size Instance
415
    node1.example.com /dev/hdc1 xenvg instance1.example.com-sda_11000.meta 128  instance1.example.com
416
    node1.example.com /dev/hdc1 xenvg instance1.example.com-sda_11001.data 256  instance1.example.com
417

    
418

    
419
LIST-STORAGE
420
~~~~~~~~~~~~
421

    
422
| **list-storage** [\--no-headers] [\--human-readable]
423
| [\--separator=*SEPARATOR*] [\--storage-type=*STORAGE\_TYPE*]
424
| [{-o|\--output} *FIELDS*]
425
| [*node*...]
426

    
427
Lists the available storage units and their details for the given
428
node(s).
429

    
430
The ``--no-headers`` option will skip the initial header line. The
431
``--separator`` option takes an argument which denotes what will be
432
used between the output fields. Both these options are to help
433
scripting.
434

    
435
The units used to display the numeric values in the output varies,
436
depending on the options given. By default, the values will be
437
formatted in the most appropriate unit. If the ``--separator``
438
option is given, then the values are shown in mebibytes to allow
439
parsing by scripts. In both cases, the ``--units`` option can be
440
used to enforce a given output unit.
441

    
442
The ``--storage-type`` option can be used to choose a storage unit
443
type. Possible choices are lvm-pv, lvm-vg or file.
444

    
445
The ``-o (--output)`` option takes a comma-separated list of output
446
fields. The available fields and their meaning are:
447

    
448
node
449
    the node name on which the volume exists
450

    
451
type
452
    the type of the storage unit (currently just what is passed in via
453
    ``--storage-type``)
454

    
455
name
456
    the path/identifier of the storage unit
457

    
458
size
459
    total size of the unit; for the file type see a note below
460

    
461
used
462
    used space in the unit; for the file type see a note below
463

    
464
free
465
    available disk space
466

    
467
allocatable
468
    whether we the unit is available for allocation (only lvm-pv can
469
    change this setting, the other types always report true)
470

    
471

    
472
Note that for the "file" type, the total disk space might not equal
473
to the sum of used and free, due to the method Ganeti uses to
474
compute each of them. The total and free values are computed as the
475
total and free space values for the filesystem to which the
476
directory belongs, but the used space is computed from the used
477
space under that directory *only*, which might not be necessarily
478
the root of the filesystem, and as such there could be files
479
outside the file storage directory using disk space and causing a
480
mismatch in the values.
481

    
482
Example::
483

    
484
    node1# gnt-node list-storage node2
485
    Node  Type   Name        Size Used   Free Allocatable
486
    node2 lvm-pv /dev/sda7 673.8G 1.5G 672.3G Y
487
    node2 lvm-pv /dev/sdb1 698.6G   0M 698.6G Y
488

    
489

    
490
MODIFY-STORAGE
491
~~~~~~~~~~~~~~
492

    
493
| **modify-storage** [\--allocatable={yes|no}] [\--submit] [\--print-job-id]
494
| {*node*} {*storage-type*} {*volume-name*}
495

    
496
Modifies storage volumes on a node. Only LVM physical volumes can
497
be modified at the moment. They have a storage type of "lvm-pv".
498

    
499
Example::
500

    
501
    # gnt-node modify-storage --allocatable no node5.example.com lvm-pv /dev/sdb1
502

    
503

    
504
REPAIR-STORAGE
505
~~~~~~~~~~~~~~
506

    
507
| **repair-storage** [\--ignore-consistency] ]\--submit]
508
| {*node*} {*storage-type*} {*volume-name*}
509

    
510
Repairs a storage volume on a node. Only LVM volume groups can be
511
repaired at this time. They have the storage type "lvm-vg".
512

    
513
On LVM volume groups, **repair-storage** runs ``vgreduce
514
--removemissing``.
515

    
516

    
517

    
518
**Caution:** Running this command can lead to data loss. Use it with
519
care.
520

    
521
The ``--ignore-consistency`` option will ignore any inconsistent
522
disks (on the nodes paired with this one). Use of this option is
523
most likely to lead to data-loss.
524

    
525
Example::
526

    
527
    # gnt-node repair-storage node5.example.com lvm-vg xenvg
528

    
529

    
530
POWERCYCLE
531
~~~~~~~~~~
532

    
533
**powercycle** [\--yes] [\--force] [\--submit] [\--print-job-id] {*node*}
534

    
535
This command (tries to) forcefully reboot a node. It is a command
536
that can be used if the node environment is broken, such that the
537
admin can no longer login over SSH, but the Ganeti node daemon is
538
still working.
539

    
540
Note that this command is not guaranteed to work; it depends on the
541
hypervisor how effective is the reboot attempt. For Linux, this
542
command requires the kernel option ``CONFIG_MAGIC_SYSRQ`` to be
543
enabled.
544

    
545
The ``--yes`` option can be used to skip confirmation, while the
546
``--force`` option is needed if the target node is the master
547
node.
548

    
549
See **ganeti**\(7) for a description of ``--submit`` and other common
550
options.
551

    
552
POWER
553
~~~~~
554

    
555
**power** [``--force``] [``--ignore-status``] [``--all``]
556
[``--power-delay``] on|off|cycle|status [*nodes*]
557

    
558
This command calls out to out-of-band management to change the power
559
state of given node. With ``status`` you get the power status as reported
560
by the out-of-band management script.
561

    
562
Note that this command will only work if the out-of-band functionality
563
is configured and enabled on the cluster. If this is not the case,
564
please use the **powercycle** command above.
565

    
566
Using ``--force`` you skip the confirmation to do the operation.
567
Currently this only has effect on ``off`` and ``cycle``. On those two
568
you can *not* operate on the master. However, the command will provide
569
you with the command to invoke to operate on the master nerver-mind.
570
This is considered harmful and Ganeti does not support the use of it.
571

    
572
Providing ``--ignore-status`` will ignore the offline=N state of a node
573
and continue with power off.
574

    
575
``--power-delay`` specifies the time in seconds (factions allowed)
576
waited between powering on the next node. This is by default 2 seconds
577
but can increased if needed with this option.
578

    
579
*nodes* are optional. If not provided it will call out for every node in
580
the cluster. Except for the ``off`` and ``cycle`` command where you've
581
to explicit use ``--all`` to select all.
582

    
583

    
584
HEALTH
585
~~~~~~
586

    
587
**health** [*nodes*]
588

    
589
This command calls out to out-of-band management to ask for the health status
590
of all or given nodes. The health contains the node name and then the items
591
element with their status in a ``item=status`` manner. Where ``item`` is script
592
specific and ``status`` can be one of ``OK``, ``WARNING``, ``CRITICAL`` or
593
``UNKNOWN``. Items with status ``WARNING`` or ``CRITICAL`` are logged and
594
annotated in the command line output.
595

    
596

    
597
RESTRICTED-COMMAND
598
~~~~~~~~~~~~~~~~~~
599

    
600
| **restricted-command** [-M] [\--sync]
601
| { -g *group* *command* | *command* *nodes*... }
602

    
603
Executes a restricted command on the specified nodes. Restricted commands are
604
not arbitrary, but must reside in
605
``@SYSCONFDIR@/ganeti/restricted-commands`` on a node, either as a regular
606
file or as a symlink. The directory must be owned by root and not be
607
world- or group-writable. If a command fails verification or otherwise
608
fails to start, the node daemon log must be consulted for more detailed
609
information.
610

    
611
Example for running a command on two nodes::
612

    
613
    # gnt-node restricted-command mycommand \
614
      node1.example.com node2.example.com
615

    
616
The ``-g`` option can be used to run a command only on a specific node
617
group, e.g.::
618

    
619
    # gnt-node restricted-command -g default mycommand
620

    
621
The ``-M`` option can be used to prepend the node name to all command
622
output lines. ``--sync`` forces the opcode to acquire the node lock(s)
623
in exclusive mode.
624

    
625
Tags
626
~~~~
627

    
628
ADD-TAGS
629
^^^^^^^^
630

    
631
**add-tags** [\--from *file*] {*nodename*} {*tag*...}
632

    
633
Add tags to the given node. If any of the tags contains invalid
634
characters, the entire operation will abort.
635

    
636
If the ``--from`` option is given, the list of tags will be
637
extended with the contents of that file (each line becomes a tag).
638
In this case, there is not need to pass tags on the command line
639
(if you do, both sources will be used). A file name of - will be
640
interpreted as stdin.
641

    
642
LIST-TAGS
643
^^^^^^^^^
644

    
645
**list-tags** {*nodename*}
646

    
647
List the tags of the given node.
648

    
649
REMOVE-TAGS
650
^^^^^^^^^^^
651

    
652
**remove-tags** [\--from *file*] {*nodename*} {*tag*...}
653

    
654
Remove tags from the given node. If any of the tags are not
655
existing on the node, the entire operation will abort.
656

    
657
If the ``--from`` option is given, the list of tags to be removed will
658
be extended with the contents of that file (each line becomes a tag).
659
In this case, there is not need to pass tags on the command line (if
660
you do, tags from both sources will be removed). A file name of - will
661
be interpreted as stdin.
662

    
663
.. vim: set textwidth=72 :
664
.. Local Variables:
665
.. mode: rst
666
.. fill-column: 72
667
.. End: