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 setup, need not be in the same
117 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>--nic</option> option. By default, one NIC is
152 created for the instance, with a random MAC, and connected
153 to the default bridge. Each NIC can take up to three
154 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 bridge to attach this NIC
183 Alternatively, if no network is desired for the instance, you
184 can prevent the default of one NIC with the
185 <option>--no-nics</option> option.
189 The <option>-o</option> options specifies the operating
190 system to be installed. The available operating systems can
191 be listed with <command>gnt-os list</command>.
195 The <option>-B</option> option specifies the backend
196 parameters for the instance. If no such parameters are
197 specified, the values are inherited from the cluster. Possible
203 <simpara>the memory size of the instance; as usual,
204 suffixes can be used to denote the unit, otherwise the
205 value is taken in mebibites</simpara>
211 <simpara>the number of VCPUs to assign to the instance
212 (if this value makes sense for the hypervisor)</simpara>
216 <term>auto_balance</term>
218 <simpara>whether the instance is considered in the N+1
219 cluster checks (enough redundancy in the cluster to
220 survive a node failure)</simpara>
227 The <option>-H</option> option specified the hypervisor to
228 use for the instance (must be one of the enabled hypervisors
229 on the cluster) and optionally custom parameters for this
230 instance. If not other options are used (i.e. the invocation
231 is just <userinput>-H
232 <replaceable>NAME</replaceable></userinput>) the instance
233 will inherit the cluster options. The defaults below show
234 the cluster defaults at cluster creation time.
238 The possible hypervisor options are as follows:
241 <term>boot_order</term>
243 <simpara>Valid for the Xen HVM and KVM
244 hypervisors.</simpara>
246 <simpara>A string value denoting the boot order. This
247 has different meaning for the Xen HVM hypervisor and
248 for the KVM one.</simpara>
251 For Xen HVM, The boot order is a string of letters
252 listing the boot devices, with valid device letters
290 The default is not to set an HVM boot order which is
297 <term>cdrom_image_path</term>
299 <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
301 <simpara>The path to a CDROM image to attach to the
307 <term>nic_type</term>
309 <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
312 This parameter determines the way the network cards
313 are presented to the instance. The possible options are:
315 <member>rtl8139 (default for Xen HVM) (HVM & KVM)</member>
316 <member>ne2k_isa (HVM & KVM)</member>
317 <member>ne2k_pci (HVM & KVM)</member>
318 <member>i82551 (KVM)</member>
319 <member>i82557b (KVM)</member>
320 <member>i82559er (KVM)</member>
321 <member>pcnet (KVM)</member>
322 <member>e1000 (KVM)</member>
323 <member>paravirtual (default for KVM) (HVM & KVM)</member>
329 <term>disk_type</term>
331 <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
334 This parameter determines the way the disks are
335 presented to the instance. The possible options are:
337 <member>ioemu (default for HVM & KVM) (HVM & KVM)</member>
338 <member>ide (HVM & KVM)</member>
339 <member>scsi (KVM)</member>
340 <member>sd (KVM)</member>
341 <member>mtd (KVM)</member>
342 <member>pflash (KVM)</member>
348 <term>vnc_bind_address</term>
350 <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
352 <para>Specifies the address that the VNC listener for
353 this instance should bind to. Valid values are IPv4
354 addresses. Use the address 0.0.0.0 to bind to all
355 available interfaces (this is the default) or specify
356 the address of one of the interfaces on the node to
357 restrict listening to that interface.</para>
364 <simpara>Valid for the KVM hypervisor.</simpara>
366 <simpara>A boolean option that controls whether the
367 VNC connection is secured with TLS.</simpara>
372 <term>vnc_x509_path</term>
374 <simpara>Valid for the KVM hypervisor.</simpara>
376 <para>If <option>vnc_tls</option> is enabled, this
377 options specifies the path to the x509 certificate to
383 <term>vnc_x509_verify</term>
385 <simpara>Valid for the KVM hypervisor.</simpara>
392 <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
395 A boolean option that specifies if the hypervisor
396 should enable ACPI support for this instance. By
397 default, ACPI is disabled.
405 <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
408 A boolean option that specifies if the hypervisor
409 should enabled PAE support for this instance. The
410 default is false, disabling PAE support.
416 <term>kernel_path</term>
418 <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
421 This option specifies the path (on the node) to the
422 kernel to boot the instance with. Xen PVM instances
423 always require this, while for KVM if this option is
424 empty, it will cause the machine to load the kernel
431 <term>kernel_args</term>
433 <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
436 This options specifies extra arguments to the kernel
437 that will be loaded. device. This is always used
438 for Xen PVM, while for KVM it is only used if the
439 <option>kernel_path</option> option is also
444 The default setting for this value is simply
445 <constant>"ro"</constant>, which mounts the root
446 disk (initially) in read-only one. For example,
447 setting this to <userinput>single</userinput> will
448 cause the instance to start in single-user mode.
454 <term>initrd_path</term>
456 <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
459 This option specifies the path (on the node) to the
460 initrd to boot the instance with. Xen PVM instances
461 can use this always, while for KVM if this option is
462 only used if the <option>kernel_path</option> option
463 is also specified. You can pass here either an
464 absolute filename (the path to the initrd) if you
465 want to use an initrd, or use the format
466 <userinput>no_initrd_path</userinput> for no initrd.
472 <term>root_path</term>
474 <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
477 This options specifies the name of the root
478 device. This is always needed for Xen PVM, while for
479 KVM it is only used if the
480 <option>kernel_path</option> option is also
487 <term>serial_console</term>
489 <simpara>Valid for the KVM hypervisor.</simpara>
491 <simpara>This boolean option specifies whether to
492 emulate a serial console for the instance.</simpara>
502 The <option>--iallocator</option> option specifies the instance
503 allocator plugin to use. If you pass in this option the allocator
504 will select nodes for this instance automatically, so you don't need
505 to pass them with the <option>-n</option> option. For more
506 information please refer to the instance allocator documentation.
510 The <option>-t</option> options specifies the disk layout type for
511 the instance. The available choices are:
514 <term>diskless</term>
517 This creates an instance with no disks. Its useful for
518 testing only (or other special cases).
525 <para>Disk devices will be regular files.</para>
531 <para>Disk devices will be logical volumes.</para>
538 Disk devices will be drbd (version 8.x) on top of
547 The optional second value of the <option>--node</option> is used for
548 the drbd template type and specifies the remote node.
552 If you do not want gnt-instance to wait for the disk mirror
553 to be synced, use the <option>--no-wait-for-sync</option>
558 The <option>--file-storage-dir</option> specifies the relative path
559 under the cluster-wide file storage directory to store file-based
560 disks. It is useful for having different subdirectories for
561 different instances. The full path of the directory where the disk
562 files are stored will consist of cluster-wide file storage directory
563 + optional subdirectory + instance name. Example:
564 /srv/ganeti/file-storage/mysubdir/instance1.example.com. This option
565 is only relevant for instances using the file storage backend.
569 The <option>--file-driver</option> specifies the driver to use for
570 file-based disks. Note that currently these drivers work with the
571 xen hypervisor only. This option is only relevant for instances using
572 the file storage backend. The available choices are:
578 Kernel loopback driver. This driver uses loopback
579 devices to access the filesystem within the
580 file. However, running I/O intensive applications in
581 your instance using the loop driver might result in
582 slowdowns. Furthermore, if you use the loopback
583 driver consider increasing the maximum amount of
584 loopback devices (on most systems it's 8) using the
592 <para>The blktap driver (for Xen hypervisors). In
593 order to be able to use the blktap driver you should
594 check if the 'blktapctrl' user space disk agent is
595 running (usually automatically started via xend). This
596 user-level disk I/O interface has the advantage of
597 better performance. Especially if you use a network
598 file system (e.g. NFS) to store your instances this is
599 the recommended choice.
607 The <option>--submit</option> option is used to send the job to
608 the master daemon but not wait for its completion. The job
609 ID will be shown so that it can be examined via
610 <command>gnt-job info</command>.
616 # gnt-instance add -t file --disk 0:size=30g -B memory=512 -o debian-etch \
617 -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
618 # gnt-instance add -t plain --disk 0:size=30g -B memory=512 -o debian-etch \
619 -n node1.example.com instance1.example.com
620 # gnt-instance add -t drbd --disk 0:size=30g -B memory=512 -o debian-etch \
621 -n node1.example.com:node2.example.com instance2.example.com
627 <title>BATCH-CREATE</title>
629 <command>batch-create</command>
630 <arg choice="req">instances_file.json</arg>
634 This command (similar to the Ganeti 1.2
635 <command>batcher</command> tool) submits multiple instance
636 creation jobs based on a definition file. The instance
637 configurations do not encompass all the possible options for
638 the <command>add</command> command, but only a subset.
642 The instance file should be a valid-formed JSON file,
643 containing a dictionary with instance name and instance
644 parameters. The accepted parameters are:
648 <term>disk_size</term>
650 <simpara>The size of the disks of the instance.</simpara>
654 <term>disk_templace</term>
656 <simpara>The disk template to use for the instance,
657 the same as in the <command>add</command>
664 <simpara>A dictionary of backend parameters.</simpara>
668 <term>hypervisor</term>
670 <simpara>A dictionary with a single key (the
671 hypervisor name), and as value the hypervisor
672 options. If not passed, the default hypervisor and
673 hypervisor options will be inherited.</simpara>
677 <term>mac, ip, bridge</term>
679 <simpara>Specifications for the one NIC that will be
680 created for the instance.</simpara>
684 <term>primary_node, secondary_node</term>
686 <simpara>The primary and optionally the secondary node
687 to use for the instance (in case an iallocator script
688 is not used).</simpara>
692 <term>iallocator</term>
694 <simpara>Instead of specifying the nodes, an
695 iallocator script can be used to automatically compute
702 <simpara>whether to start the instance</simpara>
706 <term>ip_check</term>
708 <simpara>Skip the check for already-in-use instance;
709 see the description in the <command>add</command>
710 command for details.</simpara>
714 <term>file_storage_dir, file_driver</term>
716 <simpara>Configuration for the <literal>file</literal>
717 disk type, see the <command>add</command> command for
725 A simple definition for one instance can be (with most of
726 the parameters taken from the cluster defaults):
732 "disk_size": ["25G"],
738 "disk_size": ["25G"],
739 "iallocator": "dumb",
740 "hypervisor": "xen-hvm",
741 "hvparams": {"acpi": true},
742 "backend": {"memory": 512}
749 The command will display the job id for each submitted instance, as follows:
751 # gnt-instance batch-create instances.json
760 <title>REMOVE</title>
763 <command>remove</command>
764 <arg>--ignore-failures</arg>
766 <arg choice="req"><replaceable>instance</replaceable></arg>
770 Remove an instance. This will remove all data from the
771 instance and there is <emphasis>no way back</emphasis>. If
772 you are not sure if you use an instance again, use
773 <command>shutdown</command> first and leave it in the
774 shutdown state for a while.
779 The <option>--ignore-failures</option> option will cause the
780 removal to proceed even in the presence of errors during the
781 removal of the instance (e.g. during the shutdown or the
782 disk removal). If this option is not given, the command will
783 stop at the first error.
787 The <option>--submit</option> option is used to send the job to
788 the master daemon but not wait for its completion. The job
789 ID will be shown so that it can be examined via
790 <command>gnt-job info</command>.
796 # gnt-instance remove instance1.example.com
805 <command>list</command>
806 <arg>--no-headers</arg>
807 <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
808 <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
809 <arg rep="repeat">instance</arg>
813 Shows the currently configured instances with memory usage,
814 disk usage, the node they are running on, and their run
819 The <option>--no-headers</option> option will skip the
820 initial header line. The <option>--separator</option> option
821 takes an argument which denotes what will be used between
822 the output fields. Both these options are to help scripting.
826 The <option>-o</option> option takes a comma-separated list
827 of output fields. The available fields and their meaning
833 <simpara>the instance name</simpara>
839 <simpara>the OS of the instance</simpara>
845 <simpara>the primary node of the instance</simpara>
851 <simpara>comma-separated list of secondary nodes for the
852 instance; usually this will be just one node</simpara>
856 <term>admin_state</term>
858 <simpara>the desired state of the instance (either "yes"
859 or "no" denoting the instance should run or
864 <term>disk_template</term>
866 <simpara>the disk template of the instance</simpara>
870 <term>oper_state</term>
872 <simpara>the actual state of the instance; can be
873 one of the values "running", "stopped", "(node
880 <simpara>combined form of admin_state and oper_stat;
882 <computeroutput>ERROR_nodedown</computeroutput> if the
883 node of the instance is down,
884 <computeroutput>ERROR_down</computeroutput> if the
885 instance should run but is down,
886 <computeroutput>ERROR_up</computeroutput> if the
887 instance should be stopped but is actually running,
888 <computeroutput>ADMIN_down</computeroutput> if the
889 instance has been stopped (and is stopped) and
890 <computeroutput>running</computeroutput> if the
891 instance is set to be running (and is
896 <term>oper_ram</term>
898 <simpara>the actual memory usage of the instance as seen
899 by the hypervisor</simpara>
905 <simpara>the ip address ganeti recognizes as associated with
906 the first instance interface</simpara>
912 <simpara>the first instance interface MAC address</simpara>
918 <simpara>the bridge of the first instance NIC
923 <term>sda_size</term>
925 <simpara>the size of the instance's first disk</simpara>
929 <term>sdb_size</term>
931 <simpara>the size of the instance's second disk, if
938 <simpara>the number of VCPUs allocated to the
945 <simpara>comma-separated list of the instances's
950 <term>serial_no</term>
952 <simpara>the so called 'serial number' of the
953 instance; this is a numeric field that is incremented
954 each time the instance is modified, and it can be used
955 to track modifications</simpara>
959 <term>network_port</term>
961 <simpara>If the instance has a network port assigned
962 to it (e.g. for VNC connections), this will be shown,
963 otherwise <literal>-</literal> will be
968 <term>beparams</term>
970 <simpara>A text format of the entire beparams for the
971 instance. It's more useful to select individual fields
972 from this dictionary, see below.</simpara>
976 <term>disk.count</term>
978 <simpara>The number of instance disks.</simpara>
982 <term>disk.size/N</term>
984 <simpara>The size of the instance's Nth disk. This is
985 a more generic form of the <literal>sda_size</literal>
986 and <literal>sdb_size</literal> fields.</simpara>
990 <term>disk.sizes</term>
992 <simpara>A comma-separated list of the disk sizes for
993 this instance.</simpara>
997 <term>disk_usage</term>
999 <simpara>The total disk space used by this instance on
1000 each of its nodes. This is not the instance-visible
1001 disk size, but the actual disk "cost" of the
1006 <term>nic.mac/N</term>
1008 <simpara>The MAC of the Nth instance NIC.</simpara>
1012 <term>nic.ip/N</term>
1014 <simpara>The IP address of the Nth instance NIC.</simpara>
1018 <term>nic.bridge/N</term>
1020 <simpara>The bridge the Nth instance NIC is attached
1025 <term>nic.macs</term>
1027 <simpara>A comma-separated list of all the MACs of the
1028 instance's NICs.</simpara>
1032 <term>nic.ips</term>
1034 <simpara>A comma-separated list of all the IP
1035 addresses of the instance's NICs.</simpara>
1039 <term>nic.bridges</term>
1041 <simpara>A comma-separated list of all the bridges of the
1042 instance's NICs.</simpara>
1046 <term>nic.count</term>
1048 <simpara>The number of instance nics.</simpara>
1052 <term>hv/<replaceable>NAME</replaceable></term>
1054 <simpara>The value of the hypervisor parameter called
1055 <replaceable>NAME</replaceable>. For details of what
1056 hypervisor parameters exist and their meaning, see the
1057 <command>add</command> command.</simpara>
1061 <term>be/memory</term>
1063 <simpara>The configured memory for the instance.</simpara>
1067 <term>be/vcpus</term>
1069 <simpara>The configured number of VCPUs for the
1074 <term>be/auto_balance</term>
1076 <simpara>Whether the instance is considered in N+1
1084 If the value of the option starts with the character
1085 <constant>+</constant>, the new field(s) will be added to the
1086 default list. This allows to quickly see the default list
1087 plus a few other fields, instead of retyping the entire list
1092 There is a subtle grouping about the available output
1093 fields: all fields except for <option>oper_state</option>,
1094 <option>oper_ram</option> and <option>status</option> are
1095 configuration value and not run-time values. So if you don't
1096 select any of the these fields, the query will be satisfied
1097 instantly from the cluster configuration, without having to
1098 ask the remote nodes for the data. This can be helpful for
1099 big clusters when you only want some data and it makes sense
1100 to specify a reduced set of output fields.
1103 <para>The default output field list is:
1104 <simplelist type="inline">
1105 <member>name</member>
1107 <member>pnode</member>
1108 <member>admin_state</member>
1109 <member>oper_state</member>
1110 <member>oper_ram</member>
1119 <command>info</command>
1124 <group choice="req">
1126 <arg rep="repeat"><replaceable>instance</replaceable></arg>
1131 Show detailed information about the given instance(s). This is
1132 different from <command>list</command> as it shows detailed data
1133 about the instance's disks (especially useful for the drbd disk
1138 If the option <option>-s</option> is used, only information
1139 available in the configuration file is returned, without
1140 querying nodes, making the operation faster.
1144 Use the <option>--all</option> to get info about all instances,
1145 rather than explicitely passing the ones you're interested in.
1150 <title>MODIFY</title>
1153 <command>modify</command>
1155 <arg choice="opt">-H <replaceable>HYPERVISOR_PARAMETERS</replaceable></arg>
1157 <arg choice="opt">-B <replaceable>BACKEND_PARAMETERS</replaceable></arg>
1160 <arg>--net add<replaceable><optional>:options</optional></replaceable></arg>
1161 <arg>--net remove</arg>
1162 <arg>--net <replaceable>N:options</replaceable></arg>
1166 <arg>--disk add:size=<replaceable>SIZE</replaceable></arg>
1167 <arg>--disk remove</arg>
1168 <arg>--disk <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></arg>
1174 <arg choice="req"><replaceable>instance</replaceable></arg>
1178 Modifies the memory size, number of vcpus, ip address, MAC
1179 address and/or bridge for an instance. It can also add and
1180 remove disks and NICs to/from the instance. Note that you
1181 need to give at least one of the arguments, otherwise the
1186 The <option>-H</option> option specifies hypervisor options
1187 in the form of <userinput>name=value[,...]</userinput>. For details which options can be specified, see the <command>add</command> command.
1192 add:size=<replaceable>SIZE</replaceable></option> option
1193 adds a disk to the instance. The <option>--disk
1194 remove</option> will remove the last disk of the
1195 instance. The <option>--disk
1196 <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></option>
1197 option will change the mode of the Nth disk of the instance
1198 between read-only (<literal>ro</literal>) and read-write
1199 (<literal>rw</literal>).
1204 add:<replaceable>options</replaceable></option> option will
1205 add a new NIC to the instance. The available options are the
1206 same as in the <command>add</command> command (mac, ip,
1207 bridge). The <option>--nice remove</option> will remove the
1208 last NIC of the instance, while the <option>--nic
1209 <replaceable>N</replaceable>:<replaceable>options</replaceable></option>
1210 option will change the parameters of the Nth instance NIC.
1214 The <option>--submit</option> option is used to send the job to
1215 the master daemon but not wait for its completion. The job
1216 ID will be shown so that it can be examined via
1217 <command>gnt-job info</command>.
1221 All the changes take effect at the next restart. If the
1222 instance is running, there is no effect on the instance.
1227 <title>REINSTALL</title>
1230 <command>reinstall</command>
1231 <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
1232 <arg>--select-os</arg>
1233 <arg choice="opt">-f <replaceable>force</replaceable></arg>
1234 <arg>--force-multiple</arg>
1236 <group choice="opt">
1237 <arg>--instance</arg>
1239 <arg>--primary</arg>
1240 <arg>--secondary</arg>
1244 <arg choice="opt" rep="repeat"><replaceable>instance</replaceable></arg>
1248 Reinstalls the operating system on the given instance(s). The
1249 instance(s) must be stopped when running this command. If the
1250 <option>--os-type</option> is specified, the operating
1255 The <option>--select-os</option> option switches to an
1256 interactive OS reinstall. The user is prompted to select the OS
1257 template from the list of available OS templates.
1261 Since this is a potentially dangerous command, the user will
1262 be required to confirm this action, unless the
1263 <option>-f</option> flag is passed. When multiple instances
1264 are selected (either by passing multiple arguments or by
1265 using the <option>--node</option>,
1266 <option>--primary</option>, <option>--secondary</option> or
1267 <option>--all</option> options), the user must pass both the
1268 <option>--force</option> and
1269 <option>--force-multiple</option> options to skip the
1270 interactive confirmation.
1274 The <option>--submit</option> option is used to send the job to
1275 the master daemon but not wait for its completion. The job
1276 ID will be shown so that it can be examined via
1277 <command>gnt-job info</command>.
1284 <title>RENAME</title>
1287 <command>rename</command>
1288 <arg>--no-ip-check</arg>
1290 <arg choice="req"><replaceable>instance</replaceable></arg>
1291 <arg choice="req"><replaceable>new_name</replaceable></arg>
1295 Renames the given instance. The instance must be stopped
1296 when running this command. The requirements for the new name
1297 are the same as for adding an instance: the new name must be
1298 resolvable and the IP it resolves to must not be reachable
1299 (in order to prevent duplicate IPs the next time the
1300 instance is started). The IP test can be skipped if the
1301 <option>--no-ip-check</option> option is passed.
1305 The <option>--submit</option> option is used to send the job to
1306 the master daemon but not wait for its completion. The job
1307 ID will be shown so that it can be examined via
1308 <command>gnt-job info</command>.
1316 <title>Starting/stopping/connecting to console</title>
1319 <title>STARTUP</title>
1322 <command>startup</command>
1326 <arg>--force-multiple</arg>
1328 <group choice="opt">
1329 <arg>--instance</arg>
1331 <arg>--primary</arg>
1332 <arg>--secondary</arg>
1336 <arg>-H <option>key=value...</option></arg>
1337 <arg>-B <option>key=value...</option></arg>
1342 rep="repeat"><replaceable>name</replaceable></arg>
1346 Starts one or more instances, depending on the following
1347 options. The four available modes are:
1350 <term><option>--instance</option></term>
1352 <simpara>will start the instances given as arguments
1353 (at least one argument required); this is the default
1360 <simpara>will start the instances who have the given
1361 node as either primary or secondary</simpara>
1365 <term><option>--primary</option></term>
1367 <simpara>will start all instances whose primary node
1368 is in the list of nodes passed as arguments (at least
1369 one node required)</simpara>
1373 <term><option>--secondary</option></term>
1375 <simpara>will start all instances whose secondary node
1376 is in the list of nodes passed as arguments (at least
1377 one node required)</simpara>
1383 <simpara>will start all instances in the cluster (no
1384 arguments accepted)</simpara>
1391 Note that although you can pass more than one selection
1392 option, the last one wins, so in order to guarantee the
1393 desired result, don't pass more than one such option.
1397 Use <option>--force</option> to start even if secondary disks are
1402 The <option>--force-multiple</option> will skip the
1403 interactive confirmation in the case the more than one
1404 instance will be affected.
1408 The <option>-H</option> and <option>-B</option> options
1409 specify extra, temporary hypervisor and backend parameters
1410 that can be used to start an instance with modified
1411 parameters. They can be useful for quick testing without
1412 having to modify an instance back and forth, e.g.:
1414 # gnt-instance start -H root_args="single" instance1
1415 # gnt-instance start -B memory=2048 instance2
1417 The first form will start the instance
1418 <userinput>instance1</userinput> in single-user mode, and
1419 the instance <userinput>instance2</userinput> with 2GB of
1420 RAM (this time only, unless that is the actual instance
1421 memory size already).
1425 The <option>--submit</option> option is used to send the job to
1426 the master daemon but not wait for its completion. The job
1427 ID will be shown so that it can be examined via
1428 <command>gnt-job info</command>.
1434 # gnt-instance start instance1.example.com
1435 # gnt-instance start --node node1.example.com node2.example.com
1436 # gnt-instance start --all
1442 <title>SHUTDOWN</title>
1445 <command>shutdown</command>
1447 <arg>--force-multiple</arg>
1449 <group choice="opt">
1450 <arg>--instance</arg>
1452 <arg>--primary</arg>
1453 <arg>--secondary</arg>
1460 rep="repeat"><replaceable>name</replaceable></arg>
1464 Stops one or more instances. If the instance cannot be
1465 cleanly stopped during a hardcoded interval (currently 2
1466 minutes), it will forcibly stop the instance (equivalent to
1467 switching off the power on a physical machine).
1471 The <option>--instance</option>, <option>--node</option>,
1472 <option>--primary</option>, <option>--secondary</option> and
1473 <option>--all</option> options are similar as for the
1474 <command>startup</command> command and they influence the
1475 actual instances being shutdown.
1479 The <option>--submit</option> option is used to send the job to
1480 the master daemon but not wait for its completion. The job
1481 ID will be shown so that it can be examined via
1482 <command>gnt-job info</command>.
1489 # gnt-instance shutdown instance1.example.com
1490 # gnt-instance shutdown --all
1496 <title>REBOOT</title>
1499 <command>reboot</command>
1501 <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
1503 <arg>--ignore-secondaries</arg>
1505 <arg>--force-multiple</arg>
1507 <group choice="opt">
1508 <arg>--instance</arg>
1510 <arg>--primary</arg>
1511 <arg>--secondary</arg>
1518 rep="repeat"><replaceable>name</replaceable></arg>
1522 Reboots one or more instances. The type of reboot depends on
1523 the value of <option>--type</option>. A soft reboot does a
1524 hypervisor reboot, a hard reboot does a instance stop,
1525 recreates the hypervisor config for the instance and
1526 starts the instance. A full reboot does the equivalent
1527 of <command>gnt-instance shutdown && gnt-instance
1528 startup</command>. The default is hard reboot.
1532 For the hard reboot the option
1533 <option>--ignore-secondaries</option> ignores errors for the
1534 secondary node while re-assembling the instance disks.
1538 The <option>--instance</option>, <option>--node</option>,
1539 <option>--primary</option>, <option>--secondary</option> and
1540 <option>--all</option> options are similar as for the
1541 <command>startup</command> command and they influence the
1542 actual instances being rebooted.
1546 The <option>--force-multiple</option> will skip the
1547 interactive confirmation in the case the more than one
1548 instance will be affected.
1554 # gnt-instance reboot instance1.example.com
1555 # gnt-instance reboot --type=full instance1.example.com
1561 <title>CONSOLE</title>
1563 <command>console</command>
1564 <arg choice="opt">--show-cmd</arg>
1565 <arg choice="req"><replaceable>instance</replaceable></arg>
1569 Connects to the console of the given instance. If the
1570 instance is not up, an error is returned. Use the
1571 <option>--show-cmd</option> option to display the command
1572 instead of executing it.
1576 For HVM instances, this will attempt to connect to the
1577 serial console of the instance. To connect to the
1578 virtualized "physical" console of a HVM instance, use a VNC
1579 client with the connection info from the
1580 <command>info</command> command.
1586 # gnt-instance console instance1.example.com
1594 <title>Disk management</title>
1597 <title>REPLACE-DISKS</title>
1600 <command>replace-disks</command>
1602 <arg choice="req">-p</arg>
1603 <arg>--disks <replaceable>idx</replaceable></arg>
1604 <arg choice="req"><replaceable>instance</replaceable></arg>
1608 <command>replace-disks</command>
1610 <arg choice="req">-s</arg>
1611 <arg>--disks <replaceable>idx</replaceable></arg>
1612 <arg choice="req"><replaceable>instance</replaceable></arg>
1616 <command>replace-disks</command>
1618 <group choice="req">
1619 <arg>--iallocator <replaceable>name</replaceable></arg>
1620 <arg>--new-secondary <replaceable>NODE</replaceable></arg>
1623 <arg choice="req"><replaceable>instance</replaceable></arg>
1627 This command is a generalized form for replacing disks. It
1628 is currently only valid for the mirrored (DRBD) disk
1633 The first form (when passing the <option>-p</option> option)
1634 will replace the disks on the primary, while the second form
1635 (when passing the <option>-s</option> option will replace
1636 the disks on the secondary node. For these two cases (as the
1637 node doesn't change), it is possible to only run the replace
1638 for a subset of the disks, using the option
1639 <option>--disks</option> which takes a list of
1640 comma-delimited disk indices (zero-based),
1641 e.g. <userinput>0,2</userinput> to replace only the first
1646 The third form (when passing either the
1647 <option>--iallocator</option> or the
1648 <option>--new-secondary</option> option) is designed to
1649 change secondary node of the instance. Specifying
1650 <option>--iallocator</option> makes the new secondary be
1651 selected automatically by the specified allocator plugin,
1652 otherwise the new secondary node will be the one chosen
1653 manually via the <option>--new-secondary</option> option.
1657 The <option>--submit</option> option is used to send the job to
1658 the master daemon but not wait for its completion. The job
1659 ID will be shown so that it can be examined via
1660 <command>gnt-job info</command>.
1664 Note that it is not possible to select an offline or drained
1665 node as a new secondary.
1671 <title>ACTIVATE-DISKS</title>
1674 <command>activate-disks</command>
1676 <arg choice="req"><replaceable>instance</replaceable></arg>
1679 Activates the block devices of the given instance. If
1680 successful, the command will show the location and name of
1683 node1.example.com:disk/0:/dev/drbd0
1684 node1.example.com:disk/1:/dev/drbd1
1687 In this example, <emphasis>node1.example.com</emphasis> is
1688 the name of the node on which the devices have been
1689 activated. The <emphasis>disk/0</emphasis> and
1690 <emphasis>disk/1</emphasis> are the Ganeti-names of the
1691 instance disks; how they are visible inside the instance is
1692 hypervisor-specific. <emphasis>/dev/drbd0</emphasis> and
1693 <emphasis>/dev/drbd1</emphasis> are the actual block devices
1694 as visible on the node.
1698 The <option>--submit</option> option is used to send the job to
1699 the master daemon but not wait for its completion. The job
1700 ID will be shown so that it can be examined via
1701 <command>gnt-job info</command>.
1705 Note that it is safe to run this command while the instance
1711 <title>DEACTIVATE-DISKS</title>
1714 <command>deactivate-disks</command>
1716 <arg choice="req"><replaceable>instance</replaceable></arg>
1719 De-activates the block devices of the given instance. Note
1720 that if you run this command for an instance with a drbd
1721 disk template, while it is running, it will not be able to
1722 shutdown the block devices on the primary node, but it will
1723 shutdown the block devices on the secondary nodes, thus
1724 breaking the replication.
1728 The <option>--submit</option> option is used to send the job to
1729 the master daemon but not wait for its completion. The job
1730 ID will be shown so that it can be examined via
1731 <command>gnt-job info</command>.
1737 <title>GROW-DISK</title>
1739 <command>grow-disk</command>
1740 <arg>--no-wait-for-sync</arg>
1742 <arg choice="req"><replaceable>instance</replaceable></arg>
1743 <arg choice="req"><replaceable>disk</replaceable></arg>
1744 <arg choice="req"><replaceable>amount</replaceable></arg>
1748 Grows an instance's disk. This is only possible for
1749 instances having a <literal>plain</literal> or
1750 <literal>drbd</literal> disk template.
1754 Note that this command only change the block device size; it
1755 will not grow the actual filesystems, partitions, etc. that
1756 live on that disk. Usually, you will need to:
1759 <simpara>use <command>gnt-instance grow-disk</command></simpara>
1762 <simpara>reboot the instance (later, at a convenient
1766 <simpara>use a filesystem resizer, such as
1767 <citerefentry> <refentrytitle>ext2online</refentrytitle>
1768 <manvolnum>8</manvolnum> </citerefentry> or
1769 <citerefentry> <refentrytitle>xfs_growfs</refentrytitle>
1770 <manvolnum>8</manvolnum> </citerefentry> to resize the
1771 filesystem, or use <citerefentry>
1772 <refentrytitle>fdisk</refentrytitle>
1773 <manvolnum>8</manvolnum> </citerefentry> to change the
1774 partition table on the disk
1782 The <replaceable>disk</replaceable> argument is the index of
1783 the instance disk to grow. The
1784 <replaceable>amount</replaceable> argument is given either
1785 as a number (and it represents the amount to increase the
1786 disk with in mebibytes) or can be given similar to the
1787 arguments in the create instance operation, with a suffix
1792 Note that the disk grow operation might complete on one node
1793 but fail on the other; this will leave the instance with
1794 different-sized LVs on the two nodes, but this will not
1795 create problems (except for unused space).
1799 If you do not want gnt-instance to wait for the new disk
1800 region to be synced, use the
1801 <option>--no-wait-for-sync</option> option.
1805 The <option>--submit</option> option is used to send the job to
1806 the master daemon but not wait for its completion. The job
1807 ID will be shown so that it can be examined via
1808 <command>gnt-job info</command>.
1812 <para>Example (increase the first disk for instance1 by 16GiB):
1814 # gnt-instance grow-disk instance1.example.com 0 16g
1819 Also note that disk shrinking is not supported; use
1820 <command>gnt-backup export</command> and then
1821 <command>gnt-backup import</command> to reduce the disk size
1829 <title>Recovery</title>
1832 <title>FAILOVER</title>
1835 <command>failover</command>
1837 <arg>--ignore-consistency</arg>
1839 <arg choice="req"><replaceable>instance</replaceable></arg>
1843 Failover will fail the instance over its secondary
1844 node. This works only for instances having a drbd disk
1849 Normally the failover will check the consistency of the
1850 disks before failing over the instance. If you are trying to
1851 migrate instances off a dead node, this will fail. Use the
1852 <option>--ignore-consistency</option> option for this
1853 purpose. Note that this option can be dangerous as errors in
1854 shutting down the instance will be ignored, resulting in
1855 possibly having the instance running on two machines in
1856 parallel (on disconnected DRBD drives).
1860 The <option>--submit</option> option is used to send the job to
1861 the master daemon but not wait for its completion. The job
1862 ID will be shown so that it can be examined via
1863 <command>gnt-job info</command>.
1869 # gnt-instance failover instance1.example.com
1875 <title>MIGRATE</title>
1878 <command>migrate</command>
1880 <arg choice="req">--cleanup</arg>
1881 <arg choice="req"><replaceable>instance</replaceable></arg>
1885 <command>migrate</command>
1887 <arg>--non-live</arg>
1888 <arg choice="req"><replaceable>instance</replaceable></arg>
1892 Migrate will move the instance to its secondary node without
1893 shutdown. It only works for instances having the drbd8 disk
1898 The migration command needs a perfectly healthy instance, as
1899 we rely on the dual-master capability of drbd8 and the disks
1900 of the instance are not allowed to be degraded.
1904 The <option>--non-live</option> option will switch (for the
1905 hypervisors that support it) between a "fully live"
1906 (i.e. the interruption is as minimal as possible) migration
1907 and one in which the instance is frozen, its state saved and
1908 transported to the remote node, and then resumed there. This
1909 all depends on the hypervisor support for two different
1910 methods. In any case, it is not an error to pass this
1911 parameter (it will just be ignored if the hypervisor doesn't
1916 If the <option>--cleanup</option> option is passed, the
1917 operation changes from migration to attempting recovery from
1918 a failed previous migration. In this mode, ganeti checks if
1919 the instance runs on the correct node (and updates its
1920 configuration if not) and ensures the instances's disks are
1921 configured correctly. In this mode, the
1922 <option>--non-live</option> option is ignored.
1926 The option <option>-f</option> will skip the prompting for
1930 Example (and expected output):
1932 # gnt-instance migrate instance1
1933 Migrate will happen to the instance instance1. Note that migration is
1934 **experimental** in this version. This might impact the instance if
1935 anything goes wrong. Continue?
1937 * checking disk consistency between source and target
1938 * ensuring the target is in secondary mode
1939 * changing disks into dual-master mode
1940 - INFO: Waiting for instance instance1 to sync disks.
1941 - INFO: Instance instance1's disks are in sync.
1942 * migrating instance to node2.example.com
1943 * changing the instance's disks on source node to secondary
1944 - INFO: Waiting for instance instance1 to sync disks.
1945 - INFO: Instance instance1's disks are in sync.
1946 * changing the instance's disks to single-master
1958 <title>ADD-TAGS</title>
1961 <command>add-tags</command>
1962 <arg choice="opt">--from <replaceable>file</replaceable></arg>
1963 <arg choice="req"><replaceable>instancename</replaceable></arg>
1965 rep="repeat"><replaceable>tag</replaceable></arg>
1969 Add tags to the given instance. If any of the tags contains
1970 invalid characters, the entire operation will abort.
1973 If the <option>--from</option> option is given, the list of
1974 tags will be extended with the contents of that file (each
1975 line becomes a tag). In this case, there is not need to pass
1976 tags on the command line (if you do, both sources will be
1977 used). A file name of - will be interpreted as stdin.
1982 <title>LIST-TAGS</title>
1985 <command>list-tags</command>
1986 <arg choice="req"><replaceable>instancename</replaceable></arg>
1989 <para>List the tags of the given instance.</para>
1993 <title>REMOVE-TAGS</title>
1995 <command>remove-tags</command>
1996 <arg choice="opt">--from <replaceable>file</replaceable></arg>
1997 <arg choice="req"><replaceable>instancename</replaceable></arg>
1999 rep="repeat"><replaceable>tag</replaceable></arg>
2003 Remove tags from the given instance. If any of the tags are
2004 not existing on the node, the entire operation will abort.
2008 If the <option>--from</option> option is given, the list of
2009 tags will be extended with the contents of that file (each
2010 line becomes a tag). In this case, there is not need to pass
2011 tags on the command line (if you do, both sources will be
2012 used). A file name of - will be interpreted as stdin.
2024 <!-- Keep this comment at the end of the file
2029 sgml-minimize-attributes:nil
2030 sgml-always-quote-attributes:t
2033 sgml-parent-document:nil
2034 sgml-default-dtd-file:nil
2035 sgml-exposed-tags:nil
2036 sgml-local-catalogs:nil
2037 sgml-local-ecat-files:nil