Revert "Updated man pages with new SPICE TLS options"
[ganeti-local] / man / gnt-cluster.rst
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 ADD-TAGS
31 ~~~~~~~~
32
33 **add-tags** [--from *file*] {*tag*...}
34
35 Add tags to the cluster. If any of the tags contains invalid
36 characters, the entire operation will abort.
37
38 If the ``--from`` option is given, the list of tags will be
39 extended with the contents of that file (each line becomes a tag).
40 In this case, there is not need to pass tags on the command line
41 (if you do, both sources will be used). A file name of - will be
42 interpreted as stdin.
43
44 COMMAND
45 ~~~~~~~
46
47 **command** [-n *node*] [-g *group*] {*command*}
48
49 Executes a command on all nodes. If the option ``-n`` is not given,
50 the command will be executed on all nodes, otherwise it will be
51 executed only on the node(s) specified. Use the option multiple
52 times for running it on multiple nodes, like::
53
54     # gnt-cluster command -n node1.example.com -n node2.example.com date
55
56 The ``-g`` option can be used to run a command only on a specific node
57 group, e.g.::
58
59     # gnt-cluster command -g default date
60
61 The command is executed serially on the selected nodes. If the
62 master node is present in the list, the command will be executed
63 last on the master. Regarding the other nodes, the execution order
64 is somewhat alphabetic, so that node2.example.com will be earlier
65 than node10.example.com but after node1.example.com.
66
67 So given the node names node1, node2, node3, node10, node11, with
68 node3 being the master, the order will be: node1, node2, node10,
69 node11, node3.
70
71 The command is constructed by concatenating all other command line
72 arguments. For example, to list the contents of the /etc directory
73 on all nodes, run::
74
75     # gnt-cluster command ls -l /etc
76
77 and the command which will be executed will be ``ls -l /etc``.
78
79 COPYFILE
80 ~~~~~~~~
81
82 | **copyfile** [--use-replication-network] [-n *node*] [-g *group*]
83 | {*file*}
84
85 Copies a file to all or to some nodes. The argument specifies the
86 source file (on the current system), the ``-n`` argument specifies
87 the target node, or nodes if the option is given multiple times. If
88 ``-n`` is not given at all, the file will be copied to all nodes. The
89 ``-g`` option can be used to only select nodes in a specific node group.
90 Passing the ``--use-replication-network`` option will cause the
91 copy to be done over the replication network (only matters if the
92 primary/secondary IPs are different). Example::
93
94     # gnt-cluster -n node1.example.com -n node2.example.com copyfile /tmp/test
95
96 This will copy the file /tmp/test from the current node to the two
97 named nodes.
98
99 DEACTIVATE-MASTER-IP
100 ~~~~~~~~~~~~~~~~~~~~
101
102 **deactivate-master-ip** [--yes]
103
104 Deactivates the master IP on the master node.
105
106 This should be run only locally or on a connection to the node ip
107 directly, as a connection to the master ip will be broken by this
108 operation. Because of this risk it will require user confirmation
109 unless the ``--yes`` option is passed.
110
111 DESTROY
112 ~~~~~~~
113
114 **destroy** {--yes-do-it}
115
116 Remove all configuration files related to the cluster, so that a
117 **gnt-cluster init** can be done again afterwards.
118
119 Since this is a dangerous command, you are required to pass the
120 argument *--yes-do-it.*
121
122 EPO
123 ~~~
124
125 **epo** [--on] [--groups|--all] [--power-delay] *arguments*
126
127 Performs an emergency power-off on nodes given as arguments. If
128 ``--groups`` is given, arguments are node groups. If ``--all`` is
129 provided, the whole cluster will be shut down.
130
131 The ``--on`` flag recovers the cluster after an emergency power-off.
132 When powering on the cluster you can use ``--power-delay`` to define the
133 time in seconds (fractions allowed) waited between powering on
134 individual nodes.
135
136 Please note that the master node will not be turned down or up
137 automatically.  It will just be left in a state, where you can manully
138 perform the shutdown of that one node. If the master is in the list of
139 affected nodes and this is not a complete cluster emergency power-off
140 (e.g. using ``--all``), you're required to do a master failover to
141 another node not affected.
142
143 GETMASTER
144 ~~~~~~~~~
145
146 **getmaster**
147
148 Displays the current master node.
149
150 INFO
151 ~~~~
152
153 **info** [--roman]
154
155 Shows runtime cluster information: cluster name, architecture (32
156 or 64 bit), master node, node list and instance list.
157
158 Passing the ``--roman`` option gnt-cluster info will try to print
159 its integer fields in a latin friendly way. This allows further
160 diffusion of Ganeti among ancient cultures.
161
162 INIT
163 ~~~~
164
165 | **init**
166 | [{-s|--secondary-ip} *secondary\_ip*]
167 | [--vg-name *vg-name*]
168 | [--master-netdev *interface-name*]
169 | [{-m|--mac-prefix} *mac-prefix*]
170 | [--no-lvm-storage]
171 | [--no-etc-hosts]
172 | [--no-ssh-init]
173 | [--file-storage-dir *dir*]
174 | [--enabled-hypervisors *hypervisors*]
175 | [{-H|--hypervisor-parameters} *hypervisor*:*hv-param*=*value*[,*hv-param*=*value*...]]
176 | [{-B|--backend-parameters} *be-param*=*value* [,*be-param*=*value*...]]
177 | [{-N|--nic-parameters} *nic-param*=*value* [,*nic-param*=*value*...]]
178 | [--maintain-node-health {yes \| no}]
179 | [--uid-pool *user-id pool definition*]
180 | [{-I|--default-iallocator} *default instance allocator*]
181 | [--primary-ip-version *version*]
182 | [--prealloc-wipe-disks {yes \| no}]
183 | [--node-parameters *ndparams*]
184 | [{-C|--candidate-pool-size} *candidate\_pool\_size*]
185 | {*clustername*}
186
187 This commands is only run once initially on the first node of the
188 cluster. It will initialize the cluster configuration, setup the
189 ssh-keys, start the daemons on the master node, etc. in order to have
190 a working one-node cluster.
191
192 Note that the *clustername* is not any random name. It has to be
193 resolvable to an IP address using DNS, and it is best if you give the
194 fully-qualified domain name. This hostname must resolve to an IP
195 address reserved exclusively for this purpose, i.e. not already in
196 use.
197
198 The cluster can run in two modes: single-home or dual-homed. In the
199 first case, all traffic (both public traffic, inter-node traffic and
200 data replication traffic) goes over the same interface. In the
201 dual-homed case, the data replication traffic goes over the second
202 network. The ``-s (--secondary-ip)`` option here marks the cluster as
203 dual-homed and its parameter represents this node's address on the
204 second network.  If you initialise the cluster with ``-s``, all nodes
205 added must have a secondary IP as well.
206
207 Note that for Ganeti it doesn't matter if the secondary network is
208 actually a separate physical network, or is done using tunneling,
209 etc. For performance reasons, it's recommended to use a separate
210 network, of course.
211
212 The ``--vg-name`` option will let you specify a volume group
213 different than "xenvg" for Ganeti to use when creating instance
214 disks. This volume group must have the same name on all nodes. Once
215 the cluster is initialized this can be altered by using the
216 **modify** command. If you don't want to use lvm storage at all use
217 the ``--no-lvm-storage`` option. Once the cluster is initialized
218 you can change this setup with the **modify** command.
219
220 The ``--master-netdev`` option is useful for specifying a different
221 interface on which the master will activate its IP address. It's
222 important that all nodes have this interface because you'll need it
223 for a master failover.
224
225 The ``-m (--mac-prefix)`` option will let you specify a three byte
226 prefix under which the virtual MAC addresses of your instances will be
227 generated. The prefix must be specified in the format ``XX:XX:XX`` and
228 the default is ``aa:00:00``.
229
230 The ``--no-lvm-storage`` option allows you to initialize the
231 cluster without lvm support. This means that only instances using
232 files as storage backend will be possible to create. Once the
233 cluster is initialized you can change this setup with the
234 **modify** command.
235
236 The ``--no-etc-hosts`` option allows you to initialize the cluster
237 without modifying the /etc/hosts file.
238
239 The ``--no-ssh-init`` option allows you to initialize the cluster
240 without creating or distributing SSH key pairs.
241
242 The ``--file-storage-dir`` option allows you set the directory to
243 use for storing the instance disk files when using file storage as
244 backend for instance disks.
245
246 The ``--prealloc-wipe-disks`` sets a cluster wide configuration
247 value for wiping disks prior to allocation. This increases security
248 on instance level as the instance can't access untouched data from
249 it's underlying storage.
250
251 The ``--enabled-hypervisors`` option allows you to set the list of
252 hypervisors that will be enabled for this cluster. Instance
253 hypervisors can only be chosen from the list of enabled
254 hypervisors, and the first entry of this list will be used by
255 default. Currently, the following hypervisors are available:
256
257 xen-pvm
258     Xen PVM hypervisor
259
260 xen-hvm
261     Xen HVM hypervisor
262
263 kvm
264     Linux KVM hypervisor
265
266 chroot
267     a simple chroot manager that starts chroot based on a script at the
268     root of the filesystem holding the chroot
269
270 fake
271     fake hypervisor for development/testing
272
273 Either a single hypervisor name or a comma-separated list of
274 hypervisor names can be specified. If this option is not specified,
275 only the xen-pvm hypervisor is enabled by default.
276
277 The ``-H (--hypervisor-parameters)`` option allows you to set default
278 hypervisor specific parameters for the cluster. The format of this
279 option is the name of the hypervisor, followed by a colon and a
280 comma-separated list of key=value pairs. The keys available for each
281 hypervisors are detailed in the gnt-instance(8) man page, in the
282 **add** command plus the following parameters which are only
283 configurable globally (at cluster level):
284
285 migration\_port
286     Valid for the Xen PVM and KVM hypervisors.
287
288     This options specifies the TCP port to use for live-migration. For
289     Xen, the same port should be configured on all nodes in the
290     ``/etc/xen/xend-config.sxp`` file, under the key
291     "xend-relocation-port".
292
293 migration\_bandwidth
294     Valid for the KVM hypervisor.
295
296     This option specifies the maximum bandwidth that KVM will use for
297     instance live migrations. The value is in MiB/s.
298
299     This option is only effective with kvm versions >= 78 and qemu-kvm
300     versions >= 0.10.0.
301
302 The ``-B (--backend-parameters)`` option allows you to set the default
303 backend parameters for the cluster. The parameter format is a
304 comma-separated list of key=value pairs with the following supported
305 keys:
306
307 vcpus
308     Number of VCPUs to set for an instance by default, must be an
309     integer, will be set to 1 if no specified.
310
311 memory
312     Amount of memory to allocate for an instance by default, can be
313     either an integer or an integer followed by a unit (M for mebibytes
314     and G for gibibytes are supported), will be set to 128M if not
315     specified.
316
317 auto\_balance
318     Value of the auto\_balance flag for instances to use by default,
319     will be set to true if not specified.
320
321
322 The ``-N (--nic-parameters)`` option allows you to set the default nic
323 parameters for the cluster. The parameter format is a comma-separated
324 list of key=value pairs with the following supported keys:
325
326 mode
327     The default nic mode, 'routed' or 'bridged'.
328
329 link
330     In bridged mode the default NIC bridge. In routed mode it
331     represents an hypervisor-vif-script dependent value to allow
332     different instance groups. For example under the KVM default
333     network script it is interpreted as a routing table number or
334     name.
335
336 The option ``--maintain-node-health`` allows one to enable/disable
337 automatic maintenance actions on nodes. Currently these include
338 automatic shutdown of instances and deactivation of DRBD devices on
339 offline nodes; in the future it might be extended to automatic
340 removal of unknown LVM volumes, etc.
341
342 The ``--uid-pool`` option initializes the user-id pool. The
343 *user-id pool definition* can contain a list of user-ids and/or a
344 list of user-id ranges. The parameter format is a comma-separated
345 list of numeric user-ids or user-id ranges. The ranges are defined
346 by a lower and higher boundary, separated by a dash. The boundaries
347 are inclusive. If the ``--uid-pool`` option is not supplied, the
348 user-id pool is initialized to an empty list. An empty list means
349 that the user-id pool feature is disabled.
350
351 The ``-I (--default-iallocator)`` option specifies the default
352 instance allocator. The instance allocator will be used for operations
353 like instance creation, instance and node migration, etc. when no
354 manual override is specified. If this option is not specified and
355 htools was not enabled at build time, the default instance allocator
356 will be blank, which means that relevant operations will require the
357 administrator to manually specify either an instance allocator, or a
358 set of nodes. If the option is not specified but htools was enabled,
359 the default iallocator will be **hail**(1) (assuming it can be found
360 on disk). The default iallocator can be changed later using the
361 **modify** command.
362
363 The ``--primary-ip-version`` option specifies the IP version used
364 for the primary address. Possible values are 4 and 6 for IPv4 and
365 IPv6, respectively. This option is used when resolving node names
366 and the cluster name.
367
368 The ``--node-parameters`` option allows you to set default node
369 parameters for the cluster. Please see **ganeti**(7) for more
370 information about supported key=value pairs.
371
372 The ``-C (--candidate-pool-size)`` option specifies the
373 ``candidate_pool_size`` cluster parameter. This is the number of nodes
374 that the master will try to keep as master\_candidates. For more
375 details about this role and other node roles, see the ganeti(7).
376
377 LIST-TAGS
378 ~~~~~~~~~
379
380 **list-tags**
381
382 List the tags of the cluster.
383
384 MASTER-FAILOVER
385 ~~~~~~~~~~~~~~~
386
387 **master-failover** [--no-voting]
388
389 Failover the master role to the current node.
390
391 The ``--no-voting`` option skips the remote node agreement checks.
392 This is dangerous, but necessary in some cases (for example failing
393 over the master role in a 2 node cluster with the original master
394 down). If the original master then comes up, it won't be able to
395 start its master daemon because it won't have enough votes, but so
396 won't the new master, if the master daemon ever needs a restart.
397 You can pass ``--no-voting`` to **ganeti-masterd** on the new
398 master to solve this problem, and run **gnt-cluster redist-conf**
399 to make sure the cluster is consistent again.
400
401 MASTER-PING
402 ~~~~~~~~~~~
403
404 **master-ping**
405
406 Checks if the master daemon is alive.
407
408 If the master daemon is alive and can respond to a basic query (the
409 equivalent of **gnt-cluster info**), then the exit code of the
410 command will be 0. If the master daemon is not alive (either due to
411 a crash or because this is not the master node), the exit code will
412 be 1.
413
414 MODIFY
415 ~~~~~~
416
417 | **modify**
418 | [--vg-name *vg-name*]
419 | [--no-lvm-storage]
420 | [--enabled-hypervisors *hypervisors*]
421 | [{-H|--hypervisor-parameters} *hypervisor*:*hv-param*=*value*[,*hv-param*=*value*...]]
422 | [{-B|--backend-parameters} *be-param*=*value* [,*be-param*=*value*...]]
423 | [{-N|--nic-parameters} *nic-param*=*value* [,*nic-param*=*value*...]]
424 | [--uid-pool *user-id pool definition*]
425 | [--add-uids *user-id pool definition*]
426 | [--remove-uids *user-id pool definition*]
427 | [{-C|--candidate-pool-size} *candidate\_pool\_size*]
428 | [--maintain-node-health {yes \| no}]
429 | [--prealloc-wipe-disks {yes \| no}]
430 | [{-I|--default-iallocator} *default instance allocator*]
431 | [--reserved-lvs=*NAMES*]
432 | [--node-parameters *ndparams*]
433 | [--master-netdev *interface-name*]
434
435 Modify the options for the cluster.
436
437 The ``--vg-name``, ``--no-lvm-storarge``, ``--enabled-hypervisors``,
438 ``-H (--hypervisor-parameters)``, ``-B (--backend-parameters)``,
439 ``--nic-parameters``, ``-C (--candidate-pool-size)``,
440 ``--maintain-node-health``, ``--prealloc-wipe-disks``, ``--uid-pool``,
441 ``--node-parameters``, ``--master-netdev`` options are described in
442 the **init** command.
443
444 The ``--add-uids`` and ``--remove-uids`` options can be used to
445 modify the user-id pool by adding/removing a list of user-ids or
446 user-id ranges.
447
448 The option ``--reserved-lvs`` specifies a list (comma-separated) of
449 logical volume group names (regular expressions) that will be
450 ignored by the cluster verify operation. This is useful if the
451 volume group used for Ganeti is shared with the system for other
452 uses. Note that it's not recommended to create and mark as ignored
453 logical volume names which match Ganeti's own name format (starting
454 with UUID and then .diskN), as this option only skips the
455 verification, but not the actual use of the names given.
456
457 To remove all reserved logical volumes, pass in an empty argument
458 to the option, as in ``--reserved-lvs=`` or ``--reserved-lvs ''``.
459
460 The ``-I (--default-iallocator)`` is described in the **init**
461 command. To clear the default iallocator, just pass an empty string
462 ('').
463
464 QUEUE
465 ~~~~~
466
467 **queue** {drain | undrain | info}
468
469 Change job queue properties.
470
471 The ``drain`` option sets the drain flag on the job queue. No new
472 jobs will be accepted, but jobs already in the queue will be
473 processed.
474
475 The ``undrain`` will unset the drain flag on the job queue. New
476 jobs will be accepted.
477
478 The ``info`` option shows the properties of the job queue.
479
480 WATCHER
481 ~~~~~~~
482
483 **watcher** {pause *duration* | continue | info}
484
485 Make the watcher pause or let it continue.
486
487 The ``pause`` option causes the watcher to pause for *duration*
488 seconds.
489
490 The ``continue`` option will let the watcher continue.
491
492 The ``info`` option shows whether the watcher is currently paused.
493
494 redist-conf
495 ~~~~~~~~~~~
496
497 **redist-conf** [--submit]
498
499 This command forces a full push of configuration files from the
500 master node to the other nodes in the cluster. This is normally not
501 needed, but can be run if the **verify** complains about
502 configuration mismatches.
503
504 The ``--submit`` option is used to send the job to the master
505 daemon but not wait for its completion. The job ID will be shown so
506 that it can be examined via **gnt-job info**.
507
508 REMOVE-TAGS
509 ~~~~~~~~~~~
510
511 **remove-tags** [--from *file*] {*tag*...}
512
513 Remove tags from the cluster. If any of the tags are not existing
514 on the cluster, the entire operation will abort.
515
516 If the ``--from`` option is given, the list of tags to be removed will
517 be extended with the contents of that file (each line becomes a tag).
518 In this case, there is not need to pass tags on the command line (if
519 you do, tags from both sources will be removed). A file name of - will
520 be interpreted as stdin.
521
522 RENAME
523 ~~~~~~
524
525 **rename** [-f] {*name*}
526
527 Renames the cluster and in the process updates the master IP
528 address to the one the new name resolves to. At least one of either
529 the name or the IP address must be different, otherwise the
530 operation will be aborted.
531
532 Note that since this command can be dangerous (especially when run
533 over SSH), the command will require confirmation unless run with
534 the ``-f`` option.
535
536 RENEW-CRYPTO
537 ~~~~~~~~~~~~
538
539 | **renew-crypto** [-f]
540 | [--new-cluster-certificate] [--new-confd-hmac-key]
541 | [--new-rapi-certificate] [--rapi-certificate *rapi-cert*]
542 | [--new-cluster-domain-secret] [--cluster-domain-secret *filename*]
543
544 This command will stop all Ganeti daemons in the cluster and start
545 them again once the new certificates and keys are replicated. The
546 options ``--new-cluster-certificate`` and ``--new-confd-hmac-key``
547 can be used to regenerate the cluster-internal SSL certificate
548 respective the HMAC key used by ganeti-confd(8).
549
550 To generate a new self-signed RAPI certificate (used by
551 ganeti-rapi(8)) specify ``--new-rapi-certificate``. If you want to
552 use your own certificate, e.g. one signed by a certificate
553 authority (CA), pass its filename to ``--rapi-certificate``.
554
555 ``--new-cluster-domain-secret`` generates a new, random cluster
556 domain secret. ``--cluster-domain-secret`` reads the secret from a
557 file. The cluster domain secret is used to sign information
558 exchanged between separate clusters via a third party.
559
560 REPAIR-DISK-SIZES
561 ~~~~~~~~~~~~~~~~~
562
563 **repair-disk-sizes** [instance...]
564
565 This command checks that the recorded size of the given instance's
566 disks matches the actual size and updates any mismatches found.
567 This is needed if the Ganeti configuration is no longer consistent
568 with reality, as it will impact some disk operations. If no
569 arguments are given, all instances will be checked.
570
571 Note that only active disks can be checked by this command; in case
572 a disk cannot be activated it's advised to use
573 **gnt-instance activate-disks --ignore-size ...** to force
574 activation without regard to the current size.
575
576 When the all disk sizes are consistent, the command will return no
577 output. Otherwise it will log details about the inconsistencies in
578 the configuration.
579
580 SEARCH-TAGS
581 ~~~~~~~~~~~
582
583 **search-tags** {*pattern*}
584
585 Searches the tags on all objects in the cluster (the cluster
586 itself, the nodes and the instances) for a given pattern. The
587 pattern is interpreted as a regular expression and a search will be
588 done on it (i.e. the given pattern is not anchored to the beggining
589 of the string; if you want that, prefix the pattern with ^).
590
591 If no tags are matching the pattern, the exit code of the command
592 will be one. If there is at least one match, the exit code will be
593 zero. Each match is listed on one line, the object and the tag
594 separated by a space. The cluster will be listed as /cluster, a
595 node will be listed as /nodes/*name*, and an instance as
596 /instances/*name*. Example:
597
598 ::
599
600     # gnt-cluster search-tags time
601     /cluster ctime:2007-09-01
602     /nodes/node1.example.com mtime:2007-10-04
603
604 VERIFY
605 ~~~~~~
606
607 **verify** [--no-nplus1-mem] [--node-group *nodegroup*]
608
609 Verify correctness of cluster configuration. This is safe with
610 respect to running instances, and incurs no downtime of the
611 instances.
612
613 If the ``--no-nplus1-mem`` option is given, Ganeti won't check
614 whether if it loses a node it can restart all the instances on
615 their secondaries (and report an error otherwise).
616
617 With ``--node-group``, restrict the verification to those nodes and
618 instances that live in the named group. This will not verify global
619 settings, but will allow to perform verification of a group while other
620 operations are ongoing in other groups.
621
622 VERIFY-DISKS
623 ~~~~~~~~~~~~
624
625 **verify-disks**
626
627 The command checks which instances have degraded DRBD disks and
628 activates the disks of those instances.
629
630 This command is run from the **ganeti-watcher** tool, which also
631 has a different, complementary algorithm for doing this check.
632 Together, these two should ensure that DRBD disks are kept
633 consistent.
634
635 VERSION
636 ~~~~~~~
637
638 **version**
639
640 Show the cluster version.
641
642 .. vim: set textwidth=72 :
643 .. Local Variables:
644 .. mode: rst
645 .. fill-column: 72
646 .. End: