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>
88 <arg>local_raid1</arg>
89 <arg>remote_raid1</arg>
94 <arg choice="req">-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg>
95 <arg choice="req"><replaceable>instance</replaceable></arg>
99 Creates a new instance on the specified
100 host. <replaceable>instance</replaceable> must be in DNS and
101 resolve to a IP in the same network as the nodes in the
106 The <option>-s</option> option specifies the disk size for
107 the instance, in mebibytes (defaults to
108 <constant>20480MiB</constant> =
109 <constant>20GiB</constant>). You can also use one of the
110 suffixes <literal>m</literal>, <literal>g</literal> or
111 <literal>t</literal> to specificy the exact the units used;
112 these suffixes map to mebibytes, gibibytes and tebibytes.
116 The <option>--swap-size</option> option specifies the swap
117 disk size (in mebibytes) for the instance (the one presented
118 as <filename class="devicefile">/dev/sdb</filename>). The
119 default is <constant>4096MiB</constant>. As for the disk
120 size, you can specify other suffixes.
124 The <option>-m</option> option specifies the memory size for
125 the instance, in mebibytes (defaults to 128 MiB). Again, you
126 can use other suffixes (e.g. <userinput>2g</userinput>).
130 The <option>-o</option> options specifies the operating
131 system to be installed. The available operating systems can
132 be listed with <command>gnt-os list</command>.
136 The <option>-b</option> option specifies the bridge to which the
137 instance will be connected. (defaults to the cluster-wide default
138 bridge specified at cluster initialization time).
142 The <option>--mac</option> option specifies the MAC address
143 of the ethernet interface for the instance. If this option
144 is not specified, a new MAC address is generated randomly with
145 the configured MAC prefix. The randomly generated MAC
146 address is guaranteed to be unique among the instances of
151 The <option>--hvm-boot-order</option> option specifies the
152 boot device order for Xen HVM instances. The boot order is a
153 string of letters listing the boot devices, with valid
154 device letters being:
195 The option is only relevant for Xen HVM instances and
196 ignored by all other instances types.
200 The <option>--kernel</option> options allows the instance to
201 use a custom kernel (if a filename is passed) or to use the
202 default kernel (<filename>@CUSTOM_XEN_KERNEL@</filename>), if the
203 string <constant>default</constant> is passed.
207 The <option>--initrd</option> option is similar: it allows
208 the instance to use a custom initrd (if a filename is
209 passed) or to use the default initrd
210 (<filename>@CUSTOM_XEN_INITRD@</filename>), if the string
211 <constant>default</constant> is passed, or to disable the
212 use of an initrd, if the string <constant>none</constant> is
213 passed. Note that in the case the instance is set to use the
214 default initrd and it doesn't exist, it will be silently
215 ignored; if the instance is set to use a custom initrd and
216 it doesn't exist, this will be treated as an error and will
217 prevent the startup of the instance.
221 The <option>-t</option> options specifies the disk layout type for
222 the instance. The available choices are:
225 <term>diskless</term>
228 This creates an instance with no disks. Its useful for
229 testing only (or other special cases).
236 <para>Disk devices will be logical volumes.</para>
240 <term>local_raid1</term>
243 Disk devices will be md raid1 arrays over two local
249 <term>remote_raid1</term>
252 Disk devices will be md raid1 arrays with one
253 component (so it's not actually raid1): a drbd
254 (0.7.x) device between the instance's primary node
255 and the node given by the second value of the
256 <option>--node</option> option.
264 Disk devices will be drbd (version 8.x) on top of
265 lvm volumes. They are equivalent in functionality to
266 <replaceable>remote_raid1</replaceable>, but are
267 recommended for new instances (if you have drbd 8.x
276 The optional second value of the <option>--node</option> is used for
277 the remote raid template type and specifies the remote node.
281 If you do not want gnt-instance to wait for the disk mirror
282 to be synced, use the <option>--no-wait-for-sync</option>
289 # gnt-instance add -t plain -s 30g -m 512 -o debian-etch \
290 -n node1.example.com instance1.example.com
291 # gnt-instance add -t remote_raid1 -s 30g -m 512 -o debian-etch \
292 -n node1.example.com:node2.example.com instance2.example.com
298 <title>REMOVE</title>
301 <command>remove</command>
302 <arg>--ignore-failures</arg>
303 <arg choice="req"><replaceable>instance</replaceable></arg>
307 Remove an instance. This will remove all data from the
308 instance and there is <emphasis>no way back</emphasis>. If
309 you are not sure if you use an instance again, use
310 <command>shutdown</command> first and leave it in the
311 shutdown state for a while.
316 The <option>--ignore-failures</option> option will cause the
317 removal to proceed even in the presence of errors during the
318 removal of the instance (e.g. during the shutdown or the
319 disk removal). If this option is not given, the command will
320 stop at the first error.
326 # gnt-instance remove instance1.example.com
335 <command>list</command>
336 <arg>--no-headers</arg>
337 <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
338 <arg>-o <replaceable>FIELD,...</replaceable></arg>
342 Shows the currently configured instances with memory usage,
343 disk usage, the node they are running on, and the CPU time,
344 counted in seconds, used by each instance since its latest
349 The <option>--no-headers</option> option will skip the
350 initial header line. The <option>--separator</option> option
351 takes an argument which denotes what will be used between
352 the output fields. Both these options are to help scripting.
356 The <option>-o</option> option takes a comma-separated list
357 of output fields. The available fields and their meaning
363 <simpara>the instance name</simpara>
369 <simpara>the OS of the instance</simpara>
375 <simpara>the primary node of the instance</simpara>
381 <simpara>comma-separated list of secondary nodes for the
382 instance; usually this will be just one node</simpara>
386 <term>admin_state</term>
388 <simpara>the desired state of the instance (either "yes"
389 or "no" denoting the instance should run or
394 <term>admin_ram</term>
396 <simpara>the desired memory for the instance</simpara>
400 <term>disk_template</term>
402 <simpara>the disk template of the instance</simpara>
406 <term>oper_state</term>
408 <simpara>the actual state of the instance; can take of
409 the values "running", "stopped", "(node down)"</simpara>
413 <term>oper_ram</term>
415 <simpara>the actual memory usage of the instance as seen
416 by the hypervisor</simpara>
422 <simpara>the ip address ganeti recognizes as associated with
423 the instance interface</simpara>
429 <simpara>the instance interface MAC address</simpara>
435 <simpara>bridge the instance is connected to
440 <term>sda_size</term>
442 <simpara>the size of the instance's first disk</simpara>
446 <term>sdb_size</term>
448 <simpara>the size of the instance's second disk</simpara>
454 <simpara>the number of VCPUs allocated to the
462 There is a subtle grouping about the available output
463 fields: all fields except for <option>oper_state</option>
464 and <option>oper_ram</option> are configuration value and
465 not run-time values. So if you don't select any of the
466 <option>oper_*</option> fields, the query will be satisfied
467 instantly from the cluster configuration, without having to
468 ask the remote nodes for the data. This can be helpful for
469 big clusters when you only want some data and it makes sense
470 to specify a reduced set of output fields.
473 <para>The default output field list is:
474 <simplelist type="inline">
475 <member>name</member>
477 <member>pnode</member>
478 <member>admin_state</member>
479 <member>oper_state</member>
480 <member>oper_ram</member>
489 <command>info</command>
490 <arg rep="repeat"><replaceable>instance</replaceable></arg>
494 Show detailed information about the (given) instances. This
495 is different from <command>list</command> as it shows
496 detailed data about the instance's disks (especially useful
497 for remote raid templates).
502 <title>MODIFY</title>
505 <command>modify</command>
506 <arg choice="opt">-m <replaceable>memsize</replaceable></arg>
507 <arg choice="opt">-p <replaceable>vcpus</replaceable></arg>
508 <arg choice="opt">-i <replaceable>ip</replaceable></arg>
509 <arg choice="opt">-b <replaceable>bridge</replaceable></arg>
510 <arg choice="opt">--mac <replaceable>MAC-address</replaceable></arg>
511 <arg>--hvm-boot-order <replaceable>boot-order</replaceable></arg>
513 <arg>--kernel <group choice="req">
515 <arg><replaceable>kernel_path</replaceable></arg>
518 <arg>--initrd <group choice="req">
521 <arg><replaceable>initrd_path</replaceable></arg>
524 <arg choice="req"><replaceable>instance</replaceable></arg>
528 Modify the memory size, number of vcpus, ip address, MAC
529 address and/or bridge for an instance.
533 The memory size is given in MiB. Note that you need to give
534 at least one of the arguments, otherwise the command
539 The <option>--kernel</option>, <option>--initrd</option>
540 and <option>--hvm-boot-order</option>
541 options are described in the <command>add</command> command.
545 Additionally, the HVM boot order can be reset to the default
546 values by using <option>--hvm-boot-order=default</option>.
550 All the changes take effect at the next restart. If the
551 instance is running, there is no effect on the instance.
556 <title>REINSTALL</title>
559 <command>reinstall</command>
560 <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
561 <arg choice="opt">-f <replaceable>force</replaceable></arg>
562 <arg choice="req"><replaceable>instance</replaceable></arg>
566 Reinstalls the operating system on the given instance. The instance
567 must be stopped when running this command. If the
568 <option>--os-type</option> is specified, the operating system is
574 <title>RENAME</title>
577 <command>rename</command>
578 <arg>--no-ip-check</arg>
579 <arg choice="req"><replaceable>instance</replaceable></arg>
580 <arg choice="req"><replaceable>new_name</replaceable></arg>
584 Renames the given instance. The instance must be stopped
585 when running this command. The requirements for the new name
586 are the same as for adding an instance: the new name must be
587 resolvable and the IP it resolves to must not be reachable
588 (in order to prevent duplicate IPs the next time the
589 instance is started). The IP test can be skipped if the
590 <option>--no-ip-check</option> option is passed.
597 <title>Starting/stopping/connecting to console</title>
600 <title>STARTUP</title>
603 <command>startup</command>
604 <arg>--extra=<replaceable>PARAMS</replaceable></arg>
608 <arg>--instance</arg>
611 <arg>--secondary</arg>
616 rep="repeat"><replaceable>name</replaceable></arg>
620 Starts one or more instances, depending on the following
621 options. The four available modes are:
624 <term><option>--instance</option></term>
626 <simpara>will start the instances given as arguments
627 (at least one argument required); this is the default
634 <simpara>will start the instances who have the given
635 node as either primary or secondary</simpara>
639 <term><option>--primary</option></term>
641 <simpara>will start all instances whose primary node
642 is in the list of nodes passed as arguments (at least
643 one node required)</simpara>
647 <term><option>--secondary</option></term>
649 <simpara>will start all instances whose secondary node
650 is in the list of nodes passed as arguments (at least
651 one node required)</simpara>
657 <simpara>will start all instances in the cluster (no
658 arguments accepted)</simpara>
665 Note that although you can pass more than one selection
666 option, the last one wins, so in order to guarantee the
667 desired result, don't pass more than one such option.
671 The <option>--extra</option> option is used to pass
672 additional argument to the instance's kernel for this start
673 only. Currently there is no way to specify a persistent set
674 of arguments (beside the one hardcoded). Note that this may
675 not apply to all virtualization types.
679 Use <option>--force</option> to start even if secondary disks are
686 # gnt-instance start instance1.example.com
687 # gnt-instance start --extra single test1.example.com
688 # gnt-instance start --node node1.example.com node2.example.com
689 # gnt-instance start --all
695 <title>SHUTDOWN</title>
698 <command>shutdown</command>
701 <arg>--instance</arg>
704 <arg>--secondary</arg>
710 rep="repeat"><replaceable>name</replaceable></arg>
714 Stops one or more instances. If the instance cannot be
715 cleanly stopped during a hardcoded interval (currently 2
716 minutes), it will forcibly stop the instance (equivalent to
717 switching off the power on a physical machine).
721 The <option>--instance</option>, <option>--node</option>,
722 <option>--primary</option>, <option>--secondary</option> and
723 <option>--all</option> options are similar as for the
724 <command>startup</command> command and they influence the
725 actual instances being shutdown.
731 # gnt-instance shutdown instance1.example.com
732 # gnt-instance shutdown --all
738 <title>REBOOT</title>
741 <command>reboot</command>
743 <arg>--extra=<replaceable>PARAMS</replaceable></arg>
745 <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
747 <arg>--ignore-secondaries</arg>
749 <arg>--force-multiple</arg>
752 <arg>--instance</arg>
755 <arg>--secondary</arg>
761 rep="repeat"><replaceable>name</replaceable></arg>
765 Reboots one or more instances. The type of reboot depends on
766 the value of <option>--type</option>. A soft reboot does a
767 hypervisor reboot, a hard reboot does a instance stop,
768 recreates the hypervisor config for the instance and
769 starts the instance. A full reboot does the equivalent
770 of <command>gnt-instance shutdown && gnt-instance
771 startup</command>. The default is soft reboot.
775 For the hard reboot the option
776 <option>--ignore-secondaries</option> ignores errors for the
777 secondary node while re-assembling the instance disks.
781 The <option>--instance</option>, <option>--node</option>,
782 <option>--primary</option>, <option>--secondary</option> and
783 <option>--all</option> options are similar as for the
784 <command>startup</command> command and they influence the
785 actual instances being rebooted.
789 Use the <option>--force-multiple</option> option to keep
790 gnt-instance from asking for confirmation when more than one
791 instance is affected.
797 # gnt-instance reboot instance1.example.com
798 # gnt-instance reboot --type=full instance1.example.com
804 <title>CONSOLE</title>
806 <command>console</command>
807 <arg choice="req"><replaceable>instance</replaceable></arg>
811 Connects to the console of the given instance. If the instance
812 is not up, an error is returned.
818 # gnt-instance console instance1.example.com
826 <title>Disk management</title>
829 <title>REPLACE-DISKS</title>
832 <command>replace-disks</command>
833 <arg choice="opt">--new-secondary <replaceable>NODE</replaceable></arg>
834 <arg choice="req"><replaceable>instance</replaceable></arg>
838 <command>replace-disks</command>
839 <arg choice="req">-s</arg>
840 <arg choice="req">--new-secondary <replaceable>NODE</replaceable></arg>
841 <arg choice="req"><replaceable>instance</replaceable></arg>
845 <command>replace-disks</command>
847 <arg choice="req">-s</arg>
848 <arg choice="req">-p</arg>
850 <arg choice="req"><replaceable>instance</replaceable></arg>
854 This command is a generalized form for adding and replacing
859 The first form is usable with the
860 <literal>remote_raid1</literal> disk template. This will
861 replace the disks on both the primary and secondary node,
862 and optionally will change the secondary node to a new one
863 if you pass the <option>--new-secondary</option> option.
867 The second and third forms are usable with the
868 <literal>drbd</literal> disk template. The second form will
869 do a secondary replacement, but as opposed to the
870 <literal>remote_raid1</literal> will not replace the disks
871 on the primary, therefore it will execute faster. The third
872 form will replace the disks on either the primary
873 (<option>-p</option>) or the secondary (<option>-s</option>)
874 node of the instance only, without changing the node.
880 <title>ADD-MIRROR</title>
882 <command>add-mirror</command>
883 <arg choice="req">-b <replaceable>sdX</replaceable></arg>
884 <arg choice="req">-n <replaceable>node</replaceable></arg>
885 <arg choice="req"><replaceable>instance</replaceable></arg>
888 Adds a new mirror to the disk layout of the instance, if the
889 instance has a remote raid disk layout.
891 The new mirror member will be between the instance's primary
892 node and the node given with the <option>-n</option> option.
897 <title>REMOVE-MIRROR</title>
900 <command>removemirror</command>
901 <arg choice="req">-b <replaceable>sdX</replaceable></arg>
902 <arg choice="req">-p <replaceable>id</replaceable></arg>
903 <arg choice="req"><replaceable>instance</replaceable></arg>
906 Removes a mirror componenent from the disk layout of the
907 instance, if the instance has a remote raid disk layout.
911 You need to specifiy on which disk to act on using the
912 <option>-b</option> option (either <filename>sda</filename>
913 or <filename>sdb</filename>) and the mirror component, which
914 is identified by the <option>-p</option> option. You can
915 find the list of valid identifiers with the
916 <command>info</command> command.
920 <title>ACTIVATE-DISKS</title>
923 <command>activate-disks</command>
924 <arg choice="req"><replaceable>instance</replaceable></arg>
927 Activates the block devices of the given instance. If
928 successful, the command will show the location and name of
931 node1.example.com:sda:/dev/md0
932 node1.example.com:sdb:/dev/md1
935 In this example, <emphasis>node1.example.com</emphasis> is
936 the name of the node on which the devices have been
937 activated. The <emphasis>sda</emphasis> and
938 <emphasis>sdb</emphasis> are the names of the block devices
939 inside the instance. <emphasis>/dev/md0</emphasis> and
940 <emphasis>/dev/md1</emphasis> are the names of the block
941 devices as visible on the node.
945 Note that it is safe to run this command while the instance
951 <title>DEACTIVATE-DISKS</title>
954 <command>deactivate-disks</command>
955 <arg choice="req"><replaceable>instance</replaceable></arg>
958 De-activates the block devices of the given instance. Note
959 that if you run this command for a remote raid instance
960 type, while it is running, it will not be able to shutdown
961 the block devices on the primary node, but it will shutdown
962 the block devices on the secondary nodes, thus breaking the
971 <title>Recovery</title>
974 <title>FAILOVER</title>
977 <command>failover</command>
979 <arg>--ignore-consistency</arg>
980 <arg choice="req"><replaceable>instance</replaceable></arg>
984 Failover will fail the instance over its secondary
985 node. This works only for instances having a remote raid
990 Normally the failover will check the consistency of the
991 disks before failing over the instance. If you are trying to
992 migrate instances off a dead node, this will fail. Use the
993 <option>--ignore-consistency</option> option for this
994 purpose. Note that this option can be dangerous as errors in
995 shutting down the instance will be ignored, resulting in
996 possibly having the instance running on two machines in
997 parallel (on disconnected DRBD drives).
1003 # gnt-instance failover instance1.example.com
1014 <title>ADD-TAGS</title>
1017 <command>add-tags</command>
1018 <arg choice="opt">--from <replaceable>file</replaceable></arg>
1019 <arg choice="req"><replaceable>instancename</replaceable></arg>
1021 rep="repeat"><replaceable>tag</replaceable></arg>
1025 Add tags to the given instance. If any of the tags contains
1026 invalid characters, the entire operation will abort.
1029 If the <option>--from</option> option is given, the list of
1030 tags will be extended with the contents of that file (each
1031 line becomes a tag). In this case, there is not need to pass
1032 tags on the command line (if you do, both sources will be
1033 used). A file name of - will be interpreted as stdin.
1038 <title>LIST-TAGS</title>
1041 <command>list-tags</command>
1042 <arg choice="req"><replaceable>instancename</replaceable></arg>
1045 <para>List the tags of the given instance.</para>
1049 <title>REMOVE-TAGS</title>
1051 <command>remove-tags</command>
1052 <arg choice="opt">--from <replaceable>file</replaceable></arg>
1053 <arg choice="req"><replaceable>instancename</replaceable></arg>
1055 rep="repeat"><replaceable>tag</replaceable></arg>
1059 Remove tags from the given instance. If any of the tags are
1060 not existing on the node, the entire operation will abort.
1064 If the <option>--from</option> option is given, the list of
1065 tags will be extended with the contents of that file (each
1066 line becomes a tag). In this case, there is not need to pass
1067 tags on the command line (if you do, both sources will be
1068 used). A file name of - will be interpreted as stdin.
1080 <!-- Keep this comment at the end of the file
1085 sgml-minimize-attributes:nil
1086 sgml-always-quote-attributes:t
1089 sgml-parent-document:nil
1090 sgml-default-dtd-file:nil
1091 sgml-exposed-tags:nil
1092 sgml-local-catalogs:nil
1093 sgml-local-ecat-files:nil