1 <!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
3 <!-- Fill in your name for FIRSTNAME and SURNAME. -->
4 <!-- Please adjust the date whenever revising the manpage. -->
5 <!ENTITY dhdate "<date>February 11, 2009</date>">
6 <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
7 allowed: see man(7), man(1). -->
8 <!ENTITY dhsection "<manvolnum>8</manvolnum>">
9 <!ENTITY dhucpackage "<refentrytitle>gnt-instance</refentrytitle>">
10 <!ENTITY dhpackage "gnt-instance">
12 <!ENTITY debian "<productname>Debian</productname>">
13 <!ENTITY gnu "<acronym>GNU</acronym>">
14 <!ENTITY gpl "&gnu; <acronym>GPL</acronym>">
15 <!ENTITY footer SYSTEM "footer.sgml">
25 <holder>Google Inc.</holder>
33 <refmiscinfo>ganeti 2.0</refmiscinfo>
36 <refname>&dhpackage;</refname>
38 <refpurpose>ganeti instance administration</refpurpose>
42 <command>&dhpackage; </command>
44 <arg choice="req">command</arg>
45 <arg>arguments...</arg>
49 <title>DESCRIPTION</title>
52 The <command>&dhpackage;</command> is used for instance
53 administration in the ganeti system.
58 <title>COMMANDS</title>
61 <title>Creation/removal/querying</title>
66 <command>add</command>
68 <arg choice="req">-t<group choice="req">
77 <arg rep="repeat">--disk=<replaceable>N</replaceable>:size=<replaceable>VAL</replaceable><arg>,mode=<replaceable>ro|rw</replaceable></arg></arg>
78 <arg>-s <replaceable>SIZE</replaceable></arg>
82 <arg rep="repeat">--net=<replaceable>N</replaceable><arg rep="repeat">:options</arg></arg>
86 <arg>-B <replaceable>BEPARAMS</replaceable></arg>
89 <arg>-H <replaceable>HYPERVISOR</replaceable><arg>:<arg choice="plain" rep="repeat">option=<replaceable>value</replaceable></arg></arg></arg>
92 <arg>--file-storage-dir <replaceable>dir_path</replaceable></arg>
93 <arg>--file-driver<group choice="req">
100 <arg>-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg>
101 <arg>--iallocator <replaceable>name</replaceable></arg>
105 <arg choice="req">-o <replaceable>os-type</replaceable></arg>
110 <arg choice="req"><replaceable>instance</replaceable></arg>
114 Creates a new instance on the specified host. The
115 <replaceable>instance</replaceable> argument must be in DNS,
116 but depending on the bridge/routing setup, need not be in
117 the same network as the nodes in the cluster.
121 The <option>disk</option> option specifies the parameters
122 for the disks of the instance. The numbering of disks starts
123 at zero, and at least one disk needs to be passed. For each
124 disk, at least the size needs to be given, and optionally
125 the access mode (read-only or the default of read-write) can
126 also be specified. The size is interpreted (when no unit is
127 given) in mebibytes. You can also use one of the suffixes
128 <literal>m</literal>, <literal>g</literal> or
129 <literal>t</literal> to specificy the exact the units used;
130 these suffixes map to mebibytes, gibibytes and tebibytes.
134 Alternatively, a single-disk instance can be created via the
135 <option>-s</option> option which takes a single argument,
136 the size of the disk. This is similar to the Ganeti 1.2
137 version (but will only create one disk).
141 The minimum disk specification is therefore
142 <userinput>--disk 0:size=20G</userinput> (or <userinput>-s
143 20G</userinput> when using the <option>-s</option> option),
144 and a three-disk instance can be specified as
145 <userinput>--disk 0:size=20G --disk 1:size=4G --disk
146 2:size=100G</userinput>.
150 The NICs of the instances can be specified via the
151 <option>--net</option> option. By default, one NIC is
152 created for the instance, with a random MAC, and set
153 up according the the cluster level nic parameters.
154 Each NIC can take these parameters (all optional):
159 <simpara>either a value or <constant>GENERATE</constant>
160 to generate a new unique MAC</simpara>
166 <simpara>specifies the IP address assigned to the
167 instance from the Ganeti side (this is not necessarily
168 what the instance will use, but what the node expects
169 the instance to use)</simpara>
175 <simpara>specifies the connection mode for this nic:
176 routed or bridged.</simpara>
182 <simpara>in bridged mode specifies the bridge to attach
183 this NIC to, in routed mode it's intended to
184 differentiate between different routing tables/instance
185 groups (but the meaning is dependent on the network
186 script, see gnt-cluster(8) for more details)</simpara>
190 Of these "mode" and "link" are nic parameters, and inherit their
191 default at cluster level.
195 Alternatively, if no network is desired for the instance, you
196 can prevent the default of one NIC with the
197 <option>--no-nics</option> option.
201 The <option>-o</option> options specifies the operating
202 system to be installed. The available operating systems can
203 be listed with <command>gnt-os list</command>.
207 The <option>-B</option> option specifies the backend
208 parameters for the instance. If no such parameters are
209 specified, the values are inherited from the cluster. Possible
215 <simpara>the memory size of the instance; as usual,
216 suffixes can be used to denote the unit, otherwise the
217 value is taken in mebibites</simpara>
223 <simpara>the number of VCPUs to assign to the instance
224 (if this value makes sense for the hypervisor)</simpara>
228 <term>auto_balance</term>
230 <simpara>whether the instance is considered in the N+1
231 cluster checks (enough redundancy in the cluster to
232 survive a node failure)</simpara>
239 The <option>-H</option> option specified the hypervisor to
240 use for the instance (must be one of the enabled hypervisors
241 on the cluster) and optionally custom parameters for this
242 instance. If not other options are used (i.e. the invocation
243 is just <userinput>-H
244 <replaceable>NAME</replaceable></userinput>) the instance
245 will inherit the cluster options. The defaults below show
246 the cluster defaults at cluster creation time.
250 The possible hypervisor options are as follows:
253 <term>boot_order</term>
255 <simpara>Valid for the Xen HVM and KVM
256 hypervisors.</simpara>
258 <simpara>A string value denoting the boot order. This
259 has different meaning for the Xen HVM hypervisor and
260 for the KVM one.</simpara>
263 For Xen HVM, The boot order is a string of letters
264 listing the boot devices, with valid device letters
302 The default is not to set an HVM boot order which is
309 <term>cdrom_image_path</term>
311 <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
313 <simpara>The path to a CDROM image to attach to the
319 <term>nic_type</term>
321 <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
324 This parameter determines the way the network cards
325 are presented to the instance. The possible options are:
327 <member>rtl8139 (default for Xen HVM) (HVM & KVM)</member>
328 <member>ne2k_isa (HVM & KVM)</member>
329 <member>ne2k_pci (HVM & KVM)</member>
330 <member>i82551 (KVM)</member>
331 <member>i82557b (KVM)</member>
332 <member>i82559er (KVM)</member>
333 <member>pcnet (KVM)</member>
334 <member>e1000 (KVM)</member>
335 <member>paravirtual (default for KVM) (HVM & KVM)</member>
341 <term>disk_type</term>
343 <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
346 This parameter determines the way the disks are
347 presented to the instance. The possible options are:
349 <member>ioemu (default for HVM & KVM) (HVM & KVM)</member>
350 <member>ide (HVM & KVM)</member>
351 <member>scsi (KVM)</member>
352 <member>sd (KVM)</member>
353 <member>mtd (KVM)</member>
354 <member>pflash (KVM)</member>
360 <term>vnc_bind_address</term>
362 <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
364 <para>Specifies the address that the VNC listener for
365 this instance should bind to. Valid values are IPv4
366 addresses. Use the address 0.0.0.0 to bind to all
367 available interfaces (this is the default) or specify
368 the address of one of the interfaces on the node to
369 restrict listening to that interface.</para>
376 <simpara>Valid for the KVM hypervisor.</simpara>
378 <simpara>A boolean option that controls whether the
379 VNC connection is secured with TLS.</simpara>
384 <term>vnc_x509_path</term>
386 <simpara>Valid for the KVM hypervisor.</simpara>
388 <para>If <option>vnc_tls</option> is enabled, this
389 options specifies the path to the x509 certificate to
395 <term>vnc_x509_verify</term>
397 <simpara>Valid for the KVM hypervisor.</simpara>
404 <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
407 A boolean option that specifies if the hypervisor
408 should enable ACPI support for this instance. By
409 default, ACPI is disabled.
417 <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
420 A boolean option that specifies if the hypervisor
421 should enabled PAE support for this instance. The
422 default is false, disabling PAE support.
428 <term>kernel_path</term>
430 <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
433 This option specifies the path (on the node) to the
434 kernel to boot the instance with. Xen PVM instances
435 always require this, while for KVM if this option is
436 empty, it will cause the machine to load the kernel
443 <term>kernel_args</term>
445 <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
448 This options specifies extra arguments to the kernel
449 that will be loaded. device. This is always used
450 for Xen PVM, while for KVM it is only used if the
451 <option>kernel_path</option> option is also
456 The default setting for this value is simply
457 <constant>"ro"</constant>, which mounts the root
458 disk (initially) in read-only one. For example,
459 setting this to <userinput>single</userinput> will
460 cause the instance to start in single-user mode.
466 <term>initrd_path</term>
468 <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
471 This option specifies the path (on the node) to the
472 initrd to boot the instance with. Xen PVM instances
473 can use this always, while for KVM if this option is
474 only used if the <option>kernel_path</option> option
475 is also specified. You can pass here either an
476 absolute filename (the path to the initrd) if you
477 want to use an initrd, or use the format
478 <userinput>no_initrd_path</userinput> for no initrd.
484 <term>root_path</term>
486 <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
489 This options specifies the name of the root
490 device. This is always needed for Xen PVM, while for
491 KVM it is only used if the
492 <option>kernel_path</option> option is also
499 <term>serial_console</term>
501 <simpara>Valid for the KVM hypervisor.</simpara>
503 <simpara>This boolean option specifies whether to
504 emulate a serial console for the instance.</simpara>
514 The <option>--iallocator</option> option specifies the instance
515 allocator plugin to use. If you pass in this option the allocator
516 will select nodes for this instance automatically, so you don't need
517 to pass them with the <option>-n</option> option. For more
518 information please refer to the instance allocator documentation.
522 The <option>-t</option> options specifies the disk layout type for
523 the instance. The available choices are:
526 <term>diskless</term>
529 This creates an instance with no disks. Its useful for
530 testing only (or other special cases).
537 <para>Disk devices will be regular files.</para>
543 <para>Disk devices will be logical volumes.</para>
550 Disk devices will be drbd (version 8.x) on top of
559 The optional second value of the <option>--node</option> is used for
560 the drbd template type and specifies the remote node.
564 If you do not want gnt-instance to wait for the disk mirror
565 to be synced, use the <option>--no-wait-for-sync</option>
570 The <option>--file-storage-dir</option> specifies the relative path
571 under the cluster-wide file storage directory to store file-based
572 disks. It is useful for having different subdirectories for
573 different instances. The full path of the directory where the disk
574 files are stored will consist of cluster-wide file storage directory
575 + optional subdirectory + instance name. Example:
576 /srv/ganeti/file-storage/mysubdir/instance1.example.com. This option
577 is only relevant for instances using the file storage backend.
581 The <option>--file-driver</option> specifies the driver to use for
582 file-based disks. Note that currently these drivers work with the
583 xen hypervisor only. This option is only relevant for instances using
584 the file storage backend. The available choices are:
590 Kernel loopback driver. This driver uses loopback
591 devices to access the filesystem within the
592 file. However, running I/O intensive applications in
593 your instance using the loop driver might result in
594 slowdowns. Furthermore, if you use the loopback
595 driver consider increasing the maximum amount of
596 loopback devices (on most systems it's 8) using the
604 <para>The blktap driver (for Xen hypervisors). In
605 order to be able to use the blktap driver you should
606 check if the 'blktapctrl' user space disk agent is
607 running (usually automatically started via xend). This
608 user-level disk I/O interface has the advantage of
609 better performance. Especially if you use a network
610 file system (e.g. NFS) to store your instances this is
611 the recommended choice.
619 The <option>--submit</option> option is used to send the job to
620 the master daemon but not wait for its completion. The job
621 ID will be shown so that it can be examined via
622 <command>gnt-job info</command>.
628 # gnt-instance add -t file --disk 0:size=30g -B memory=512 -o debian-etch \
629 -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
630 # gnt-instance add -t plain --disk 0:size=30g -B memory=512 -o debian-etch \
631 -n node1.example.com instance1.example.com
632 # gnt-instance add -t drbd --disk 0:size=30g -B memory=512 -o debian-etch \
633 -n node1.example.com:node2.example.com instance2.example.com
639 <title>BATCH-CREATE</title>
641 <command>batch-create</command>
642 <arg choice="req">instances_file.json</arg>
646 This command (similar to the Ganeti 1.2
647 <command>batcher</command> tool) submits multiple instance
648 creation jobs based on a definition file. The instance
649 configurations do not encompass all the possible options for
650 the <command>add</command> command, but only a subset.
654 The instance file should be a valid-formed JSON file,
655 containing a dictionary with instance name and instance
656 parameters. The accepted parameters are:
660 <term>disk_size</term>
662 <simpara>The size of the disks of the instance.</simpara>
666 <term>disk_templace</term>
668 <simpara>The disk template to use for the instance,
669 the same as in the <command>add</command>
676 <simpara>A dictionary of backend parameters.</simpara>
680 <term>hypervisor</term>
682 <simpara>A dictionary with a single key (the
683 hypervisor name), and as value the hypervisor
684 options. If not passed, the default hypervisor and
685 hypervisor options will be inherited.</simpara>
689 <term>mac, ip, mode, link</term>
691 <simpara>Specifications for the one NIC that will be
692 created for the instance. 'bridge' is also accepted
693 as a backwards compatibile key.</simpara>
699 <simpara>List of nics that will be created for the
700 instance. Each entry should be a dict, with mac, ip, mode
701 and link as possible keys. Please don't provide the "mac,
702 ip, mode, link" parent keys if you use this method for
703 specifying nics.</simpara>
707 <term>primary_node, secondary_node</term>
709 <simpara>The primary and optionally the secondary node
710 to use for the instance (in case an iallocator script
711 is not used).</simpara>
715 <term>iallocator</term>
717 <simpara>Instead of specifying the nodes, an
718 iallocator script can be used to automatically compute
725 <simpara>whether to start the instance</simpara>
729 <term>ip_check</term>
731 <simpara>Skip the check for already-in-use instance;
732 see the description in the <command>add</command>
733 command for details.</simpara>
737 <term>file_storage_dir, file_driver</term>
739 <simpara>Configuration for the <literal>file</literal>
740 disk type, see the <command>add</command> command for
748 A simple definition for one instance can be (with most of
749 the parameters taken from the cluster defaults):
755 "disk_size": ["25G"],
761 "disk_size": ["25G"],
762 "iallocator": "dumb",
763 "hypervisor": "xen-hvm",
764 "hvparams": {"acpi": true},
765 "backend": {"memory": 512}
772 The command will display the job id for each submitted instance, as follows:
774 # gnt-instance batch-create instances.json
783 <title>REMOVE</title>
786 <command>remove</command>
787 <arg>--ignore-failures</arg>
789 <arg choice="req"><replaceable>instance</replaceable></arg>
793 Remove an instance. This will remove all data from the
794 instance and there is <emphasis>no way back</emphasis>. If
795 you are not sure if you use an instance again, use
796 <command>shutdown</command> first and leave it in the
797 shutdown state for a while.
802 The <option>--ignore-failures</option> option will cause the
803 removal to proceed even in the presence of errors during the
804 removal of the instance (e.g. during the shutdown or the
805 disk removal). If this option is not given, the command will
806 stop at the first error.
810 The <option>--submit</option> option is used to send the job to
811 the master daemon but not wait for its completion. The job
812 ID will be shown so that it can be examined via
813 <command>gnt-job info</command>.
819 # gnt-instance remove instance1.example.com
828 <command>list</command>
829 <arg>--no-headers</arg>
830 <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
831 <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
832 <arg rep="repeat">instance</arg>
836 Shows the currently configured instances with memory usage,
837 disk usage, the node they are running on, and their run
842 The <option>--no-headers</option> option will skip the
843 initial header line. The <option>--separator</option> option
844 takes an argument which denotes what will be used between
845 the output fields. Both these options are to help scripting.
849 The <option>-o</option> option takes a comma-separated list
850 of output fields. The available fields and their meaning
856 <simpara>the instance name</simpara>
862 <simpara>the OS of the instance</simpara>
868 <simpara>the primary node of the instance</simpara>
874 <simpara>comma-separated list of secondary nodes for the
875 instance; usually this will be just one node</simpara>
879 <term>admin_state</term>
881 <simpara>the desired state of the instance (either "yes"
882 or "no" denoting the instance should run or
887 <term>disk_template</term>
889 <simpara>the disk template of the instance</simpara>
893 <term>oper_state</term>
895 <simpara>the actual state of the instance; can be
896 one of the values "running", "stopped", "(node
903 <simpara>combined form of admin_state and oper_stat;
905 <computeroutput>ERROR_nodedown</computeroutput> if the
906 node of the instance is down,
907 <computeroutput>ERROR_down</computeroutput> if the
908 instance should run but is down,
909 <computeroutput>ERROR_up</computeroutput> if the
910 instance should be stopped but is actually running,
911 <computeroutput>ADMIN_down</computeroutput> if the
912 instance has been stopped (and is stopped) and
913 <computeroutput>running</computeroutput> if the
914 instance is set to be running (and is
919 <term>oper_ram</term>
921 <simpara>the actual memory usage of the instance as seen
922 by the hypervisor</simpara>
928 <simpara>the ip address ganeti recognizes as associated with
929 the first instance interface</simpara>
935 <simpara>the first instance interface MAC address</simpara>
942 <simpara>the mode of the first instance NIC
943 (routed or bridged)</simpara>
949 <simpara>the link of the first instance NIC
954 <term>sda_size</term>
956 <simpara>the size of the instance's first disk</simpara>
960 <term>sdb_size</term>
962 <simpara>the size of the instance's second disk, if
969 <simpara>the number of VCPUs allocated to the
976 <simpara>comma-separated list of the instances's
981 <term>serial_no</term>
983 <simpara>the so called 'serial number' of the
984 instance; this is a numeric field that is incremented
985 each time the instance is modified, and it can be used
986 to track modifications</simpara>
993 the creation time of the instance; note that this
994 field contains spaces and as such it's harder to parse
997 if this attribute is not present (e.g. when upgrading
998 from older versions), then "N/A" will be shown instead
1006 the last modification time of the instance; note that
1007 this field contains spaces and as such it's harder to
1011 if this attribute is not present (e.g. when upgrading
1012 from older versions), then "N/A" will be shown instead
1018 <term>network_port</term>
1020 <simpara>If the instance has a network port assigned
1021 to it (e.g. for VNC connections), this will be shown,
1022 otherwise <literal>-</literal> will be
1023 displayed.</simpara>
1027 <term>beparams</term>
1029 <simpara>A text format of the entire beparams for the
1030 instance. It's more useful to select individual fields
1031 from this dictionary, see below.</simpara>
1035 <term>disk.count</term>
1037 <simpara>The number of instance disks.</simpara>
1041 <term>disk.size/N</term>
1043 <simpara>The size of the instance's Nth disk. This is
1044 a more generic form of the <literal>sda_size</literal>
1045 and <literal>sdb_size</literal> fields.</simpara>
1049 <term>disk.sizes</term>
1051 <simpara>A comma-separated list of the disk sizes for
1052 this instance.</simpara>
1056 <term>disk_usage</term>
1058 <simpara>The total disk space used by this instance on
1059 each of its nodes. This is not the instance-visible
1060 disk size, but the actual disk "cost" of the
1065 <term>nic.mac/N</term>
1067 <simpara>The MAC of the Nth instance NIC.</simpara>
1071 <term>nic.ip/N</term>
1073 <simpara>The IP address of the Nth instance NIC.</simpara>
1077 <term>nic.mode/N</term>
1079 <simpara>The mode of the Nth instance NIC</simpara>
1083 <term>nic.link/N</term>
1085 <simpara>The link of the Nth instance NIC</simpara>
1089 <term>nic.macs</term>
1091 <simpara>A comma-separated list of all the MACs of the
1092 instance's NICs.</simpara>
1096 <term>nic.ips</term>
1098 <simpara>A comma-separated list of all the IP
1099 addresses of the instance's NICs.</simpara>
1103 <term>nic.modes</term>
1105 <simpara>A comma-separated list of all the modes of the
1106 instance's NICs.</simpara>
1110 <term>nic.links</term>
1112 <simpara>A comma-separated list of all the link parameters
1113 of the instance's NICs.</simpara>
1117 <term>nic.count</term>
1119 <simpara>The number of instance nics.</simpara>
1123 <term>hv/<replaceable>NAME</replaceable></term>
1125 <simpara>The value of the hypervisor parameter called
1126 <replaceable>NAME</replaceable>. For details of what
1127 hypervisor parameters exist and their meaning, see the
1128 <command>add</command> command.</simpara>
1132 <term>be/memory</term>
1134 <simpara>The configured memory for the instance.</simpara>
1138 <term>be/vcpus</term>
1140 <simpara>The configured number of VCPUs for the
1145 <term>be/auto_balance</term>
1147 <simpara>Whether the instance is considered in N+1
1155 If the value of the option starts with the character
1156 <constant>+</constant>, the new field(s) will be added to the
1157 default list. This allows to quickly see the default list
1158 plus a few other fields, instead of retyping the entire list
1163 There is a subtle grouping about the available output
1164 fields: all fields except for <option>oper_state</option>,
1165 <option>oper_ram</option> and <option>status</option> are
1166 configuration value and not run-time values. So if you don't
1167 select any of the these fields, the query will be satisfied
1168 instantly from the cluster configuration, without having to
1169 ask the remote nodes for the data. This can be helpful for
1170 big clusters when you only want some data and it makes sense
1171 to specify a reduced set of output fields.
1174 <para>The default output field list is:
1175 <simplelist type="inline">
1176 <member>name</member>
1178 <member>pnode</member>
1179 <member>admin_state</member>
1180 <member>oper_state</member>
1181 <member>oper_ram</member>
1190 <command>info</command>
1195 <group choice="req">
1197 <arg rep="repeat"><replaceable>instance</replaceable></arg>
1202 Show detailed information about the given instance(s). This is
1203 different from <command>list</command> as it shows detailed data
1204 about the instance's disks (especially useful for the drbd disk
1209 If the option <option>-s</option> is used, only information
1210 available in the configuration file is returned, without
1211 querying nodes, making the operation faster.
1215 Use the <option>--all</option> to get info about all instances,
1216 rather than explicitely passing the ones you're interested in.
1221 <title>MODIFY</title>
1224 <command>modify</command>
1226 <arg choice="opt">-H <replaceable>HYPERVISOR_PARAMETERS</replaceable></arg>
1228 <arg choice="opt">-B <replaceable>BACKEND_PARAMETERS</replaceable></arg>
1231 <arg>--net add<replaceable><optional>:options</optional></replaceable></arg>
1232 <arg>--net remove</arg>
1233 <arg>--net <replaceable>N:options</replaceable></arg>
1237 <arg>--disk add:size=<replaceable>SIZE</replaceable></arg>
1238 <arg>--disk remove</arg>
1239 <arg>--disk <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></arg>
1245 <arg choice="req"><replaceable>instance</replaceable></arg>
1249 Modifies the memory size, number of vcpus, ip address, MAC
1250 address and/or nic parameters for an instance. It can also
1251 add and remove disks and NICs to/from the instance. Note
1252 that you need to give at least one of the arguments, otherwise
1253 the command complains.
1257 The <option>-H</option> option specifies hypervisor options
1258 in the form of <userinput>name=value[,...]</userinput>. For details which options can be specified, see the <command>add</command> command.
1263 add:size=<replaceable>SIZE</replaceable></option> option
1264 adds a disk to the instance. The <option>--disk
1265 remove</option> will remove the last disk of the
1266 instance. The <option>--disk
1267 <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></option>
1268 option will change the mode of the Nth disk of the instance
1269 between read-only (<literal>ro</literal>) and read-write
1270 (<literal>rw</literal>).
1275 add:<replaceable>options</replaceable></option> option will
1276 add a new NIC to the instance. The available options are the
1277 same as in the <command>add</command> command (mac, ip, link,
1278 mode). The <option>--net remove</option> will remove the
1279 last NIC of the instance, while the <option>--net
1280 <replaceable>N</replaceable>:<replaceable>options</replaceable></option>
1281 option will change the parameters of the Nth instance NIC.
1285 The <option>--submit</option> option is used to send the job to
1286 the master daemon but not wait for its completion. The job
1287 ID will be shown so that it can be examined via
1288 <command>gnt-job info</command>.
1292 All the changes take effect at the next restart. If the
1293 instance is running, there is no effect on the instance.
1298 <title>REINSTALL</title>
1301 <command>reinstall</command>
1302 <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
1303 <arg>--select-os</arg>
1304 <arg choice="opt">-f <replaceable>force</replaceable></arg>
1305 <arg>--force-multiple</arg>
1307 <group choice="opt">
1308 <arg>--instance</arg>
1310 <arg>--primary</arg>
1311 <arg>--secondary</arg>
1315 <arg choice="opt" rep="repeat"><replaceable>instance</replaceable></arg>
1319 Reinstalls the operating system on the given instance(s). The
1320 instance(s) must be stopped when running this command. If the
1321 <option>--os-type</option> is specified, the operating
1326 The <option>--select-os</option> option switches to an
1327 interactive OS reinstall. The user is prompted to select the OS
1328 template from the list of available OS templates.
1332 Since this is a potentially dangerous command, the user will
1333 be required to confirm this action, unless the
1334 <option>-f</option> flag is passed. When multiple instances
1335 are selected (either by passing multiple arguments or by
1336 using the <option>--node</option>,
1337 <option>--primary</option>, <option>--secondary</option> or
1338 <option>--all</option> options), the user must pass both the
1339 <option>--force</option> and
1340 <option>--force-multiple</option> options to skip the
1341 interactive confirmation.
1345 The <option>--submit</option> option is used to send the job to
1346 the master daemon but not wait for its completion. The job
1347 ID will be shown so that it can be examined via
1348 <command>gnt-job info</command>.
1355 <title>RENAME</title>
1358 <command>rename</command>
1359 <arg>--no-ip-check</arg>
1361 <arg choice="req"><replaceable>instance</replaceable></arg>
1362 <arg choice="req"><replaceable>new_name</replaceable></arg>
1366 Renames the given instance. The instance must be stopped
1367 when running this command. The requirements for the new name
1368 are the same as for adding an instance: the new name must be
1369 resolvable and the IP it resolves to must not be reachable
1370 (in order to prevent duplicate IPs the next time the
1371 instance is started). The IP test can be skipped if the
1372 <option>--no-ip-check</option> option is passed.
1376 The <option>--submit</option> option is used to send the job to
1377 the master daemon but not wait for its completion. The job
1378 ID will be shown so that it can be examined via
1379 <command>gnt-job info</command>.
1387 <title>Starting/stopping/connecting to console</title>
1390 <title>STARTUP</title>
1393 <command>startup</command>
1397 <arg>--force-multiple</arg>
1399 <group choice="opt">
1400 <arg>--instance</arg>
1402 <arg>--primary</arg>
1403 <arg>--secondary</arg>
1407 <arg>-H <option>key=value...</option></arg>
1408 <arg>-B <option>key=value...</option></arg>
1413 rep="repeat"><replaceable>name</replaceable></arg>
1417 Starts one or more instances, depending on the following
1418 options. The four available modes are:
1421 <term><option>--instance</option></term>
1423 <simpara>will start the instances given as arguments
1424 (at least one argument required); this is the default
1431 <simpara>will start the instances who have the given
1432 node as either primary or secondary</simpara>
1436 <term><option>--primary</option></term>
1438 <simpara>will start all instances whose primary node
1439 is in the list of nodes passed as arguments (at least
1440 one node required)</simpara>
1444 <term><option>--secondary</option></term>
1446 <simpara>will start all instances whose secondary node
1447 is in the list of nodes passed as arguments (at least
1448 one node required)</simpara>
1454 <simpara>will start all instances in the cluster (no
1455 arguments accepted)</simpara>
1462 Note that although you can pass more than one selection
1463 option, the last one wins, so in order to guarantee the
1464 desired result, don't pass more than one such option.
1468 Use <option>--force</option> to start even if secondary disks are
1473 The <option>--force-multiple</option> will skip the
1474 interactive confirmation in the case the more than one
1475 instance will be affected.
1479 The <option>-H</option> and <option>-B</option> options
1480 specify extra, temporary hypervisor and backend parameters
1481 that can be used to start an instance with modified
1482 parameters. They can be useful for quick testing without
1483 having to modify an instance back and forth, e.g.:
1485 # gnt-instance start -H root_args="single" instance1
1486 # gnt-instance start -B memory=2048 instance2
1488 The first form will start the instance
1489 <userinput>instance1</userinput> in single-user mode, and
1490 the instance <userinput>instance2</userinput> with 2GB of
1491 RAM (this time only, unless that is the actual instance
1492 memory size already).
1496 The <option>--submit</option> option is used to send the job to
1497 the master daemon but not wait for its completion. The job
1498 ID will be shown so that it can be examined via
1499 <command>gnt-job info</command>.
1505 # gnt-instance start instance1.example.com
1506 # gnt-instance start --node node1.example.com node2.example.com
1507 # gnt-instance start --all
1513 <title>SHUTDOWN</title>
1516 <command>shutdown</command>
1518 <arg>--force-multiple</arg>
1520 <group choice="opt">
1521 <arg>--instance</arg>
1523 <arg>--primary</arg>
1524 <arg>--secondary</arg>
1531 rep="repeat"><replaceable>name</replaceable></arg>
1535 Stops one or more instances. If the instance cannot be
1536 cleanly stopped during a hardcoded interval (currently 2
1537 minutes), it will forcibly stop the instance (equivalent to
1538 switching off the power on a physical machine).
1542 The <option>--instance</option>, <option>--node</option>,
1543 <option>--primary</option>, <option>--secondary</option> and
1544 <option>--all</option> options are similar as for the
1545 <command>startup</command> command and they influence the
1546 actual instances being shutdown.
1550 The <option>--submit</option> option is used to send the job to
1551 the master daemon but not wait for its completion. The job
1552 ID will be shown so that it can be examined via
1553 <command>gnt-job info</command>.
1560 # gnt-instance shutdown instance1.example.com
1561 # gnt-instance shutdown --all
1567 <title>REBOOT</title>
1570 <command>reboot</command>
1572 <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
1574 <arg>--ignore-secondaries</arg>
1576 <arg>--force-multiple</arg>
1578 <group choice="opt">
1579 <arg>--instance</arg>
1581 <arg>--primary</arg>
1582 <arg>--secondary</arg>
1589 rep="repeat"><replaceable>name</replaceable></arg>
1593 Reboots one or more instances. The type of reboot depends on
1594 the value of <option>--type</option>. A soft reboot does a
1595 hypervisor reboot, a hard reboot does a instance stop,
1596 recreates the hypervisor config for the instance and
1597 starts the instance. A full reboot does the equivalent
1598 of <command>gnt-instance shutdown && gnt-instance
1599 startup</command>. The default is hard reboot.
1603 For the hard reboot the option
1604 <option>--ignore-secondaries</option> ignores errors for the
1605 secondary node while re-assembling the instance disks.
1609 The <option>--instance</option>, <option>--node</option>,
1610 <option>--primary</option>, <option>--secondary</option> and
1611 <option>--all</option> options are similar as for the
1612 <command>startup</command> command and they influence the
1613 actual instances being rebooted.
1617 The <option>--force-multiple</option> will skip the
1618 interactive confirmation in the case the more than one
1619 instance will be affected.
1625 # gnt-instance reboot instance1.example.com
1626 # gnt-instance reboot --type=full instance1.example.com
1632 <title>CONSOLE</title>
1634 <command>console</command>
1635 <arg choice="opt">--show-cmd</arg>
1636 <arg choice="req"><replaceable>instance</replaceable></arg>
1640 Connects to the console of the given instance. If the
1641 instance is not up, an error is returned. Use the
1642 <option>--show-cmd</option> option to display the command
1643 instead of executing it.
1647 For HVM instances, this will attempt to connect to the
1648 serial console of the instance. To connect to the
1649 virtualized "physical" console of a HVM instance, use a VNC
1650 client with the connection info from the
1651 <command>info</command> command.
1657 # gnt-instance console instance1.example.com
1665 <title>Disk management</title>
1668 <title>REPLACE-DISKS</title>
1671 <command>replace-disks</command>
1673 <arg choice="req">-p</arg>
1674 <arg>--disks <replaceable>idx</replaceable></arg>
1675 <arg choice="req"><replaceable>instance</replaceable></arg>
1679 <command>replace-disks</command>
1681 <arg choice="req">-s</arg>
1682 <arg>--disks <replaceable>idx</replaceable></arg>
1683 <arg choice="req"><replaceable>instance</replaceable></arg>
1687 <command>replace-disks</command>
1689 <group choice="req">
1690 <arg>--iallocator <replaceable>name</replaceable></arg>
1691 <arg>--new-secondary <replaceable>NODE</replaceable></arg>
1694 <arg choice="req"><replaceable>instance</replaceable></arg>
1698 <command>replace-disks</command>
1700 <arg choice="req">--auto</arg>
1701 <arg choice="req"><replaceable>instance</replaceable></arg>
1705 This command is a generalized form for replacing disks. It
1706 is currently only valid for the mirrored (DRBD) disk
1711 The first form (when passing the <option>-p</option> option)
1712 will replace the disks on the primary, while the second form
1713 (when passing the <option>-s</option> option will replace
1714 the disks on the secondary node. For these two cases (as the
1715 node doesn't change), it is possible to only run the replace
1716 for a subset of the disks, using the option
1717 <option>--disks</option> which takes a list of
1718 comma-delimited disk indices (zero-based),
1719 e.g. <userinput>0,2</userinput> to replace only the first
1724 The third form (when passing either the
1725 <option>--iallocator</option> or the
1726 <option>--new-secondary</option> option) is designed to
1727 change secondary node of the instance. Specifying
1728 <option>--iallocator</option> makes the new secondary be
1729 selected automatically by the specified allocator plugin,
1730 otherwise the new secondary node will be the one chosen
1731 manually via the <option>--new-secondary</option> option.
1735 The fourth form (when using <option>--auto</option>) will
1736 automatically determine which disks of an instance are faulty and
1737 replace them within the same node. The <option>--auto</option>
1738 option works only when an instance has only faulty disks on
1739 either the primary or secondary node; it doesn't work when
1740 both sides have faulty disks.
1744 The <option>--submit</option> option is used to send the job to
1745 the master daemon but not wait for its completion. The job
1746 ID will be shown so that it can be examined via
1747 <command>gnt-job info</command>.
1751 Note that it is not possible to select an offline or drained
1752 node as a new secondary.
1758 <title>ACTIVATE-DISKS</title>
1761 <command>activate-disks</command>
1763 <arg>--ignore-size</arg>
1764 <arg choice="req"><replaceable>instance</replaceable></arg>
1767 Activates the block devices of the given instance. If
1768 successful, the command will show the location and name of
1771 node1.example.com:disk/0:/dev/drbd0
1772 node1.example.com:disk/1:/dev/drbd1
1775 In this example, <emphasis>node1.example.com</emphasis> is
1776 the name of the node on which the devices have been
1777 activated. The <emphasis>disk/0</emphasis> and
1778 <emphasis>disk/1</emphasis> are the Ganeti-names of the
1779 instance disks; how they are visible inside the instance is
1780 hypervisor-specific. <emphasis>/dev/drbd0</emphasis> and
1781 <emphasis>/dev/drbd1</emphasis> are the actual block devices
1782 as visible on the node.
1786 The <option>--submit</option> option is used to send the job to
1787 the master daemon but not wait for its completion. The job
1788 ID will be shown so that it can be examined via
1789 <command>gnt-job info</command>.
1793 The <option>--ignore-size</option> option can be used to
1794 activate disks ignoring the currently configured size in
1795 Ganeti. This can be used in cases where the configuration
1796 has gotten out of sync with the real-world (e.g. after a
1797 partially-failed grow-disk operation or due to rounding in
1798 LVM devices). This should not be used in normal cases, but
1799 only when activate-disks fails without it.
1803 Note that it is safe to run this command while the instance
1809 <title>DEACTIVATE-DISKS</title>
1812 <command>deactivate-disks</command>
1814 <arg choice="req"><replaceable>instance</replaceable></arg>
1817 De-activates the block devices of the given instance. Note
1818 that if you run this command for an instance with a drbd
1819 disk template, while it is running, it will not be able to
1820 shutdown the block devices on the primary node, but it will
1821 shutdown the block devices on the secondary nodes, thus
1822 breaking the replication.
1826 The <option>--submit</option> option is used to send the job to
1827 the master daemon but not wait for its completion. The job
1828 ID will be shown so that it can be examined via
1829 <command>gnt-job info</command>.
1835 <title>GROW-DISK</title>
1837 <command>grow-disk</command>
1838 <arg>--no-wait-for-sync</arg>
1840 <arg choice="req"><replaceable>instance</replaceable></arg>
1841 <arg choice="req"><replaceable>disk</replaceable></arg>
1842 <arg choice="req"><replaceable>amount</replaceable></arg>
1846 Grows an instance's disk. This is only possible for
1847 instances having a <literal>plain</literal> or
1848 <literal>drbd</literal> disk template.
1852 Note that this command only change the block device size; it
1853 will not grow the actual filesystems, partitions, etc. that
1854 live on that disk. Usually, you will need to:
1857 <simpara>use <command>gnt-instance grow-disk</command></simpara>
1860 <simpara>reboot the instance (later, at a convenient
1864 <simpara>use a filesystem resizer, such as
1865 <citerefentry> <refentrytitle>ext2online</refentrytitle>
1866 <manvolnum>8</manvolnum> </citerefentry> or
1867 <citerefentry> <refentrytitle>xfs_growfs</refentrytitle>
1868 <manvolnum>8</manvolnum> </citerefentry> to resize the
1869 filesystem, or use <citerefentry>
1870 <refentrytitle>fdisk</refentrytitle>
1871 <manvolnum>8</manvolnum> </citerefentry> to change the
1872 partition table on the disk
1880 The <replaceable>disk</replaceable> argument is the index of
1881 the instance disk to grow. The
1882 <replaceable>amount</replaceable> argument is given either
1883 as a number (and it represents the amount to increase the
1884 disk with in mebibytes) or can be given similar to the
1885 arguments in the create instance operation, with a suffix
1890 Note that the disk grow operation might complete on one node
1891 but fail on the other; this will leave the instance with
1892 different-sized LVs on the two nodes, but this will not
1893 create problems (except for unused space).
1897 If you do not want gnt-instance to wait for the new disk
1898 region to be synced, use the
1899 <option>--no-wait-for-sync</option> option.
1903 The <option>--submit</option> option is used to send the job to
1904 the master daemon but not wait for its completion. The job
1905 ID will be shown so that it can be examined via
1906 <command>gnt-job info</command>.
1910 <para>Example (increase the first disk for instance1 by 16GiB):
1912 # gnt-instance grow-disk instance1.example.com 0 16g
1917 Also note that disk shrinking is not supported; use
1918 <command>gnt-backup export</command> and then
1919 <command>gnt-backup import</command> to reduce the disk size
1925 <title>RECREATE-DISKS</title>
1928 <command>recreate-disks</command>
1930 <arg>--disks=<option>indices</option></arg>
1931 <arg choice="req"><replaceable>instance</replaceable></arg>
1934 Recreates the disks of the given instance, or only a subset
1935 of the disks (if the option <option>disks</option> is
1936 passed, which must be a comma-separated list of disk
1937 indices, starting from zero).
1941 The <option>--submit</option> option is used to send the job to
1942 the master daemon but not wait for its completion. The job
1943 ID will be shown so that it can be examined via
1944 <command>gnt-job info</command>.
1952 <title>Recovery</title>
1955 <title>FAILOVER</title>
1958 <command>failover</command>
1960 <arg>--ignore-consistency</arg>
1962 <arg choice="req"><replaceable>instance</replaceable></arg>
1966 Failover will fail the instance over its secondary
1967 node. This works only for instances having a drbd disk
1972 Normally the failover will check the consistency of the
1973 disks before failing over the instance. If you are trying to
1974 migrate instances off a dead node, this will fail. Use the
1975 <option>--ignore-consistency</option> option for this
1976 purpose. Note that this option can be dangerous as errors in
1977 shutting down the instance will be ignored, resulting in
1978 possibly having the instance running on two machines in
1979 parallel (on disconnected DRBD drives).
1983 The <option>--submit</option> option is used to send the job to
1984 the master daemon but not wait for its completion. The job
1985 ID will be shown so that it can be examined via
1986 <command>gnt-job info</command>.
1992 # gnt-instance failover instance1.example.com
1998 <title>MIGRATE</title>
2001 <command>migrate</command>
2003 <arg choice="req">--cleanup</arg>
2004 <arg choice="req"><replaceable>instance</replaceable></arg>
2008 <command>migrate</command>
2010 <arg>--non-live</arg>
2011 <arg choice="req"><replaceable>instance</replaceable></arg>
2015 Migrate will move the instance to its secondary node without
2016 shutdown. It only works for instances having the drbd8 disk
2021 The migration command needs a perfectly healthy instance, as
2022 we rely on the dual-master capability of drbd8 and the disks
2023 of the instance are not allowed to be degraded.
2027 The <option>--non-live</option> option will switch (for the
2028 hypervisors that support it) between a "fully live"
2029 (i.e. the interruption is as minimal as possible) migration
2030 and one in which the instance is frozen, its state saved and
2031 transported to the remote node, and then resumed there. This
2032 all depends on the hypervisor support for two different
2033 methods. In any case, it is not an error to pass this
2034 parameter (it will just be ignored if the hypervisor doesn't
2039 If the <option>--cleanup</option> option is passed, the
2040 operation changes from migration to attempting recovery from
2041 a failed previous migration. In this mode, ganeti checks if
2042 the instance runs on the correct node (and updates its
2043 configuration if not) and ensures the instances's disks are
2044 configured correctly. In this mode, the
2045 <option>--non-live</option> option is ignored.
2049 The option <option>-f</option> will skip the prompting for
2053 Example (and expected output):
2055 # gnt-instance migrate instance1
2056 Migrate will happen to the instance instance1. Note that migration is
2057 **experimental** in this version. This might impact the instance if
2058 anything goes wrong. Continue?
2060 * checking disk consistency between source and target
2061 * ensuring the target is in secondary mode
2062 * changing disks into dual-master mode
2063 - INFO: Waiting for instance instance1 to sync disks.
2064 - INFO: Instance instance1's disks are in sync.
2065 * migrating instance to node2.example.com
2066 * changing the instance's disks on source node to secondary
2067 - INFO: Waiting for instance instance1 to sync disks.
2068 - INFO: Instance instance1's disks are in sync.
2069 * changing the instance's disks to single-master
2079 <command>move</command>
2081 <arg>-n <replaceable>node</replaceable></arg>
2083 <arg choice="req"><replaceable>instance</replaceable></arg>
2087 Move will move the instance to an arbitrary node in the
2088 cluster. This works only for instances having a plain or
2093 Note that since this operation is done via data copy, it
2094 will take a long time for big disks (similar to
2095 replace-disks for a drbd instance).
2099 The <option>--submit</option> option is used to send the job to
2100 the master daemon but not wait for its completion. The job
2101 ID will be shown so that it can be examined via
2102 <command>gnt-job info</command>.
2108 # gnt-instance move -n node3.example.com instance1.example.com
2119 <title>ADD-TAGS</title>
2122 <command>add-tags</command>
2123 <arg choice="opt">--from <replaceable>file</replaceable></arg>
2124 <arg choice="req"><replaceable>instancename</replaceable></arg>
2126 rep="repeat"><replaceable>tag</replaceable></arg>
2130 Add tags to the given instance. If any of the tags contains
2131 invalid characters, the entire operation will abort.
2134 If the <option>--from</option> option is given, the list of
2135 tags will be extended with the contents of that file (each
2136 line becomes a tag). In this case, there is not need to pass
2137 tags on the command line (if you do, both sources will be
2138 used). A file name of - will be interpreted as stdin.
2143 <title>LIST-TAGS</title>
2146 <command>list-tags</command>
2147 <arg choice="req"><replaceable>instancename</replaceable></arg>
2150 <para>List the tags of the given instance.</para>
2154 <title>REMOVE-TAGS</title>
2156 <command>remove-tags</command>
2157 <arg choice="opt">--from <replaceable>file</replaceable></arg>
2158 <arg choice="req"><replaceable>instancename</replaceable></arg>
2160 rep="repeat"><replaceable>tag</replaceable></arg>
2164 Remove tags from the given instance. If any of the tags are
2165 not existing on the node, the entire operation will abort.
2169 If the <option>--from</option> option is given, the list of
2170 tags will be extended with the contents of that file (each
2171 line becomes a tag). In this case, there is not need to pass
2172 tags on the command line (if you do, both sources will be
2173 used). A file name of - will be interpreted as stdin.
2185 <!-- Keep this comment at the end of the file
2190 sgml-minimize-attributes:nil
2191 sgml-always-quote-attributes:t
2194 sgml-parent-document:nil
2195 sgml-default-dtd-file:nil
2196 sgml-exposed-tags:nil
2197 sgml-local-catalogs:nil
2198 sgml-local-ecat-files:nil