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>May 16, 2007</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">
23 <holder>Google Inc.</holder>
31 <refmiscinfo>ganeti 1.2</refmiscinfo>
34 <refname>&dhpackage;</refname>
36 <refpurpose>ganeti instance administration</refpurpose>
40 <command>&dhpackage; </command>
42 <arg choice="req">command</arg>
43 <arg>arguments...</arg>
47 <title>DESCRIPTION</title>
50 The <command>&dhpackage;</command> is used for instance
51 administration in the ganeti system.
56 <title>COMMANDS</title>
59 <title>Creation/removal/querying</title>
64 <command>add</command>
65 <arg>-s <replaceable>disksize</replaceable></arg>
66 <arg>--swap-size <replaceable>disksize</replaceable></arg>
67 <arg>-m <replaceable>memsize</replaceable></arg>
69 <arg>-o <replaceable>os-type</replaceable></arg>
70 <arg>-b <replaceable>bridge</replaceable></arg>
71 <arg>--mac <replaceable>MAC-address</replaceable></arg>
72 <arg>--hvm-boot-order <replaceable>boot-order</replaceable></arg>
74 <arg>--kernel <group choice="req">
76 <arg><replaceable>kernel_path</replaceable></arg>
79 <arg>--initrd <group choice="req">
82 <arg><replaceable>initrd_path</replaceable></arg>
85 <arg choice="req">-t<group>
92 <arg choice="req">-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg>
93 <arg choice="req"><replaceable>instance</replaceable></arg>
97 Creates a new instance on the specified
98 host. <replaceable>instance</replaceable> must be in DNS and
99 resolve to a IP in the same network as the nodes in the
104 The <option>-s</option> option specifies the disk size for
105 the instance, in mebibytes (defaults to
106 <constant>20480MiB</constant> =
107 <constant>20GiB</constant>). You can also use one of the
108 suffixes <literal>m</literal>, <literal>g</literal> or
109 <literal>t</literal> to specificy the exact the units used;
110 these suffixes map to mebibytes, gibibytes and tebibytes.
114 The <option>--swap-size</option> option specifies the swap
115 disk size (in mebibytes) for the instance (the one presented
116 as <filename class="devicefile">/dev/sdb</filename>). The
117 default is <constant>4096MiB</constant>. As for the disk
118 size, you can specify other suffixes.
122 The <option>-m</option> option specifies the memory size for
123 the instance, in mebibytes (defaults to 128 MiB). Again, you
124 can use other suffixes (e.g. <userinput>2g</userinput>).
128 The <option>-o</option> options specifies the operating
129 system to be installed. The available operating systems can
130 be listed with <command>gnt-os list</command>.
134 The <option>-b</option> option specifies the bridge to which the
135 instance will be connected. (defaults to the cluster-wide default
136 bridge specified at cluster initialization time).
140 The <option>--mac</option> option specifies the MAC address
141 of the ethernet interface for the instance. If this option
142 is not specified, a new MAC address is generated randomly with
143 the configured MAC prefix. The randomly generated MAC
144 address is guaranteed to be unique among the instances of
149 The <option>--hvm-boot-order</option> option specifies the
150 boot device order for Xen HVM instances. The boot order is a
151 string of letters listing the boot devices, with valid
152 device letters being:
193 The option is only relevant for Xen HVM instances and
194 ignored by all other instances types.
198 The <option>--kernel</option> options allows the instance to
199 use a custom kernel (if a filename is passed) or to use the
200 default kernel (<filename>@CUSTOM_XEN_KERNEL@</filename>), if the
201 string <constant>default</constant> is passed.
205 The <option>--initrd</option> option is similar: it allows
206 the instance to use a custom initrd (if a filename is
207 passed) or to use the default initrd
208 (<filename>@CUSTOM_XEN_INITRD@</filename>), if the string
209 <constant>default</constant> is passed, or to disable the
210 use of an initrd, if the string <constant>none</constant> is
211 passed. Note that in the case the instance is set to use the
212 default initrd and it doesn't exist, it will be silently
213 ignored; if the instance is set to use a custom initrd and
214 it doesn't exist, this will be treated as an error and will
215 prevent the startup of the instance.
219 The <option>-t</option> options specifies the disk layout type for
220 the instance. The available choices are:
223 <term>diskless</term>
226 This creates an instance with no disks. Its useful for
227 testing only (or other special cases).
234 <para>Disk devices will be logical volumes.</para>
241 Disk devices will be drbd (version 8.x) on top of
250 The optional second value of the <option>--node</option> is used for
251 the remote raid template type and specifies the remote node.
255 If you do not want gnt-instance to wait for the disk mirror
256 to be synced, use the <option>--no-wait-for-sync</option>
263 # gnt-instance add -t plain -s 30g -m 512 -o debian-etch \
264 -n node1.example.com instance1.example.com
265 # gnt-instance add -t drbd -s 30g -m 512 -o debian-etch \
266 -n node1.example.com:node2.example.com instance2.example.com
272 <title>REMOVE</title>
275 <command>remove</command>
276 <arg>--ignore-failures</arg>
277 <arg choice="req"><replaceable>instance</replaceable></arg>
281 Remove an instance. This will remove all data from the
282 instance and there is <emphasis>no way back</emphasis>. If
283 you are not sure if you use an instance again, use
284 <command>shutdown</command> first and leave it in the
285 shutdown state for a while.
290 The <option>--ignore-failures</option> option will cause the
291 removal to proceed even in the presence of errors during the
292 removal of the instance (e.g. during the shutdown or the
293 disk removal). If this option is not given, the command will
294 stop at the first error.
300 # gnt-instance remove instance1.example.com
309 <command>list</command>
310 <arg>--no-headers</arg>
311 <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
312 <arg>-o <replaceable>FIELD,...</replaceable></arg>
316 Shows the currently configured instances with memory usage,
317 disk usage, the node they are running on, and the CPU time,
318 counted in seconds, used by each instance since its latest
323 The <option>--no-headers</option> option will skip the
324 initial header line. The <option>--separator</option> option
325 takes an argument which denotes what will be used between
326 the output fields. Both these options are to help scripting.
330 The <option>-o</option> option takes a comma-separated list
331 of output fields. The available fields and their meaning
337 <simpara>the instance name</simpara>
343 <simpara>the OS of the instance</simpara>
349 <simpara>the primary node of the instance</simpara>
355 <simpara>comma-separated list of secondary nodes for the
356 instance; usually this will be just one node</simpara>
360 <term>admin_state</term>
362 <simpara>the desired state of the instance (either "yes"
363 or "no" denoting the instance should run or
368 <term>admin_ram</term>
370 <simpara>the desired memory for the instance</simpara>
374 <term>disk_template</term>
376 <simpara>the disk template of the instance</simpara>
380 <term>oper_state</term>
382 <simpara>the actual state of the instance; can be
383 one of the values "running", "stopped", "(node
390 <simpara>combined form of admin_state and oper_stat;
392 <computeroutput>ERROR_nodedown</computeroutput> if the
393 node of the instance is down,
394 <computeroutput>ERROR_down</computeroutput> if the
395 instance should run but is down,
396 <computeroutput>ERROR_up</computeroutput> if the
397 instance should be stopped but is actually running,
398 <computeroutput>ADMIN_down</computeroutput> if the
399 instance has been stopped (and is stopped) and
400 <computeroutput>running</computeroutput> if the
401 instance is set to be running (and is
406 <term>oper_ram</term>
408 <simpara>the actual memory usage of the instance as seen
409 by the hypervisor</simpara>
415 <simpara>the ip address ganeti recognizes as associated with
416 the instance interface</simpara>
422 <simpara>the instance interface MAC address</simpara>
428 <simpara>bridge the instance is connected to
433 <term>sda_size</term>
435 <simpara>the size of the instance's first disk</simpara>
439 <term>sdb_size</term>
441 <simpara>the size of the instance's second disk</simpara>
447 <simpara>the number of VCPUs allocated to the
455 There is a subtle grouping about the available output
456 fields: all fields except for <option>oper_state</option>
457 and <option>oper_ram</option> are configuration value and
458 not run-time values. So if you don't select any of the
459 <option>oper_*</option> fields, the query will be satisfied
460 instantly from the cluster configuration, without having to
461 ask the remote nodes for the data. This can be helpful for
462 big clusters when you only want some data and it makes sense
463 to specify a reduced set of output fields.
466 <para>The default output field list is:
467 <simplelist type="inline">
468 <member>name</member>
470 <member>pnode</member>
471 <member>admin_state</member>
472 <member>oper_state</member>
473 <member>oper_ram</member>
482 <command>info</command>
483 <arg rep="repeat"><replaceable>instance</replaceable></arg>
487 Show detailed information about the (given) instances. This
488 is different from <command>list</command> as it shows
489 detailed data about the instance's disks (especially useful
490 for remote raid templates).
495 <title>MODIFY</title>
498 <command>modify</command>
499 <arg choice="opt">-m <replaceable>memsize</replaceable></arg>
500 <arg choice="opt">-p <replaceable>vcpus</replaceable></arg>
501 <arg choice="opt">-i <replaceable>ip</replaceable></arg>
502 <arg choice="opt">-b <replaceable>bridge</replaceable></arg>
503 <arg choice="opt">--mac <replaceable>MAC-address</replaceable></arg>
504 <arg>--hvm-boot-order <replaceable>boot-order</replaceable></arg>
506 <arg>--kernel <group choice="req">
508 <arg><replaceable>kernel_path</replaceable></arg>
511 <arg>--initrd <group choice="req">
514 <arg><replaceable>initrd_path</replaceable></arg>
517 <arg choice="req"><replaceable>instance</replaceable></arg>
521 Modify the memory size, number of vcpus, ip address, MAC
522 address and/or bridge for an instance.
526 The memory size is given in MiB. Note that you need to give
527 at least one of the arguments, otherwise the command
532 The <option>--kernel</option>, <option>--initrd</option>
533 and <option>--hvm-boot-order</option>
534 options are described in the <command>add</command> command.
538 Additionally, the HVM boot order can be reset to the default
539 values by using <option>--hvm-boot-order=default</option>.
543 All the changes take effect at the next restart. If the
544 instance is running, there is no effect on the instance.
549 <title>REINSTALL</title>
552 <command>reinstall</command>
553 <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
554 <arg choice="opt">-f <replaceable>force</replaceable></arg>
555 <arg choice="req"><replaceable>instance</replaceable></arg>
559 Reinstalls the operating system on the given instance. The instance
560 must be stopped when running this command. If the
561 <option>--os-type</option> is specified, the operating system is
567 <title>RENAME</title>
570 <command>rename</command>
571 <arg>--no-ip-check</arg>
572 <arg choice="req"><replaceable>instance</replaceable></arg>
573 <arg choice="req"><replaceable>new_name</replaceable></arg>
577 Renames the given instance. The instance must be stopped
578 when running this command. The requirements for the new name
579 are the same as for adding an instance: the new name must be
580 resolvable and the IP it resolves to must not be reachable
581 (in order to prevent duplicate IPs the next time the
582 instance is started). The IP test can be skipped if the
583 <option>--no-ip-check</option> option is passed.
590 <title>Starting/stopping/connecting to console</title>
593 <title>STARTUP</title>
596 <command>startup</command>
597 <arg>--extra=<replaceable>PARAMS</replaceable></arg>
601 <arg>--instance</arg>
604 <arg>--secondary</arg>
609 rep="repeat"><replaceable>name</replaceable></arg>
613 Starts one or more instances, depending on the following
614 options. The four available modes are:
617 <term><option>--instance</option></term>
619 <simpara>will start the instances given as arguments
620 (at least one argument required); this is the default
627 <simpara>will start the instances who have the given
628 node as either primary or secondary</simpara>
632 <term><option>--primary</option></term>
634 <simpara>will start all instances whose primary node
635 is in the list of nodes passed as arguments (at least
636 one node required)</simpara>
640 <term><option>--secondary</option></term>
642 <simpara>will start all instances whose secondary node
643 is in the list of nodes passed as arguments (at least
644 one node required)</simpara>
650 <simpara>will start all instances in the cluster (no
651 arguments accepted)</simpara>
658 Note that although you can pass more than one selection
659 option, the last one wins, so in order to guarantee the
660 desired result, don't pass more than one such option.
664 The <option>--extra</option> option is used to pass
665 additional argument to the instance's kernel for this start
666 only. Currently there is no way to specify a persistent set
667 of arguments (beside the one hardcoded). Note that this may
668 not apply to all virtualization types.
672 Use <option>--force</option> to start even if secondary disks are
679 # gnt-instance start instance1.example.com
680 # gnt-instance start --extra single test1.example.com
681 # gnt-instance start --node node1.example.com node2.example.com
682 # gnt-instance start --all
688 <title>SHUTDOWN</title>
691 <command>shutdown</command>
694 <arg>--instance</arg>
697 <arg>--secondary</arg>
703 rep="repeat"><replaceable>name</replaceable></arg>
707 Stops one or more instances. If the instance cannot be
708 cleanly stopped during a hardcoded interval (currently 2
709 minutes), it will forcibly stop the instance (equivalent to
710 switching off the power on a physical machine).
714 The <option>--instance</option>, <option>--node</option>,
715 <option>--primary</option>, <option>--secondary</option> and
716 <option>--all</option> options are similar as for the
717 <command>startup</command> command and they influence the
718 actual instances being shutdown.
724 # gnt-instance shutdown instance1.example.com
725 # gnt-instance shutdown --all
731 <title>REBOOT</title>
734 <command>reboot</command>
736 <arg>--extra=<replaceable>PARAMS</replaceable></arg>
738 <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
740 <arg>--ignore-secondaries</arg>
742 <arg>--force-multiple</arg>
745 <arg>--instance</arg>
748 <arg>--secondary</arg>
754 rep="repeat"><replaceable>name</replaceable></arg>
758 Reboots one or more instances. The type of reboot depends on
759 the value of <option>--type</option>. A soft reboot does a
760 hypervisor reboot, a hard reboot does a instance stop,
761 recreates the hypervisor config for the instance and
762 starts the instance. A full reboot does the equivalent
763 of <command>gnt-instance shutdown && gnt-instance
764 startup</command>. The default is soft reboot.
768 For the hard reboot the option
769 <option>--ignore-secondaries</option> ignores errors for the
770 secondary node while re-assembling the instance disks.
774 The <option>--instance</option>, <option>--node</option>,
775 <option>--primary</option>, <option>--secondary</option> and
776 <option>--all</option> options are similar as for the
777 <command>startup</command> command and they influence the
778 actual instances being rebooted.
782 Use the <option>--force-multiple</option> option to keep
783 gnt-instance from asking for confirmation when more than one
784 instance is affected.
790 # gnt-instance reboot instance1.example.com
791 # gnt-instance reboot --type=full instance1.example.com
797 <title>CONSOLE</title>
799 <command>console</command>
800 <arg choice="req"><replaceable>instance</replaceable></arg>
804 Connects to the console of the given instance. If the instance
805 is not up, an error is returned.
811 # gnt-instance console instance1.example.com
819 <title>Disk management</title>
822 <title>REPLACE-DISKS</title>
825 <command>replace-disks</command>
826 <arg choice="opt">--new-secondary <replaceable>NODE</replaceable></arg>
827 <arg choice="req"><replaceable>instance</replaceable></arg>
831 <command>replace-disks</command>
832 <arg choice="opt">-s</arg>
833 <arg choice="req">--new-secondary <replaceable>NODE</replaceable></arg>
834 <arg choice="req"><replaceable>instance</replaceable></arg>
838 <command>replace-disks</command>
840 <arg choice="req">-s</arg>
841 <arg choice="req">-p</arg>
843 <arg choice="req"><replaceable>instance</replaceable></arg>
847 This command is a generalized form for adding and replacing
852 The first form is usable with the
853 <literal>remote_raid1</literal> disk template. This will
854 replace the disks on both the primary and secondary node,
855 and optionally will change the secondary node to a new one
856 if you pass the <option>--new-secondary</option> option.
860 The second and third forms are usable with the
861 <literal>drbd</literal> disk template. The second form will
862 do a secondary replacement, but as opposed to the
863 <literal>remote_raid1</literal> will not replace the disks
864 on the primary, therefore it will execute faster. The third
865 form will replace the disks on either the primary
866 (<option>-p</option>) or the secondary (<option>-s</option>)
867 node of the instance only, without changing the node.
873 <title>ACTIVATE-DISKS</title>
876 <command>activate-disks</command>
877 <arg choice="req"><replaceable>instance</replaceable></arg>
880 Activates the block devices of the given instance. If
881 successful, the command will show the location and name of
884 node1.example.com:sda:/dev/md0
885 node1.example.com:sdb:/dev/md1
888 In this example, <emphasis>node1.example.com</emphasis> is
889 the name of the node on which the devices have been
890 activated. The <emphasis>sda</emphasis> and
891 <emphasis>sdb</emphasis> are the names of the block devices
892 inside the instance. <emphasis>/dev/md0</emphasis> and
893 <emphasis>/dev/md1</emphasis> are the names of the block
894 devices as visible on the node.
898 Note that it is safe to run this command while the instance
904 <title>DEACTIVATE-DISKS</title>
907 <command>deactivate-disks</command>
908 <arg choice="req"><replaceable>instance</replaceable></arg>
911 De-activates the block devices of the given instance. Note
912 that if you run this command for a remote raid instance
913 type, while it is running, it will not be able to shutdown
914 the block devices on the primary node, but it will shutdown
915 the block devices on the secondary nodes, thus breaking the
924 <title>Recovery</title>
927 <title>FAILOVER</title>
930 <command>failover</command>
932 <arg>--ignore-consistency</arg>
933 <arg choice="req"><replaceable>instance</replaceable></arg>
937 Failover will fail the instance over its secondary
938 node. This works only for instances having a remote raid
943 Normally the failover will check the consistency of the
944 disks before failing over the instance. If you are trying to
945 migrate instances off a dead node, this will fail. Use the
946 <option>--ignore-consistency</option> option for this
947 purpose. Note that this option can be dangerous as errors in
948 shutting down the instance will be ignored, resulting in
949 possibly having the instance running on two machines in
950 parallel (on disconnected DRBD drives).
956 # gnt-instance failover instance1.example.com
967 <title>ADD-TAGS</title>
970 <command>add-tags</command>
971 <arg choice="opt">--from <replaceable>file</replaceable></arg>
972 <arg choice="req"><replaceable>instancename</replaceable></arg>
974 rep="repeat"><replaceable>tag</replaceable></arg>
978 Add tags to the given instance. If any of the tags contains
979 invalid characters, the entire operation will abort.
982 If the <option>--from</option> option is given, the list of
983 tags will be extended with the contents of that file (each
984 line becomes a tag). In this case, there is not need to pass
985 tags on the command line (if you do, both sources will be
986 used). A file name of - will be interpreted as stdin.
991 <title>LIST-TAGS</title>
994 <command>list-tags</command>
995 <arg choice="req"><replaceable>instancename</replaceable></arg>
998 <para>List the tags of the given instance.</para>
1002 <title>REMOVE-TAGS</title>
1004 <command>remove-tags</command>
1005 <arg choice="opt">--from <replaceable>file</replaceable></arg>
1006 <arg choice="req"><replaceable>instancename</replaceable></arg>
1008 rep="repeat"><replaceable>tag</replaceable></arg>
1012 Remove tags from the given instance. If any of the tags are
1013 not existing on the node, the entire operation will abort.
1017 If the <option>--from</option> option is given, the list of
1018 tags will be extended with the contents of that file (each
1019 line becomes a tag). In this case, there is not need to pass
1020 tags on the command line (if you do, both sources will be
1021 used). A file name of - will be interpreted as stdin.
1033 <!-- Keep this comment at the end of the file
1038 sgml-minimize-attributes:nil
1039 sgml-always-quote-attributes:t
1042 sgml-parent-document:nil
1043 sgml-default-dtd-file:nil
1044 sgml-exposed-tags:nil
1045 sgml-local-catalogs:nil
1046 sgml-local-ecat-files:nil