Statistics
| Branch: | Tag: | Revision:

root / man / gnt-cluster.rst @ 0a68e0ff

History | View | Annotate | Download (20.2 kB)

1
gnt-cluster(8) Ganeti | Version @GANETI_VERSION@
2
================================================
3

    
4
Name
5
----
6

    
7
gnt-cluster - Ganeti administration, cluster-wide
8

    
9
Synopsis
10
--------
11

    
12
**gnt-cluster** {command} [arguments...]
13

    
14
DESCRIPTION
15
-----------
16

    
17
The **gnt-cluster** is used for cluster-wide administration in the
18
Ganeti system.
19

    
20
COMMANDS
21
--------
22

    
23
ADD-TAGS
24
~~~~~~~~
25

    
26
**add-tags** [--from *file*] {*tag*...}
27

    
28
Add tags to the cluster. If any of the tags contains invalid
29
characters, the entire operation will abort.
30

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

    
37
COMMAND
38
~~~~~~~
39

    
40
**command** [-n *node*] {*command*}
41

    
42
Executes a command on all nodes. If the option ``-n`` is not given,
43
the command will be executed on all nodes, otherwise it will be
44
executed only on the node(s) specified. Use the option multiple
45
times for running it on multiple nodes, like::
46

    
47
    # gnt-cluster command -n node1.example.com -n node2.example.com date
48

    
49
The command is executed serially on the selected nodes. If the
50
master node is present in the list, the command will be executed
51
last on the master. Regarding the other nodes, the execution order
52
is somewhat alphabetic, so that node2.example.com will be earlier
53
than node10.example.com but after node1.example.com.
54

    
55
So given the node names node1, node2, node3, node10, node11, with
56
node3 being the master, the order will be: node1, node2, node10,
57
node11, node3.
58

    
59
The command is constructed by concatenating all other command line
60
arguments. For example, to list the contents of the /etc directory
61
on all nodes, run::
62

    
63
    # gnt-cluster command ls -l /etc
64

    
65
and the command which will be executed will be ``ls -l /etc``.
66

    
67
COPYFILE
68
~~~~~~~~
69

    
70
**copyfile** [--use-replication-network] [-n *node*] {*file*}
71

    
72
Copies a file to all or to some nodes. The argument specifies the
73
source file (on the current system), the ``-n`` argument specifies
74
the target node, or nodes if the option is given multiple times. If
75
``-n`` is not given at all, the file will be copied to all nodes.
76
Passing the ``--use-replication-network`` option will cause the
77
copy to be done over the replication network (only matters if the
78
primary/secondary IPs are different). Example::
79

    
80
    # gnt-cluster -n node1.example.com -n node2.example.com copyfile /tmp/test
81

    
82
This will copy the file /tmp/test from the current node to the two
83
named nodes.
84

    
85
DESTROY
86
~~~~~~~
87

    
88
**destroy** {--yes-do-it}
89

    
90
Remove all configuration files related to the cluster, so that a
91
**gnt-cluster init** can be done again afterwards.
92

    
93
Since this is a dangerous command, you are required to pass the
94
argument *--yes-do-it.*
95

    
96
GETMASTER
97
~~~~~~~~~
98

    
99
**getmaster**
100

    
101
Displays the current master node.
102

    
103
INFO
104
~~~~
105

    
106
**info** [--roman]
107

    
108
Shows runtime cluster information: cluster name, architecture (32
109
or 64 bit), master node, node list and instance list.
110

    
111
Passing the ``--roman`` option gnt-cluster info will try to print
112
its integer fields in a latin friendly way. This allows further
113
diffusion of Ganeti among ancient cultures.
114

    
115
INIT
116
~~~~
117

    
118
| **init**
119
| [{-s|--secondary-ip} *secondary\_ip*]
120
| [--vg-name *vg-name*]
121
| [--master-netdev *interface-name*]
122
| [{-m|--mac-prefix} *mac-prefix*]
123
| [--no-lvm-storage]
124
| [--no-etc-hosts]
125
| [--no-ssh-init]
126
| [--file-storage-dir *dir*]
127
| [--enabled-hypervisors *hypervisors*]
128
| [-t *hypervisor name*]
129
| [{-H|--hypervisor-parameters} *hypervisor*:*hv-param*=*value*[,*hv-param*=*value*...]]
130
| [{-B|--backend-parameters} *be-param*=*value* [,*be-param*=*value*...]]
131
| [{-N|--nic-parameters} *nic-param*=*value* [,*nic-param*=*value*...]]
132
| [--maintain-node-health {yes \| no}]
133
| [--uid-pool *user-id pool definition*]
134
| [{-I|--default-iallocator} *default instance allocator*]
135
| [--primary-ip-version *version*]
136
| [--prealloc-wipe-disks {yes \| no}]
137
| [--node-parameters *ndparams*]
138
| [{-C|--candidate-pool-size} *candidate\_pool\_size*]
139
| {*clustername*}
140

    
141
This commands is only run once initially on the first node of the
142
cluster. It will initialize the cluster configuration, setup the
143
ssh-keys, start the daemons on the master node, etc. in order to have
144
a working one-node cluster.
145

    
146
Note that the *clustername* is not any random name. It has to be
147
resolvable to an IP address using DNS, and it is best if you give the
148
fully-qualified domain name. This hostname must resolve to an IP
149
address reserved exclusively for this purpose, i.e. not already in
150
use.
151

    
152
The cluster can run in two modes: single-home or dual-homed. In the
153
first case, all traffic (both public traffic, inter-node traffic and
154
data replication traffic) goes over the same interface. In the
155
dual-homed case, the data replication traffic goes over the second
156
network. The ``-s (--secondary-ip)`` option here marks the cluster as
157
dual-homed and its parameter represents this node's address on the
158
second network.  If you initialise the cluster with ``-s``, all nodes
159
added must have a secondary IP as well.
160

    
161
Note that for Ganeti it doesn't matter if the secondary network is
162
actually a separate physical network, or is done using tunneling,
163
etc. For performance reasons, it's recommended to use a separate
164
network, of course.
165

    
166
The ``--vg-name`` option will let you specify a volume group
167
different than "xenvg" for Ganeti to use when creating instance
168
disks. This volume group must have the same name on all nodes. Once
169
the cluster is initialized this can be altered by using the
170
**modify** command. If you don't want to use lvm storage at all use
171
the ``--no-lvm-storage`` option. Once the cluster is initialized
172
you can change this setup with the **modify** command.
173

    
174
The ``--master-netdev`` option is useful for specifying a different
175
interface on which the master will activate its IP address. It's
176
important that all nodes have this interface because you'll need it
177
for a master failover.
178

    
179
The ``-m (--mac-prefix)`` option will let you specify a three byte
180
prefix under which the virtual MAC addresses of your instances will be
181
generated. The prefix must be specified in the format ``XX:XX:XX`` and
182
the default is ``aa:00:00``.
183

    
184
The ``--no-lvm-storage`` option allows you to initialize the
185
cluster without lvm support. This means that only instances using
186
files as storage backend will be possible to create. Once the
187
cluster is initialized you can change this setup with the
188
**modify** command.
189

    
190
The ``--no-etc-hosts`` option allows you to initialize the cluster
191
without modifying the /etc/hosts file.
192

    
193
The ``--no-ssh-init`` option allows you to initialize the cluster
194
without creating or distributing SSH key pairs.
195

    
196
The ``--file-storage-dir`` option allows you set the directory to
197
use for storing the instance disk files when using file storage as
198
backend for instance disks.
199

    
200
The ``--prealloc-wipe-disks`` sets a cluster wide configuration
201
value for wiping disks prior to allocation. This increases security
202
on instance level as the instance can't access untouched data from
203
it's underlying storage.
204

    
205
The ``--enabled-hypervisors`` option allows you to set the list of
206
hypervisors that will be enabled for this cluster. Instance
207
hypervisors can only be chosen from the list of enabled
208
hypervisors, and the first entry of this list will be used by
209
default. Currently, the following hypervisors are available:
210

    
211
xen-pvm
212
    Xen PVM hypervisor
213

    
214
xen-hvm
215
    Xen HVM hypervisor
216

    
217
kvm
218
    Linux KVM hypervisor
219

    
220
chroot
221
    a simple chroot manager that starts chroot based on a script at the
222
    root of the filesystem holding the chroot
223

    
224
fake
225
    fake hypervisor for development/testing
226

    
227
Either a single hypervisor name or a comma-separated list of
228
hypervisor names can be specified. If this option is not specified,
229
only the xen-pvm hypervisor is enabled by default.
230

    
231
The ``-H (--hypervisor-parameters)`` option allows you to set default
232
hypervisor specific parameters for the cluster. The format of this
233
option is the name of the hypervisor, followed by a colon and a
234
comma-separated list of key=value pairs. The keys available for each
235
hypervisors are detailed in the gnt-instance(8) man page, in the
236
**add** command plus the following parameters which are only
237
configurable globally (at cluster level):
238

    
239
migration\_port
240
    Valid for the Xen PVM and KVM hypervisors.
241

    
242
    This options specifies the TCP port to use for live-migration. For
243
    Xen, the same port should be configured on all nodes in the
244
    ``/etc/xen/xend-config.sxp`` file, under the key
245
    "xend-relocation-port".
246

    
247
migration\_bandwidth
248
    Valid for the KVM hypervisor.
249

    
250
    This option specifies the maximum bandwidth that KVM will use for
251
    instance live migrations. The value is in MiB/s.
252

    
253
    This option is only effective with kvm versions >= 78 and qemu-kvm
254
    versions >= 0.10.0.
255

    
256
The ``-B (--backend-parameters)`` option allows you to set the default
257
backend parameters for the cluster. The parameter format is a
258
comma-separated list of key=value pairs with the following supported
259
keys:
260

    
261
vcpus
262
    Number of VCPUs to set for an instance by default, must be an
263
    integer, will be set to 1 if no specified.
264

    
265
memory
266
    Amount of memory to allocate for an instance by default, can be
267
    either an integer or an integer followed by a unit (M for mebibytes
268
    and G for gibibytes are supported), will be set to 128M if not
269
    specified.
270

    
271
auto\_balance
272
    Value of the auto\_balance flag for instances to use by default,
273
    will be set to true if not specified.
274

    
275

    
276
The ``-N (--nic-parameters)`` option allows you to set the default nic
277
parameters for the cluster. The parameter format is a comma-separated
278
list of key=value pairs with the following supported keys:
279

    
280
mode
281
    The default nic mode, 'routed' or 'bridged'.
282

    
283
link
284
    In bridged mode the default NIC bridge. In routed mode it
285
    represents an hypervisor-vif-script dependent value to allow
286
    different instance groups. For example under the KVM default
287
    network script it is interpreted as a routing table number or
288
    name.
289

    
290
The option ``--maintain-node-health`` allows to enable/disable
291
automatic maintenance actions on nodes. Currently these include
292
automatic shutdown of instances and deactivation of DRBD devices on
293
offline nodes; in the future it might be extended to automatic
294
removal of unknown LVM volumes, etc.
295

    
296
The ``--uid-pool`` option initializes the user-id pool. The
297
*user-id pool definition* can contain a list of user-ids and/or a
298
list of user-id ranges. The parameter format is a comma-separated
299
list of numeric user-ids or user-id ranges. The ranges are defined
300
by a lower and higher boundary, separated by a dash. The boundaries
301
are inclusive. If the ``--uid-pool`` option is not supplied, the
302
user-id pool is initialized to an empty list. An empty list means
303
that the user-id pool feature is disabled.
304

    
305
The ``-I (--default-iallocator)`` option specifies the default
306
instance allocator. The instance allocator will be used for
307
operations like instance creation, instance and node migration,
308
etc. when no manual override is specified. If this option is not
309
specified, the default instance allocator will be blank, which
310
means that relevant operations will require the administrator to
311
manually specify either an instance allocator, or a set of nodes.
312
The default iallocator can be changed later using the **modify**
313
command.
314

    
315
The ``--primary-ip-version`` option specifies the IP version used
316
for the primary address. Possible values are 4 and 6 for IPv4 and
317
IPv6, respectively. This option is used when resolving node names
318
and the cluster name.
319

    
320
The ``--node-parameters`` option allows you to set default node
321
parameters for the cluster. Please see **ganeti**(7) for more
322
information about supported key=value pairs.
323

    
324
The ``-C (--candidate-pool-size)`` option specifies the
325
``candidate_pool_size`` cluster parameter. This is the number of nodes
326
that the master will try to keep as master\_candidates. For more
327
details about this role and other node roles, see the ganeti(7).
328

    
329
LIST-TAGS
330
~~~~~~~~~
331

    
332
**list-tags**
333

    
334
List the tags of the cluster.
335

    
336
MASTER-FAILOVER
337
~~~~~~~~~~~~~~~
338

    
339
**master-failover** [--no-voting]
340

    
341
Failover the master role to the current node.
342

    
343
The ``--no-voting`` option skips the remote node agreement checks.
344
This is dangerous, but necessary in some cases (for example failing
345
over the master role in a 2 node cluster with the original master
346
down). If the original master then comes up, it won't be able to
347
start its master daemon because it won't have enough votes, but so
348
won't the new master, if the master daemon ever needs a restart.
349
You can pass ``--no-voting`` to **ganeti-masterd** on the new
350
master to solve this problem, and run **gnt-cluster redist-conf**
351
to make sure the cluster is consistent again.
352

    
353
MASTER-PING
354
~~~~~~~~~~~
355

    
356
**master-ping**
357

    
358
Checks if the master daemon is alive.
359

    
360
If the master daemon is alive and can respond to a basic query (the
361
equivalent of **gnt-cluster info**), then the exit code of the
362
command will be 0. If the master daemon is not alive (either due to
363
a crash or because this is not the master node), the exit code will
364
be 1.
365

    
366
MODIFY
367
~~~~~~
368

    
369
| **modify**
370
| [--vg-name *vg-name*]
371
| [--no-lvm-storage]
372
| [--enabled-hypervisors *hypervisors*]
373
| [{-H|--hypervisor-parameters} *hypervisor*:*hv-param*=*value*[,*hv-param*=*value*...]]
374
| [{-B|--backend-parameters} *be-param*=*value* [,*be-param*=*value*...]]
375
| [{-N|--nic-parameters} *nic-param*=*value* [,*nic-param*=*value*...]]
376
| [--uid-pool *user-id pool definition*]
377
| [--add-uids *user-id pool definition*]
378
| [--remove-uids *user-id pool definition*]
379
| [{-C|--candidate-pool-size} *candidate\_pool\_size*]
380
| [--maintain-node-health {yes \| no}]
381
| [--prealloc-wipe-disks {yes \| no}]
382
| [{-I|--default-iallocator} *default instance allocator*]
383
| [--reserved-lvs=*NAMES*]
384
| [--node-parameters *ndparams*]
385
| [--master-netdev *interface-name*]
386

    
387
Modify the options for the cluster.
388

    
389
The ``--vg-name``, ``--no-lvm-storarge``, ``--enabled-hypervisors``,
390
``-H (--hypervisor-parameters)``, ``-B (--backend-parameters)``,
391
``--nic-parameters``, ``-C (--candidate-pool-size)``,
392
``--maintain-node-health``, ``--prealloc-wipe-disks``, ``--uid-pool``,
393
``--node-parameters``, ``--master-netdev`` options are described in
394
the **init** command.
395

    
396
The ``--add-uids`` and ``--remove-uids`` options can be used to
397
modify the user-id pool by adding/removing a list of user-ids or
398
user-id ranges.
399

    
400
The option ``--reserved-lvs`` specifies a list (comma-separated) of
401
logical volume group names (regular expressions) that will be
402
ignored by the cluster verify operation. This is useful if the
403
volume group used for Ganeti is shared with the system for other
404
uses. Note that it's not recommended to create and mark as ignored
405
logical volume names which match Ganeti's own name format (starting
406
with UUID and then .diskN), as this option only skips the
407
verification, but not the actual use of the names given.
408

    
409
To remove all reserved logical volumes, pass in an empty argument
410
to the option, as in ``--reserved-lvs=`` or ``--reserved-lvs ''``.
411

    
412
The ``-I (--default-iallocator)`` is described in the **init**
413
command. To clear the default iallocator, just pass an empty string
414
('').
415

    
416
QUEUE
417
~~~~~
418

    
419
**queue** {drain | undrain | info}
420

    
421
Change job queue properties.
422

    
423
The ``drain`` option sets the drain flag on the job queue. No new
424
jobs will be accepted, but jobs already in the queue will be
425
processed.
426

    
427
The ``undrain`` will unset the drain flag on the job queue. New
428
jobs will be accepted.
429

    
430
The ``info`` option shows the properties of the job queue.
431

    
432
WATCHER
433
~~~~~~~
434

    
435
**watcher** {pause *duration* | continue | info}
436

    
437
Make the watcher pause or let it continue.
438

    
439
The ``pause`` option causes the watcher to pause for *duration*
440
seconds.
441

    
442
The ``continue`` option will let the watcher continue.
443

    
444
The ``info`` option shows whether the watcher is currently paused.
445

    
446
redist-conf
447
~~~~~~~~~~~
448

    
449
**redist-conf** [--submit]
450

    
451
This command forces a full push of configuration files from the
452
master node to the other nodes in the cluster. This is normally not
453
needed, but can be run if the **verify** complains about
454
configuration mismatches.
455

    
456
The ``--submit`` option is used to send the job to the master
457
daemon but not wait for its completion. The job ID will be shown so
458
that it can be examined via **gnt-job info**.
459

    
460
REMOVE-TAGS
461
~~~~~~~~~~~
462

    
463
**remove-tags** [--from *file*] {*tag*...}
464

    
465
Remove tags from the cluster. If any of the tags are not existing
466
on the cluster, the entire operation will abort.
467

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

    
474
RENAME
475
~~~~~~
476

    
477
**rename** [-f] {*name*}
478

    
479
Renames the cluster and in the process updates the master IP
480
address to the one the new name resolves to. At least one of either
481
the name or the IP address must be different, otherwise the
482
operation will be aborted.
483

    
484
Note that since this command can be dangerous (especially when run
485
over SSH), the command will require confirmation unless run with
486
the ``-f`` option.
487

    
488
RENEW-CRYPTO
489
~~~~~~~~~~~~
490

    
491
| **renew-crypto** [-f]
492
| [--new-cluster-certificate] [--new-confd-hmac-key]
493
| [--new-rapi-certificate] [--rapi-certificate *rapi-cert*]
494
| [--new-cluster-domain-secret] [--cluster-domain-secret *filename*]
495

    
496
This command will stop all Ganeti daemons in the cluster and start
497
them again once the new certificates and keys are replicated. The
498
options ``--new-cluster-certificate`` and ``--new-confd-hmac-key``
499
can be used to regenerate the cluster-internal SSL certificate
500
respective the HMAC key used by ganeti-confd(8).
501

    
502
To generate a new self-signed RAPI certificate (used by
503
ganeti-rapi(8)) specify ``--new-rapi-certificate``. If you want to
504
use your own certificate, e.g. one signed by a certificate
505
authority (CA), pass its filename to ``--rapi-certificate``.
506

    
507
``--new-cluster-domain-secret`` generates a new, random cluster
508
domain secret. ``--cluster-domain-secret`` reads the secret from a
509
file. The cluster domain secret is used to sign information
510
exchanged between separate clusters via a third party.
511

    
512
REPAIR-DISK-SIZES
513
~~~~~~~~~~~~~~~~~
514

    
515
**repair-disk-sizes** [instance...]
516

    
517
This command checks that the recorded size of the given instance's
518
disks matches the actual size and updates any mismatches found.
519
This is needed if the Ganeti configuration is no longer consistent
520
with reality, as it will impact some disk operations. If no
521
arguments are given, all instances will be checked.
522

    
523
Note that only active disks can be checked by this command; in case
524
a disk cannot be activated it's advised to use
525
**gnt-instance activate-disks --ignore-size ...** to force
526
activation without regard to the current size.
527

    
528
When the all disk sizes are consistent, the command will return no
529
output. Otherwise it will log details about the inconsistencies in
530
the configuration.
531

    
532
SEARCH-TAGS
533
~~~~~~~~~~~
534

    
535
**search-tags** {*pattern*}
536

    
537
Searches the tags on all objects in the cluster (the cluster
538
itself, the nodes and the instances) for a given pattern. The
539
pattern is interpreted as a regular expression and a search will be
540
done on it (i.e. the given pattern is not anchored to the beggining
541
of the string; if you want that, prefix the pattern with ^).
542

    
543
If no tags are matching the pattern, the exit code of the command
544
will be one. If there is at least one match, the exit code will be
545
zero. Each match is listed on one line, the object and the tag
546
separated by a space. The cluster will be listed as /cluster, a
547
node will be listed as /nodes/*name*, and an instance as
548
/instances/*name*. Example:
549

    
550
::
551

    
552
    # gnt-cluster search-tags time
553
    /cluster ctime:2007-09-01
554
    /nodes/node1.example.com mtime:2007-10-04
555

    
556
VERIFY
557
~~~~~~
558

    
559
**verify** [--no-nplus1-mem]
560

    
561
Verify correctness of cluster configuration. This is safe with
562
respect to running instances, and incurs no downtime of the
563
instances.
564

    
565
If the ``--no-nplus1-mem`` option is given, Ganeti won't check
566
whether if it loses a node it can restart all the instances on
567
their secondaries (and report an error otherwise).
568

    
569
VERIFY-DISKS
570
~~~~~~~~~~~~
571

    
572
**verify-disks**
573

    
574
The command checks which instances have degraded DRBD disks and
575
activates the disks of those instances.
576

    
577
This command is run from the **ganeti-watcher** tool, which also
578
has a different, complementary algorithm for doing this check.
579
Together, these two should ensure that DRBD disks are kept
580
consistent.
581

    
582
VERSION
583
~~~~~~~
584

    
585
**version**
586

    
587
Show the cluster version.