Statistics
| Branch: | Tag: | Revision:

root / man / gnt-node.rst @ 61413377

History | View | Annotate | Download (17.5 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*] [-g *nodegroup*]
27
| [--master-capable=``yes|no``] [--vm-capable=``yes|no``]
28
| [--node-parameters *ndparams*]
29
| {*nodename*}
30

    
31
Adds the given node to the cluster.
32

    
33
This command is used to join a new node to the cluster. You will
34
have to provide the password for root of the node to be able to add
35
the node in the cluster. The command needs to be run on the Ganeti
36
master.
37

    
38
Note that the command is potentially destructive, as it will
39
forcibly join the specified host the cluster, not paying attention
40
to its current status (it could be already in a cluster, etc.)
41

    
42
The ``-s`` is used in dual-home clusters and specifies the new node's
43
IP in the secondary network. See the discussion in **gnt-cluster**(8)
44
for more information.
45

    
46
In case you're readding a node after hardware failure, you can use
47
the ``--readd`` parameter. In this case, you don't need to pass the
48
secondary IP again, it will reused from the cluster. Also, the
49
drained and offline flags of the node will be cleared before
50
re-adding it.
51

    
52
The ``--force-join`` option is to proceed with adding a node even if it already
53
appears to belong to another cluster. This is used during cluster merging, for
54
example.
55

    
56
The ``-g`` is used to add the new node into a specific node group,
57
specified by UUID or name. If only one node group exists you can
58
skip this option, otherwise it's mandatory.
59

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

    
64
Example::
65

    
66
    # gnt-node add node5.example.com
67
    # gnt-node add -s 192.0.2.5 node5.example.com
68
    # gnt-node add -g group2 -s 192.0.2.9 node9.group2.example.com
69

    
70

    
71
ADD-TAGS
72
~~~~~~~~
73

    
74
**add-tags** [--from *file*] {*nodename*} {*tag*...}
75

    
76
Add tags to the given node. If any of the tags contains invalid
77
characters, the entire operation will abort.
78

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

    
85
EVACUATE
86
~~~~~~~~
87

    
88
**evacuate** [-f] [--early-release] [--iallocator *NAME* \|
89
--new-secondary *destination\_node*] {*node*...}
90

    
91
This command will move all secondary instances away from the given
92
node(s). It works only for instances having a drbd disk template.
93

    
94
The new location for the instances can be specified in two ways:
95

    
96
- as a single node for all instances, via the ``--new-secondary``
97
  option
98

    
99
- or via the ``--iallocator`` option, giving a script name as
100
  parameter, so each instance will be in turn placed on the (per the
101
  script) optimal node
102

    
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
Example::
115

    
116
    # gnt-node evacuate -I dumb node3.example.com
117

    
118

    
119
FAILOVER
120
~~~~~~~~
121

    
122
**failover** [-f] [--ignore-consistency] {*node*}
123

    
124
This command will fail over all instances having the given node as
125
primary to their secondary nodes. This works only for instances having
126
a drbd disk template.
127

    
128
Normally the failover will check the consistency of the disks before
129
failing over the instance. If you are trying to migrate instances off
130
a dead node, this will fail. Use the ``--ignore-consistency`` option
131
for this purpose.
132

    
133
Example::
134

    
135
    # gnt-node failover node1.example.com
136

    
137

    
138
INFO
139
~~~~
140

    
141
**info** [*node*...]
142

    
143
Show detailed information about the nodes in the cluster. If you
144
don't give any arguments, all nodes will be shows, otherwise the
145
output will be restricted to the given names.
146

    
147
LIST
148
~~~~
149

    
150
| **list**
151
| [--no-headers] [--separator=*SEPARATOR*]
152
| [--units=*UNITS*] [-o *[+]FIELD,...*]
153
| [node...]
154

    
155
Lists the nodes in the cluster.
156

    
157
The ``--no-headers`` option will skip the initial header line. The
158
``--separator`` option takes an argument which denotes what will be
159
used between the output fields. Both these options are to help
160
scripting.
161

    
162
The units used to display the numeric values in the output varies,
163
depending on the options given. By default, the values will be
164
formatted in the most appropriate unit. If the ``--separator``
165
option is given, then the values are shown in mebibytes to allow
166
parsing by scripts. In both cases, the ``--units`` option can be
167
used to enforce a given output unit.
168

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

    
172
The ``-o`` option takes a comma-separated list of output fields.
173
The available fields and their meaning are:
174

    
175

    
176

    
177
name
178
    the node name
179

    
180
pinst_cnt
181
    the number of instances having this node as primary
182

    
183
pinst_list
184
    the list of instances having this node as primary, comma separated
185

    
186
sinst_cnt
187
    the number of instances having this node as a secondary node
188

    
189
sinst_list
190
    the list of instances having this node as a secondary node, comma
191
    separated
192

    
193
pip
194
    the primary ip of this node (used for cluster communication)
195

    
196
sip
197
    the secondary ip of this node (used for data replication in dual-ip
198
    clusters, see gnt-cluster(8)
199

    
200
dtotal
201
    total disk space in the volume group used for instance disk
202
    allocations
203

    
204
dfree
205
    available disk space in the volume group
206

    
207
mtotal
208
    total memory on the physical node
209

    
210
mnode
211
    the memory used by the node itself
212

    
213
mfree
214
    memory available for instance allocations
215

    
216
bootid
217
    the node bootid value; this is a linux specific feature that
218
    assigns a new UUID to the node at each boot and can be use to
219
    detect node reboots (by tracking changes in this value)
220

    
221
tags
222
    comma-separated list of the node's tags
223

    
224
serial_no
225
    the so called 'serial number' of the node; this is a numeric field
226
    that is incremented each time the node is modified, and it can be
227
    used to detect modifications
228

    
229
ctime
230
    the creation time of the node; note that this field contains spaces
231
    and as such it's harder to parse
232

    
233
    if this attribute is not present (e.g. when upgrading from older
234
    versions), then "N/A" will be shown instead
235

    
236
mtime
237
    the last modification time of the node; note that this field
238
    contains spaces and as such it's harder to parse
239

    
240
    if this attribute is not present (e.g. when upgrading from older
241
    versions), then "N/A" will be shown instead
242

    
243
uuid
244
    Show the UUID of the node (generated automatically by Ganeti)
245

    
246
ctotal
247
    the toal number of logical processors
248

    
249
cnodes
250
    the number of NUMA domains on the node, if the hypervisor can
251
    export this information
252

    
253
csockets
254
    the number of physical CPU sockets, if the hypervisor can export
255
    this information
256

    
257
master_candidate
258
    whether the node is a master candidate or not
259

    
260
drained
261
    whether the node is drained or not; the cluster still communicates
262
    with drained nodes but excludes them from allocation operations
263

    
264
offline
265
    whether the node is offline or not; if offline, the cluster does
266
    not communicate with offline nodes; useful for nodes that are not
267
    reachable in order to avoid delays
268

    
269
role
270
    A condensed version of the node flags; this field will output a
271
    one-character field, with the following possible values:
272

    
273
    - *M* for the master node
274

    
275
    - *C* for a master candidate
276

    
277
    - *R* for a regular node
278

    
279
    - *D* for a drained node
280

    
281
    - *O* for an offline node
282

    
283
master_capable
284
    whether the node can become a master candidate
285

    
286
vm_capable
287
    whether the node can host instances
288

    
289
group
290
    the name of the node's group, if known (the query is done without
291
    locking, so data consistency is not guaranteed)
292

    
293
group.uuid
294
    the UUID of the node's group
295

    
296

    
297
If the value of the option starts with the character ``+``, the new
298
fields will be added to the default list. This allows to quickly
299
see the default list plus a few other fields, instead of retyping
300
the entire list of fields.
301

    
302
Note that some of this fields are known from the configuration of
303
the cluster (e.g. name, pinst, sinst, pip, sip and thus the master
304
does not need to contact the node for this data (making the listing
305
fast if only fields from this set are selected), whereas the other
306
fields are "live" fields and we need to make a query to the cluster
307
nodes.
308

    
309
Depending on the virtualization type and implementation details,
310
the mtotal, mnode and mfree may have slighly varying meanings. For
311
example, some solutions share the node memory with the pool of
312
memory used for instances (KVM), whereas others have separate
313
memory for the node and for the instances (Xen).
314

    
315
If no node names are given, then all nodes are queried. Otherwise,
316
only the given nodes will be listed.
317

    
318

    
319
LIST-FIELDS
320
~~~~~~~~~~~
321

    
322
**list-fields** [field...]
323

    
324
Lists available fields for nodes.
325

    
326

    
327
LIST-TAGS
328
~~~~~~~~~
329

    
330
**list-tags** {*nodename*}
331

    
332
List the tags of the given node.
333

    
334
MIGRATE
335
~~~~~~~
336

    
337
**migrate** [-f] [--non-live] [--migration-mode=live\|non-live]
338
{*node*}
339

    
340
This command will migrate all instances having the given node as
341
primary to their secondary nodes. This works only for instances
342
having a drbd disk template.
343

    
344
As for the **gnt-instance migrate** command, the options
345
``--no-live`` and ``--migration-mode`` can be given to influence
346
the migration type.
347

    
348
Example::
349

    
350
    # gnt-node migrate node1.example.com
351

    
352

    
353
MODIFY
354
~~~~~~
355

    
356
| **modify** [-f] [--submit]
357
| [--master-candidate=``yes|no``] [--drained=``yes|no``] [--offline=``yes|no``]
358
| [--master-capable=``yes|no``] [--vm-capable=``yes|no``] [--auto-promote]
359
| [-s *secondary_ip*]
360
| [--node-parameters *ndparams*]
361
| [--node-powered=``yes|no``]
362
| {*node*}
363

    
364
This command changes the role of the node. Each options takes
365
either a literal yes or no, and only one option should be given as
366
yes. The meaning of the roles and flags are described in the
367
manpage **ganeti**(7).
368

    
369
``--node-powered`` can be used to modify state-of-record if it doesn't reflect
370
the reality anymore.
371

    
372
In case a node is demoted from the master candidate role, the
373
operation will be refused unless you pass the ``--auto-promote``
374
option. This option will cause the operation to lock all cluster nodes
375
(thus it will not be able to run in parallel with most other jobs),
376
but it allows automated maintenance of the cluster candidate pool. If
377
locking all cluster node is too expensive, another option is to
378
promote manually another node to master candidate before demoting the
379
current one.
380

    
381
Example (setting a node offline, which will demote it from master
382
candidate role if is in that role)::
383

    
384
    # gnt-node modify --offline=yes node1.example.com
385

    
386
The ``-s`` can be used to change the node's secondary ip. No drbd
387
instances can be running on the node, while this operation is
388
taking place.
389

    
390
Example (setting the node back to online and master candidate)::
391

    
392
    # gnt-node modify --offline=no --master-candidate=yes node1.example.com
393

    
394

    
395
REMOVE
396
~~~~~~
397

    
398
**remove** {*nodename*}
399

    
400
Removes a node from the cluster. Instances must be removed or
401
migrated to another cluster before.
402

    
403
Example::
404

    
405
    # gnt-node remove node5.example.com
406

    
407

    
408
REMOVE-TAGS
409
~~~~~~~~~~~
410

    
411
**remove-tags** [--from *file*] {*nodename*} {*tag*...}
412

    
413
Remove tags from the given node. If any of the tags are not
414
existing on the node, the entire operation will abort.
415

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

    
422
VOLUMES
423
~~~~~~~
424

    
425
| **volumes** [--no-headers] [--human-readable]
426
| [--separator=*SEPARATOR*] [--output=*FIELDS*]
427
| [*node*...]
428

    
429
Lists all logical volumes and their physical disks from the node(s)
430
provided.
431

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

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

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

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

    
450
phys
451
    the physical drive (on which the LVM physical volume lives)
452

    
453
vg
454
    the volume group name
455

    
456
name
457
    the logical volume name
458

    
459
size
460
    the logical volume size
461

    
462
instance
463
    The name of the instance to which this volume belongs, or (in case
464
    it's an orphan volume) the character "-"
465

    
466

    
467
Example::
468

    
469
    # gnt-node volumes node5.example.com
470
    Node              PhysDev   VG    Name                                 Size Instance
471
    node1.example.com /dev/hdc1 xenvg instance1.example.com-sda_11000.meta 128  instance1.example.com
472
    node1.example.com /dev/hdc1 xenvg instance1.example.com-sda_11001.data 256  instance1.example.com
473

    
474

    
475
LIST-STORAGE
476
~~~~~~~~~~~~
477

    
478
| **list-storage** [--no-headers] [--human-readable]
479
| [--separator=*SEPARATOR*] [--storage-type=*STORAGE\_TYPE*]
480
| [--output=*FIELDS*]
481
| [*node*...]
482

    
483
Lists the available storage units and their details for the given
484
node(s).
485

    
486
The ``--no-headers`` option will skip the initial header line. The
487
``--separator`` option takes an argument which denotes what will be
488
used between the output fields. Both these options are to help
489
scripting.
490

    
491
The units used to display the numeric values in the output varies,
492
depending on the options given. By default, the values will be
493
formatted in the most appropriate unit. If the ``--separator``
494
option is given, then the values are shown in mebibytes to allow
495
parsing by scripts. In both cases, the ``--units`` option can be
496
used to enforce a given output unit.
497

    
498
The ``--storage-type`` option can be used to choose a storage unit
499
type. Possible choices are lvm-pv, lvm-vg or file.
500

    
501
The ``-o`` option takes a comma-separated list of output fields.
502
The available fields and their meaning are:
503

    
504
node
505
    the node name on which the volume exists
506

    
507
type
508
    the type of the storage unit (currently just what is passed in via
509
    ``--storage-type``)
510

    
511
name
512
    the path/identifier of the storage unit
513

    
514
size
515
    total size of the unit; for the file type see a note below
516

    
517
used
518
    used space in the unit; for the file type see a note below
519

    
520
free
521
    available disk space
522

    
523
allocatable
524
    whether we the unit is available for allocation (only lvm-pv can
525
    change this setting, the other types always report true)
526

    
527

    
528
Note that for the "file" type, the total disk space might not equal
529
to the sum of used and free, due to the method Ganeti uses to
530
compute each of them. The total and free values are computed as the
531
total and free space values for the filesystem to which the
532
directory belongs, but the used space is computed from the used
533
space under that directory *only*, which might not be necessarily
534
the root of the filesystem, and as such there could be files
535
outside the file storage directory using disk space and causing a
536
mismatch in the values.
537

    
538
Example::
539

    
540
    node1# gnt-node list-storage node2
541
    Node  Type   Name        Size Used   Free Allocatable
542
    node2 lvm-pv /dev/sda7 673.8G 1.5G 672.3G Y
543
    node2 lvm-pv /dev/sdb1 698.6G   0M 698.6G Y
544

    
545

    
546
MODIFY-STORAGE
547
~~~~~~~~~~~~~~
548

    
549
**modify-storage** [``--allocatable=yes|no``]
550
{*node*} {*storage-type*} {*volume-name*}
551

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

    
555
Example::
556

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

    
559

    
560
REPAIR-STORAGE
561
~~~~~~~~~~~~~~
562

    
563
**repair-storage** [--ignore-consistency] {*node*} {*storage-type*}
564
{*volume-name*}
565

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

    
569
On LVM volume groups, **repair-storage** runs "vgreduce
570
--removemissing".
571

    
572

    
573

    
574
**Caution:** Running this command can lead to data loss. Use it with
575
care.
576

    
577
The ``--ignore-consistency`` option will ignore any inconsistent
578
disks (on the nodes paired with this one). Use of this option is
579
most likely to lead to data-loss.
580

    
581
Example::
582

    
583
    # gnt-node repair-storage node5.example.com lvm-vg xenvg
584

    
585

    
586
POWERCYCLE
587
~~~~~~~~~~
588

    
589
**powercycle** [``--yes``] [``--force``] {*node*}
590

    
591
This commands (tries to) forcefully reboot a node. It is a command
592
that can be used if the node environemnt is broken, such that the
593
admin can no longer login over ssh, but the Ganeti node daemon is
594
still working.
595

    
596
Note that this command is not guaranteed to work; it depends on the
597
hypervisor how effective is the reboot attempt. For Linux, this
598
command require that the kernel option CONFIG\_MAGIC\_SYSRQ is
599
enabled.
600

    
601
The ``--yes`` option can be used to skip confirmation, while the
602
``--force`` option is needed if the target node is the master
603
node.
604

    
605
POWER
606
~~~~~
607

    
608
**power** on|off|cycle|status {*node*}
609

    
610
This commands calls out to out-of-band management to change the power
611
state of given node. With ``status`` you get the power status as reported
612
by the out-of-band managment script.