Statistics
| Branch: | Tag: | Revision:

root / man / gnt-node.rst @ 9fa567b3

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
| [--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
Example::
68

    
69
    # gnt-node add node5.example.com
70
    # gnt-node add -s 192.0.2.5 node5.example.com
71
    # gnt-node add -g group2 -s 192.0.2.9 node9.group2.example.com
72

    
73

    
74
ADD-TAGS
75
~~~~~~~~
76

    
77
**add-tags** [--from *file*] {*nodename*} {*tag*...}
78

    
79
Add tags to the given node. If any of the tags contains invalid
80
characters, the entire operation will abort.
81

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

    
88
EVACUATE
89
~~~~~~~~
90

    
91
**evacuate** [-f] [--early-release] [--iallocator *NAME* \|
92
--new-secondary *destination\_node*]
93
[--primary-only \| --secondary-only] [--early-release] {*node*}
94

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

    
101
The new location for the instances can be specified in two ways:
102

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

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

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

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

    
123
- ``--primary-only`` is equivalent to ``gnt-instance failover/migration``
124
- ``--secondary-only`` is equivalent to ``gnt-instance replace-disks``
125
  in the secondary node change mode (only valid for DRBD instances)
126
- when neither of the above is done a combination of the two cases is run
127

    
128
Example::
129

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

    
132

    
133
FAILOVER
134
~~~~~~~~
135

    
136
**failover** [-f] [--ignore-consistency] {*node*}
137

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

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

    
147
Example::
148

    
149
    # gnt-node failover node1.example.com
150

    
151

    
152
INFO
153
~~~~
154

    
155
**info** [*node*...]
156

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

    
161
LIST
162
~~~~
163

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

    
170
Lists the nodes in the cluster.
171

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

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

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

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

    
190
The ``-o (--output)`` option takes a comma-separated list of output
191
fields. The available fields and their meaning are:
192

    
193
@QUERY_FIELDS_NODE@
194

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

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

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

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

    
218
If no node names are given, then all nodes are queried. Otherwise,
219
only the given nodes will be listed.
220

    
221

    
222
LIST-FIELDS
223
~~~~~~~~~~~
224

    
225
**list-fields** [field...]
226

    
227
Lists available fields for nodes.
228

    
229

    
230
LIST-TAGS
231
~~~~~~~~~
232

    
233
**list-tags** {*nodename*}
234

    
235
List the tags of the given node.
236

    
237
MIGRATE
238
~~~~~~~
239

    
240
**migrate** [-f] [--non-live] [--migration-mode=live\|non-live]
241
[--ignore-ipolicy] {*node*}
242

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

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

    
251
If ``--ignore-ipolicy`` is given any instance policy violations occuring
252
during this operation are ignored.
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
| [--hypervisor-state *hvstate*]
270
| [--disk-state *diskstate*]
271
| {*node*}
272

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

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

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

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

    
293
    # gnt-node modify --offline=yes node1.example.com
294

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

    
299
Example (setting the node back to online and master candidate)::
300

    
301
    # gnt-node modify --offline=no --master-candidate=yes node1.example.com
302

    
303

    
304
REMOVE
305
~~~~~~
306

    
307
**remove** {*nodename*}
308

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

    
312
Example::
313

    
314
    # gnt-node remove node5.example.com
315

    
316

    
317
REMOVE-TAGS
318
~~~~~~~~~~~
319

    
320
**remove-tags** [--from *file*] {*nodename*} {*tag*...}
321

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

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

    
331
VOLUMES
332
~~~~~~~
333

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

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

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

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

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

    
356
node
357
    the node name on which the volume exists
358

    
359
phys
360
    the physical drive (on which the LVM physical volume lives)
361

    
362
vg
363
    the volume group name
364

    
365
name
366
    the logical volume name
367

    
368
size
369
    the logical volume size
370

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

    
375

    
376
Example::
377

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

    
383

    
384
LIST-STORAGE
385
~~~~~~~~~~~~
386

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

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

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

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

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

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

    
413
node
414
    the node name on which the volume exists
415

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

    
420
name
421
    the path/identifier of the storage unit
422

    
423
size
424
    total size of the unit; for the file type see a note below
425

    
426
used
427
    used space in the unit; for the file type see a note below
428

    
429
free
430
    available disk space
431

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

    
436

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

    
447
Example::
448

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

    
454

    
455
MODIFY-STORAGE
456
~~~~~~~~~~~~~~
457

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

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

    
464
Example::
465

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

    
468

    
469
REPAIR-STORAGE
470
~~~~~~~~~~~~~~
471

    
472
**repair-storage** [--ignore-consistency] {*node*} {*storage-type*}
473
{*volume-name*}
474

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

    
478
On LVM volume groups, **repair-storage** runs "vgreduce
479
--removemissing".
480

    
481

    
482

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

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

    
490
Example::
491

    
492
    # gnt-node repair-storage node5.example.com lvm-vg xenvg
493

    
494

    
495
POWERCYCLE
496
~~~~~~~~~~
497

    
498
**powercycle** [``--yes``] [``--force``] {*node*}
499

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

    
505
Note that this command is not guaranteed to work; it depends on the
506
hypervisor how effective is the reboot attempt. For Linux, this
507
command requires the kernel option ``CONFIG_MAGIC_SYSRQ`` to be
508
enabled.
509

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

    
514
POWER
515
~~~~~
516

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

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

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

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

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

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

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

    
545

    
546
HEALTH
547
~~~~~~
548

    
549
**health** [*nodes*]
550

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

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