root / man / gnt-node.rst @ f7b769b1
History | View | Annotate | Download (18 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*] {*node*...} |
91 |
|
92 |
This command will move all secondary instances away from the given |
93 |
node(s). It works only for instances having a drbd disk 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, so each instance will be in turn placed on the (per the |
102 |
script) optimal node |
103 |
|
104 |
|
105 |
The ``--early-release`` changes the code so that the old storage on |
106 |
node being evacuated is removed early (before the resync is |
107 |
completed) and the internal Ganeti locks are also released for both |
108 |
the current secondary and the new secondary, thus allowing more |
109 |
parallelism in the cluster operation. This should be used only when |
110 |
recovering from a disk failure on the current secondary (thus the |
111 |
old storage is already broken) or when the storage on the primary |
112 |
node is known to be fine (thus we won't need the old storage for |
113 |
potential recovery). |
114 |
|
115 |
Example:: |
116 |
|
117 |
# gnt-node evacuate -I hail node3.example.com |
118 |
|
119 |
|
120 |
FAILOVER |
121 |
~~~~~~~~ |
122 |
|
123 |
**failover** [-f] [--ignore-consistency] {*node*} |
124 |
|
125 |
This command will fail over all instances having the given node as |
126 |
primary to their secondary nodes. This works only for instances having |
127 |
a drbd disk template. |
128 |
|
129 |
Normally the failover will check the consistency of the disks before |
130 |
failing over the instance. If you are trying to migrate instances off |
131 |
a dead node, this will fail. Use the ``--ignore-consistency`` option |
132 |
for this purpose. |
133 |
|
134 |
Example:: |
135 |
|
136 |
# gnt-node failover node1.example.com |
137 |
|
138 |
|
139 |
INFO |
140 |
~~~~ |
141 |
|
142 |
**info** [*node*...] |
143 |
|
144 |
Show detailed information about the nodes in the cluster. If you |
145 |
don't give any arguments, all nodes will be shows, otherwise the |
146 |
output will be restricted to the given names. |
147 |
|
148 |
LIST |
149 |
~~~~ |
150 |
|
151 |
| **list** |
152 |
| [--no-headers] [--separator=*SEPARATOR*] |
153 |
| [--units=*UNITS*] [-v] [{-o|--output} *[+]FIELD,...*] |
154 |
| [node...] |
155 |
|
156 |
Lists the nodes in the cluster. |
157 |
|
158 |
The ``--no-headers`` option will skip the initial header line. The |
159 |
``--separator`` option takes an argument which denotes what will be |
160 |
used between the output fields. Both these options are to help |
161 |
scripting. |
162 |
|
163 |
The units used to display the numeric values in the output varies, |
164 |
depending on the options given. By default, the values will be |
165 |
formatted in the most appropriate unit. If the ``--separator`` |
166 |
option is given, then the values are shown in mebibytes to allow |
167 |
parsing by scripts. In both cases, the ``--units`` option can be |
168 |
used to enforce a given output unit. |
169 |
|
170 |
Queries of nodes will be done in parallel with any running jobs. This might |
171 |
give inconsistent results for the free disk/memory. |
172 |
|
173 |
The ``-v`` option activates verbose mode, which changes the display of |
174 |
special field states (see **ganeti(7)**). |
175 |
|
176 |
The ``-o (--output)`` option takes a comma-separated list of output |
177 |
fields. The available fields and their meaning are: |
178 |
|
179 |
|
180 |
name |
181 |
the node name |
182 |
|
183 |
pinst_cnt |
184 |
the number of instances having this node as primary |
185 |
|
186 |
pinst_list |
187 |
the list of instances having this node as primary, comma separated |
188 |
|
189 |
sinst_cnt |
190 |
the number of instances having this node as a secondary node |
191 |
|
192 |
sinst_list |
193 |
the list of instances having this node as a secondary node, comma |
194 |
separated |
195 |
|
196 |
pip |
197 |
the primary ip of this node (used for cluster communication) |
198 |
|
199 |
sip |
200 |
the secondary ip of this node (used for data replication in dual-ip |
201 |
clusters, see gnt-cluster(8) |
202 |
|
203 |
dtotal |
204 |
total disk space in the volume group used for instance disk |
205 |
allocations |
206 |
|
207 |
dfree |
208 |
available disk space in the volume group |
209 |
|
210 |
mtotal |
211 |
total memory on the physical node |
212 |
|
213 |
mnode |
214 |
the memory used by the node itself |
215 |
|
216 |
mfree |
217 |
memory available for instance allocations |
218 |
|
219 |
bootid |
220 |
the node bootid value; this is a linux specific feature that |
221 |
assigns a new UUID to the node at each boot and can be use to |
222 |
detect node reboots (by tracking changes in this value) |
223 |
|
224 |
tags |
225 |
comma-separated list of the node's tags |
226 |
|
227 |
serial_no |
228 |
the so called 'serial number' of the node; this is a numeric field |
229 |
that is incremented each time the node is modified, and it can be |
230 |
used to detect modifications |
231 |
|
232 |
ctime |
233 |
the creation time of the node; note that this field contains spaces |
234 |
and as such it's harder to parse |
235 |
|
236 |
if this attribute is not present (e.g. when upgrading from older |
237 |
versions), then "N/A" will be shown instead |
238 |
|
239 |
mtime |
240 |
the last modification time of the node; note that this field |
241 |
contains spaces and as such it's harder to parse |
242 |
|
243 |
if this attribute is not present (e.g. when upgrading from older |
244 |
versions), then "N/A" will be shown instead |
245 |
|
246 |
uuid |
247 |
Show the UUID of the node (generated automatically by Ganeti) |
248 |
|
249 |
ctotal |
250 |
the toal number of logical processors |
251 |
|
252 |
cnodes |
253 |
the number of NUMA domains on the node, if the hypervisor can |
254 |
export this information |
255 |
|
256 |
csockets |
257 |
the number of physical CPU sockets, if the hypervisor can export |
258 |
this information |
259 |
|
260 |
master_candidate |
261 |
whether the node is a master candidate or not |
262 |
|
263 |
drained |
264 |
whether the node is drained or not; the cluster still communicates |
265 |
with drained nodes but excludes them from allocation operations |
266 |
|
267 |
offline |
268 |
whether the node is offline or not; if offline, the cluster does |
269 |
not communicate with offline nodes; useful for nodes that are not |
270 |
reachable in order to avoid delays |
271 |
|
272 |
role |
273 |
A condensed version of the node flags; this field will output a |
274 |
one-character field, with the following possible values: |
275 |
|
276 |
- *M* for the master node |
277 |
|
278 |
- *C* for a master candidate |
279 |
|
280 |
- *R* for a regular node |
281 |
|
282 |
- *D* for a drained node |
283 |
|
284 |
- *O* for an offline node |
285 |
|
286 |
master_capable |
287 |
whether the node can become a master candidate |
288 |
|
289 |
vm_capable |
290 |
whether the node can host instances |
291 |
|
292 |
group |
293 |
the name of the node's group, if known (the query is done without |
294 |
locking, so data consistency is not guaranteed) |
295 |
|
296 |
group.uuid |
297 |
the UUID of the node's group |
298 |
|
299 |
|
300 |
If the value of the option starts with the character ``+``, the new |
301 |
fields will be added to the default list. This allows one to quickly |
302 |
see the default list plus a few other fields, instead of retyping |
303 |
the entire list of fields. |
304 |
|
305 |
Note that some of this fields are known from the configuration of |
306 |
the cluster (e.g. name, pinst, sinst, pip, sip and thus the master |
307 |
does not need to contact the node for this data (making the listing |
308 |
fast if only fields from this set are selected), whereas the other |
309 |
fields are "live" fields and we need to make a query to the cluster |
310 |
nodes. |
311 |
|
312 |
Depending on the virtualization type and implementation details, |
313 |
the mtotal, mnode and mfree may have slighly varying meanings. For |
314 |
example, some solutions share the node memory with the pool of |
315 |
memory used for instances (KVM), whereas others have separate |
316 |
memory for the node and for the instances (Xen). |
317 |
|
318 |
If no node names are given, then all nodes are queried. Otherwise, |
319 |
only the given nodes will be listed. |
320 |
|
321 |
|
322 |
LIST-FIELDS |
323 |
~~~~~~~~~~~ |
324 |
|
325 |
**list-fields** [field...] |
326 |
|
327 |
Lists available fields for nodes. |
328 |
|
329 |
|
330 |
LIST-TAGS |
331 |
~~~~~~~~~ |
332 |
|
333 |
**list-tags** {*nodename*} |
334 |
|
335 |
List the tags of the given node. |
336 |
|
337 |
MIGRATE |
338 |
~~~~~~~ |
339 |
|
340 |
**migrate** [-f] [--non-live] [--migration-mode=live\|non-live] |
341 |
{*node*} |
342 |
|
343 |
This command will migrate all instances having the given node as |
344 |
primary to their secondary nodes. This works only for instances |
345 |
having a drbd disk template. |
346 |
|
347 |
As for the **gnt-instance migrate** command, the options |
348 |
``--no-live`` and ``--migration-mode`` can be given to influence |
349 |
the migration type. |
350 |
|
351 |
Example:: |
352 |
|
353 |
# gnt-node migrate node1.example.com |
354 |
|
355 |
|
356 |
MODIFY |
357 |
~~~~~~ |
358 |
|
359 |
| **modify** [-f] [--submit] |
360 |
| [{-C|--master-candidate} ``yes|no``] |
361 |
| [{-D|--drained} ``yes|no``] [{-O|--offline} ``yes|no``] |
362 |
| [--master-capable=``yes|no``] [--vm-capable=``yes|no``] [--auto-promote] |
363 |
| [{-s|--secondary-ip} *secondary_ip*] |
364 |
| [--node-parameters *ndparams*] |
365 |
| [--node-powered=``yes|no``] |
366 |
| {*node*} |
367 |
|
368 |
This command changes the role of the node. Each options takes |
369 |
either a literal yes or no, and only one option should be given as |
370 |
yes. The meaning of the roles and flags are described in the |
371 |
manpage **ganeti**(7). |
372 |
|
373 |
The option ``--node-powered`` can be used to modify state-of-record if |
374 |
it doesn't reflect the reality anymore. |
375 |
|
376 |
In case a node is demoted from the master candidate role, the |
377 |
operation will be refused unless you pass the ``--auto-promote`` |
378 |
option. This option will cause the operation to lock all cluster nodes |
379 |
(thus it will not be able to run in parallel with most other jobs), |
380 |
but it allows automated maintenance of the cluster candidate pool. If |
381 |
locking all cluster node is too expensive, another option is to |
382 |
promote manually another node to master candidate before demoting the |
383 |
current one. |
384 |
|
385 |
Example (setting a node offline, which will demote it from master |
386 |
candidate role if is in that role):: |
387 |
|
388 |
# gnt-node modify --offline=yes node1.example.com |
389 |
|
390 |
The ``-s (--secondary-ip)`` option can be used to change the node's |
391 |
secondary ip. No drbd instances can be running on the node, while this |
392 |
operation is taking place. |
393 |
|
394 |
Example (setting the node back to online and master candidate):: |
395 |
|
396 |
# gnt-node modify --offline=no --master-candidate=yes node1.example.com |
397 |
|
398 |
|
399 |
REMOVE |
400 |
~~~~~~ |
401 |
|
402 |
**remove** {*nodename*} |
403 |
|
404 |
Removes a node from the cluster. Instances must be removed or |
405 |
migrated to another cluster before. |
406 |
|
407 |
Example:: |
408 |
|
409 |
# gnt-node remove node5.example.com |
410 |
|
411 |
|
412 |
REMOVE-TAGS |
413 |
~~~~~~~~~~~ |
414 |
|
415 |
**remove-tags** [--from *file*] {*nodename*} {*tag*...} |
416 |
|
417 |
Remove tags from the given node. If any of the tags are not |
418 |
existing on the node, the entire operation will abort. |
419 |
|
420 |
If the ``--from`` option is given, the list of tags to be removed will |
421 |
be extended with the contents of that file (each line becomes a tag). |
422 |
In this case, there is not need to pass tags on the command line (if |
423 |
you do, tags from both sources will be removed). A file name of - will |
424 |
be interpreted as stdin. |
425 |
|
426 |
VOLUMES |
427 |
~~~~~~~ |
428 |
|
429 |
| **volumes** [--no-headers] [--human-readable] |
430 |
| [--separator=*SEPARATOR*] [{-o|--output} *FIELDS*] |
431 |
| [*node*...] |
432 |
|
433 |
Lists all logical volumes and their physical disks from the node(s) |
434 |
provided. |
435 |
|
436 |
The ``--no-headers`` option will skip the initial header line. The |
437 |
``--separator`` option takes an argument which denotes what will be |
438 |
used between the output fields. Both these options are to help |
439 |
scripting. |
440 |
|
441 |
The units used to display the numeric values in the output varies, |
442 |
depending on the options given. By default, the values will be |
443 |
formatted in the most appropriate unit. If the ``--separator`` |
444 |
option is given, then the values are shown in mebibytes to allow |
445 |
parsing by scripts. In both cases, the ``--units`` option can be |
446 |
used to enforce a given output unit. |
447 |
|
448 |
The ``-o (--output)`` option takes a comma-separated list of output |
449 |
fields. The available fields and their meaning are: |
450 |
|
451 |
node |
452 |
the node name on which the volume exists |
453 |
|
454 |
phys |
455 |
the physical drive (on which the LVM physical volume lives) |
456 |
|
457 |
vg |
458 |
the volume group name |
459 |
|
460 |
name |
461 |
the logical volume name |
462 |
|
463 |
size |
464 |
the logical volume size |
465 |
|
466 |
instance |
467 |
The name of the instance to which this volume belongs, or (in case |
468 |
it's an orphan volume) the character "-" |
469 |
|
470 |
|
471 |
Example:: |
472 |
|
473 |
# gnt-node volumes node5.example.com |
474 |
Node PhysDev VG Name Size Instance |
475 |
node1.example.com /dev/hdc1 xenvg instance1.example.com-sda_11000.meta 128 instance1.example.com |
476 |
node1.example.com /dev/hdc1 xenvg instance1.example.com-sda_11001.data 256 instance1.example.com |
477 |
|
478 |
|
479 |
LIST-STORAGE |
480 |
~~~~~~~~~~~~ |
481 |
|
482 |
| **list-storage** [--no-headers] [--human-readable] |
483 |
| [--separator=*SEPARATOR*] [--storage-type=*STORAGE\_TYPE*] |
484 |
| [{-o|--output} *FIELDS*] |
485 |
| [*node*...] |
486 |
|
487 |
Lists the available storage units and their details for the given |
488 |
node(s). |
489 |
|
490 |
The ``--no-headers`` option will skip the initial header line. The |
491 |
``--separator`` option takes an argument which denotes what will be |
492 |
used between the output fields. Both these options are to help |
493 |
scripting. |
494 |
|
495 |
The units used to display the numeric values in the output varies, |
496 |
depending on the options given. By default, the values will be |
497 |
formatted in the most appropriate unit. If the ``--separator`` |
498 |
option is given, then the values are shown in mebibytes to allow |
499 |
parsing by scripts. In both cases, the ``--units`` option can be |
500 |
used to enforce a given output unit. |
501 |
|
502 |
The ``--storage-type`` option can be used to choose a storage unit |
503 |
type. Possible choices are lvm-pv, lvm-vg or file. |
504 |
|
505 |
The ``-o (--output)`` option takes a comma-separated list of output |
506 |
fields. The available fields and their meaning are: |
507 |
|
508 |
node |
509 |
the node name on which the volume exists |
510 |
|
511 |
type |
512 |
the type of the storage unit (currently just what is passed in via |
513 |
``--storage-type``) |
514 |
|
515 |
name |
516 |
the path/identifier of the storage unit |
517 |
|
518 |
size |
519 |
total size of the unit; for the file type see a note below |
520 |
|
521 |
used |
522 |
used space in the unit; for the file type see a note below |
523 |
|
524 |
free |
525 |
available disk space |
526 |
|
527 |
allocatable |
528 |
whether we the unit is available for allocation (only lvm-pv can |
529 |
change this setting, the other types always report true) |
530 |
|
531 |
|
532 |
Note that for the "file" type, the total disk space might not equal |
533 |
to the sum of used and free, due to the method Ganeti uses to |
534 |
compute each of them. The total and free values are computed as the |
535 |
total and free space values for the filesystem to which the |
536 |
directory belongs, but the used space is computed from the used |
537 |
space under that directory *only*, which might not be necessarily |
538 |
the root of the filesystem, and as such there could be files |
539 |
outside the file storage directory using disk space and causing a |
540 |
mismatch in the values. |
541 |
|
542 |
Example:: |
543 |
|
544 |
node1# gnt-node list-storage node2 |
545 |
Node Type Name Size Used Free Allocatable |
546 |
node2 lvm-pv /dev/sda7 673.8G 1.5G 672.3G Y |
547 |
node2 lvm-pv /dev/sdb1 698.6G 0M 698.6G Y |
548 |
|
549 |
|
550 |
MODIFY-STORAGE |
551 |
~~~~~~~~~~~~~~ |
552 |
|
553 |
**modify-storage** [``--allocatable=yes|no``] |
554 |
{*node*} {*storage-type*} {*volume-name*} |
555 |
|
556 |
Modifies storage volumes on a node. Only LVM physical volumes can |
557 |
be modified at the moment. They have a storage type of "lvm-pv". |
558 |
|
559 |
Example:: |
560 |
|
561 |
# gnt-node modify-storage --allocatable no node5.example.com lvm-pv /dev/sdb1 |
562 |
|
563 |
|
564 |
REPAIR-STORAGE |
565 |
~~~~~~~~~~~~~~ |
566 |
|
567 |
**repair-storage** [--ignore-consistency] {*node*} {*storage-type*} |
568 |
{*volume-name*} |
569 |
|
570 |
Repairs a storage volume on a node. Only LVM volume groups can be |
571 |
repaired at this time. They have the storage type "lvm-vg". |
572 |
|
573 |
On LVM volume groups, **repair-storage** runs "vgreduce |
574 |
--removemissing". |
575 |
|
576 |
|
577 |
|
578 |
**Caution:** Running this command can lead to data loss. Use it with |
579 |
care. |
580 |
|
581 |
The ``--ignore-consistency`` option will ignore any inconsistent |
582 |
disks (on the nodes paired with this one). Use of this option is |
583 |
most likely to lead to data-loss. |
584 |
|
585 |
Example:: |
586 |
|
587 |
# gnt-node repair-storage node5.example.com lvm-vg xenvg |
588 |
|
589 |
|
590 |
POWERCYCLE |
591 |
~~~~~~~~~~ |
592 |
|
593 |
**powercycle** [``--yes``] [``--force``] {*node*} |
594 |
|
595 |
This commands (tries to) forcefully reboot a node. It is a command |
596 |
that can be used if the node environemnt is broken, such that the |
597 |
admin can no longer login over ssh, but the Ganeti node daemon is |
598 |
still working. |
599 |
|
600 |
Note that this command is not guaranteed to work; it depends on the |
601 |
hypervisor how effective is the reboot attempt. For Linux, this |
602 |
command require that the kernel option CONFIG\_MAGIC\_SYSRQ is |
603 |
enabled. |
604 |
|
605 |
The ``--yes`` option can be used to skip confirmation, while the |
606 |
``--force`` option is needed if the target node is the master |
607 |
node. |
608 |
|
609 |
POWER |
610 |
~~~~~ |
611 |
|
612 |
**power** on|off|cycle|status {*node*} |
613 |
|
614 |
This commands calls out to out-of-band management to change the power |
615 |
state of given node. With ``status`` you get the power status as reported |
616 |
by the out-of-band managment script. |
617 |
|
618 |
Note that this command will only work if the out-of-band functionality |
619 |
is configured and enabled on the cluster. If this is not the case, |
620 |
please use the **powercycle** command above. |