Statistics
| Branch: | Tag: | Revision:

root / man / gnt-cluster.rst @ f5bbddb5

History | View | Annotate | Download (33.8 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
| [\--enabled-hypervisors *hypervisors*]
177
| [{-H|\--hypervisor-parameters} *hypervisor*:*hv-param*=*value*[,*hv-param*=*value*...]]
178
| [{-B|\--backend-parameters} *be-param*=*value*[,*be-param*=*value*...]]
179
| [{-N|\--nic-parameters} *nic-param*=*value*[,*nic-param*=*value*...]]
180
| [{-D|\--disk-parameters} *disk-template*:*disk-param*=*value*[,*disk-param*=*value*...]]
181
| [\--maintain-node-health {yes \| no}]
182
| [\--uid-pool *user-id pool definition*]
183
| [{-I|\--default-iallocator} *default instance allocator*]
184
| [\--primary-ip-version *version*]
185
| [\--prealloc-wipe-disks {yes \| no}]
186
| [\--node-parameters *ndparams*]
187
| [{-C|\--candidate-pool-size} *candidate\_pool\_size*]
188
| [\--specs-cpu-count *spec-param*=*value* [,*spec-param*=*value*...]]
189
| [\--specs-disk-count *spec-param*=*value* [,*spec-param*=*value*...]]
190
| [\--specs-disk-size *spec-param*=*value* [,*spec-param*=*value*...]]
191
| [\--specs-mem-size *spec-param*=*value* [,*spec-param*=*value*...]]
192
| [\--specs-nic-count *spec-param*=*value* [,*spec-param*=*value*...]]
193
| [\--ipolicy-std-specs *spec*=*value* [,*spec*=*value*...]]
194
| [\--ipolicy-bounds-specs *bounds_ispecs*]
195
| [\--ipolicy-disk-templates *template* [,*template*...]]
196
| [\--ipolicy-spindle-ratio *ratio*]
197
| [\--ipolicy-vcpu-ratio *ratio*]
198
| [\--disk-state *diskstate*]
199
| [\--hypervisor-state *hvstate*]
200
| [\--drbd-usermode-helper *helper*]
201
| [\--enabled-disk-templates *template* [,*template*...]]
202
| {*clustername*}
203

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

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

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

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

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

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

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

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

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

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

    
263
The ``--no-etc-hosts`` option allows you to initialize the cluster
264
without modifying the /etc/hosts file.
265

    
266
The ``--no-ssh-init`` option allows you to initialize the cluster
267
without creating or distributing SSH key pairs.
268

    
269
The ``--file-storage-dir`` option allows you set the directory to
270
use for storing the instance disk files when using file storage as
271
backend for instance disks. Note that the file storage dir must be
272
an allowed directory for file storage. Those directories are specified
273
in the ``@SYSCONFDIR@/ganeti/file-storage-paths`` file. The file storage
274
directory can also be a subdirectory of an allowed one. The file storage
275
directory should be present on all nodes.
276

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

    
282
The ``--enabled-hypervisors`` option allows you to set the list of
283
hypervisors that will be enabled for this cluster. Instance
284
hypervisors can only be chosen from the list of enabled
285
hypervisors, and the first entry of this list will be used by
286
default. Currently, the following hypervisors are available:
287

    
288
xen-pvm
289
    Xen PVM hypervisor
290

    
291
xen-hvm
292
    Xen HVM hypervisor
293

    
294
kvm
295
    Linux KVM hypervisor
296

    
297
chroot
298
    a simple chroot manager that starts chroot based on a script at the
299
    root of the filesystem holding the chroot
300

    
301
fake
302
    fake hypervisor for development/testing
303

    
304
Either a single hypervisor name or a comma-separated list of
305
hypervisor names can be specified. If this option is not specified,
306
only the xen-pvm hypervisor is enabled by default.
307

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

    
316
migration\_port
317
    Valid for the Xen PVM and KVM hypervisors.
318

    
319
    This options specifies the TCP port to use for live-migration. For
320
    Xen, the same port should be configured on all nodes in the
321
    ``@XEN_CONFIG_DIR@/xend-config.sxp`` file, under the key
322
    "xend-relocation-port".
323

    
324
migration\_bandwidth
325
    Valid for the KVM hypervisor.
326

    
327
    This option specifies the maximum bandwidth that KVM will use for
328
    instance live migrations. The value is in MiB/s.
329

    
330
    This option is only effective with kvm versions >= 78 and qemu-kvm
331
    versions >= 0.10.0.
332

    
333
The ``-B (--backend-parameters)`` option allows you to set the default
334
backend parameters for the cluster. The parameter format is a
335
comma-separated list of key=value pairs with the following supported
336
keys:
337

    
338
vcpus
339
    Number of VCPUs to set for an instance by default, must be an
340
    integer, will be set to 1 if no specified.
341

    
342
maxmem
343
    Maximum amount of memory to allocate for an instance by default, can
344
    be either an integer or an integer followed by a unit (M for
345
    mebibytes and G for gibibytes are supported), will be set to 128M if
346
    not specified.
347

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

    
354
auto\_balance
355
    Value of the auto\_balance flag for instances to use by default,
356
    will be set to true if not specified.
357

    
358
always\_failover
359
    Default value for the ``always_failover`` flag for instances; if
360
    not set, ``False`` is used.
361

    
362

    
363
The ``-N (--nic-parameters)`` option allows you to set the default
364
network interface parameters for the cluster. The parameter format is a
365
comma-separated list of key=value pairs with the following supported
366
keys:
367

    
368
mode
369
    The default NIC mode, one of ``routed``, ``bridged`` or
370
    ``openvswitch``.
371

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

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

    
390
The following is the list of disk parameters available for the **drbd**
391
template, with measurement units specified in square brackets at the end
392
of the description (when applicable):
393

    
394
resync-rate
395
    Static re-synchronization rate. [KiB/s]
396

    
397
data-stripes
398
    Number of stripes to use for data LVs.
399

    
400
meta-stripes
401
    Number of stripes to use for meta LVs.
402

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

    
409
meta-barriers
410
    Boolean value indicating whether the meta barriers should be
411
    disabled (True) or not (False).
412

    
413
metavg
414
    String containing the name of the default LVM volume group for DRBD
415
    metadata. By default, it is set to ``xenvg``. It can be overridden
416
    during the instance creation process by using the ``metavg`` key of
417
    the ``--disk`` parameter.
418

    
419
disk-custom
420
    String containing additional parameters to be appended to the
421
    arguments list of ``drbdsetup disk``.
422

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

    
427
protocol
428
    Replication protocol for the DRBD device. Has to be either "A", "B"
429
    or "C". Refer to the DRBD documentation for further information
430
    about the differences between the protocols.
431

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

    
438
c-plan-ahead
439
    Agility factor of the dynamic resync speed controller. (the higher,
440
    the slower the algorithm will adapt the resync speed). A value of 0
441
    (that is the default) disables the controller. [ds]
442

    
443
c-fill-target
444
    Maximum amount of in-flight resync data for the dynamic resync speed
445
    controller. [sectors]
446

    
447
c-delay-target
448
    Maximum estimated peer response latency for the dynamic resync speed
449
    controller. [ds]
450

    
451
c-min-rate
452
    Minimum resync speed for the dynamic resync speed controller. [KiB/s]
453

    
454
c-max-rate
455
    Upper bound on resync speed for the dynamic resync speed controller.
456
    [KiB/s]
457

    
458
List of parameters available for the **plain** template:
459

    
460
stripes
461
    Number of stripes to use for new LVs.
462

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

    
465
pool
466
    The RADOS cluster pool, inside which all rbd volumes will reside.
467
    When a new RADOS cluster is deployed, the default pool to put rbd
468
    volumes (Images in RADOS terminology) is 'rbd'.
469

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

    
477
The ``--uid-pool`` option initializes the user-id pool. The
478
*user-id pool definition* can contain a list of user-ids and/or a
479
list of user-id ranges. The parameter format is a comma-separated
480
list of numeric user-ids or user-id ranges. The ranges are defined
481
by a lower and higher boundary, separated by a dash. The boundaries
482
are inclusive. If the ``--uid-pool`` option is not supplied, the
483
user-id pool is initialized to an empty list. An empty list means
484
that the user-id pool feature is disabled.
485

    
486
The ``-I (--default-iallocator)`` option specifies the default
487
instance allocator. The instance allocator will be used for operations
488
like instance creation, instance and node migration, etc. when no
489
manual override is specified. If this option is not specified and
490
htools was not enabled at build time, the default instance allocator
491
will be blank, which means that relevant operations will require the
492
administrator to manually specify either an instance allocator, or a
493
set of nodes. If the option is not specified but htools was enabled,
494
the default iallocator will be **hail**\(1) (assuming it can be found
495
on disk). The default iallocator can be changed later using the
496
**modify** command.
497

    
498
The ``--primary-ip-version`` option specifies the IP version used
499
for the primary address. Possible values are 4 and 6 for IPv4 and
500
IPv6, respectively. This option is used when resolving node names
501
and the cluster name.
502

    
503
The ``--node-parameters`` option allows you to set default node
504
parameters for the cluster. Please see **ganeti**\(7) for more
505
information about supported key=value pairs.
506

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

    
512
The ``--specs-...`` and ``--ipolicy-...`` options specify the instance
513
policy on the cluster. The ``--ipolicy-bounds-specs`` option sets the
514
minimum and maximum specifications for instances. The format is:
515
min:*param*=*value*,.../max:*param*=*value*,... and further
516
specifications pairs can be added by using ``//`` as a separator. The
517
``--ipolicy-std-specs`` option takes a list of parameter/value pairs.
518
For both options, *param* can be:
519

    
520
- ``cpu-count``: number of VCPUs for an instance
521
- ``disk-count``: number of disk for an instance
522
- ``disk-size``: size of each disk
523
- ``memory-size``: instance memory
524
- ``nic-count``: number of network interface
525
- ``spindle-use``: spindle usage for an instance
526

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

    
533
- ``--specs-cpu-count`` limits the number of VCPUs that can be used by an
534
  instance.
535
- ``--specs-disk-count`` limits the number of disks
536
- ``--specs-disk-size`` limits the disk size for every disk used
537
- ``--specs-mem-size`` limits the amount of memory available
538
- ``--specs-nic-count`` sets limits on the number of NICs used
539

    
540
The ``--ipolicy-disk-templates`` and ``--ipolicy-spindle-ratio`` options
541
take a decimal number. The ``--ipolicy-disk-templates`` option takes a
542
comma-separated list of disk templates.
543

    
544
- ``--ipolicy-disk-templates`` limits the allowed disk templates
545
- ``--ipolicy-spindle-ratio`` limits the instances-spindles ratio
546
- ``--ipolicy-vcpu-ratio`` limits the vcpu-cpu ratio
547

    
548
All the instance policy elements can be overridden at group level. Group
549
level overrides can be removed by specifying ``default`` as the value of
550
an item.
551

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

    
555
For details about how to use ``--hypervisor-state`` and ``--disk-state``
556
have a look at **ganeti**\(7).
557

    
558
The ``--enabled-disk-templates`` option specifies a list of disk templates
559
that can be used by instances of the cluster. For the possible values in
560
this list, see **gnt-instance**\(8). Note that in contrast to the list of
561
disk templates in the ipolicy, this list is a hard restriction. It is not
562
possible to create instances with disk templates that are not enabled in
563
the cluster. It is also not possible to disable a disk template when there
564
are still instances using it. The first disk template in the list of
565
enabled disk template is the default disk template. It will be used for
566
instance creation, if no disk template is requested explicitely.
567

    
568
MASTER-FAILOVER
569
~~~~~~~~~~~~~~~
570

    
571
**master-failover** [\--no-voting] [\--yes-do-it]
572

    
573
Failover the master role to the current node.
574

    
575
The ``--no-voting`` option skips the remote node agreement checks.
576
This is dangerous, but necessary in some cases (for example failing
577
over the master role in a 2 node cluster with the original master
578
down). If the original master then comes up, it won't be able to
579
start its master daemon because it won't have enough votes, but so
580
won't the new master, if the master daemon ever needs a restart.
581
You can pass ``--no-voting`` to **ganeti-masterd** on the new
582
master to solve this problem, and run **gnt-cluster redist-conf**
583
to make sure the cluster is consistent again.
584

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

    
590
MASTER-PING
591
~~~~~~~~~~~
592

    
593
**master-ping**
594

    
595
Checks if the master daemon is alive.
596

    
597
If the master daemon is alive and can respond to a basic query (the
598
equivalent of **gnt-cluster info**), then the exit code of the
599
command will be 0. If the master daemon is not alive (either due to
600
a crash or because this is not the master node), the exit code will
601
be 1.
602

    
603
MODIFY
604
~~~~~~
605

    
606
| **modify** [\--submit] [\--print-job-id]
607
| [\--force]
608
| [\--vg-name *vg-name*]
609
| [\--enabled-hypervisors *hypervisors*]
610
| [{-H|\--hypervisor-parameters} *hypervisor*:*hv-param*=*value*[,*hv-param*=*value*...]]
611
| [{-B|\--backend-parameters} *be-param*=*value*[,*be-param*=*value*...]]
612
| [{-N|\--nic-parameters} *nic-param*=*value*[,*nic-param*=*value*...]]
613
| [{-D|\--disk-parameters} *disk-template*:*disk-param*=*value*[,*disk-param*=*value*...]]
614
| [\--uid-pool *user-id pool definition*]
615
| [\--add-uids *user-id pool definition*]
616
| [\--remove-uids *user-id pool definition*]
617
| [{-C|\--candidate-pool-size} *candidate\_pool\_size*]
618
| [\--maintain-node-health {yes \| no}]
619
| [\--prealloc-wipe-disks {yes \| no}]
620
| [{-I|\--default-iallocator} *default instance allocator*]
621
| [\--reserved-lvs=*NAMES*]
622
| [\--node-parameters *ndparams*]
623
| [\--master-netdev *interface-name*]
624
| [\--master-netmask *netmask*]
625
| [\--use-external-mip-script {yes \| no}]
626
| [\--hypervisor-state *hvstate*]
627
| [\--disk-state *diskstate*]
628
| [\--ipolicy-std-specs *spec*=*value* [,*spec*=*value*...]]
629
| [\--ipolicy-bounds-specs *bounds_ispecs*]
630
| [\--ipolicy-disk-templates *template* [,*template*...]]
631
| [\--ipolicy-spindle-ratio *ratio*]
632
| [\--ipolicy-vcpu-ratio *ratio*]
633
| [\--enabled-disk-templates *template* [,*template*...]]
634
| [\--drbd-usermode-helper *helper*]
635
| [\--file-storage-dir *dir*]
636

    
637

    
638
Modify the options for the cluster.
639

    
640
The ``--vg-name``, ``--enabled-hypervisors``, ``-H (--hypervisor-parameters)``,
641
``-B (--backend-parameters)``, ``-D (--disk-parameters)``, ``--nic-parameters``,
642
``-C (--candidate-pool-size)``, ``--maintain-node-health``,
643
``--prealloc-wipe-disks``, ``--uid-pool``, ``--node-parameters``,
644
``--master-netdev``, ``--master-netmask``, ``--use-external-mip-script``,
645
``--drbd-usermode-helper``, ``--file-storage-dir``, and
646
``--enabled-disk-templates`` options are described in the **init** command.
647

    
648
The ``--hypervisor-state`` and ``--disk-state`` options are described in
649
detail in **ganeti**\(7).
650

    
651
The ``--add-uids`` and ``--remove-uids`` options can be used to
652
modify the user-id pool by adding/removing a list of user-ids or
653
user-id ranges.
654

    
655
The option ``--reserved-lvs`` specifies a list (comma-separated) of
656
logical volume group names (regular expressions) that will be
657
ignored by the cluster verify operation. This is useful if the
658
volume group used for Ganeti is shared with the system for other
659
uses. Note that it's not recommended to create and mark as ignored
660
logical volume names which match Ganeti's own name format (starting
661
with UUID and then .diskN), as this option only skips the
662
verification, but not the actual use of the names given.
663

    
664
To remove all reserved logical volumes, pass in an empty argument
665
to the option, as in ``--reserved-lvs=`` or ``--reserved-lvs ''``.
666

    
667
The ``-I (--default-iallocator)`` is described in the **init**
668
command. To clear the default iallocator, just pass an empty string
669
('').
670

    
671
The ``--ipolicy-...`` options are described in the **init** command.
672

    
673
See **ganeti**\(7) for a description of ``--submit`` and other common
674
options.
675

    
676
QUEUE
677
~~~~~
678

    
679
**queue** {drain | undrain | info}
680

    
681
Change job queue properties.
682

    
683
The ``drain`` option sets the drain flag on the job queue. No new
684
jobs will be accepted, but jobs already in the queue will be
685
processed.
686

    
687
The ``undrain`` will unset the drain flag on the job queue. New
688
jobs will be accepted.
689

    
690
The ``info`` option shows the properties of the job queue.
691

    
692
WATCHER
693
~~~~~~~
694

    
695
**watcher** {pause *duration* | continue | info}
696

    
697
Make the watcher pause or let it continue.
698

    
699
The ``pause`` option causes the watcher to pause for *duration*
700
seconds.
701

    
702
The ``continue`` option will let the watcher continue.
703

    
704
The ``info`` option shows whether the watcher is currently paused.
705

    
706
REDIST-CONF
707
~~~~~~~~~~~
708

    
709
**redist-conf** [\--submit] [\--print-job-id]
710

    
711
This command forces a full push of configuration files from the
712
master node to the other nodes in the cluster. This is normally not
713
needed, but can be run if the **verify** complains about
714
configuration mismatches.
715

    
716
See **ganeti**\(7) for a description of ``--submit`` and other common
717
options.
718

    
719
RENAME
720
~~~~~~
721

    
722
**rename** [-f] {*name*}
723

    
724
Renames the cluster and in the process updates the master IP
725
address to the one the new name resolves to. At least one of either
726
the name or the IP address must be different, otherwise the
727
operation will be aborted.
728

    
729
Note that since this command can be dangerous (especially when run
730
over SSH), the command will require confirmation unless run with
731
the ``-f`` option.
732

    
733
RENEW-CRYPTO
734
~~~~~~~~~~~~
735

    
736
| **renew-crypto** [-f]
737
| [\--new-cluster-certificate] [\--new-confd-hmac-key]
738
| [\--new-rapi-certificate] [\--rapi-certificate *rapi-cert*]
739
| [\--new-spice-certificate | \--spice-certificate *spice-cert*
740
| \--spice-ca-certificate *spice-ca-cert*]
741
| [\--new-cluster-domain-secret] [\--cluster-domain-secret *filename*]
742

    
743
This command will stop all Ganeti daemons in the cluster and start
744
them again once the new certificates and keys are replicated. The
745
options ``--new-cluster-certificate`` and ``--new-confd-hmac-key``
746
can be used to regenerate respectively the cluster-internal SSL
747
certificate and the HMAC key used by **ganeti-confd**\(8).
748

    
749
To generate a new self-signed RAPI certificate (used by
750
**ganeti-rapi**\(8)) specify ``--new-rapi-certificate``. If you want to
751
use your own certificate, e.g. one signed by a certificate
752
authority (CA), pass its filename to ``--rapi-certificate``.
753

    
754
To generate a new self-signed SPICE certificate, used for SPICE
755
connections to the KVM hypervisor, specify the
756
``--new-spice-certificate`` option. If you want to provide a
757
certificate, pass its filename to ``--spice-certificate`` and pass the
758
signing CA certificate to ``--spice-ca-certificate``.
759

    
760
Finally ``--new-cluster-domain-secret`` generates a new, random
761
cluster domain secret, and ``--cluster-domain-secret`` reads the
762
secret from a file. The cluster domain secret is used to sign
763
information exchanged between separate clusters via a third party.
764

    
765
REPAIR-DISK-SIZES
766
~~~~~~~~~~~~~~~~~
767

    
768
**repair-disk-sizes** [instance...]
769

    
770
This command checks that the recorded size of the given instance's
771
disks matches the actual size and updates any mismatches found.
772
This is needed if the Ganeti configuration is no longer consistent
773
with reality, as it will impact some disk operations. If no
774
arguments are given, all instances will be checked. When exclusive
775
storage is active, also spindles are updated.
776

    
777
Note that only active disks can be checked by this command; in case
778
a disk cannot be activated it's advised to use
779
**gnt-instance activate-disks \--ignore-size ...** to force
780
activation without regard to the current size.
781

    
782
When all the disk sizes are consistent, the command will return no
783
output. Otherwise it will log details about the inconsistencies in
784
the configuration.
785

    
786
VERIFY
787
~~~~~~
788

    
789
| **verify** [\--no-nplus1-mem] [\--node-group *nodegroup*]
790
| [\--error-codes] [{-I|\--ignore-errors} *errorcode*]
791
| [{-I|\--ignore-errors} *errorcode*...]
792

    
793
Verify correctness of cluster configuration. This is safe with
794
respect to running instances, and incurs no downtime of the
795
instances.
796

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

    
801
With ``--node-group``, restrict the verification to those nodes and
802
instances that live in the named group. This will not verify global
803
settings, but will allow to perform verification of a group while other
804
operations are ongoing in other groups.
805

    
806
The ``--error-codes`` option outputs each error in the following
807
parseable format: *ftype*:*ecode*:*edomain*:*name*:*msg*.
808
These fields have the following meaning:
809

    
810
ftype
811
    Failure type. Can be *WARNING* or *ERROR*.
812

    
813
ecode
814
    Error code of the failure. See below for a list of error codes.
815

    
816
edomain
817
    Can be *cluster*, *node* or *instance*.
818

    
819
name
820
    Contains the name of the item that is affected from the failure.
821

    
822
msg
823
    Contains a descriptive error message about the error
824

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

    
828
The ``--ignore-errors`` option can be used to change this behaviour,
829
because it demotes the error represented by the error code received as a
830
parameter to a warning. The option must be repeated for each error that
831
should be ignored (e.g.: ``-I ENODEVERSION -I ENODEORPHANLV``). The
832
``--error-codes`` option can be used to determine the error code of a
833
given error.
834

    
835
List of error codes:
836

    
837
@CONSTANTS_ECODES@
838

    
839
VERIFY-DISKS
840
~~~~~~~~~~~~
841

    
842
**verify-disks**
843

    
844
The command checks which instances have degraded DRBD disks and
845
activates the disks of those instances.
846

    
847
This command is run from the **ganeti-watcher** tool, which also
848
has a different, complementary algorithm for doing this check.
849
Together, these two should ensure that DRBD disks are kept
850
consistent.
851

    
852
VERSION
853
~~~~~~~
854

    
855
**version**
856

    
857
Show the cluster version.
858

    
859
Tags
860
~~~~
861

    
862
ADD-TAGS
863
^^^^^^^^
864

    
865
**add-tags** [\--from *file*] {*tag*...}
866

    
867
Add tags to the cluster. If any of the tags contains invalid
868
characters, the entire operation will abort.
869

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

    
876
LIST-TAGS
877
^^^^^^^^^
878

    
879
**list-tags**
880

    
881
List the tags of the cluster.
882

    
883
REMOVE-TAGS
884
^^^^^^^^^^^
885

    
886
**remove-tags** [\--from *file*] {*tag*...}
887

    
888
Remove tags from the cluster. If any of the tags are not existing
889
on the cluster, the entire operation will abort.
890

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

    
897
SEARCH-TAGS
898
^^^^^^^^^^^
899

    
900
**search-tags** {*pattern*}
901

    
902
Searches the tags on all objects in the cluster (the cluster
903
itself, the nodes and the instances) for a given pattern. The
904
pattern is interpreted as a regular expression and a search will be
905
done on it (i.e. the given pattern is not anchored to the beggining
906
of the string; if you want that, prefix the pattern with ^).
907

    
908
If no tags are matching the pattern, the exit code of the command
909
will be one. If there is at least one match, the exit code will be
910
zero. Each match is listed on one line, the object and the tag
911
separated by a space. The cluster will be listed as /cluster, a
912
node will be listed as /nodes/*name*, and an instance as
913
/instances/*name*. Example:
914

    
915
::
916

    
917
    # gnt-cluster search-tags time
918
    /cluster ctime:2007-09-01
919
    /nodes/node1.example.com mtime:2007-10-04
920

    
921
.. vim: set textwidth=72 :
922
.. Local Variables:
923
.. mode: rst
924
.. fill-column: 72
925
.. End: