Statistics
| Branch: | Tag: | Revision:

root / man / gnt-cluster.rst @ d3e6fd0e

History | View | Annotate | Download (35.7 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
ACTIVATE-MASTER-IP
24
~~~~~~~~~~~~~~~~~~
25

    
26
**activate-master-ip**
27

    
28
Activates the master IP on the master node.
29

    
30
COMMAND
31
~~~~~~~
32

    
33
**command** [-n *node*] [-g *group*] [-M] {*command*}
34

    
35
Executes a command on all nodes. This command is designed for simple
36
usage. For more complex use cases the commands **dsh**\(1) or **cssh**\(1)
37
should be used instead.
38

    
39
If the option ``-n`` is not given, the command will be executed on all
40
nodes, otherwise it will be executed only on the node(s) specified. Use
41
the option multiple times for running it on multiple nodes, like::
42

    
43
    # gnt-cluster command -n node1.example.com -n node2.example.com date
44

    
45
The ``-g`` option can be used to run a command only on a specific node
46
group, e.g.::
47

    
48
    # gnt-cluster command -g default date
49

    
50
The ``-M`` option can be used to prepend the node name to all output
51
lines. The ``--failure-only`` option hides successful commands, making
52
it easier to see failures.
53

    
54
The command is executed serially on the selected nodes. If the
55
master node is present in the list, the command will be executed
56
last on the master. Regarding the other nodes, the execution order
57
is somewhat alphabetic, so that node2.example.com will be earlier
58
than node10.example.com but after node1.example.com.
59

    
60
So given the node names node1, node2, node3, node10, node11, with
61
node3 being the master, the order will be: node1, node2, node10,
62
node11, node3.
63

    
64
The command is constructed by concatenating all other command line
65
arguments. For example, to list the contents of the /etc directory
66
on all nodes, run::
67

    
68
    # gnt-cluster command ls -l /etc
69

    
70
and the command which will be executed will be ``ls -l /etc``.
71

    
72
COPYFILE
73
~~~~~~~~
74

    
75
| **copyfile** [\--use-replication-network] [-n *node*] [-g *group*]
76
| {*file*}
77

    
78
Copies a file to all or to some nodes. The argument specifies the
79
source file (on the current system), the ``-n`` argument specifies
80
the target node, or nodes if the option is given multiple times. If
81
``-n`` is not given at all, the file will be copied to all nodes. The
82
``-g`` option can be used to only select nodes in a specific node group.
83
Passing the ``--use-replication-network`` option will cause the
84
copy to be done over the replication network (only matters if the
85
primary/secondary IPs are different). Example::
86

    
87
    # gnt-cluster -n node1.example.com -n node2.example.com copyfile /tmp/test
88

    
89
This will copy the file /tmp/test from the current node to the two
90
named nodes.
91

    
92
DEACTIVATE-MASTER-IP
93
~~~~~~~~~~~~~~~~~~~~
94

    
95
**deactivate-master-ip** [\--yes]
96

    
97
Deactivates the master IP on the master node.
98

    
99
This should be run only locally or on a connection to the node ip
100
directly, as a connection to the master ip will be broken by this
101
operation. Because of this risk it will require user confirmation
102
unless the ``--yes`` option is passed.
103

    
104
DESTROY
105
~~~~~~~
106

    
107
**destroy** {\--yes-do-it}
108

    
109
Remove all configuration files related to the cluster, so that a
110
**gnt-cluster init** can be done again afterwards.
111

    
112
Since this is a dangerous command, you are required to pass the
113
argument *\--yes-do-it.*
114

    
115
EPO
116
~~~
117

    
118
**epo** [\--on] [\--groups|\--all] [\--power-delay] *arguments*
119

    
120
Performs an emergency power-off on nodes given as arguments. If
121
``--groups`` is given, arguments are node groups. If ``--all`` is
122
provided, the whole cluster will be shut down.
123

    
124
The ``--on`` flag recovers the cluster after an emergency power-off.
125
When powering on the cluster you can use ``--power-delay`` to define the
126
time in seconds (fractions allowed) waited between powering on
127
individual nodes.
128

    
129
Please note that the master node will not be turned down or up
130
automatically.  It will just be left in a state, where you can manully
131
perform the shutdown of that one node. If the master is in the list of
132
affected nodes and this is not a complete cluster emergency power-off
133
(e.g. using ``--all``), you're required to do a master failover to
134
another node not affected.
135

    
136
GETMASTER
137
~~~~~~~~~
138

    
139
**getmaster**
140

    
141
Displays the current master node.
142

    
143
INFO
144
~~~~
145

    
146
**info** [\--roman]
147

    
148
Shows runtime cluster information: cluster name, architecture (32
149
or 64 bit), master node, node list and instance list.
150

    
151
Passing the ``--roman`` option gnt-cluster info will try to print
152
its integer fields in a latin friendly way. This allows further
153
diffusion of Ganeti among ancient cultures.
154

    
155
SHOW-ISPECS-CMD
156
~~~~~~~~~~~~~~~
157

    
158
**show-ispecs-cmd**
159

    
160
Shows the command line that can be used to recreate the cluster with the
161
same options relative to specs in the instance policies.
162

    
163
INIT
164
~~~~
165

    
166
| **init**
167
| [{-s|\--secondary-ip} *secondary\_ip*]
168
| [\--vg-name *vg-name*]
169
| [\--master-netdev *interface-name*]
170
| [\--master-netmask *netmask*]
171
| [\--use-external-mip-script {yes \| no}]
172
| [{-m|\--mac-prefix} *mac-prefix*]
173
| [\--no-etc-hosts]
174
| [\--no-ssh-init]
175
| [\--file-storage-dir *dir*]
176
| [\--shared-file-storage-dir *dir*]
177
| [\--gluster-storage-dir *dir*]
178
| [\--enabled-hypervisors *hypervisors*]
179
| [{-H|\--hypervisor-parameters} *hypervisor*:*hv-param*=*value*[,*hv-param*=*value*...]]
180
| [{-B|\--backend-parameters} *be-param*=*value*[,*be-param*=*value*...]]
181
| [{-N|\--nic-parameters} *nic-param*=*value*[,*nic-param*=*value*...]]
182
| [{-D|\--disk-parameters} *disk-template*:*disk-param*=*value*[,*disk-param*=*value*...]]
183
| [\--maintain-node-health {yes \| no}]
184
| [\--uid-pool *user-id pool definition*]
185
| [{-I|\--default-iallocator} *default instance allocator*]
186
| [\--default-iallocator-params *ial-param*=*value*,*ial-param*=*value*]
187
| [\--primary-ip-version *version*]
188
| [\--prealloc-wipe-disks {yes \| no}]
189
| [\--node-parameters *ndparams*]
190
| [{-C|\--candidate-pool-size} *candidate\_pool\_size*]
191
| [\--specs-cpu-count *spec-param*=*value* [,*spec-param*=*value*...]]
192
| [\--specs-disk-count *spec-param*=*value* [,*spec-param*=*value*...]]
193
| [\--specs-disk-size *spec-param*=*value* [,*spec-param*=*value*...]]
194
| [\--specs-mem-size *spec-param*=*value* [,*spec-param*=*value*...]]
195
| [\--specs-nic-count *spec-param*=*value* [,*spec-param*=*value*...]]
196
| [\--ipolicy-std-specs *spec*=*value* [,*spec*=*value*...]]
197
| [\--ipolicy-bounds-specs *bounds_ispecs*]
198
| [\--ipolicy-disk-templates *template* [,*template*...]]
199
| [\--ipolicy-spindle-ratio *ratio*]
200
| [\--ipolicy-vcpu-ratio *ratio*]
201
| [\--disk-state *diskstate*]
202
| [\--hypervisor-state *hvstate*]
203
| [\--drbd-usermode-helper *helper*]
204
| [\--enabled-disk-templates *template* [,*template*...]]
205
| {*clustername*}
206

    
207
This commands is only run once initially on the first node of the
208
cluster. It will initialize the cluster configuration, setup the
209
ssh-keys, start the daemons on the master node, etc. in order to have
210
a working one-node cluster.
211

    
212
Note that the *clustername* is not any random name. It has to be
213
resolvable to an IP address using DNS, and it is best if you give the
214
fully-qualified domain name. This hostname must resolve to an IP
215
address reserved exclusively for this purpose, i.e. not already in
216
use.
217

    
218
The cluster can run in two modes: single-home or dual-homed. In the
219
first case, all traffic (both public traffic, inter-node traffic and
220
data replication traffic) goes over the same interface. In the
221
dual-homed case, the data replication traffic goes over the second
222
network. The ``-s (--secondary-ip)`` option here marks the cluster as
223
dual-homed and its parameter represents this node's address on the
224
second network.  If you initialise the cluster with ``-s``, all nodes
225
added must have a secondary IP as well.
226

    
227
Note that for Ganeti it doesn't matter if the secondary network is
228
actually a separate physical network, or is done using tunneling,
229
etc. For performance reasons, it's recommended to use a separate
230
network, of course.
231

    
232
The ``--vg-name`` option will let you specify a volume group
233
different than "xenvg" for Ganeti to use when creating instance
234
disks. This volume group must have the same name on all nodes. Once
235
the cluster is initialized this can be altered by using the
236
**modify** command. Note that if the volume group name is modified after
237
the cluster creation and DRBD support is enabled you might have to
238
manually modify the metavg as well.
239

    
240
If you don't want to use lvm storage at all use
241
the ``--enabled-disk-templates`` option to restrict the set of enabled
242
disk templates. Once the cluster is initialized
243
you can change this setup with the **modify** command.
244

    
245
The ``--master-netdev`` option is useful for specifying a different
246
interface on which the master will activate its IP address. It's
247
important that all nodes have this interface because you'll need it
248
for a master failover.
249

    
250
The ``--master-netmask`` option allows to specify a netmask for the
251
master IP. The netmask must be specified as an integer, and will be
252
interpreted as a CIDR netmask. The default value is 32 for an IPv4
253
address and 128 for an IPv6 address.
254

    
255
The ``--use-external-mip-script`` option allows to specify whether to
256
use an user-supplied master IP address setup script, whose location is
257
``@SYSCONFDIR@/ganeti/scripts/master-ip-setup``. If the option value is
258
set to False, the default script (located at
259
``@PKGLIBDIR@/tools/master-ip-setup``) will be executed.
260

    
261
The ``-m (--mac-prefix)`` option will let you specify a three byte
262
prefix under which the virtual MAC addresses of your instances will be
263
generated. The prefix must be specified in the format ``XX:XX:XX`` and
264
the default is ``aa:00:00``.
265

    
266
The ``--no-etc-hosts`` option allows you to initialize the cluster
267
without modifying the /etc/hosts file.
268

    
269
The ``--no-ssh-init`` option allows you to initialize the cluster
270
without creating or distributing SSH key pairs.
271

    
272
The ``--file-storage-dir``, ``--shared-file-storage-dir`` and
273
``--gluster-storage-dir`` options allow you set the directory to use for
274
storing the instance disk files when using respectively the file storage
275
backend, the shared file storage backend and the gluster storage
276
backend. Note that these directories must be an allowed directory for
277
file storage. Those directories are specified in the
278
``@SYSCONFDIR@/ganeti/file-storage-paths`` file.
279
The file storage directory can also be a subdirectory of an allowed one.
280
The file storage directory should be present on all nodes.
281

    
282
The ``--prealloc-wipe-disks`` sets a cluster wide configuration value
283
for wiping disks prior to allocation and size changes (``gnt-instance
284
grow-disk``). This increases security on instance level as the instance
285
can't access untouched data from its underlying storage.
286

    
287
The ``--enabled-hypervisors`` option allows you to set the list of
288
hypervisors that will be enabled for this cluster. Instance
289
hypervisors can only be chosen from the list of enabled
290
hypervisors, and the first entry of this list will be used by
291
default. Currently, the following hypervisors are available:
292

    
293
xen-pvm
294
    Xen PVM hypervisor
295

    
296
xen-hvm
297
    Xen HVM hypervisor
298

    
299
kvm
300
    Linux KVM hypervisor
301

    
302
chroot
303
    a simple chroot manager that starts chroot based on a script at the
304
    root of the filesystem holding the chroot
305

    
306
fake
307
    fake hypervisor for development/testing
308

    
309
Either a single hypervisor name or a comma-separated list of
310
hypervisor names can be specified. If this option is not specified,
311
only the xen-pvm hypervisor is enabled by default.
312

    
313
The ``-H (--hypervisor-parameters)`` option allows you to set default
314
hypervisor specific parameters for the cluster. The format of this
315
option is the name of the hypervisor, followed by a colon and a
316
comma-separated list of key=value pairs. The keys available for each
317
hypervisors are detailed in the **gnt-instance**\(8) man page, in the
318
**add** command plus the following parameters which are only
319
configurable globally (at cluster level):
320

    
321
migration\_port
322
    Valid for the Xen PVM and KVM hypervisors.
323

    
324
    This options specifies the TCP port to use for live-migration. For
325
    Xen, the same port should be configured on all nodes in the
326
    ``@XEN_CONFIG_DIR@/xend-config.sxp`` file, under the key
327
    "xend-relocation-port".
328

    
329
migration\_bandwidth
330
    Valid for the KVM hypervisor.
331

    
332
    This option specifies the maximum bandwidth that KVM will use for
333
    instance live migrations. The value is in MiB/s.
334

    
335
    This option is only effective with kvm versions >= 78 and qemu-kvm
336
    versions >= 0.10.0.
337

    
338
The ``-B (--backend-parameters)`` option allows you to set the default
339
backend parameters for the cluster. The parameter format is a
340
comma-separated list of key=value pairs with the following supported
341
keys:
342

    
343
vcpus
344
    Number of VCPUs to set for an instance by default, must be an
345
    integer, will be set to 1 if no specified.
346

    
347
maxmem
348
    Maximum amount of memory to allocate for an instance by default, can
349
    be either an integer or an integer followed by a unit (M for
350
    mebibytes and G for gibibytes are supported), will be set to 128M if
351
    not specified.
352

    
353
minmem
354
    Minimum amount of memory to allocate for an instance by default, can
355
    be either an integer or an integer followed by a unit (M for
356
    mebibytes and G for gibibytes are supported), will be set to 128M if
357
    not specified.
358

    
359
auto\_balance
360
    Value of the auto\_balance flag for instances to use by default,
361
    will be set to true if not specified.
362

    
363
always\_failover
364
    Default value for the ``always_failover`` flag for instances; if
365
    not set, ``False`` is used.
366

    
367

    
368
The ``-N (--nic-parameters)`` option allows you to set the default
369
network interface parameters for the cluster. The parameter format is a
370
comma-separated list of key=value pairs with the following supported
371
keys:
372

    
373
mode
374
    The default NIC mode, one of ``routed``, ``bridged`` or
375
    ``openvswitch``.
376

    
377
link
378
    In ``bridged`` or ``openvswitch`` mode the default interface where
379
    to attach NICs. In ``routed`` mode it represents an
380
    hypervisor-vif-script dependent value to allow different instance
381
    groups. For example under the KVM default network script it is
382
    interpreted as a routing table number or name. Openvswitch support
383
    is also hypervisor dependent and currently works for the default KVM
384
    network script. Under Xen a custom network script must be provided.
385

    
386
The ``-D (--disk-parameters)`` option allows you to set the default disk
387
template parameters at cluster level. The format used for this option is
388
similar to the one use by the  ``-H`` option: the disk template name
389
must be specified first, followed by a colon and by a comma-separated
390
list of key-value pairs. These parameters can only be specified at
391
cluster and node group level; the cluster-level parameter are inherited
392
by the node group at the moment of its creation, and can be further
393
modified at node group level using the **gnt-group**\(8) command.
394

    
395
The following is the list of disk parameters available for the **drbd**
396
template, with measurement units specified in square brackets at the end
397
of the description (when applicable):
398

    
399
resync-rate
400
    Static re-synchronization rate. [KiB/s]
401

    
402
data-stripes
403
    Number of stripes to use for data LVs.
404

    
405
meta-stripes
406
    Number of stripes to use for meta LVs.
407

    
408
disk-barriers
409
    What kind of barriers to **disable** for disks. It can either assume
410
    the value "n", meaning no barrier disabled, or a non-empty string
411
    containing a subset of the characters "bfd". "b" means disable disk
412
    barriers, "f" means disable disk flushes, "d" disables disk drains.
413

    
414
meta-barriers
415
    Boolean value indicating whether the meta barriers should be
416
    disabled (True) or not (False).
417

    
418
metavg
419
    String containing the name of the default LVM volume group for DRBD
420
    metadata. By default, it is set to ``xenvg``. It can be overridden
421
    during the instance creation process by using the ``metavg`` key of
422
    the ``--disk`` parameter.
423

    
424
disk-custom
425
    String containing additional parameters to be appended to the
426
    arguments list of ``drbdsetup disk``.
427

    
428
net-custom
429
    String containing additional parameters to be appended to the
430
    arguments list of ``drbdsetup net``.
431

    
432
protocol
433
    Replication protocol for the DRBD device. Has to be either "A", "B"
434
    or "C". Refer to the DRBD documentation for further information
435
    about the differences between the protocols.
436

    
437
dynamic-resync
438
    Boolean indicating whether to use the dynamic resync speed
439
    controller or not. If enabled, c-plan-ahead must be non-zero and all
440
    the c-* parameters will be used by DRBD. Otherwise, the value of
441
    resync-rate will be used as a static resync speed.
442

    
443
c-plan-ahead
444
    Agility factor of the dynamic resync speed controller. (the higher,
445
    the slower the algorithm will adapt the resync speed). A value of 0
446
    (that is the default) disables the controller. [ds]
447

    
448
c-fill-target
449
    Maximum amount of in-flight resync data for the dynamic resync speed
450
    controller. [sectors]
451

    
452
c-delay-target
453
    Maximum estimated peer response latency for the dynamic resync speed
454
    controller. [ds]
455

    
456
c-min-rate
457
    Minimum resync speed for the dynamic resync speed controller. [KiB/s]
458

    
459
c-max-rate
460
    Upper bound on resync speed for the dynamic resync speed controller.
461
    [KiB/s]
462

    
463
List of parameters available for the **plain** template:
464

    
465
stripes
466
    Number of stripes to use for new LVs.
467

    
468
List of parameters available for the **rbd** template:
469

    
470
pool
471
    The RADOS cluster pool, inside which all rbd volumes will reside.
472
    When a new RADOS cluster is deployed, the default pool to put rbd
473
    volumes (Images in RADOS terminology) is 'rbd'.
474

    
475
access
476
    If 'userspace', instances will access their disks directly without
477
    going through a block device, avoiding expensive context switches
478
    with kernel space and the potential for deadlocks_ in low memory
479
    scenarios.
480

    
481
    The default value is 'kernelspace' and it disables this behaviour.
482
    This setting may only be changed to 'userspace' if all instance
483
    disks in the affected group or cluster can be accessed in userspace.
484

    
485
    Attempts to use this feature without rbd support compiled in KVM
486
    result in a "no such file or directory" error messages.
487

    
488
.. _deadlocks: http://tracker.ceph.com/issues/3076
489

    
490
The option ``--maintain-node-health`` allows one to enable/disable
491
automatic maintenance actions on nodes. Currently these include
492
automatic shutdown of instances and deactivation of DRBD devices on
493
offline nodes; in the future it might be extended to automatic
494
removal of unknown LVM volumes, etc. Note that this option is only
495
useful if the use of ``ganeti-confd`` was enabled at compilation.
496

    
497
The ``--uid-pool`` option initializes the user-id pool. The
498
*user-id pool definition* can contain a list of user-ids and/or a
499
list of user-id ranges. The parameter format is a comma-separated
500
list of numeric user-ids or user-id ranges. The ranges are defined
501
by a lower and higher boundary, separated by a dash. The boundaries
502
are inclusive. If the ``--uid-pool`` option is not supplied, the
503
user-id pool is initialized to an empty list. An empty list means
504
that the user-id pool feature is disabled.
505

    
506
The ``-I (--default-iallocator)`` option specifies the default
507
instance allocator. The instance allocator will be used for operations
508
like instance creation, instance and node migration, etc. when no
509
manual override is specified. If this option is not specified and
510
htools was not enabled at build time, the default instance allocator
511
will be blank, which means that relevant operations will require the
512
administrator to manually specify either an instance allocator, or a
513
set of nodes. If the option is not specified but htools was enabled,
514
the default iallocator will be **hail**\(1) (assuming it can be found
515
on disk). The default iallocator can be changed later using the
516
**modify** command.
517

    
518
The option ``--default-iallocator-params`` sets the cluster-wide
519
iallocator parameters used by the default iallocator only on instance
520
allocations.
521

    
522
The ``--primary-ip-version`` option specifies the IP version used
523
for the primary address. Possible values are 4 and 6 for IPv4 and
524
IPv6, respectively. This option is used when resolving node names
525
and the cluster name.
526

    
527
The ``--node-parameters`` option allows you to set default node
528
parameters for the cluster. Please see **ganeti**\(7) for more
529
information about supported key=value pairs.
530

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

    
536
The ``--specs-...`` and ``--ipolicy-...`` options specify the instance
537
policy on the cluster. The ``--ipolicy-bounds-specs`` option sets the
538
minimum and maximum specifications for instances. The format is:
539
min:*param*=*value*,.../max:*param*=*value*,... and further
540
specifications pairs can be added by using ``//`` as a separator. The
541
``--ipolicy-std-specs`` option takes a list of parameter/value pairs.
542
For both options, *param* can be:
543

    
544
- ``cpu-count``: number of VCPUs for an instance
545
- ``disk-count``: number of disk for an instance
546
- ``disk-size``: size of each disk
547
- ``memory-size``: instance memory
548
- ``nic-count``: number of network interface
549
- ``spindle-use``: spindle usage for an instance
550

    
551
For the ``--specs-...`` options, each option can have three values:
552
``min``, ``max`` and ``std``, which can also be modified on group level
553
(except for ``std``, which is defined once for the entire cluster).
554
Please note, that ``std`` values are not the same as defaults set by
555
``--beparams``, but they are used for the capacity calculations.
556

    
557
- ``--specs-cpu-count`` limits the number of VCPUs that can be used by an
558
  instance.
559
- ``--specs-disk-count`` limits the number of disks
560
- ``--specs-disk-size`` limits the disk size for every disk used
561
- ``--specs-mem-size`` limits the amount of memory available
562
- ``--specs-nic-count`` sets limits on the number of NICs used
563

    
564
The ``--ipolicy-spindle-ratio`` option takes a decimal number. The
565
``--ipolicy-disk-templates`` option takes a comma-separated list of disk
566
templates. This list of disk templates must be a subset of the list
567
of cluster-wide enabled disk templates (which can be set with
568
``--enabled-disk-templates``).
569

    
570
- ``--ipolicy-spindle-ratio`` limits the instances-spindles ratio
571
- ``--ipolicy-vcpu-ratio`` limits the vcpu-cpu ratio
572

    
573
All the instance policy elements can be overridden at group level. Group
574
level overrides can be removed by specifying ``default`` as the value of
575
an item.
576

    
577
The ``--drbd-usermode-helper`` option can be used to specify a usermode
578
helper. Check that this string is the one used by the DRBD kernel.
579

    
580
For details about how to use ``--hypervisor-state`` and ``--disk-state``
581
have a look at **ganeti**\(7).
582

    
583
The ``--enabled-disk-templates`` option specifies a list of disk templates
584
that can be used by instances of the cluster. For the possible values in
585
this list, see **gnt-instance**\(8). Note that in contrast to the list of
586
disk templates in the ipolicy, this list is a hard restriction. It is not
587
possible to create instances with disk templates that are not enabled in
588
the cluster. It is also not possible to disable a disk template when there
589
are still instances using it. The first disk template in the list of
590
enabled disk template is the default disk template. It will be used for
591
instance creation, if no disk template is requested explicitely.
592

    
593
MASTER-FAILOVER
594
~~~~~~~~~~~~~~~
595

    
596
**master-failover** [\--no-voting] [\--yes-do-it]
597

    
598
Failover the master role to the current node.
599

    
600
The ``--no-voting`` option skips the remote node agreement checks.
601
This is dangerous, but necessary in some cases (for example failing
602
over the master role in a 2 node cluster with the original master
603
down). If the original master then comes up, it won't be able to
604
start its master daemon because it won't have enough votes, but so
605
won't the new master, if the master daemon ever needs a restart.
606
You can pass ``--no-voting`` to **ganeti-masterd** on the new
607
master to solve this problem, and run **gnt-cluster redist-conf**
608
to make sure the cluster is consistent again.
609

    
610
The option ``--yes-do-it`` is used together with ``--no-voting``, for
611
skipping the interactive checks. This is even more dangerous, and should
612
only be used in conjunction with other means (e.g. a HA suite) to
613
confirm that the operation is indeed safe.
614

    
615
MASTER-PING
616
~~~~~~~~~~~
617

    
618
**master-ping**
619

    
620
Checks if the master daemon is alive.
621

    
622
If the master daemon is alive and can respond to a basic query (the
623
equivalent of **gnt-cluster info**), then the exit code of the
624
command will be 0. If the master daemon is not alive (either due to
625
a crash or because this is not the master node), the exit code will
626
be 1.
627

    
628
MODIFY
629
~~~~~~
630

    
631
| **modify** [\--submit] [\--print-job-id]
632
| [\--force]
633
| [\--vg-name *vg-name*]
634
| [\--enabled-hypervisors *hypervisors*]
635
| [{-H|\--hypervisor-parameters} *hypervisor*:*hv-param*=*value*[,*hv-param*=*value*...]]
636
| [{-B|\--backend-parameters} *be-param*=*value*[,*be-param*=*value*...]]
637
| [{-N|\--nic-parameters} *nic-param*=*value*[,*nic-param*=*value*...]]
638
| [{-D|\--disk-parameters} *disk-template*:*disk-param*=*value*[,*disk-param*=*value*...]]
639
| [\--uid-pool *user-id pool definition*]
640
| [\--add-uids *user-id pool definition*]
641
| [\--remove-uids *user-id pool definition*]
642
| [{-C|\--candidate-pool-size} *candidate\_pool\_size*]
643
| [\--maintain-node-health {yes \| no}]
644
| [\--prealloc-wipe-disks {yes \| no}]
645
| [{-I|\--default-iallocator} *default instance allocator*]
646
| [\--default-iallocator-params *ial-param*=*value*,*ial-param*=*value*]
647
| [\--reserved-lvs=*NAMES*]
648
| [\--node-parameters *ndparams*]
649
| [\--master-netdev *interface-name*]
650
| [\--master-netmask *netmask*]
651
| [\--use-external-mip-script {yes \| no}]
652
| [\--hypervisor-state *hvstate*]
653
| [\--disk-state *diskstate*]
654
| [\--ipolicy-std-specs *spec*=*value* [,*spec*=*value*...]]
655
| [\--ipolicy-bounds-specs *bounds_ispecs*]
656
| [\--ipolicy-disk-templates *template* [,*template*...]]
657
| [\--ipolicy-spindle-ratio *ratio*]
658
| [\--ipolicy-vcpu-ratio *ratio*]
659
| [\--enabled-disk-templates *template* [,*template*...]]
660
| [\--drbd-usermode-helper *helper*]
661
| [\--file-storage-dir *dir*]
662
| [\--shared-file-storage-dir *dir*]
663

    
664

    
665
Modify the options for the cluster.
666

    
667
The ``--vg-name``, ``--enabled-hypervisors``, ``-H (--hypervisor-parameters)``,
668
``-B (--backend-parameters)``, ``-D (--disk-parameters)``, ``--nic-parameters``,
669
``-C (--candidate-pool-size)``, ``--maintain-node-health``,
670
``--prealloc-wipe-disks``, ``--uid-pool``, ``--node-parameters``,
671
``--master-netdev``, ``--master-netmask``, ``--use-external-mip-script``,
672
``--drbd-usermode-helper``, ``--file-storage-dir``,
673
``--shared-file-storage-dir``, and ``--enabled-disk-templates`` options are
674
described in the **init** command.
675

    
676
The ``--hypervisor-state`` and ``--disk-state`` options are described in
677
detail in **ganeti**\(7).
678

    
679
The ``--add-uids`` and ``--remove-uids`` options can be used to
680
modify the user-id pool by adding/removing a list of user-ids or
681
user-id ranges.
682

    
683
The option ``--reserved-lvs`` specifies a list (comma-separated) of
684
logical volume group names (regular expressions) that will be
685
ignored by the cluster verify operation. This is useful if the
686
volume group used for Ganeti is shared with the system for other
687
uses. Note that it's not recommended to create and mark as ignored
688
logical volume names which match Ganeti's own name format (starting
689
with UUID and then .diskN), as this option only skips the
690
verification, but not the actual use of the names given.
691

    
692
To remove all reserved logical volumes, pass in an empty argument
693
to the option, as in ``--reserved-lvs=`` or ``--reserved-lvs ''``.
694

    
695
The ``-I (--default-iallocator)`` is described in the **init**
696
command. To clear the default iallocator, just pass an empty string
697
('').
698

    
699
The option ``--default-iallocator-params`` is described in the **init**
700
command. To clear the default iallocator parameters, just pass an empty
701
string ('').
702

    
703
The ``--ipolicy-...`` options are described in the **init** command.
704

    
705
See **ganeti**\(7) for a description of ``--submit`` and other common
706
options.
707

    
708
QUEUE
709
~~~~~
710

    
711
**queue** {drain | undrain | info}
712

    
713
Change job queue properties.
714

    
715
The ``drain`` option sets the drain flag on the job queue. No new
716
jobs will be accepted, but jobs already in the queue will be
717
processed.
718

    
719
The ``undrain`` will unset the drain flag on the job queue. New
720
jobs will be accepted.
721

    
722
The ``info`` option shows the properties of the job queue.
723

    
724
WATCHER
725
~~~~~~~
726

    
727
**watcher** {pause *duration* | continue | info}
728

    
729
Make the watcher pause or let it continue.
730

    
731
The ``pause`` option causes the watcher to pause for *duration*
732
seconds.
733

    
734
The ``continue`` option will let the watcher continue.
735

    
736
The ``info`` option shows whether the watcher is currently paused.
737

    
738
REDIST-CONF
739
~~~~~~~~~~~
740

    
741
**redist-conf** [\--submit] [\--print-job-id]
742

    
743
This command forces a full push of configuration files from the
744
master node to the other nodes in the cluster. This is normally not
745
needed, but can be run if the **verify** complains about
746
configuration mismatches.
747

    
748
See **ganeti**\(7) for a description of ``--submit`` and other common
749
options.
750

    
751
RENAME
752
~~~~~~
753

    
754
**rename** [-f] {*name*}
755

    
756
Renames the cluster and in the process updates the master IP
757
address to the one the new name resolves to. At least one of either
758
the name or the IP address must be different, otherwise the
759
operation will be aborted.
760

    
761
Note that since this command can be dangerous (especially when run
762
over SSH), the command will require confirmation unless run with
763
the ``-f`` option.
764

    
765
RENEW-CRYPTO
766
~~~~~~~~~~~~
767

    
768
| **renew-crypto** [-f]
769
| [\--new-cluster-certificate] [\--new-confd-hmac-key]
770
| [\--new-rapi-certificate] [\--rapi-certificate *rapi-cert*]
771
| [\--new-spice-certificate | \--spice-certificate *spice-cert*
772
| \--spice-ca-certificate *spice-ca-cert*]
773
| [\--new-cluster-domain-secret] [\--cluster-domain-secret *filename*]
774

    
775
This command will stop all Ganeti daemons in the cluster and start
776
them again once the new certificates and keys are replicated. The
777
options ``--new-cluster-certificate`` and ``--new-confd-hmac-key``
778
can be used to regenerate respectively the cluster-internal SSL
779
certificate and the HMAC key used by **ganeti-confd**\(8).
780

    
781
To generate a new self-signed RAPI certificate (used by
782
**ganeti-rapi**\(8)) specify ``--new-rapi-certificate``. If you want to
783
use your own certificate, e.g. one signed by a certificate
784
authority (CA), pass its filename to ``--rapi-certificate``.
785

    
786
To generate a new self-signed SPICE certificate, used for SPICE
787
connections to the KVM hypervisor, specify the
788
``--new-spice-certificate`` option. If you want to provide a
789
certificate, pass its filename to ``--spice-certificate`` and pass the
790
signing CA certificate to ``--spice-ca-certificate``.
791

    
792
Finally ``--new-cluster-domain-secret`` generates a new, random
793
cluster domain secret, and ``--cluster-domain-secret`` reads the
794
secret from a file. The cluster domain secret is used to sign
795
information exchanged between separate clusters via a third party.
796

    
797
REPAIR-DISK-SIZES
798
~~~~~~~~~~~~~~~~~
799

    
800
**repair-disk-sizes** [instance...]
801

    
802
This command checks that the recorded size of the given instance's
803
disks matches the actual size and updates any mismatches found.
804
This is needed if the Ganeti configuration is no longer consistent
805
with reality, as it will impact some disk operations. If no
806
arguments are given, all instances will be checked. When exclusive
807
storage is active, also spindles are updated.
808

    
809
Note that only active disks can be checked by this command; in case
810
a disk cannot be activated it's advised to use
811
**gnt-instance activate-disks \--ignore-size ...** to force
812
activation without regard to the current size.
813

    
814
When all the disk sizes are consistent, the command will return no
815
output. Otherwise it will log details about the inconsistencies in
816
the configuration.
817

    
818
UPGRADE
819
~~~~~~~
820

    
821
**upgrade** {--to *version* | --resume}
822

    
823
This command safely switches all nodes of the cluster to a new Ganeti
824
version. It is a prerequisite that the new version is already installed,
825
albeit not activated, on all nodes; this requisite is checked before any
826
actions are done.
827

    
828
If called with the ``--resume`` option, any pending upgrade is
829
continued, that was interrupted by a power failure or similar on
830
master. It will do nothing, if not run on the master node, or if no
831
upgrade was in progress.
832

    
833

    
834
VERIFY
835
~~~~~~
836

    
837
| **verify** [\--no-nplus1-mem] [\--node-group *nodegroup*]
838
| [\--error-codes] [{-I|\--ignore-errors} *errorcode*]
839
| [{-I|\--ignore-errors} *errorcode*...]
840

    
841
Verify correctness of cluster configuration. This is safe with
842
respect to running instances, and incurs no downtime of the
843
instances.
844

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

    
849
With ``--node-group``, restrict the verification to those nodes and
850
instances that live in the named group. This will not verify global
851
settings, but will allow to perform verification of a group while other
852
operations are ongoing in other groups.
853

    
854
The ``--error-codes`` option outputs each error in the following
855
parseable format: *ftype*:*ecode*:*edomain*:*name*:*msg*.
856
These fields have the following meaning:
857

    
858
ftype
859
    Failure type. Can be *WARNING* or *ERROR*.
860

    
861
ecode
862
    Error code of the failure. See below for a list of error codes.
863

    
864
edomain
865
    Can be *cluster*, *node* or *instance*.
866

    
867
name
868
    Contains the name of the item that is affected from the failure.
869

    
870
msg
871
    Contains a descriptive error message about the error
872

    
873
``gnt-cluster verify`` will have a non-zero exit code if at least one of
874
the failures that are found are of type *ERROR*.
875

    
876
The ``--ignore-errors`` option can be used to change this behaviour,
877
because it demotes the error represented by the error code received as a
878
parameter to a warning. The option must be repeated for each error that
879
should be ignored (e.g.: ``-I ENODEVERSION -I ENODEORPHANLV``). The
880
``--error-codes`` option can be used to determine the error code of a
881
given error.
882

    
883
List of error codes:
884

    
885
@CONSTANTS_ECODES@
886

    
887
VERIFY-DISKS
888
~~~~~~~~~~~~
889

    
890
**verify-disks**
891

    
892
The command checks which instances have degraded DRBD disks and
893
activates the disks of those instances.
894

    
895
This command is run from the **ganeti-watcher** tool, which also
896
has a different, complementary algorithm for doing this check.
897
Together, these two should ensure that DRBD disks are kept
898
consistent.
899

    
900
VERSION
901
~~~~~~~
902

    
903
**version**
904

    
905
Show the cluster version.
906

    
907
Tags
908
~~~~
909

    
910
ADD-TAGS
911
^^^^^^^^
912

    
913
**add-tags** [\--from *file*] {*tag*...}
914

    
915
Add tags to the cluster. If any of the tags contains invalid
916
characters, the entire operation will abort.
917

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

    
924
LIST-TAGS
925
^^^^^^^^^
926

    
927
**list-tags**
928

    
929
List the tags of the cluster.
930

    
931
REMOVE-TAGS
932
^^^^^^^^^^^
933

    
934
**remove-tags** [\--from *file*] {*tag*...}
935

    
936
Remove tags from the cluster. If any of the tags are not existing
937
on the cluster, the entire operation will abort.
938

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

    
945
SEARCH-TAGS
946
^^^^^^^^^^^
947

    
948
**search-tags** {*pattern*}
949

    
950
Searches the tags on all objects in the cluster (the cluster
951
itself, the nodes and the instances) for a given pattern. The
952
pattern is interpreted as a regular expression and a search will be
953
done on it (i.e. the given pattern is not anchored to the beggining
954
of the string; if you want that, prefix the pattern with ^).
955

    
956
If no tags are matching the pattern, the exit code of the command
957
will be one. If there is at least one match, the exit code will be
958
zero. Each match is listed on one line, the object and the tag
959
separated by a space. The cluster will be listed as /cluster, a
960
node will be listed as /nodes/*name*, and an instance as
961
/instances/*name*. Example:
962

    
963
::
964

    
965
    # gnt-cluster search-tags time
966
    /cluster ctime:2007-09-01
967
    /nodes/node1.example.com mtime:2007-10-04
968

    
969
.. vim: set textwidth=72 :
970
.. Local Variables:
971
.. mode: rst
972
.. fill-column: 72
973
.. End: