Cleanup of the INSTALL file
[ganeti-local] / man / gnt-instance.rst
1 gnt-instance(8) Ganeti | Version @GANETI_VERSION@
2 =================================================
3
4 Name
5 ----
6
7 gnt-instance - Ganeti instance administration
8
9 Synopsis
10 --------
11
12 **gnt-instance** {command} [arguments...]
13
14 DESCRIPTION
15 -----------
16
17 The **gnt-instance** command is used for instance administration in
18 the Ganeti system.
19
20 COMMANDS
21 --------
22
23 Creation/removal/querying
24 ~~~~~~~~~~~~~~~~~~~~~~~~~
25
26 ADD
27 ^^^
28
29 | **add**
30 | {-t|\--disk-template {diskless | file \| plain \| drbd \| rbd}}
31 | {\--disk=*N*: {size=*VAL* \| adopt=*LV*}[,options...]
32 |  \| {size=*VAL*,provider=*PROVIDER*}[,param=*value*... ][,options...]
33 |  \| {-s|\--os-size} *SIZE*}
34 | [\--no-ip-check] [\--no-name-check] [\--no-start] [\--no-install]
35 | [\--net=*N* [:options...] \| \--no-nics]
36 | [{-B|\--backend-parameters} *BEPARAMS*]
37 | [{-H|\--hypervisor-parameters} *HYPERVISOR* [: option=*value*... ]]
38 | [{-O|\--os-parameters} *param*=*value*... ]
39 | [\--file-storage-dir *dir\_path*] [\--file-driver {loop \| blktap}]
40 | {{-n|\--node} *node[:secondary-node]* \| {-I|\--iallocator} *name*}
41 | {{-o|\--os-type} *os-type*}
42 | [\--submit]
43 | [\--ignore-ipolicy]
44 | {*instance*}
45
46 Creates a new instance on the specified host. The *instance* argument
47 must be in DNS, but depending on the bridge/routing setup, need not be
48 in the same network as the nodes in the cluster.
49
50 The ``disk`` option specifies the parameters for the disks of the
51 instance. The numbering of disks starts at zero, and at least one disk
52 needs to be passed. For each disk, either the size or the adoption
53 source needs to be given. The size is interpreted (when no unit is
54 given) in mebibytes. You can also use one of the suffixes *m*, *g* or
55 *t* to specify the exact the units used; these suffixes map to
56 mebibytes, gibibytes and tebibytes. Each disk can also take these
57 parameters (all optional):
58
59 mode
60   The access mode. Either ``ro`` (read-only) or the default ``rw``
61   (read-write).
62
63 name
64    this option specifies a name for the disk, which can be used as a disk
65    identifier. An instance can not have two disks with the same name.
66
67 vg
68    The LVM volume group. This works only for LVM and DRBD devices.
69
70 metavg
71    This options specifies a different VG for the metadata device. This
72    works only for DRBD devices
73
74 When creating ExtStorage disks, also arbitrary parameters can be passed,
75 to the ExtStorage provider. Those parameters are passed as additional
76 comma separated options. Therefore, an ExtStorage disk provided by
77 provider ``pvdr1`` with parameters ``param1``, ``param2`` would be
78 passed as ``--disk 0:size=10G,provider=pvdr1,param1=val1,param2=val2``.
79
80 When using the ``adopt`` key in the disk definition, Ganeti will
81 reuse those volumes (instead of creating new ones) as the
82 instance's disks. Ganeti will rename these volumes to the standard
83 format, and (without installing the OS) will use them as-is for the
84 instance. This allows migrating instances from non-managed mode
85 (e.g. plain KVM with LVM) to being managed via Ganeti. Please note that
86 this works only for the \`plain' disk template (see below for
87 template details).
88
89 Alternatively, a single-disk instance can be created via the ``-s``
90 option which takes a single argument, the size of the disk. This is
91 similar to the Ganeti 1.2 version (but will only create one disk).
92
93 The minimum disk specification is therefore ``--disk 0:size=20G`` (or
94 ``-s 20G`` when using the ``-s`` option), and a three-disk instance
95 can be specified as ``--disk 0:size=20G --disk 1:size=4G --disk
96 2:size=100G``.
97
98 The minimum information needed to specify an ExtStorage disk are the
99 ``size`` and the ``provider``. For example:
100 ``--disk 0:size=20G,provider=pvdr1``.
101
102 The ``--no-ip-check`` skips the checks that are done to see if the
103 instance's IP is not already alive (i.e. reachable from the master
104 node).
105
106 The ``--no-name-check`` skips the check for the instance name via
107 the resolver (e.g. in DNS or /etc/hosts, depending on your setup).
108 Since the name check is used to compute the IP address, if you pass
109 this option you must also pass the ``--no-ip-check`` option.
110
111 If you don't want the instance to automatically start after
112 creation, this is possible via the ``--no-start`` option. This will
113 leave the instance down until a subsequent **gnt-instance start**
114 command.
115
116 The NICs of the instances can be specified via the ``--net``
117 option. By default, one NIC is created for the instance, with a
118 random MAC, and set up according the the cluster level NIC
119 parameters. Each NIC can take these parameters (all optional):
120
121 mac
122     either a value or 'generate' to generate a new unique MAC
123
124 ip
125     specifies the IP address assigned to the instance from the Ganeti
126     side (this is not necessarily what the instance will use, but what
127     the node expects the instance to use)
128
129 mode
130     specifies the connection mode for this NIC: routed, bridged or
131     openvswitch.
132
133 link
134     in bridged or openvswitch mode specifies the interface to attach
135     this NIC to, in routed mode it's intended to differentiate between
136     different routing tables/instance groups (but the meaning is
137     dependent on the network script, see **gnt-cluster**\(8) for more
138     details). Note that openvswitch support is also hypervisor
139     dependent.
140
141 network
142     derives the mode and the link from the settings of the network
143     which is identified by its name. If the network option is chosen,
144     link and mode must not be specified. Note that the mode and link
145     depend on the network-to-nodegroup connection, thus allowing
146     different nodegroups to be connected to the same network in
147     different ways.
148
149 name
150    this option specifies a name for the NIC, which can be used as a NIC
151    identifier. An instance can not have two NICs with the same name.
152
153
154 Of these "mode" and "link" are NIC parameters, and inherit their
155 default at cluster level.  Alternatively, if no network is desired for
156 the instance, you can prevent the default of one NIC with the
157 ``--no-nics`` option.
158
159 The ``-o (--os-type)`` option specifies the operating system to be
160 installed.  The available operating systems can be listed with
161 **gnt-os list**.  Passing ``--no-install`` will however skip the OS
162 installation, allowing a manual import if so desired. Note that the
163 no-installation mode will automatically disable the start-up of the
164 instance (without an OS, it most likely won't be able to start-up
165 successfully).
166
167 The ``-B (--backend-parameters)`` option specifies the backend
168 parameters for the instance. If no such parameters are specified, the
169 values are inherited from the cluster. Possible parameters are:
170
171 maxmem
172     the maximum memory size of the instance; as usual, suffixes can be
173     used to denote the unit, otherwise the value is taken in mebibytes
174
175 minmem
176     the minimum memory size of the instance; as usual, suffixes can be
177     used to denote the unit, otherwise the value is taken in mebibytes
178
179 vcpus
180     the number of VCPUs to assign to the instance (if this value makes
181     sense for the hypervisor)
182
183 auto\_balance
184     whether the instance is considered in the N+1 cluster checks
185     (enough redundancy in the cluster to survive a node failure)
186
187 always\_failover
188     ``True`` or ``False``, whether the instance must be failed over
189     (shut down and rebooted) always or it may be migrated (briefly
190     suspended)
191
192 Note that before 2.6 Ganeti had a ``memory`` parameter, which was the
193 only value of memory an instance could have. With the
194 ``maxmem``/``minmem`` change Ganeti guarantees that at least the minimum
195 memory is always available for an instance, but allows more memory to be
196 used (up to the maximum memory) should it be free.
197
198 The ``-H (--hypervisor-parameters)`` option specified the hypervisor
199 to use for the instance (must be one of the enabled hypervisors on the
200 cluster) and optionally custom parameters for this instance. If not
201 other options are used (i.e. the invocation is just -H *NAME*) the
202 instance will inherit the cluster options. The defaults below show the
203 cluster defaults at cluster creation time.
204
205 The possible hypervisor options are as follows:
206
207 boot\_order
208     Valid for the Xen HVM and KVM hypervisors.
209
210     A string value denoting the boot order. This has different meaning
211     for the Xen HVM hypervisor and for the KVM one.
212
213     For Xen HVM, The boot order is a string of letters listing the boot
214     devices, with valid device letters being:
215
216     a
217         floppy drive
218
219     c
220         hard disk
221
222     d
223         CDROM drive
224
225     n
226         network boot (PXE)
227
228     The default is not to set an HVM boot order, which is interpreted
229     as 'dc'.
230
231     For KVM the boot order is either "floppy", "cdrom", "disk" or
232     "network".  Please note that older versions of KVM couldn't netboot
233     from virtio interfaces. This has been fixed in more recent versions
234     and is confirmed to work at least with qemu-kvm 0.11.1. Also note
235     that if you have set the ``kernel_path`` option, that will be used
236     for booting, and this setting will be silently ignored.
237
238 blockdev\_prefix
239     Valid for the Xen HVM and PVM hypervisors.
240
241     Relevant to non-pvops guest kernels, in which the disk device names
242     are given by the host.  Allows one to specify 'xvd', which helps run
243     Red Hat based installers, driven by anaconda.
244
245 floppy\_image\_path
246     Valid for the KVM hypervisor.
247
248     The path to a floppy disk image to attach to the instance.  This
249     is useful to install Windows operating systems on Virt/IO disks
250     because you can specify here the floppy for the drivers at
251     installation time.
252
253 cdrom\_image\_path
254     Valid for the Xen HVM and KVM hypervisors.
255
256     The path to a CDROM image to attach to the instance.
257
258 cdrom2\_image\_path
259     Valid for the KVM hypervisor.
260
261     The path to a second CDROM image to attach to the instance.
262     **NOTE**: This image can't be used to boot the system. To do that
263     you have to use the 'cdrom\_image\_path' option.
264
265 nic\_type
266     Valid for the Xen HVM and KVM hypervisors.
267
268     This parameter determines the way the network cards are presented
269     to the instance. The possible options are:
270
271     - rtl8139 (default for Xen HVM) (HVM & KVM)
272     - ne2k\_isa (HVM & KVM)
273     - ne2k\_pci (HVM & KVM)
274     - i82551 (KVM)
275     - i82557b (KVM)
276     - i82559er (KVM)
277     - pcnet (KVM)
278     - e1000 (KVM)
279     - paravirtual (default for KVM) (HVM & KVM)
280
281 disk\_type
282     Valid for the Xen HVM and KVM hypervisors.
283
284     This parameter determines the way the disks are presented to the
285     instance. The possible options are:
286
287     - ioemu [default] (HVM & KVM)
288     - ide (HVM & KVM)
289     - scsi (KVM)
290     - sd (KVM)
291     - mtd (KVM)
292     - pflash (KVM)
293
294
295 cdrom\_disk\_type
296     Valid for the KVM hypervisor.
297
298     This parameter determines the way the cdroms disks are presented
299     to the instance. The default behavior is to get the same value of
300     the earlier parameter (disk_type). The possible options are:
301
302     - paravirtual
303     - ide
304     - scsi
305     - sd
306     - mtd
307     - pflash
308
309
310 vnc\_bind\_address
311     Valid for the Xen HVM and KVM hypervisors.
312
313     Specifies the address that the VNC listener for this instance
314     should bind to. Valid values are IPv4 addresses. Use the address
315     0.0.0.0 to bind to all available interfaces (this is the default)
316     or specify the address of one of the interfaces on the node to
317     restrict listening to that interface.
318
319 vnc\_tls
320     Valid for the KVM hypervisor.
321
322     A boolean option that controls whether the VNC connection is
323     secured with TLS.
324
325 vnc\_x509\_path
326     Valid for the KVM hypervisor.
327
328     If ``vnc_tls`` is enabled, this options specifies the path to the
329     x509 certificate to use.
330
331 vnc\_x509\_verify
332     Valid for the KVM hypervisor.
333
334 spice\_bind
335     Valid for the KVM hypervisor.
336
337     Specifies the address or interface on which the SPICE server will
338     listen. Valid values are:
339
340     - IPv4 addresses, including 0.0.0.0 and 127.0.0.1
341     - IPv6 addresses, including :: and ::1
342     - names of network interfaces
343
344     If a network interface is specified, the SPICE server will be bound
345     to one of the addresses of that interface.
346
347 spice\_ip\_version
348     Valid for the KVM hypervisor.
349
350     Specifies which version of the IP protocol should be used by the
351     SPICE server.
352
353     It is mainly intended to be used for specifying what kind of IP
354     addresses should be used if a network interface with both IPv4 and
355     IPv6 addresses is specified via the ``spice_bind`` parameter. In
356     this case, if the ``spice_ip_version`` parameter is not used, the
357     default IP version of the cluster will be used.
358
359 spice\_password\_file
360     Valid for the KVM hypervisor.
361
362     Specifies a file containing the password that must be used when
363     connecting via the SPICE protocol. If the option is not specified,
364     passwordless connections are allowed.
365
366 spice\_image\_compression
367     Valid for the KVM hypervisor.
368
369     Configures the SPICE lossless image compression. Valid values are:
370
371     - auto_glz
372     - auto_lz
373     - quic
374     - glz
375     - lz
376     - off
377
378 spice\_jpeg\_wan\_compression
379     Valid for the KVM hypervisor.
380
381     Configures how SPICE should use the jpeg algorithm for lossy image
382     compression on slow links. Valid values are:
383
384     - auto
385     - never
386     - always
387
388 spice\_zlib\_glz\_wan\_compression
389     Valid for the KVM hypervisor.
390
391     Configures how SPICE should use the zlib-glz algorithm for lossy image
392     compression on slow links. Valid values are:
393
394     - auto
395     - never
396     - always
397
398 spice\_streaming\_video
399     Valid for the KVM hypervisor.
400
401     Configures how SPICE should detect video streams. Valid values are:
402
403     - off
404     - all
405     - filter
406
407 spice\_playback\_compression
408     Valid for the KVM hypervisor.
409
410     Configures whether SPICE should compress audio streams or not.
411
412 spice\_use\_tls
413     Valid for the KVM hypervisor.
414
415     Specifies that the SPICE server must use TLS to encrypt all the
416     traffic with the client.
417
418 spice\_tls\_ciphers
419     Valid for the KVM hypervisor.
420
421     Specifies a list of comma-separated ciphers that SPICE should use
422     for TLS connections. For the format, see man **cipher**\(1).
423
424 spice\_use\_vdagent
425     Valid for the KVM hypervisor.
426
427     Enables or disables passing mouse events via SPICE vdagent.
428
429 cpu\_type
430     Valid for the KVM hypervisor.
431
432     This parameter determines the emulated cpu for the instance. If this
433     parameter is empty (which is the default configuration), it will not
434     be passed to KVM.
435
436     Be aware of setting this parameter to ``"host"`` if you have nodes
437     with different CPUs from each other. Live migration may stop working
438     in this situation.
439
440     For more information please refer to the KVM manual.
441
442 acpi
443     Valid for the Xen HVM and KVM hypervisors.
444
445     A boolean option that specifies if the hypervisor should enable
446     ACPI support for this instance. By default, ACPI is disabled.
447
448 pae
449     Valid for the Xen HVM and KVM hypervisors.
450
451     A boolean option that specifies if the hypervisor should enabled
452     PAE support for this instance. The default is false, disabling PAE
453     support.
454
455 use\_localtime
456     Valid for the Xen HVM and KVM hypervisors.
457
458     A boolean option that specifies if the instance should be started
459     with its clock set to the localtime of the machine (when true) or
460     to the UTC (When false). The default is false, which is useful for
461     Linux/Unix machines; for Windows OSes, it is recommended to enable
462     this parameter.
463
464 kernel\_path
465     Valid for the Xen PVM and KVM hypervisors.
466
467     This option specifies the path (on the node) to the kernel to boot
468     the instance with. Xen PVM instances always require this, while for
469     KVM if this option is empty, it will cause the machine to load the
470     kernel from its disks (and the boot will be done accordingly to
471     ``boot_order``).
472
473 kernel\_args
474     Valid for the Xen PVM and KVM hypervisors.
475
476     This options specifies extra arguments to the kernel that will be
477     loaded. device. This is always used for Xen PVM, while for KVM it
478     is only used if the ``kernel_path`` option is also specified.
479
480     The default setting for this value is simply ``"ro"``, which
481     mounts the root disk (initially) in read-only one. For example,
482     setting this to single will cause the instance to start in
483     single-user mode.
484
485 initrd\_path
486     Valid for the Xen PVM and KVM hypervisors.
487
488     This option specifies the path (on the node) to the initrd to boot
489     the instance with. Xen PVM instances can use this always, while
490     for KVM if this option is only used if the ``kernel_path`` option
491     is also specified. You can pass here either an absolute filename
492     (the path to the initrd) if you want to use an initrd, or use the
493     format no\_initrd\_path for no initrd.
494
495 root\_path
496     Valid for the Xen PVM and KVM hypervisors.
497
498     This options specifies the name of the root device. This is always
499     needed for Xen PVM, while for KVM it is only used if the
500     ``kernel_path`` option is also specified.
501
502     Please note, that if this setting is an empty string and the
503     hypervisor is Xen it will not be written to the Xen configuration
504     file
505
506 serial\_console
507     Valid for the KVM hypervisor.
508
509     This boolean option specifies whether to emulate a serial console
510     for the instance. Note that some versions of KVM have a bug that
511     will make an instance hang when configured to use the serial console
512     unless a connection is made to it within about 2 seconds of the
513     instance's startup. For such case it's recommended to disable this
514     option, which is enabled by default.
515
516 serial\_speed
517     Valid for the KVM hypervisor.
518
519     This integer option specifies the speed of the serial console.
520     Common values are 9600, 19200, 38400, 57600 and 115200: choose the
521     one which works on your system. (The default is 38400 for historical
522     reasons, but newer versions of kvm/qemu work with 115200)
523
524 disk\_cache
525     Valid for the KVM hypervisor.
526
527     The disk cache mode. It can be either default to not pass any
528     cache option to KVM, or one of the KVM cache modes: none (for
529     direct I/O), writethrough (to use the host cache but report
530     completion to the guest only when the host has committed the
531     changes to disk) or writeback (to use the host cache and report
532     completion as soon as the data is in the host cache). Note that
533     there are special considerations for the cache mode depending on
534     version of KVM used and disk type (always raw file under Ganeti),
535     please refer to the KVM documentation for more details.
536
537 security\_model
538     Valid for the KVM hypervisor.
539
540     The security model for kvm. Currently one of *none*, *user* or
541     *pool*. Under *none*, the default, nothing is done and instances
542     are run as the Ganeti daemon user (normally root).
543
544     Under *user* kvm will drop privileges and become the user
545     specified by the security\_domain parameter.
546
547     Under *pool* a global cluster pool of users will be used, making
548     sure no two instances share the same user on the same node. (this
549     mode is not implemented yet)
550
551 security\_domain
552     Valid for the KVM hypervisor.
553
554     Under security model *user* the username to run the instance
555     under.  It must be a valid username existing on the host.
556
557     Cannot be set under security model *none* or *pool*.
558
559 kvm\_flag
560     Valid for the KVM hypervisor.
561
562     If *enabled* the -enable-kvm flag is passed to kvm. If *disabled*
563     -disable-kvm is passed. If unset no flag is passed, and the
564     default running mode for your kvm binary will be used.
565
566 mem\_path
567     Valid for the KVM hypervisor.
568
569     This option passes the -mem-path argument to kvm with the path (on
570     the node) to the mount point of the hugetlbfs file system, along
571     with the -mem-prealloc argument too.
572
573 use\_chroot
574     Valid for the KVM hypervisor.
575
576     This boolean option determines whether to run the KVM instance in a
577     chroot directory.
578
579     If it is set to ``true``, an empty directory is created before
580     starting the instance and its path is passed via the -chroot flag
581     to kvm. The directory is removed when the instance is stopped.
582
583     It is set to ``false`` by default.
584
585 migration\_downtime
586     Valid for the KVM hypervisor.
587
588     The maximum amount of time (in ms) a KVM instance is allowed to be
589     frozen during a live migration, in order to copy dirty memory
590     pages. Default value is 30ms, but you may need to increase this
591     value for busy instances.
592
593     This option is only effective with kvm versions >= 87 and qemu-kvm
594     versions >= 0.11.0.
595
596 cpu\_mask
597     Valid for the Xen, KVM and LXC hypervisors.
598
599     The processes belonging to the given instance are only scheduled
600     on the specified CPUs.
601
602     The format of the mask can be given in three forms. First, the word
603     "all", which signifies the common case where all VCPUs can live on
604     any CPU, based on the hypervisor's decisions.
605
606     Second, a comma-separated list of CPU IDs or CPU ID ranges. The
607     ranges are defined by a lower and higher boundary, separated by a
608     dash, and the boundaries are inclusive. In this form, all VCPUs of
609     the instance will be mapped on the selected list of CPUs. Example:
610     ``0-2,5``, mapping all VCPUs (no matter how many) onto physical CPUs
611     0, 1, 2 and 5.
612
613     The last form is used for explicit control of VCPU-CPU pinnings. In
614     this form, the list of VCPU mappings is given as a colon (:)
615     separated list, whose elements are the possible values for the
616     second or first form above. In this form, the number of elements in
617     the colon-separated list _must_ equal the number of VCPUs of the
618     instance.
619
620     Example:
621
622     .. code-block:: bash
623
624       # Map the entire instance to CPUs 0-2
625       gnt-instance modify -H cpu_mask=0-2 my-inst
626
627       # Map vCPU 0 to physical CPU 1 and vCPU 1 to CPU 3 (assuming 2 vCPUs)
628       gnt-instance modify -H cpu_mask=1:3 my-inst
629
630       # Pin vCPU 0 to CPUs 1 or 2, and vCPU 1 to any CPU
631       gnt-instance modify -H cpu_mask=1-2:all my-inst
632
633       # Pin vCPU 0 to any CPU, vCPU 1 to CPUs 1, 3, 4 or 5, and CPU 2 to
634       # CPU 0 (backslashes for escaping the comma)
635       gnt-instance modify -H cpu_mask=all:1\\,3-5:0 my-inst
636
637       # Pin entire VM to CPU 0
638       gnt-instance modify -H cpu_mask=0 my-inst
639
640       # Turn off CPU pinning (default setting)
641       gnt-instance modify -H cpu_mask=all my-inst
642
643 cpu\_cap
644     Valid for the Xen hypervisor.
645
646     Set the maximum amount of cpu usage by the VM. The value is a percentage
647     between 0 and (100 * number of VCPUs). Default cap is 0: unlimited.
648
649 cpu\_weight
650     Valid for the Xen hypervisor.
651
652     Set the cpu time ratio to be allocated to the VM. Valid values are
653     between 1 and 65535. Default weight is 256.
654
655 usb\_mouse
656     Valid for the KVM hypervisor.
657
658     This option specifies the usb mouse type to be used. It can be
659     "mouse" or "tablet". When using VNC it's recommended to set it to
660     "tablet".
661
662 keymap
663     Valid for the KVM hypervisor.
664
665     This option specifies the keyboard mapping to be used. It is only
666     needed when using the VNC console. For example: "fr" or "en-gb".
667
668 reboot\_behavior
669     Valid for Xen PVM, Xen HVM and KVM hypervisors.
670
671     Normally if an instance reboots, the hypervisor will restart it. If
672     this option is set to ``exit``, the hypervisor will treat a reboot
673     as a shutdown instead.
674
675     It is set to ``reboot`` by default.
676
677 cpu\_cores
678     Valid for the KVM hypervisor.
679
680     Number of emulated CPU cores.
681
682 cpu\_threads
683     Valid for the KVM hypervisor.
684
685     Number of emulated CPU threads.
686
687 cpu\_sockets
688     Valid for the KVM hypervisor.
689
690     Number of emulated CPU sockets.
691
692 soundhw
693     Valid for the KVM hypervisor.
694
695     Comma separated list of emulated sounds cards, or "all" to enable
696     all the available ones.
697
698 usb\_devices
699     Valid for the KVM hypervisor.
700
701     Comma separated list of usb devices. These can be emulated devices
702     or passthrough ones, and each one gets passed to kvm with its own
703     ``-usbdevice`` option. See the **qemu**\(1) manpage for the syntax
704     of the possible components.
705
706 vga
707     Valid for the KVM hypervisor.
708
709     Emulated vga mode, passed the the kvm -vga option.
710
711 kvm\_extra
712     Valid for the KVM hypervisor.
713
714     Any other option to the KVM hypervisor, useful tweaking anything
715     that Ganeti doesn't support.
716
717 machine\_version
718     Valid for the KVM hypervisor.
719
720     Use in case an instance must be booted with an exact type of
721     machine version (due to e.g. outdated drivers). In case it's not set
722     the default version supported by your version of kvm is used.
723
724 kvm\_path
725     Valid for the KVM hypervisor.
726
727     Path to the userspace KVM (or qemu) program.
728
729 The ``-O (--os-parameters)`` option allows customisation of the OS
730 parameters. The actual parameter names and values depends on the OS
731 being used, but the syntax is the same key=value. For example, setting
732 a hypothetical ``dhcp`` parameter to yes can be achieved by::
733
734     gnt-instance add -O dhcp=yes ...
735
736 The ``-I (--iallocator)`` option specifies the instance allocator plugin
737 to use (``.`` means the default allocator). If you pass in this option
738 the allocator will select nodes for this instance automatically, so you
739 don't need to pass them with the ``-n`` option. For more information
740 please refer to the instance allocator documentation.
741
742 The ``-t (--disk-template)`` options specifies the disk layout type
743 for the instance.  The available choices are:
744
745 diskless
746     This creates an instance with no disks. Its useful for testing only
747     (or other special cases).
748
749 file
750     Disk devices will be regular files.
751
752 sharedfile
753     Disk devices will be regulare files on a shared directory.
754
755 plain
756     Disk devices will be logical volumes.
757
758 drbd
759     Disk devices will be drbd (version 8.x) on top of lvm volumes.
760
761 rbd
762     Disk devices will be rbd volumes residing inside a RADOS cluster.
763
764 blockdev
765     Disk devices will be adopted pre-existent block devices.
766
767 ext
768     Disk devices will be provided by external shared storage,
769     through the ExtStorage Interface using ExtStorage providers.
770
771 The optional second value of the ``-n (--node)`` is used for the drbd
772 template type and specifies the remote node.
773
774 If you do not want gnt-instance to wait for the disk mirror to be
775 synced, use the ``--no-wait-for-sync`` option.
776
777 The ``--file-storage-dir`` specifies the relative path under the
778 cluster-wide file storage directory to store file-based disks. It is
779 useful for having different subdirectories for different
780 instances. The full path of the directory where the disk files are
781 stored will consist of cluster-wide file storage directory + optional
782 subdirectory + instance name. Example:
783 ``@RPL_FILE_STORAGE_DIR@/mysubdir/instance1.example.com``. This
784 option is only relevant for instances using the file storage backend.
785
786 The ``--file-driver`` specifies the driver to use for file-based
787 disks. Note that currently these drivers work with the xen hypervisor
788 only. This option is only relevant for instances using the file
789 storage backend. The available choices are:
790
791 loop
792     Kernel loopback driver. This driver uses loopback devices to
793     access the filesystem within the file. However, running I/O
794     intensive applications in your instance using the loop driver
795     might result in slowdowns. Furthermore, if you use the loopback
796     driver consider increasing the maximum amount of loopback devices
797     (on most systems it's 8) using the max\_loop param.
798
799 blktap
800     The blktap driver (for Xen hypervisors). In order to be able to
801     use the blktap driver you should check if the 'blktapctrl' user
802     space disk agent is running (usually automatically started via
803     xend).  This user-level disk I/O interface has the advantage of
804     better performance. Especially if you use a network file system
805     (e.g. NFS) to store your instances this is the recommended choice.
806
807 If ``--ignore-ipolicy`` is given any instance policy violations occuring
808 during this operation are ignored.
809
810 See **ganeti**\(7) for a description of ``--submit`` and other common
811 options.
812
813 Example::
814
815     # gnt-instance add -t file --disk 0:size=30g -B maxmem=512 -o debian-etch \
816       -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
817     # gnt-instance add -t plain --disk 0:size=30g -B maxmem=1024,minmem=512 \
818       -o debian-etch -n node1.example.com instance1.example.com
819     # gnt-instance add -t plain --disk 0:size=30g --disk 1:size=100g,vg=san \
820       -B maxmem=512 -o debian-etch -n node1.example.com instance1.example.com
821     # gnt-instance add -t drbd --disk 0:size=30g -B maxmem=512 -o debian-etch \
822       -n node1.example.com:node2.example.com instance2.example.com
823     # gnt-instance add -t rbd --disk 0:size=30g -B maxmem=512 -o debian-etch \
824       -n node1.example.com instance1.example.com
825     # gnt-instance add -t ext --disk 0:size=30g,provider=pvdr1 -B maxmem=512 \
826       -o debian-etch -n node1.example.com instance1.example.com
827     # gnt-instance add -t ext --disk 0:size=30g,provider=pvdr1,param1=val1 \
828       --disk 1:size=40g,provider=pvdr2,param2=val2,param3=val3 -B maxmem=512 \
829       -o debian-etch -n node1.example.com instance1.example.com
830
831
832 BATCH-CREATE
833 ^^^^^^^^^^^^
834
835 **batch-create** {instances\_file.json}
836
837 This command (similar to the Ganeti 1.2 **batcher** tool) submits
838 multiple instance creation jobs based on a definition file. The
839 instance configurations do not encompass all the possible options for
840 the **add** command, but only a subset.
841
842 The instance file should be a valid-formed JSON file, containing a
843 dictionary with instance name and instance parameters. The accepted
844 parameters are:
845
846 disk\_size
847     The size of the disks of the instance.
848
849 disk\_template
850     The disk template to use for the instance, the same as in the
851     **add** command.
852
853 backend
854     A dictionary of backend parameters.
855
856 hypervisor
857     A dictionary with a single key (the hypervisor name), and as value
858     the hypervisor options. If not passed, the default hypervisor and
859     hypervisor options will be inherited.
860
861 mac, ip, mode, link
862     Specifications for the one NIC that will be created for the
863     instance. 'bridge' is also accepted as a backwards compatible
864     key.
865
866 nics
867     List of NICs that will be created for the instance. Each entry
868     should be a dict, with mac, ip, mode and link as possible keys.
869     Please don't provide the "mac, ip, mode, link" parent keys if you
870     use this method for specifying NICs.
871
872 primary\_node, secondary\_node
873     The primary and optionally the secondary node to use for the
874     instance (in case an iallocator script is not used).
875
876 iallocator
877     Instead of specifying the nodes, an iallocator script can be used
878     to automatically compute them.
879
880 start
881     whether to start the instance
882
883 ip\_check
884     Skip the check for already-in-use instance; see the description in
885     the **add** command for details.
886
887 name\_check
888     Skip the name check for instances; see the description in the
889     **add** command for details.
890
891 file\_storage\_dir, file\_driver
892     Configuration for the file disk type, see the **add** command for
893     details.
894
895
896 A simple definition for one instance can be (with most of the
897 parameters taken from the cluster defaults)::
898
899     {
900       "instance3": {
901         "template": "drbd",
902         "os": "debootstrap",
903         "disk_size": ["25G"],
904         "iallocator": "dumb"
905       },
906       "instance5": {
907         "template": "drbd",
908         "os": "debootstrap",
909         "disk_size": ["25G"],
910         "iallocator": "dumb",
911         "hypervisor": "xen-hvm",
912         "hvparams": {"acpi": true},
913         "backend": {"maxmem": 512, "minmem": 256}
914       }
915     }
916
917 The command will display the job id for each submitted instance, as
918 follows::
919
920     # gnt-instance batch-create instances.json
921     instance3: 11224
922     instance5: 11225
923
924 REMOVE
925 ^^^^^^
926
927 **remove** [\--ignore-failures] [\--shutdown-timeout=*N*] [\--submit]
928 [\--force] {*instance*}
929
930 Remove an instance. This will remove all data from the instance and
931 there is *no way back*. If you are not sure if you use an instance
932 again, use **shutdown** first and leave it in the shutdown state for a
933 while.
934
935 The ``--ignore-failures`` option will cause the removal to proceed
936 even in the presence of errors during the removal of the instance
937 (e.g. during the shutdown or the disk removal). If this option is not
938 given, the command will stop at the first error.
939
940 The ``--shutdown-timeout`` is used to specify how much time to wait
941 before forcing the shutdown (e.g. ``xm destroy`` in Xen, killing the
942 kvm process for KVM, etc.). By default two minutes are given to each
943 instance to stop.
944
945 The ``--force`` option is used to skip the interactive confirmation.
946
947 See **ganeti**\(7) for a description of ``--submit`` and other common
948 options.
949
950 Example::
951
952     # gnt-instance remove instance1.example.com
953
954
955 LIST
956 ^^^^
957
958 | **list**
959 | [\--no-headers] [\--separator=*SEPARATOR*] [\--units=*UNITS*] [-v]
960 | [{-o|\--output} *[+]FIELD,...*] [\--filter] [instance...]
961
962 Shows the currently configured instances with memory usage, disk
963 usage, the node they are running on, and their run status.
964
965 The ``--no-headers`` option will skip the initial header line. The
966 ``--separator`` option takes an argument which denotes what will be
967 used between the output fields. Both these options are to help
968 scripting.
969
970 The units used to display the numeric values in the output varies,
971 depending on the options given. By default, the values will be
972 formatted in the most appropriate unit. If the ``--separator`` option
973 is given, then the values are shown in mebibytes to allow parsing by
974 scripts. In both cases, the ``--units`` option can be used to enforce
975 a given output unit.
976
977 The ``-v`` option activates verbose mode, which changes the display of
978 special field states (see **ganeti**\(7)).
979
980 The ``-o (--output)`` option takes a comma-separated list of output
981 fields. The available fields and their meaning are:
982
983 @QUERY_FIELDS_INSTANCE@
984
985 If the value of the option starts with the character ``+``, the new
986 field(s) will be added to the default list. This allows one to quickly
987 see the default list plus a few other fields, instead of retyping the
988 entire list of fields.
989
990 There is a subtle grouping about the available output fields: all
991 fields except for ``oper_state``, ``oper_ram``, ``oper_vcpus`` and
992 ``status`` are configuration value and not run-time values. So if you
993 don't select any of the these fields, the query will be satisfied
994 instantly from the cluster configuration, without having to ask the
995 remote nodes for the data. This can be helpful for big clusters when
996 you only want some data and it makes sense to specify a reduced set of
997 output fields.
998
999 If exactly one argument is given and it appears to be a query filter
1000 (see **ganeti**\(7)), the query result is filtered accordingly. For
1001 ambiguous cases (e.g. a single field name as a filter) the ``--filter``
1002 (``-F``) option forces the argument to be treated as a filter (e.g.
1003 ``gnt-instance list -F admin_state``).
1004
1005 The default output field list is: ``name``, ``os``, ``pnode``,
1006 ``admin_state``, ``oper_state``, ``oper_ram``.
1007
1008
1009 LIST-FIELDS
1010 ^^^^^^^^^^^
1011
1012 **list-fields** [field...]
1013
1014 Lists available fields for instances.
1015
1016
1017 INFO
1018 ^^^^
1019
1020 **info** [-s \| \--static] [\--roman] {\--all \| *instance*}
1021
1022 Show detailed information about the given instance(s). This is
1023 different from **list** as it shows detailed data about the instance's
1024 disks (especially useful for the drbd disk template).
1025
1026 If the option ``-s`` is used, only information available in the
1027 configuration file is returned, without querying nodes, making the
1028 operation faster.
1029
1030 Use the ``--all`` to get info about all instances, rather than
1031 explicitly passing the ones you're interested in.
1032
1033 The ``--roman`` option can be used to cause envy among people who like
1034 ancient cultures, but are stuck with non-latin-friendly cluster
1035 virtualization technologies.
1036
1037 MODIFY
1038 ^^^^^^
1039
1040 | **modify**
1041 | [{-H|\--hypervisor-parameters} *HYPERVISOR\_PARAMETERS*]
1042 | [{-B|\--backend-parameters} *BACKEND\_PARAMETERS*]
1043 | [{-m|\--runtime-memory} *SIZE*]
1044 | [\--net add[:options...] \|
1045 |  \--net [*N*:]add[,options...] \|
1046 |  \--net [*ID*:]remove \|
1047 |  \--net *ID*:modify[,options...]]
1048 | [\--disk add:size=*SIZE*[,options...] \|
1049 |  \--disk *N*:add,size=*SIZE*[,options...] \|
1050 |  \--disk *N*:add,size=*SIZE*,provider=*PROVIDER*[,options...][,param=*value*... ] \|
1051 |  \--disk *ID*:modify[,options...]
1052 |  \--disk [*ID*:]remove]
1053 | [{-t|\--disk-template} plain | {-t|\--disk-template} drbd -n *new_secondary*] [\--no-wait-for-sync]
1054 | [\--new-primary=*node*]
1055 | [\--os-type=*OS* [\--force-variant]]
1056 | [{-O|\--os-parameters} *param*=*value*... ]
1057 | [\--offline \| \--online]
1058 | [\--submit]
1059 | [\--ignore-ipolicy]
1060 | {*instance*}
1061
1062 Modifies the memory size, number of vcpus, ip address, MAC address
1063 and/or NIC parameters for an instance. It can also add and remove
1064 disks and NICs to/from the instance. Note that you need to give at
1065 least one of the arguments, otherwise the command complains.
1066
1067 The ``-H (--hypervisor-parameters)``, ``-B (--backend-parameters)``
1068 and ``-O (--os-parameters)`` options specifies hypervisor, backend and
1069 OS parameter options in the form of name=value[,...]. For details
1070 which options can be specified, see the **add** command.
1071
1072 The ``-t (--disk-template)`` option will change the disk template of
1073 the instance.  Currently only conversions between the plain and drbd
1074 disk templates are supported, and the instance must be stopped before
1075 attempting the conversion. When changing from the plain to the drbd
1076 disk template, a new secondary node must be specified via the ``-n``
1077 option. The option ``--no-wait-for-sync`` can be used when converting
1078 to the ``drbd`` template in order to make the instance available for
1079 startup before DRBD has finished resyncing.
1080
1081 The ``-m (--runtime-memory)`` option will change an instance's runtime
1082 memory to the given size (in MB if a different suffix is not specified),
1083 by ballooning it up or down to the new value.
1084
1085 The ``--disk add:size=*SIZE*,[options..]`` option adds a disk to the
1086 instance, and ``--disk *N*:add:size=*SIZE*,[options..]`` will add a disk
1087 to the the instance at a specific index. The available options are the
1088 same as in the **add** command(``mode``, ``name``, ``vg``, ``metavg``).
1089 When adding an ExtStorage disk the ``provider=*PROVIDER*`` option is
1090 also mandatory and specifies the ExtStorage provider. Also, for
1091 ExtStorage disks arbitrary parameters can be passed as additional comma
1092 separated options, same as in the **add** command. -The ``--disk remove``
1093 option will remove the last disk of the instance. Use
1094 ``--disk `` *ID*``:remove`` to remove a disk by its identifier.  *ID*
1095 can be the index of the disk, the disks's name or the disks's UUID.  The
1096 ``--disk *ID*:modify[,options...]`` wil change the options of the disk.
1097 Available options are:
1098
1099 mode
1100   The access mode. Either ``ro`` (read-only) or the default ``rw`` (read-write).
1101
1102 name
1103    this option specifies a name for the disk, which can be used as a disk
1104    identifier. An instance can not have two disks with the same name.
1105
1106 The ``--net *N*:add[,options..]`` will add a new network interface to
1107 the instance. The available options are the same as in the **add**
1108 command (``mac``, ``ip``, ``link``, ``mode``, ``network``). The
1109 ``--net *ID*,remove`` will remove the intances' NIC with *ID* identifier,
1110 which can be the index of the NIC, the NIC's name or the NIC's UUID.
1111 The ``--net *ID*:modify[,options..]`` option will change the parameters of
1112 the instance network interface with the *ID* identifier.
1113
1114 The option ``-o (--os-type)`` will change the OS name for the instance
1115 (without reinstallation). In case an OS variant is specified that is
1116 not found, then by default the modification is refused, unless
1117 ``--force-variant`` is passed. An invalid OS will also be refused,
1118 unless the ``--force`` option is given.
1119
1120 The option ``--new-primary`` will set the new primary node of an instance
1121 assuming the disks have already been moved manually. Unless the ``--force``
1122 option is given, it is verified that the instance is no longer running
1123 on its current primary node.
1124
1125 The ``--online`` and ``--offline`` options are used to transition an
1126 instance into and out of the ``offline`` state. An instance can be
1127 turned offline only if it was previously down. The ``--online`` option
1128 fails if the instance was not in the ``offline`` state, otherwise it
1129 changes instance's state to ``down``. These modifications take effect
1130 immediately.
1131
1132 If ``--ignore-ipolicy`` is given any instance policy violations occuring
1133 during this operation are ignored.
1134
1135 See **ganeti**\(7) for a description of ``--submit`` and other common
1136 options.
1137
1138 Most of the changes take effect at the next restart. If the instance is
1139 running, there is no effect on the instance.
1140
1141 REINSTALL
1142 ^^^^^^^^^
1143
1144 | **reinstall** [{-o|\--os-type} *os-type*] [\--select-os] [-f *force*]
1145 | [\--force-multiple]
1146 | [\--instance \| \--node \| \--primary \| \--secondary \| \--all]
1147 | [{-O|\--os-parameters} *OS\_PARAMETERS*] [\--submit] {*instance*...}
1148
1149 Reinstalls the operating system on the given instance(s). The
1150 instance(s) must be stopped when running this command. If the ``-o
1151 (--os-type)`` is specified, the operating system is changed.
1152
1153 The ``--select-os`` option switches to an interactive OS reinstall.
1154 The user is prompted to select the OS template from the list of
1155 available OS templates. OS parameters can be overridden using ``-O
1156 (--os-parameters)`` (more documentation for this option under the
1157 **add** command).
1158
1159 Since this is a potentially dangerous command, the user will be
1160 required to confirm this action, unless the ``-f`` flag is passed.
1161 When multiple instances are selected (either by passing multiple
1162 arguments or by using the ``--node``, ``--primary``, ``--secondary``
1163 or ``--all`` options), the user must pass the ``--force-multiple``
1164 options to skip the interactive confirmation.
1165
1166 See **ganeti**\(7) for a description of ``--submit`` and other common
1167 options.
1168
1169 RENAME
1170 ^^^^^^
1171
1172 | **rename** [\--no-ip-check] [\--no-name-check] [\--submit]
1173 | {*instance*} {*new\_name*}
1174
1175 Renames the given instance. The instance must be stopped when running
1176 this command. The requirements for the new name are the same as for
1177 adding an instance: the new name must be resolvable and the IP it
1178 resolves to must not be reachable (in order to prevent duplicate IPs
1179 the next time the instance is started). The IP test can be skipped if
1180 the ``--no-ip-check`` option is passed.
1181
1182 Note that you can rename an instance to its same name, to force
1183 re-executing the os-specific rename script for that instance, if
1184 needed.
1185
1186 The ``--no-name-check`` skips the check for the new instance name via
1187 the resolver (e.g. in DNS or /etc/hosts, depending on your setup) and
1188 that the resolved name matches the provided name. Since the name check
1189 is used to compute the IP address, if you pass this option you must also
1190 pass the ``--no-ip-check`` option.
1191
1192 See **ganeti**\(7) for a description of ``--submit`` and other common
1193 options.
1194
1195 Starting/stopping/connecting to console
1196 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1197
1198 STARTUP
1199 ^^^^^^^
1200
1201 | **startup**
1202 | [\--force] [\--ignore-offline]
1203 | [\--force-multiple] [\--no-remember]
1204 | [\--instance \| \--node \| \--primary \| \--secondary \| \--all \|
1205 | \--tags \| \--node-tags \| \--pri-node-tags \| \--sec-node-tags]
1206 | [{-H|\--hypervisor-parameters} ``key=value...``]
1207 | [{-B|\--backend-parameters} ``key=value...``]
1208 | [\--submit] [\--paused]
1209 | {*name*...}
1210
1211 Starts one or more instances, depending on the following options.  The
1212 four available modes are:
1213
1214 \--instance
1215     will start the instances given as arguments (at least one argument
1216     required); this is the default selection
1217
1218 \--node
1219     will start the instances who have the given node as either primary
1220     or secondary
1221
1222 \--primary
1223     will start all instances whose primary node is in the list of nodes
1224     passed as arguments (at least one node required)
1225
1226 \--secondary
1227     will start all instances whose secondary node is in the list of
1228     nodes passed as arguments (at least one node required)
1229
1230 \--all
1231     will start all instances in the cluster (no arguments accepted)
1232
1233 \--tags
1234     will start all instances in the cluster with the tags given as
1235     arguments
1236
1237 \--node-tags
1238     will start all instances in the cluster on nodes with the tags
1239     given as arguments
1240
1241 \--pri-node-tags
1242     will start all instances in the cluster on primary nodes with the
1243     tags given as arguments
1244
1245 \--sec-node-tags
1246     will start all instances in the cluster on secondary nodes with the
1247     tags given as arguments
1248
1249 Note that although you can pass more than one selection option, the
1250 last one wins, so in order to guarantee the desired result, don't pass
1251 more than one such option.
1252
1253 Use ``--force`` to start even if secondary disks are failing.
1254 ``--ignore-offline`` can be used to ignore offline primary nodes and
1255 mark the instance as started even if the primary is not available.
1256
1257 The ``--force-multiple`` will skip the interactive confirmation in the
1258 case the more than one instance will be affected.
1259
1260 The ``--no-remember`` option will perform the startup but not change
1261 the state of the instance in the configuration file (if it was stopped
1262 before, Ganeti will still think it needs to be stopped). This can be
1263 used for testing, or for a one shot-start where you don't want the
1264 watcher to restart the instance if it crashes.
1265
1266 The ``-H (--hypervisor-parameters)`` and ``-B (--backend-parameters)``
1267 options specify temporary hypervisor and backend parameters that can
1268 be used to start an instance with modified parameters. They can be
1269 useful for quick testing without having to modify an instance back and
1270 forth, e.g.::
1271
1272     # gnt-instance start -H kernel_args="single" instance1
1273     # gnt-instance start -B maxmem=2048 instance2
1274
1275
1276 The first form will start the instance instance1 in single-user mode,
1277 and the instance instance2 with 2GB of RAM (this time only, unless
1278 that is the actual instance memory size already). Note that the values
1279 override the instance parameters (and not extend them): an instance
1280 with "kernel\_args=ro" when started with -H kernel\_args=single will
1281 result in "single", not "ro single".
1282
1283 The ``--paused`` option is only valid for Xen and kvm hypervisors.  This
1284 pauses the instance at the start of bootup, awaiting ``gnt-instance
1285 console`` to unpause it, allowing the entire boot process to be
1286 monitored for debugging.
1287
1288 See **ganeti**\(7) for a description of ``--submit`` and other common
1289 options.
1290
1291 Example::
1292
1293     # gnt-instance start instance1.example.com
1294     # gnt-instance start --node node1.example.com node2.example.com
1295     # gnt-instance start --all
1296
1297
1298 SHUTDOWN
1299 ^^^^^^^^
1300
1301 | **shutdown**
1302 | [\--timeout=*N*]
1303 | [\--force] [\--force-multiple] [\--ignore-offline] [\--no-remember]
1304 | [\--instance \| \--node \| \--primary \| \--secondary \| \--all \|
1305 | \--tags \| \--node-tags \| \--pri-node-tags \| \--sec-node-tags]
1306 | [\--submit]
1307 | {*name*...}
1308
1309 Stops one or more instances. If the instance cannot be cleanly stopped
1310 during a hardcoded interval (currently 2 minutes), it will forcibly
1311 stop the instance (equivalent to switching off the power on a physical
1312 machine).
1313
1314 The ``--timeout`` is used to specify how much time to wait before
1315 forcing the shutdown (e.g. ``xm destroy`` in Xen, killing the kvm
1316 process for KVM, etc.). By default two minutes are given to each
1317 instance to stop.
1318
1319 The ``--instance``, ``--node``, ``--primary``, ``--secondary``,
1320 ``--all``, ``--tags``, ``--node-tags``, ``--pri-node-tags`` and
1321 ``--sec-node-tags`` options are similar as for the **startup** command
1322 and they influence the actual instances being shutdown.
1323
1324 ``--ignore-offline`` can be used to ignore offline primary nodes and
1325 force the instance to be marked as stopped. This option should be used
1326 with care as it can lead to an inconsistent cluster state.
1327
1328 Use ``--force`` to be able to shutdown an instance even when it's marked
1329 as offline. This is useful is an offline instance ends up in the
1330 ``ERROR_up`` state, for example.
1331
1332 The ``--no-remember`` option will perform the shutdown but not change
1333 the state of the instance in the configuration file (if it was running
1334 before, Ganeti will still thinks it needs to be running). This can be
1335 useful for a cluster-wide shutdown, where some instances are marked as
1336 up and some as down, and you don't want to change the running state:
1337 you just need to disable the watcher, shutdown all instances with
1338 ``--no-remember``, and when the watcher is activated again it will
1339 restore the correct runtime state for all instances.
1340
1341 See **ganeti**\(7) for a description of ``--submit`` and other common
1342 options.
1343
1344 Example::
1345
1346     # gnt-instance shutdown instance1.example.com
1347     # gnt-instance shutdown --all
1348
1349
1350 REBOOT
1351 ^^^^^^
1352
1353 | **reboot**
1354 | [{-t|\--type} *REBOOT-TYPE*]
1355 | [\--ignore-secondaries]
1356 | [\--shutdown-timeout=*N*]
1357 | [\--force-multiple]
1358 | [\--instance \| \--node \| \--primary \| \--secondary \| \--all \|
1359 | \--tags \| \--node-tags \| \--pri-node-tags \| \--sec-node-tags]
1360 | [\--submit]
1361 | [*name*...]
1362
1363 Reboots one or more instances. The type of reboot depends on the value
1364 of ``-t (--type)``. A soft reboot does a hypervisor reboot, a hard reboot
1365 does a instance stop, recreates the hypervisor config for the instance
1366 and starts the instance. A full reboot does the equivalent of
1367 **gnt-instance shutdown && gnt-instance startup**.  The default is
1368 hard reboot.
1369
1370 For the hard reboot the option ``--ignore-secondaries`` ignores errors
1371 for the secondary node while re-assembling the instance disks.
1372
1373 The ``--instance``, ``--node``, ``--primary``, ``--secondary``,
1374 ``--all``, ``--tags``, ``--node-tags``, ``--pri-node-tags`` and
1375 ``--sec-node-tags`` options are similar as for the **startup** command
1376 and they influence the actual instances being rebooted.
1377
1378 The ``--shutdown-timeout`` is used to specify how much time to wait
1379 before forcing the shutdown (xm destroy in xen, killing the kvm
1380 process, for kvm). By default two minutes are given to each instance
1381 to stop.
1382
1383 The ``--force-multiple`` will skip the interactive confirmation in the
1384 case the more than one instance will be affected.
1385
1386 See **ganeti**\(7) for a description of ``--submit`` and other common
1387 options.
1388
1389 Example::
1390
1391     # gnt-instance reboot instance1.example.com
1392     # gnt-instance reboot --type=full instance1.example.com
1393
1394
1395 CONSOLE
1396 ^^^^^^^
1397
1398 **console** [\--show-cmd] {*instance*}
1399
1400 Connects to the console of the given instance. If the instance is not
1401 up, an error is returned. Use the ``--show-cmd`` option to display the
1402 command instead of executing it.
1403
1404 For HVM instances, this will attempt to connect to the serial console
1405 of the instance. To connect to the virtualized "physical" console of a
1406 HVM instance, use a VNC client with the connection info from the
1407 **info** command.
1408
1409 For Xen/kvm instances, if the instance is paused, this attempts to
1410 unpause the instance after waiting a few seconds for the connection to
1411 the console to be made.
1412
1413 Example::
1414
1415     # gnt-instance console instance1.example.com
1416
1417
1418 Disk management
1419 ~~~~~~~~~~~~~~~
1420
1421 REPLACE-DISKS
1422 ^^^^^^^^^^^^^
1423
1424 **replace-disks** [\--submit] [\--early-release] [\--ignore-ipolicy] {-p}
1425 [\--disks *idx*] {*instance*}
1426
1427 **replace-disks** [\--submit] [\--early-release] [\--ignore-ipolicy] {-s}
1428 [\--disks *idx*] {*instance*}
1429
1430 **replace-disks** [\--submit] [\--early-release] [\--ignore-ipolicy]
1431 {{-I\|\--iallocator} *name* \| {{-n|\--new-secondary} *node* } {*instance*}
1432
1433 **replace-disks** [\--submit] [\--early-release] [\--ignore-ipolicy]
1434 {-a\|\--auto} {*instance*}
1435
1436 This command is a generalized form for replacing disks. It is
1437 currently only valid for the mirrored (DRBD) disk template.
1438
1439 The first form (when passing the ``-p`` option) will replace the disks
1440 on the primary, while the second form (when passing the ``-s`` option
1441 will replace the disks on the secondary node. For these two cases (as
1442 the node doesn't change), it is possible to only run the replace for a
1443 subset of the disks, using the option ``--disks`` which takes a list
1444 of comma-delimited disk indices (zero-based), e.g. 0,2 to replace only
1445 the first and third disks.
1446
1447 The third form (when passing either the ``--iallocator`` or the
1448 ``--new-secondary`` option) is designed to change secondary node of the
1449 instance. Specifying ``--iallocator`` makes the new secondary be
1450 selected automatically by the specified allocator plugin (use ``.`` to
1451 indicate the default allocator), otherwise the new secondary node will
1452 be the one chosen manually via the ``--new-secondary`` option.
1453
1454 Note that it is not possible to select an offline or drained node as a
1455 new secondary.
1456
1457 The fourth form (when using ``--auto``) will automatically determine
1458 which disks of an instance are faulty and replace them within the same
1459 node. The ``--auto`` option works only when an instance has only
1460 faulty disks on either the primary or secondary node; it doesn't work
1461 when both sides have faulty disks.
1462
1463 The ``--early-release`` changes the code so that the old storage on
1464 secondary node(s) is removed early (before the resync is completed)
1465 and the internal Ganeti locks for the current (and new, if any)
1466 secondary node are also released, thus allowing more parallelism in
1467 the cluster operation. This should be used only when recovering from a
1468 disk failure on the current secondary (thus the old storage is already
1469 broken) or when the storage on the primary node is known to be fine
1470 (thus we won't need the old storage for potential recovery).
1471
1472 The ``--ignore-ipolicy`` let the command ignore instance policy
1473 violations if replace-disks changes groups and the instance would
1474 violate the new groups instance policy.
1475
1476 See **ganeti**\(7) for a description of ``--submit`` and other common
1477 options.
1478
1479 ACTIVATE-DISKS
1480 ^^^^^^^^^^^^^^
1481
1482 **activate-disks** [\--submit] [\--ignore-size] [\--wait-for-sync] {*instance*}
1483
1484 Activates the block devices of the given instance. If successful, the
1485 command will show the location and name of the block devices::
1486
1487     node1.example.com:disk/0:/dev/drbd0
1488     node1.example.com:disk/1:/dev/drbd1
1489
1490
1491 In this example, *node1.example.com* is the name of the node on which
1492 the devices have been activated. The *disk/0* and *disk/1* are the
1493 Ganeti-names of the instance disks; how they are visible inside the
1494 instance is hypervisor-specific. */dev/drbd0* and */dev/drbd1* are the
1495 actual block devices as visible on the node.
1496
1497 The ``--ignore-size`` option can be used to activate disks ignoring
1498 the currently configured size in Ganeti. This can be used in cases
1499 where the configuration has gotten out of sync with the real-world
1500 (e.g. after a partially-failed grow-disk operation or due to rounding
1501 in LVM devices). This should not be used in normal cases, but only
1502 when activate-disks fails without it.
1503
1504 The ``--wait-for-sync`` option will ensure that the command returns only
1505 after the instance's disks are synchronised (mostly for DRBD); this can
1506 be useful to ensure consistency, as otherwise there are no commands that
1507 can wait until synchronisation is done. However when passing this
1508 option, the command will have additional output, making it harder to
1509 parse the disk information.
1510
1511 Note that it is safe to run this command while the instance is already
1512 running.
1513
1514 See **ganeti**\(7) for a description of ``--submit`` and other common
1515 options.
1516
1517 DEACTIVATE-DISKS
1518 ^^^^^^^^^^^^^^^^
1519
1520 **deactivate-disks** [-f] [\--submit] {*instance*}
1521
1522 De-activates the block devices of the given instance. Note that if you
1523 run this command for an instance with a drbd disk template, while it
1524 is running, it will not be able to shutdown the block devices on the
1525 primary node, but it will shutdown the block devices on the secondary
1526 nodes, thus breaking the replication.
1527
1528 The ``-f``/``--force`` option will skip checks that the instance is
1529 down; in case the hypervisor is confused and we can't talk to it,
1530 normally Ganeti will refuse to deactivate the disks, but with this
1531 option passed it will skip this check and directly try to deactivate
1532 the disks. This can still fail due to the instance actually running or
1533 other issues.
1534
1535 See **ganeti**\(7) for a description of ``--submit`` and other common
1536 options.
1537
1538 GROW-DISK
1539 ^^^^^^^^^
1540
1541 | **grow-disk** [\--no-wait-for-sync] [\--submit] [\--absolute]
1542 | {*instance*} {*disk*} {*amount*}
1543
1544 Grows an instance's disk. This is only possible for instances having a
1545 plain, drbd, file, sharedfile, rbd or ext disk template. For the ext
1546 template to work, the ExtStorage provider should also support growing.
1547 This means having a ``grow`` script that actually grows the volume of
1548 the external shared storage.
1549
1550 Note that this command only change the block device size; it will not
1551 grow the actual filesystems, partitions, etc. that live on that
1552 disk. Usually, you will need to:
1553
1554 #. use **gnt-instance grow-disk**
1555
1556 #. reboot the instance (later, at a convenient time)
1557
1558 #. use a filesystem resizer, such as **ext2online**\(8) or
1559    **xfs\_growfs**\(8) to resize the filesystem, or use **fdisk**\(8) to
1560    change the partition table on the disk
1561
1562 The *disk* argument is the index of the instance disk to grow. The
1563 *amount* argument is given as a number which can have a suffix (like the
1564 disk size in instance create); if the suffix is missing, the value will
1565 be interpreted as mebibytes.
1566
1567 By default, the *amount* value represents the desired increase in the
1568 disk size (e.g. an amount of 1G will take a disk of size 3G to 4G). If
1569 the optional ``--absolute`` parameter is passed, then the *amount*
1570 argument doesn't represent the delta, but instead the desired final disk
1571 size (e.g. an amount of 8G will take a disk of size 4G to 8G).
1572
1573 For instances with a drbd template, note that the disk grow operation
1574 might complete on one node but fail on the other; this will leave the
1575 instance with different-sized LVs on the two nodes, but this will not
1576 create problems (except for unused space).
1577
1578 If you do not want gnt-instance to wait for the new disk region to be
1579 synced, use the ``--no-wait-for-sync`` option.
1580
1581 See **ganeti**\(7) for a description of ``--submit`` and other common
1582 options.
1583
1584 Example (increase the first disk for instance1 by 16GiB)::
1585
1586     # gnt-instance grow-disk instance1.example.com 0 16g
1587
1588 Example for increasing the disk size to a certain size::
1589
1590    # gnt-instance grow-disk --absolute instance1.example.com 0 32g
1591
1592 Also note that disk shrinking is not supported; use **gnt-backup
1593 export** and then **gnt-backup import** to reduce the disk size of an
1594 instance.
1595
1596 RECREATE-DISKS
1597 ^^^^^^^^^^^^^^
1598
1599 | **recreate-disks** [\--submit]
1600 | [{-n node1:[node2] \| {-I\|\--iallocator *name*}}]
1601 | [\--disk=*N*[:[size=*VAL*][,mode=*ro\|rw*]]] {*instance*}
1602
1603 Recreates all or a subset of disks of the given instance.
1604
1605 Note that this functionality should only be used for missing disks; if
1606 any of the given disks already exists, the operation will fail.  While
1607 this is suboptimal, recreate-disks should hopefully not be needed in
1608 normal operation and as such the impact of this is low.
1609
1610 If only a subset should be recreated, any number of ``disk`` options can
1611 be specified. It expects a disk index and an optional list of disk
1612 parameters to change. Only ``size`` and ``mode`` can be changed while
1613 recreating disks. To recreate all disks while changing parameters on
1614 a subset only, a ``--disk`` option must be given for every disk of the
1615 instance.
1616
1617 Optionally the instance's disks can be recreated on different
1618 nodes. This can be useful if, for example, the original nodes of the
1619 instance have gone down (and are marked offline), so we can't recreate
1620 on the same nodes. To do this, pass the new node(s) via ``-n`` option,
1621 with a syntax similar to the **add** command. The number of nodes
1622 passed must equal the number of nodes that the instance currently
1623 has. Note that changing nodes is only allowed when all disks are
1624 replaced, e.g. when no ``--disk`` option is passed.
1625
1626 Another method of choosing which nodes to place the instance on is by
1627 using the specified iallocator, passing the ``--iallocator`` option.
1628 The primary and secondary nodes will be chosen by the specified
1629 iallocator plugin, or by the default allocator if ``.`` is specified.
1630
1631 See **ganeti**\(7) for a description of ``--submit`` and other common
1632 options.
1633
1634 Recovery/moving
1635 ~~~~~~~~~~~~~~~
1636
1637 FAILOVER
1638 ^^^^^^^^
1639
1640 | **failover** [-f] [\--ignore-consistency] [\--ignore-ipolicy]
1641 | [\--shutdown-timeout=*N*]
1642 | [{-n|\--target-node} *node* \| {-I|\--iallocator} *name*]
1643 | [\--submit]
1644 | {*instance*}
1645
1646 Failover will stop the instance (if running), change its primary node,
1647 and if it was originally running it will start it again (on the new
1648 primary). This works for instances with drbd template (in which case you
1649 can only fail to the secondary node) and for externally mirrored
1650 templates (sharedfile, blockdev, rbd and ext) (in which case you can
1651 fail to any other node).
1652
1653 If the instance's disk template is of type sharedfile, blockdev, rbd or
1654 ext, then you can explicitly specify the target node (which can be any
1655 node) using the ``-n`` or ``--target-node`` option, or specify an
1656 iallocator plugin using the ``-I`` or ``--iallocator`` option. If you
1657 omit both, the default iallocator will be used to specify the target
1658 node.
1659
1660 If the instance's disk template is of type drbd, the target node is
1661 automatically selected as the drbd's secondary node. Changing the
1662 secondary node is possible with a replace-disks operation.
1663
1664 Normally the failover will check the consistency of the disks before
1665 failing over the instance. If you are trying to migrate instances off
1666 a dead node, this will fail. Use the ``--ignore-consistency`` option
1667 for this purpose. Note that this option can be dangerous as errors in
1668 shutting down the instance will be ignored, resulting in possibly
1669 having the instance running on two machines in parallel (on
1670 disconnected DRBD drives).
1671
1672 The ``--shutdown-timeout`` is used to specify how much time to wait
1673 before forcing the shutdown (xm destroy in xen, killing the kvm
1674 process, for kvm). By default two minutes are given to each instance
1675 to stop.
1676
1677 If ``--ignore-ipolicy`` is given any instance policy violations occuring
1678 during this operation are ignored.
1679
1680 See **ganeti**\(7) for a description of ``--submit`` and other common
1681 options.
1682
1683 Example::
1684
1685     # gnt-instance failover instance1.example.com
1686
1687 For externally mirrored templates also ``-n`` is available::
1688
1689     # gnt-instance failover -n node3.example.com instance1.example.com
1690
1691
1692 MIGRATE
1693 ^^^^^^^
1694
1695 | **migrate** [-f] [\--allow-failover] [\--non-live]
1696 | [\--migration-mode=live\|non-live] [\--ignore-ipolicy]
1697 | [\--no-runtime-changes] [\--submit]
1698 | [{-n|\--target-node} *node* \| {-I|\--iallocator} *name*] {*instance*}
1699
1700 | **migrate** [-f] \--cleanup [\--submit] {*instance*}
1701
1702 Migrate will move the instance to its secondary node without shutdown.
1703 As with failover, it works for instances having the drbd disk template
1704 or an externally mirrored disk template type such as sharedfile,
1705 blockdev, rbd or ext.
1706
1707 If the instance's disk template is of type sharedfile, blockdev, rbd or
1708 ext, then you can explicitly specify the target node (which can be any
1709 node) using the ``-n`` or ``--target-node`` option, or specify an
1710 iallocator plugin using the ``-I`` or ``--iallocator`` option. If you
1711 omit both, the default iallocator will be used to specify the target
1712 node.  Alternatively, the default iallocator can be requested by
1713 specifying ``.`` as the name of the plugin.
1714
1715 If the instance's disk template is of type drbd, the target node is
1716 automatically selected as the drbd's secondary node. Changing the
1717 secondary node is possible with a replace-disks operation.
1718
1719 The migration command needs a perfectly healthy instance for drbd
1720 instances, as we rely on the dual-master capability of drbd8 and the
1721 disks of the instance are not allowed to be degraded.
1722
1723 The ``--non-live`` and ``--migration-mode=non-live`` options will
1724 switch (for the hypervisors that support it) between a "fully live"
1725 (i.e. the interruption is as minimal as possible) migration and one in
1726 which the instance is frozen, its state saved and transported to the
1727 remote node, and then resumed there. This all depends on the
1728 hypervisor support for two different methods. In any case, it is not
1729 an error to pass this parameter (it will just be ignored if the
1730 hypervisor doesn't support it). The option ``--migration-mode=live``
1731 option will request a fully-live migration. The default, when neither
1732 option is passed, depends on the hypervisor parameters (and can be
1733 viewed with the **gnt-cluster info** command).
1734
1735 If the ``--cleanup`` option is passed, the operation changes from
1736 migration to attempting recovery from a failed previous migration. In
1737 this mode, Ganeti checks if the instance runs on the correct node (and
1738 updates its configuration if not) and ensures the instances' disks
1739 are configured correctly. In this mode, the ``--non-live`` option is
1740 ignored.
1741
1742 The option ``-f`` will skip the prompting for confirmation.
1743
1744 If ``--allow-failover`` is specified it tries to fallback to failover if
1745 it already can determine that a migration won't work (e.g. if the
1746 instance is shut down). Please note that the fallback will not happen
1747 during execution. If a migration fails during execution it still fails.
1748
1749 If ``--ignore-ipolicy`` is given any instance policy violations occuring
1750 during this operation are ignored.
1751
1752 The ``--no-runtime-changes`` option forbids migrate to alter an
1753 instance's runtime before migrating it (eg. ballooning an instance
1754 down because the target node doesn't have enough available memory).
1755
1756 If an instance has the backend parameter ``always_failover`` set to
1757 true, then the migration is automatically converted into a failover.
1758
1759 See **ganeti**\(7) for a description of ``--submit`` and other common
1760 options.
1761
1762 Example (and expected output)::
1763
1764     # gnt-instance migrate instance1
1765     Instance instance1 will be migrated. Note that migration
1766     might impact the instance if anything goes wrong (e.g. due to bugs in
1767     the hypervisor). Continue?
1768     y/[n]/?: y
1769     Migrating instance instance1.example.com
1770     * checking disk consistency between source and target
1771     * switching node node2.example.com to secondary mode
1772     * changing into standalone mode
1773     * changing disks into dual-master mode
1774     * wait until resync is done
1775     * preparing node2.example.com to accept the instance
1776     * migrating instance to node2.example.com
1777     * switching node node1.example.com to secondary mode
1778     * wait until resync is done
1779     * changing into standalone mode
1780     * changing disks into single-master mode
1781     * wait until resync is done
1782     * done
1783     #
1784
1785
1786 MOVE
1787 ^^^^
1788
1789 | **move** [-f] [\--ignore-consistency]
1790 | [-n *node*] [\--shutdown-timeout=*N*] [\--submit] [\--ignore-ipolicy]
1791 | {*instance*}
1792
1793 Move will move the instance to an arbitrary node in the cluster. This
1794 works only for instances having a plain or file disk template.
1795
1796 Note that since this operation is done via data copy, it will take a
1797 long time for big disks (similar to replace-disks for a drbd
1798 instance).
1799
1800 The ``--shutdown-timeout`` is used to specify how much time to wait
1801 before forcing the shutdown (e.g. ``xm destroy`` in XEN, killing the
1802 kvm process for KVM, etc.). By default two minutes are given to each
1803 instance to stop.
1804
1805 The ``--ignore-consistency`` option will make Ganeti ignore any errors
1806 in trying to shutdown the instance on its node; useful if the
1807 hypervisor is broken and you want to recover the data.
1808
1809 If ``--ignore-ipolicy`` is given any instance policy violations occuring
1810 during this operation are ignored.
1811
1812 See **ganeti**\(7) for a description of ``--submit`` and other common
1813 options.
1814
1815 Example::
1816
1817     # gnt-instance move -n node3.example.com instance1.example.com
1818
1819
1820 CHANGE-GROUP
1821 ^^^^^^^^^^^^
1822
1823 | **change-group** [\--submit]
1824 | [\--iallocator *NAME*] [\--to *GROUP*...] {*instance*}
1825
1826 This command moves an instance to another node group. The move is
1827 calculated by an iallocator, either given on the command line or as a
1828 cluster default.
1829
1830 If no specific destination groups are specified using ``--to``, all
1831 groups except the one containing the instance are considered.
1832
1833 See **ganeti**\(7) for a description of ``--submit`` and other common
1834 options.
1835
1836 Example::
1837
1838     # gnt-instance change-group -I hail --to rack2 inst1.example.com
1839
1840
1841 Tags
1842 ~~~~
1843
1844 ADD-TAGS
1845 ^^^^^^^^
1846
1847 **add-tags** [\--from *file*] {*instancename*} {*tag*...}
1848
1849 Add tags to the given instance. If any of the tags contains invalid
1850 characters, the entire operation will abort.
1851
1852 If the ``--from`` option is given, the list of tags will be extended
1853 with the contents of that file (each line becomes a tag).  In this
1854 case, there is not need to pass tags on the command line (if you do,
1855 both sources will be used). A file name of ``-`` will be interpreted
1856 as stdin.
1857
1858 LIST-TAGS
1859 ^^^^^^^^^
1860
1861 **list-tags** {*instancename*}
1862
1863 List the tags of the given instance.
1864
1865 REMOVE-TAGS
1866 ^^^^^^^^^^^
1867
1868 **remove-tags** [\--from *file*] {*instancename*} {*tag*...}
1869
1870 Remove tags from the given instance. If any of the tags are not
1871 existing on the node, the entire operation will abort.
1872
1873 If the ``--from`` option is given, the list of tags to be removed will
1874 be extended with the contents of that file (each line becomes a tag).
1875 In this case, there is not need to pass tags on the command line (if
1876 you do, tags from both sources will be removed). A file name of ``-``
1877 will be interpreted as stdin.
1878
1879 .. vim: set textwidth=72 :
1880 .. Local Variables:
1881 .. mode: rst
1882 .. fill-column: 72
1883 .. End: