Statistics
| Branch: | Tag: | Revision:

root / man / gnt-node.rst @ f1dff7ec

History | View | Annotate | Download (17.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
| {*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*]
91
[--primary-only \| --secondary-only] [--early-release] {*node*}
92

    
93
This command will move instances away from the given node. If
94
``--primary-only`` is given, only primary instances are evacuated, with
95
``--secondary-only`` only secondaries. If neither is given, all
96
instances are evacuated. It works only for instances having a drbd disk
97
template.
98

    
99
The new location for the instances can be specified in two ways:
100

    
101
- as a single node for all instances, via the ``-n (--new-secondary)``
102
  option
103

    
104
- or via the ``-I (--iallocator)`` option, giving a script name as
105
  parameter, so each instance will be in turn placed on the (per the
106
  script) optimal node
107

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

    
118
Note that this command is equivalent to using per-instance commands for
119
each affected instance individually:
120

    
121
- ``--primary-only`` is equivalent to ``gnt-instance
122
  failover/migration`` for non-DRBD instances, but for DRBD instances
123
  it's different, and usually is a slow process (it will change the
124
  primary to another node while keeping the secondary, this requiring
125
  data copies, whereas failover/migrate will only toggle the
126
  primary/secondary roles, a fast process)
127
- ``--secondary-only`` is equivalent to ``gnt-instance replace-disks``
128
  in the secondary node change mode (only valid for DRBD instances)
129
- when neither of the above is done a combination of the two cases is run
130

    
131
Example::
132

    
133
    # gnt-node evacuate -I hail node3.example.com
134

    
135

    
136
FAILOVER
137
~~~~~~~~
138

    
139
**failover** [-f] [--ignore-consistency] {*node*}
140

    
141
This command will fail over all instances having the given node as
142
primary to their secondary nodes. This works only for instances having
143
a drbd disk template.
144

    
145
Normally the failover will check the consistency of the disks before
146
failing over the instance. If you are trying to migrate instances off
147
a dead node, this will fail. Use the ``--ignore-consistency`` option
148
for this purpose.
149

    
150
Example::
151

    
152
    # gnt-node failover node1.example.com
153

    
154

    
155
INFO
156
~~~~
157

    
158
**info** [*node*...]
159

    
160
Show detailed information about the nodes in the cluster. If you
161
don't give any arguments, all nodes will be shows, otherwise the
162
output will be restricted to the given names.
163

    
164
LIST
165
~~~~
166

    
167
| **list**
168
| [--no-headers] [--separator=*SEPARATOR*]
169
| [--units=*UNITS*] [-v] [{-o|--output} *[+]FIELD,...*]
170
| [--filter]
171
| [node...]
172

    
173
Lists the nodes in the cluster.
174

    
175
The ``--no-headers`` option will skip the initial header line. The
176
``--separator`` option takes an argument which denotes what will be
177
used between the output fields. Both these options are to help
178
scripting.
179

    
180
The units used to display the numeric values in the output varies,
181
depending on the options given. By default, the values will be
182
formatted in the most appropriate unit. If the ``--separator``
183
option is given, then the values are shown in mebibytes to allow
184
parsing by scripts. In both cases, the ``--units`` option can be
185
used to enforce a given output unit.
186

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

    
190
The ``-v`` option activates verbose mode, which changes the display of
191
special field states (see **ganeti(7)**).
192

    
193
The ``-o (--output)`` option takes a comma-separated list of output
194
fields. The available fields and their meaning are:
195

    
196
@QUERY_FIELDS_NODE@
197

    
198
If the value of the option starts with the character ``+``, the new
199
fields will be added to the default list. This allows one to quickly
200
see the default list plus a few other fields, instead of retyping
201
the entire list of fields.
202

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

    
209
Depending on the virtualization type and implementation details, the
210
``mtotal``, ``mnode`` and ``mfree`` fields may have slighly varying
211
meanings. For example, some solutions share the node memory with the
212
pool of memory used for instances (KVM), whereas others have separate
213
memory for the node and for the instances (Xen).
214

    
215
If exactly one argument is given and it appears to be a query filter
216
(see **ganeti(7)**), the query result is filtered accordingly. For
217
ambiguous cases (e.g. a single field name as a filter) the ``--filter``
218
(``-F``) option forces the argument to be treated as a filter (e.g.
219
``gnt-node list -F master_candidate``).
220

    
221
If no node names are given, then all nodes are queried. Otherwise,
222
only the given nodes will be listed.
223

    
224

    
225
LIST-FIELDS
226
~~~~~~~~~~~
227

    
228
**list-fields** [field...]
229

    
230
Lists available fields for nodes.
231

    
232

    
233
LIST-TAGS
234
~~~~~~~~~
235

    
236
**list-tags** {*nodename*}
237

    
238
List the tags of the given node.
239

    
240
MIGRATE
241
~~~~~~~
242

    
243
**migrate** [-f] [--non-live] [--migration-mode=live\|non-live]
244
{*node*}
245

    
246
This command will migrate all instances having the given node as
247
primary to their secondary nodes. This works only for instances
248
having a drbd disk template.
249

    
250
As for the **gnt-instance migrate** command, the options
251
``--no-live`` and ``--migration-mode`` can be given to influence
252
the migration type.
253

    
254
Example::
255

    
256
    # gnt-node migrate node1.example.com
257

    
258

    
259
MODIFY
260
~~~~~~
261

    
262
| **modify** [-f] [--submit]
263
| [{-C|--master-candidate} ``yes|no``]
264
| [{-D|--drained} ``yes|no``] [{-O|--offline} ``yes|no``]
265
| [--master-capable=``yes|no``] [--vm-capable=``yes|no``] [--auto-promote]
266
| [{-s|--secondary-ip} *secondary_ip*]
267
| [--node-parameters *ndparams*]
268
| [--node-powered=``yes|no``]
269
| {*node*}
270

    
271
This command changes the role of the node. Each options takes
272
either a literal yes or no, and only one option should be given as
273
yes. The meaning of the roles and flags are described in the
274
manpage **ganeti**(7).
275

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

    
279
In case a node is demoted from the master candidate role, the
280
operation will be refused unless you pass the ``--auto-promote``
281
option. This option will cause the operation to lock all cluster nodes
282
(thus it will not be able to run in parallel with most other jobs),
283
but it allows automated maintenance of the cluster candidate pool. If
284
locking all cluster node is too expensive, another option is to
285
promote manually another node to master candidate before demoting the
286
current one.
287

    
288
Example (setting a node offline, which will demote it from master
289
candidate role if is in that role)::
290

    
291
    # gnt-node modify --offline=yes node1.example.com
292

    
293
The ``-s (--secondary-ip)`` option can be used to change the node's
294
secondary ip. No drbd instances can be running on the node, while this
295
operation is taking place.
296

    
297
Example (setting the node back to online and master candidate)::
298

    
299
    # gnt-node modify --offline=no --master-candidate=yes node1.example.com
300

    
301

    
302
REMOVE
303
~~~~~~
304

    
305
**remove** {*nodename*}
306

    
307
Removes a node from the cluster. Instances must be removed or
308
migrated to another cluster before.
309

    
310
Example::
311

    
312
    # gnt-node remove node5.example.com
313

    
314

    
315
REMOVE-TAGS
316
~~~~~~~~~~~
317

    
318
**remove-tags** [--from *file*] {*nodename*} {*tag*...}
319

    
320
Remove tags from the given node. If any of the tags are not
321
existing on the node, the entire operation will abort.
322

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

    
329
VOLUMES
330
~~~~~~~
331

    
332
| **volumes** [--no-headers] [--human-readable]
333
| [--separator=*SEPARATOR*] [{-o|--output} *FIELDS*]
334
| [*node*...]
335

    
336
Lists all logical volumes and their physical disks from the node(s)
337
provided.
338

    
339
The ``--no-headers`` option will skip the initial header line. The
340
``--separator`` option takes an argument which denotes what will be
341
used between the output fields. Both these options are to help
342
scripting.
343

    
344
The units used to display the numeric values in the output varies,
345
depending on the options given. By default, the values will be
346
formatted in the most appropriate unit. If the ``--separator``
347
option is given, then the values are shown in mebibytes to allow
348
parsing by scripts. In both cases, the ``--units`` option can be
349
used to enforce a given output unit.
350

    
351
The ``-o (--output)`` option takes a comma-separated list of output
352
fields. The available fields and their meaning are:
353

    
354
node
355
    the node name on which the volume exists
356

    
357
phys
358
    the physical drive (on which the LVM physical volume lives)
359

    
360
vg
361
    the volume group name
362

    
363
name
364
    the logical volume name
365

    
366
size
367
    the logical volume size
368

    
369
instance
370
    The name of the instance to which this volume belongs, or (in case
371
    it's an orphan volume) the character "-"
372

    
373

    
374
Example::
375

    
376
    # gnt-node volumes node5.example.com
377
    Node              PhysDev   VG    Name                                 Size Instance
378
    node1.example.com /dev/hdc1 xenvg instance1.example.com-sda_11000.meta 128  instance1.example.com
379
    node1.example.com /dev/hdc1 xenvg instance1.example.com-sda_11001.data 256  instance1.example.com
380

    
381

    
382
LIST-STORAGE
383
~~~~~~~~~~~~
384

    
385
| **list-storage** [--no-headers] [--human-readable]
386
| [--separator=*SEPARATOR*] [--storage-type=*STORAGE\_TYPE*]
387
| [{-o|--output} *FIELDS*]
388
| [*node*...]
389

    
390
Lists the available storage units and their details for the given
391
node(s).
392

    
393
The ``--no-headers`` option will skip the initial header line. The
394
``--separator`` option takes an argument which denotes what will be
395
used between the output fields. Both these options are to help
396
scripting.
397

    
398
The units used to display the numeric values in the output varies,
399
depending on the options given. By default, the values will be
400
formatted in the most appropriate unit. If the ``--separator``
401
option is given, then the values are shown in mebibytes to allow
402
parsing by scripts. In both cases, the ``--units`` option can be
403
used to enforce a given output unit.
404

    
405
The ``--storage-type`` option can be used to choose a storage unit
406
type. Possible choices are lvm-pv, lvm-vg or file.
407

    
408
The ``-o (--output)`` option takes a comma-separated list of output
409
fields. The available fields and their meaning are:
410

    
411
node
412
    the node name on which the volume exists
413

    
414
type
415
    the type of the storage unit (currently just what is passed in via
416
    ``--storage-type``)
417

    
418
name
419
    the path/identifier of the storage unit
420

    
421
size
422
    total size of the unit; for the file type see a note below
423

    
424
used
425
    used space in the unit; for the file type see a note below
426

    
427
free
428
    available disk space
429

    
430
allocatable
431
    whether we the unit is available for allocation (only lvm-pv can
432
    change this setting, the other types always report true)
433

    
434

    
435
Note that for the "file" type, the total disk space might not equal
436
to the sum of used and free, due to the method Ganeti uses to
437
compute each of them. The total and free values are computed as the
438
total and free space values for the filesystem to which the
439
directory belongs, but the used space is computed from the used
440
space under that directory *only*, which might not be necessarily
441
the root of the filesystem, and as such there could be files
442
outside the file storage directory using disk space and causing a
443
mismatch in the values.
444

    
445
Example::
446

    
447
    node1# gnt-node list-storage node2
448
    Node  Type   Name        Size Used   Free Allocatable
449
    node2 lvm-pv /dev/sda7 673.8G 1.5G 672.3G Y
450
    node2 lvm-pv /dev/sdb1 698.6G   0M 698.6G Y
451

    
452

    
453
MODIFY-STORAGE
454
~~~~~~~~~~~~~~
455

    
456
**modify-storage** [``--allocatable=yes|no``]
457
{*node*} {*storage-type*} {*volume-name*}
458

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

    
462
Example::
463

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

    
466

    
467
REPAIR-STORAGE
468
~~~~~~~~~~~~~~
469

    
470
**repair-storage** [--ignore-consistency] {*node*} {*storage-type*}
471
{*volume-name*}
472

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

    
476
On LVM volume groups, **repair-storage** runs "vgreduce
477
--removemissing".
478

    
479

    
480

    
481
**Caution:** Running this command can lead to data loss. Use it with
482
care.
483

    
484
The ``--ignore-consistency`` option will ignore any inconsistent
485
disks (on the nodes paired with this one). Use of this option is
486
most likely to lead to data-loss.
487

    
488
Example::
489

    
490
    # gnt-node repair-storage node5.example.com lvm-vg xenvg
491

    
492

    
493
POWERCYCLE
494
~~~~~~~~~~
495

    
496
**powercycle** [``--yes``] [``--force``] {*node*}
497

    
498
This command (tries to) forcefully reboot a node. It is a command
499
that can be used if the node environemnt is broken, such that the
500
admin can no longer login over ssh, but the Ganeti node daemon is
501
still working.
502

    
503
Note that this command is not guaranteed to work; it depends on the
504
hypervisor how effective is the reboot attempt. For Linux, this
505
command require that the kernel option CONFIG\_MAGIC\_SYSRQ is
506
enabled.
507

    
508
The ``--yes`` option can be used to skip confirmation, while the
509
``--force`` option is needed if the target node is the master
510
node.
511

    
512
POWER
513
~~~~~
514

    
515
**power** [``--force``] [``--ignore-status``] [``--all``]
516
[``--power-delay``] on|off|cycle|status [*nodes*]
517

    
518
This command calls out to out-of-band management to change the power
519
state of given node. With ``status`` you get the power status as reported
520
by the out-of-band managment script.
521

    
522
Note that this command will only work if the out-of-band functionality
523
is configured and enabled on the cluster. If this is not the case,
524
please use the **powercycle** command above.
525

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

    
532
Providing ``--ignore-status`` will ignore the offline=N state of a node
533
and continue with power off.
534

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

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

    
543

    
544
HEALTH
545
~~~~~~
546

    
547
**health** [*nodes*]
548

    
549
This command calls out to out-of-band management to ask for the health status
550
of all or given nodes. The health contains the node name and then the items
551
element with their status in a ``item=status`` manner. Where ``item`` is script
552
specific and ``status`` can be one of ``OK``, ``WARNING``, ``CRITICAL`` or
553
``UNKNOWN``. Items with status ``WARNING`` or ``CRITICAL`` are logged and
554
annotated in the command line output.
555

    
556
.. vim: set textwidth=72 :
557
.. Local Variables:
558
.. mode: rst
559
.. fill-column: 72
560
.. End: