Statistics
| Branch: | Tag: | Revision:

root / man / gnt-node.rst @ e715a6d6

History | View | Annotate | Download (22.3 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 to 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 be 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
Note that the iallocator currently only considers disk information of
127
the default disk template, even if the instance's disk templates differ
128
from that.
129

    
130
See **ganeti**\(7) for a description of ``--submit`` and other common
131
options.
132

    
133
Example::
134

    
135
    # gnt-node evacuate -I hail node3.example.com
136

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

    
143
    # gnt-node evacuate -p node3.example.com
144
    # gnt-node evacuate -s node3.example.com
145

    
146

    
147
FAILOVER
148
~~~~~~~~
149

    
150
**failover** [-f] [\--ignore-consistency] {*node*}
151

    
152
This command will fail over all instances having the given node as
153
primary to their secondary nodes. This works only for instances having
154
a drbd disk template.
155

    
156
Note that failover will stop any running instances on the given node and
157
restart them again on the new primary.
158
See also FAILOVER in **gnt-instance**\(8).
159

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

    
165
Example::
166

    
167
    # gnt-node failover node1.example.com
168

    
169

    
170
INFO
171
~~~~
172

    
173
**info** [*node*...]
174

    
175
Show detailed information about the nodes in the cluster. If you
176
don't give any arguments, all nodes will be shows, otherwise the
177
output will be restricted to the given names.
178

    
179
LIST
180
~~~~
181

    
182
| **list**
183
| [\--no-headers] [\--separator=*SEPARATOR*]
184
| [\--units=*UNITS*] [-v] [{-o|\--output} *[+]FIELD,...*]
185
| [\--filter]
186
| [node...]
187

    
188
Lists the nodes in the cluster.
189

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

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

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

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

    
208
The ``-o (--output)`` option takes a comma-separated list of output
209
fields. The available fields and their meaning are:
210

    
211
@QUERY_FIELDS_NODE@
212

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

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

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

    
230
Note that the field 'dtotal' and 'dfree' refer to the storage type
231
that is defined by the default disk template. The default disk template
232
is the first on in the list of cluster-wide enabled disk templates and
233
can be set with ``gnt-cluster modify``. Currently, only the disk
234
templates 'plain', 'drbd', 'file', and 'sharedfile' support storage
235
reporting, for all others '0' is displayed.
236

    
237
If exactly one argument is given and it appears to be a query filter
238
(see **ganeti**\(7)), the query result is filtered accordingly. For
239
ambiguous cases (e.g. a single field name as a filter) the ``--filter``
240
(``-F``) option forces the argument to be treated as a filter (e.g.
241
``gnt-node list -F master_candidate``).
242

    
243
If no node names are given, then all nodes are queried. Otherwise,
244
only the given nodes will be listed.
245

    
246

    
247
LIST-DRBD
248
~~~~~~~~~
249

    
250
**list-drbd** [\--no-headers] [\--separator=*SEPARATOR*] node
251

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

    
255
``Node``
256
  The (full) name of the node we are querying
257
``Minor``
258
  The DRBD minor
259
``Instance``
260
  The instance the DRBD minor belongs to
261
``Disk``
262
  The disk index that the DRBD minor belongs to
263
``Role``
264
  Either ``primary`` or ``secondary``, denoting the role of the node for
265
  the instance (note: this is not the live status of the DRBD device,
266
  but the configuration value)
267
``PeerNode``
268
  The node that the minor is connected to on the other end
269

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

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

    
278
LIST-FIELDS
279
~~~~~~~~~~~
280

    
281
**list-fields** [field...]
282

    
283
Lists available fields for nodes.
284

    
285

    
286
MIGRATE
287
~~~~~~~
288

    
289
| **migrate** [-f] [\--non-live] [\--migration-mode=live\|non-live]
290
| [\--ignore-ipolicy] [\--submit] [\--print-job-id] {*node*}
291

    
292
This command will migrate all instances having the given node as
293
primary to their secondary nodes. This works only for instances
294
having a drbd disk template.
295

    
296
As for the **gnt-instance migrate** command, the options
297
``--no-live``, ``--migration-mode`` and ``--no-runtime-changes``
298
can be given to influence the migration type.
299

    
300
If ``--ignore-ipolicy`` is given any instance policy violations
301
occurring during this operation are ignored.
302

    
303
See **ganeti**\(7) for a description of ``--submit`` and other common
304
options.
305

    
306
Example::
307

    
308
    # gnt-node migrate node1.example.com
309

    
310

    
311
MODIFY
312
~~~~~~
313

    
314
| **modify** [-f] [\--submit] [\--print-job-id]
315
| [{-C|\--master-candidate} ``yes|no``]
316
| [{-D|\--drained} ``yes|no``] [{-O|\--offline} ``yes|no``]
317
| [\--master-capable=``yes|no``] [\--vm-capable=``yes|no``] [\--auto-promote]
318
| [{-s|\--secondary-ip} *secondary_ip*]
319
| [\--node-parameters *ndparams*]
320
| [\--node-powered=``yes|no``]
321
| [\--hypervisor-state *hvstate*]
322
| [\--disk-state *diskstate*]
323
| {*node*}
324

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

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

    
333
In case a node is demoted from the master candidate role, the
334
operation will be refused unless you pass the ``--auto-promote``
335
option. This option will cause the operation to lock all cluster nodes
336
(thus it will not be able to run in parallel with most other jobs),
337
but it allows automated maintenance of the cluster candidate pool. If
338
locking all cluster node is too expensive, another option is to
339
promote manually another node to master candidate before demoting the
340
current one.
341

    
342
Example (setting a node offline, which will demote it from master
343
candidate role if is in that role)::
344

    
345
    # gnt-node modify --offline=yes node1.example.com
346

    
347
The ``-s (--secondary-ip)`` option can be used to change the node's
348
secondary ip. No drbd instances can be running on the node, while this
349
operation is taking place. Remember that the secondary ip must be
350
reachable from the master secondary ip, when being changed, so be sure
351
that the node has the new IP already configured and active. In order to
352
convert a cluster from single homed to multi-homed or vice versa
353
``--force`` is needed as well, and the target node for the first change
354
must be the master.
355

    
356
See **ganeti**\(7) for a description of ``--submit`` and other common
357
options.
358

    
359
Example (setting the node back to online and master candidate)::
360

    
361
    # gnt-node modify --offline=no --master-candidate=yes node1.example.com
362

    
363

    
364
REMOVE
365
~~~~~~
366

    
367
**remove** {*nodename*}
368

    
369
Removes a node from the cluster. Instances must be removed or
370
migrated to another cluster before.
371

    
372
Example::
373

    
374
    # gnt-node remove node5.example.com
375

    
376

    
377
VOLUMES
378
~~~~~~~
379

    
380
| **volumes** [\--no-headers] [\--human-readable]
381
| [\--separator=*SEPARATOR*] [{-o|\--output} *FIELDS*]
382
| [*node*...]
383

    
384
Lists all logical volumes and their physical disks from the node(s)
385
provided.
386

    
387
The ``--no-headers`` option will skip the initial header line. The
388
``--separator`` option takes an argument which denotes what will be
389
used between the output fields. Both these options are to help
390
scripting.
391

    
392
The units used to display the numeric values in the output varies,
393
depending on the options given. By default, the values will be
394
formatted in the most appropriate unit. If the ``--separator``
395
option is given, then the values are shown in mebibytes to allow
396
parsing by scripts. In both cases, the ``--units`` option can be
397
used to enforce a given output unit.
398

    
399
The ``-o (--output)`` option takes a comma-separated list of output
400
fields. The available fields and their meaning are:
401

    
402
node
403
    the node name on which the volume exists
404

    
405
phys
406
    the physical drive (on which the LVM physical volume lives)
407

    
408
vg
409
    the volume group name
410

    
411
name
412
    the logical volume name
413

    
414
size
415
    the logical volume size
416

    
417
instance
418
    The name of the instance to which this volume belongs, or (in case
419
    it's an orphan volume) the character "-"
420

    
421

    
422
Example::
423

    
424
    # gnt-node volumes node5.example.com
425
    Node              PhysDev   VG    Name                                 Size Instance
426
    node1.example.com /dev/hdc1 xenvg instance1.example.com-sda_11000.meta 128  instance1.example.com
427
    node1.example.com /dev/hdc1 xenvg instance1.example.com-sda_11001.data 256  instance1.example.com
428

    
429

    
430
LIST-STORAGE
431
~~~~~~~~~~~~
432

    
433
| **list-storage** [\--no-headers] [\--human-readable]
434
| [\--separator=*SEPARATOR*] [\--storage-type=*STORAGE\_TYPE*]
435
| [{-o|\--output} *FIELDS*]
436
| [*node*...]
437

    
438
Lists the available storage units and their details for the given
439
node(s).
440

    
441
The ``--no-headers`` option will skip the initial header line. The
442
``--separator`` option takes an argument which denotes what will be
443
used between the output fields. Both these options are to help
444
scripting.
445

    
446
The units used to display the numeric values in the output varies,
447
depending on the options given. By default, the values will be
448
formatted in the most appropriate unit. If the ``--separator``
449
option is given, then the values are shown in mebibytes to allow
450
parsing by scripts. In both cases, the ``--units`` option can be
451
used to enforce a given output unit.
452

    
453
The ``--storage-type`` option can be used to choose a storage unit
454
type. Possible choices are lvm-pv, lvm-vg or file.
455

    
456
The ``-o (--output)`` option takes a comma-separated list of output
457
fields. The available fields and their meaning are:
458

    
459
node
460
    the node name on which the volume exists
461

    
462
type
463
    the type of the storage unit (currently just what is passed in via
464
    ``--storage-type``)
465

    
466
name
467
    the path/identifier of the storage unit
468

    
469
size
470
    total size of the unit; for the file type see a note below
471

    
472
used
473
    used space in the unit; for the file type see a note below
474

    
475
free
476
    available disk space
477

    
478
allocatable
479
    whether we the unit is available for allocation (only lvm-pv can
480
    change this setting, the other types always report true)
481

    
482

    
483
Note that for the "file" type, the total disk space might not equal
484
to the sum of used and free, due to the method Ganeti uses to
485
compute each of them. The total and free values are computed as the
486
total and free space values for the filesystem to which the
487
directory belongs, but the used space is computed from the used
488
space under that directory *only*, which might not be necessarily
489
the root of the filesystem, and as such there could be files
490
outside the file storage directory using disk space and causing a
491
mismatch in the values.
492

    
493
Example::
494

    
495
    node1# gnt-node list-storage node2
496
    Node  Type   Name        Size Used   Free Allocatable
497
    node2 lvm-pv /dev/sda7 673.8G 1.5G 672.3G Y
498
    node2 lvm-pv /dev/sdb1 698.6G   0M 698.6G Y
499

    
500

    
501
MODIFY-STORAGE
502
~~~~~~~~~~~~~~
503

    
504
| **modify-storage** [\--allocatable={yes|no}] [\--submit] [\--print-job-id]
505
| {*node*} {*storage-type*} {*volume-name*}
506

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

    
510
Example::
511

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

    
514

    
515
REPAIR-STORAGE
516
~~~~~~~~~~~~~~
517

    
518
| **repair-storage** [\--ignore-consistency] ]\--submit]
519
| {*node*} {*storage-type*} {*volume-name*}
520

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

    
524
On LVM volume groups, **repair-storage** runs ``vgreduce
525
--removemissing``.
526

    
527

    
528

    
529
**Caution:** Running this command can lead to data loss. Use it with
530
care.
531

    
532
The ``--ignore-consistency`` option will ignore any inconsistent
533
disks (on the nodes paired with this one). Use of this option is
534
most likely to lead to data-loss.
535

    
536
Example::
537

    
538
    # gnt-node repair-storage node5.example.com lvm-vg xenvg
539

    
540

    
541
POWERCYCLE
542
~~~~~~~~~~
543

    
544
**powercycle** [\--yes] [\--force] [\--submit] [\--print-job-id] {*node*}
545

    
546
This command (tries to) forcefully reboot a node. It is a command
547
that can be used if the node environment is broken, such that the
548
admin can no longer login over SSH, but the Ganeti node daemon is
549
still working.
550

    
551
Note that this command is not guaranteed to work; it depends on the
552
hypervisor how effective is the reboot attempt. For Linux, this
553
command requires the kernel option ``CONFIG_MAGIC_SYSRQ`` to be
554
enabled.
555

    
556
The ``--yes`` option can be used to skip confirmation, while the
557
``--force`` option is needed if the target node is the master
558
node.
559

    
560
See **ganeti**\(7) for a description of ``--submit`` and other common
561
options.
562

    
563
POWER
564
~~~~~
565

    
566
**power** [``--force``] [``--ignore-status``] [``--all``]
567
[``--power-delay``] on|off|cycle|status [*nodes*]
568

    
569
This command calls out to out-of-band management to change the power
570
state of given node. With ``status`` you get the power status as reported
571
by the out-of-band management script.
572

    
573
Note that this command will only work if the out-of-band functionality
574
is configured and enabled on the cluster. If this is not the case,
575
please use the **powercycle** command above.
576

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

    
583
Providing ``--ignore-status`` will ignore the offline=N state of a node
584
and continue with power off.
585

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

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

    
594

    
595
HEALTH
596
~~~~~~
597

    
598
**health** [*nodes*]
599

    
600
This command calls out to out-of-band management to ask for the health status
601
of all or given nodes. The health contains the node name and then the items
602
element with their status in a ``item=status`` manner. Where ``item`` is script
603
specific and ``status`` can be one of ``OK``, ``WARNING``, ``CRITICAL`` or
604
``UNKNOWN``. Items with status ``WARNING`` or ``CRITICAL`` are logged and
605
annotated in the command line output.
606

    
607

    
608
RESTRICTED-COMMAND
609
~~~~~~~~~~~~~~~~~~
610

    
611
| **restricted-command** [-M] [\--sync]
612
| { -g *group* *command* | *command* *nodes*... }
613

    
614
Executes a restricted command on the specified nodes. Restricted commands are
615
not arbitrary, but must reside in
616
``@SYSCONFDIR@/ganeti/restricted-commands`` on a node, either as a regular
617
file or as a symlink. The directory must be owned by root and not be
618
world- or group-writable. If a command fails verification or otherwise
619
fails to start, the node daemon log must be consulted for more detailed
620
information.
621

    
622
Example for running a command on two nodes::
623

    
624
    # gnt-node restricted-command mycommand \
625
      node1.example.com node2.example.com
626

    
627
The ``-g`` option can be used to run a command only on a specific node
628
group, e.g.::
629

    
630
    # gnt-node restricted-command -g default mycommand
631

    
632
The ``-M`` option can be used to prepend the node name to all command
633
output lines. ``--sync`` forces the opcode to acquire the node lock(s)
634
in exclusive mode.
635

    
636
Tags
637
~~~~
638

    
639
ADD-TAGS
640
^^^^^^^^
641

    
642
**add-tags** [\--from *file*] {*nodename*} {*tag*...}
643

    
644
Add tags to the given node. If any of the tags contains invalid
645
characters, the entire operation will abort.
646

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

    
653
LIST-TAGS
654
^^^^^^^^^
655

    
656
**list-tags** {*nodename*}
657

    
658
List the tags of the given node.
659

    
660
REMOVE-TAGS
661
^^^^^^^^^^^
662

    
663
**remove-tags** [\--from *file*] {*nodename*} {*tag*...}
664

    
665
Remove tags from the given node. If any of the tags are not
666
existing on the node, the entire operation will abort.
667

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

    
674
.. vim: set textwidth=72 :
675
.. Local Variables:
676
.. mode: rst
677
.. fill-column: 72
678
.. End: