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>
72 <arg choice="req">-t<group>
75 <arg>local_raid1</arg>
76 <arg>remote_raid1</arg>
80 <arg choice="req">-n <replaceable>node</replaceable></arg>
81 <arg choice="req"><replaceable>instance</replaceable></arg>
84 Creates a new instance on the specified
85 host. <replaceable>instance</replaceable> must be in DNS and
86 resolve to a IP in the same network as the nodes in the
91 The <option>-s</option> option specifies the disk size for
92 the instance, in mebibytes (defaults to
93 <constant>20480MiB</constant> =
94 <constant>20GiB</constant>). You can also use one of the
95 suffixes <literal>m</literal>, <literal>g</literal> or
96 <literal>t</literal> to specificy the exact the units used;
97 these suffixes map to mebibytes, gibibytes and tebibytes.
101 The <option>--swap-size</option> option specifies the swap
102 disk size (in mebibytes) for the instance (the one presented
103 as <filename class="devicefile">/dev/sdb</filename>). The
104 default is <constant>4096MiB</constant>. As for the disk
105 size, you can specify other suffixes.
109 The <option>-m</option> option specifies the memory size for
110 the instance, in mebibytes (defaults to 128 MiB). Again, you
111 can use other suffixes (e.g. <userinput>2g</userinput>).
115 The <option>-o</option> options specifies the operating
116 system to be installed. The available operating systems can
117 be listed with <command>gnt-os list</command>.
121 The <option>-b</option> option specifies the bridge to which the
122 instance will be connected. (defaults to the cluster-wide default
123 bridge specified at cluster initialization time).
127 The <option>-t</option> options specifies the disk layout type for
128 the instance. The available choices are:
131 <term>diskless</term>
134 This creates an instance with no disks. Its useful for
135 testing only (or other special cases).
142 <para>Disk devices will be logical volumes.</para>
146 <term>local_raid1</term>
149 Disk devices will be md raid1 arrays over two local
155 <term>remote_raid1</term>
158 Disk devices will be md raid1 arrays with one
159 component (so it's not actually raid1): a drbd device
160 between the instance's primary node and the node given
161 by the option <option>--secondary-node</option>.
169 The <option>--secondary-node</option> option is used with
170 the remote raid disk template type and specifies the remote
175 If you do not want gnt-instance to wait for the disk mirror
176 to be synced, use the <option>--no-wait-for-sync</option>
184 # gnt-instance add -t plain -s 30g -m 512 -o debian-etch \
185 -n node1.example.com instance1.example.com
186 # gnt-instance add -t remote_raid1 --secondary-node node3.example.com \
187 -s 30g -m 512 -o debian-etch \
188 -n node1.example.com instance2.example.com
195 <title>REMOVE</title>
198 <command>remove</command>
199 <arg>--ignore-failures</arg>
200 <arg choice="req"><replaceable>instance</replaceable></arg>
204 Remove an instance. This will remove all data from the
205 instance and there is <emphasis>no way back</emphasis>. If
206 you are not sure if you use an instance again, use
207 <command>shutdown</command> first and leave it in the
208 shutdown state for a while.
213 The <option>--ignore-failures</option> option will cause the
214 removal to proceed even in the presence of errors during the
215 removal of the instance (e.g. during the shutdown or the
216 disk removal). If this option is not given, the command will
217 stop at the first error.
223 # gnt-instance remove instance1.example.com
232 <command>list</command>
233 <arg>--no-headers</arg>
234 <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
235 <arg>-o <replaceable>FIELD,...</replaceable></arg>
239 Shows the currently configured instances with memory usage,
240 disk usage, the node they are running on, and the CPU time,
241 counted in seconds, used by each instance since its latest
246 The <option>--no-headers</option> option will skip the
247 initial header line. The <option>--separator</option> option
248 takes an argument which denotes what will be used between
249 the output fields. Both these options are to help scripting.
253 The <option>-o</option> option takes a comma-separated list
254 of output fields. The available fields and their meaning
260 <simpara>the instance name</simpara>
266 <simpara>the OS of the instance</simpara>
272 <simpara>the primary node of the instance</simpara>
278 <simpara>comma-separated list of secondary-nodes for the
279 instance; usually this will be just one node</simpara>
283 <term>admin_state</term>
285 <simpara>the desired state of the instance (either "yes"
286 or "no" denoting the instance should run or
291 <term>admin_ram</term>
293 <simpara>the desired memory for the instance</simpara>
297 <term>disk_template</term>
299 <simpara>the disk template of the instance</simpara>
303 <term>oper_state</term>
305 <simpara>the actual state of the instance; can take of
306 the values "running", "stopped", "(node down)"</simpara>
310 <term>oper_ram</term>
312 <simpara>the actual memory usage of the instance as seen
313 by the hypervisor</simpara>
319 <simpara>the ip address ganeti recognizes as associated with
320 the instance interface</simpara>
326 <simpara>the instance interface MAC address</simpara>
332 <simpara>bridge the instance is connected to
340 There is a subtle grouping about the available output
341 fields: all fields except for <option>oper_state</option>
342 and <option>oper_ram</option> are configuration value and
343 not run-time values. So if you don't select any of the
344 <option>oper_*</option> fields, the query will be satisfied
345 instantly from the cluster configuration, without having to
346 ask the remote nodes for the data. This can be helpful for
347 big clusters when you only want some data and it makes sense
348 to specify a reduced set of output fields.
351 <para>The default output field list is:
352 <simplelist type="inline">
353 <member>name</member>
355 <member>pnode</member>
356 <member>admin_state</member>
357 <member>oper_state</member>
358 <member>oper_ram</member>
367 <command>info</command>
368 <arg rep="repeat"><replaceable>instance</replaceable></arg>
372 Show detailed information about the (given) instances. This
373 is different from <command>list</command> as it shows
374 detailed data about the instance's disks (especially useful
375 for remote raid templates).
380 <title>MODIFY</title>
383 <command>modify</command>
384 <arg choice="opt">-m <replaceable>memsize</replaceable></arg>
385 <arg choice="opt">-p <replaceable>vcpus</replaceable></arg>
386 <arg choice="opt">-i <replaceable>ip</replaceable></arg>
387 <arg choice="opt">-b <replaceable>bridge</replaceable></arg>
388 <arg choice="req"><replaceable>instance</replaceable></arg>
392 Modify the memory size, number of vcpus, ip address and/or bridge
397 The memory size is given in MiB. Note that you need to give
398 at least one of the arguments, otherwise the command
403 All the changes take effect at the next restart. If the
404 instance is running, there is no effect on the instance.
409 <title>REINSTALL</title>
412 <command>reinstall</command>
413 <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
414 <arg choice="opt">-f <replaceable>force</replaceable></arg>
415 <arg choice="req"><replaceable>instance</replaceable></arg>
419 Reinstalls the operating system on the given instance. The instance
420 must be stopped when running this command. If the
421 <option>--os-type</option> is specified, the operating system is
427 <title>RENAME</title>
430 <command>rename</command>
431 <arg>--no-ip-check</arg>
432 <arg choice="req"><replaceable>instance</replaceable></arg>
433 <arg choice="req"><replaceable>new_name</replaceable></arg>
437 Renames the given instance. The instance must be stopped
438 when running this command. The requirements for the new name
439 are the same as for adding an instance: the new name must be
440 resolvable and the IP it resolves to must not be reachable
441 (in order to prevent duplicate IPs the next time the
442 instance is started). The IP test can be skipped if the
443 <option>--no-ip-check</option> option is passed.
450 <title>Starting/stopping/connecting to console</title>
453 <title>STARTUP</title>
456 <command>startup</command>
457 <arg>--extra=<replaceable>PARAMS</replaceable></arg>
460 <arg>--instance</arg>
463 <arg>--secondary</arg>
468 rep="repeat"><replaceable>name</replaceable></arg>
472 Starts one or more instances, depending on the
473 <option>--by-*</option> mode. The four available modes are:
476 <term><option>--instance</option></term>
478 <simpara>will start the instances given as arguments
479 (at least one argument required); this is the default
486 <simpara>will start the instances who have the given
487 node as either primary or secondary</simpara>
491 <term><option>--primary</option></term>
493 <simpara>will start all instances whose primary node
494 is in the list of nodes passed as arguments (at least
495 one node required)</simpara>
499 <term><option>--secondary</option></term>
501 <simpara>will start all instances whose secondary node
502 is in the list of nodes passed as arguments (at least
503 one node required)</simpara>
509 <simpara>will start all instances in the cluster (no
510 arguments accepted)</simpara>
517 Note that although you can pass more than one
518 <option>--by-</option> option, the last one wins, so in
519 order to guarantee the desired result, don't pass more than
524 The <option>--extra</option> option is used to pass
525 additional argument to the instance's kernel for this start
526 only. Currently there is no way to specify a persistent set
527 of arguments (beside the one hardcoded). Note that this may
528 not apply to all virtualization types.
535 # gnt-instance start instance1.example.com
536 # gnt-instance start --extra single test1.example.com
537 # gnt-instance start --by-node node1.example.com node2.example.com
538 # gnt-instance start --by-cluster
544 <title>SHUTDOWN</title>
547 <command>shutdown</command>
550 <arg>--instance</arg>
553 <arg>--secondary</arg>
559 rep="repeat"><replaceable>name</replaceable></arg>
563 Stops one or more instances. If the instance cannot be
564 cleanly stopped during a hardcoded interval (currently 2
565 minutes), it will forcibly stop the instance (equivalent to
566 switching off the power on a physical machine).
570 The <option>--instance</option>, <option>--node</option>,
571 <option>--primary</option>, <option>--secondary</option> and
572 <option>--all</option> options are similar as for the
573 <command>startup</command> command and they influence the
574 actual instances being shutdown.
580 # gnt-instance shutdown instance1.example.com
581 # gnt-instance shutdown --by-cluster
587 <title>CONSOLE</title>
589 <command>console</command>
590 <arg choice="req"><replaceable>instance</replaceable></arg>
594 Connects to the console of the given instance. If the instance
595 is not up, an error is returned.
601 # gnt-instance console instance1.example.com
609 <title>Disk management</title>
612 <title>REPLACE-DISKS</title>
615 <command>replace-disks</command>
616 <arg choice="req">--new-secondary <replaceable>NODE</replaceable></arg>
617 <arg choice="req"><replaceable>instance</replaceable></arg>
621 This command does a full add and replace for both disks of
622 an instance. It basically does an
623 <command>addmirror</command> and
624 <command>removemirror</command> for both disks of the
629 If you also want to replace the secondary node during this
630 process (for example to fix a broken secondary node), you
631 can do so using the <option>--new-secondary</option> option.
636 <title>ADD-MIRROR</title>
638 <command>add-mirror</command>
639 <arg choice="req">-b <replaceable>sdX</replaceable></arg>
640 <arg choice="req">-n <replaceable>node</replaceable></arg>
641 <arg choice="req"><replaceable>instance</replaceable></arg>
644 Adds a new mirror to the disk layout of the instance, if the
645 instance has a remote raid disk layout.
647 The new mirror member will be between the instance's primary
648 node and the node given with the <option>-n</option> option.
653 <title>REMOVE-MIRROR</title>
656 <command>removemirror</command>
657 <arg choice="req">-b <replaceable>sdX</replaceable></arg>
658 <arg choice="req">-p <replaceable>id</replaceable></arg>
659 <arg choice="req"><replaceable>instance</replaceable></arg>
662 Removes a mirror componenent from the disk layout of the
663 instance, if the instance has a remote raid disk layout.
667 You need to specifiy on which disk to act on using the
668 <option>-b</option> option (either <filename>sda</filename>
669 or <filename>sdb</filename>) and the mirror component, which
670 is identified by the <option>-p</option> option. You can
671 find the list of valid identifiers with the
672 <command>info</command> command.
676 <title>ACTIVATE-DISKS</title>
679 <command>activate-disks</command>
680 <arg choice="req"><replaceable>instance</replaceable></arg>
683 Activates the block devices of the given instance. If
684 successful, the command will show the location and name of
687 node1.example.com:sda:/dev/md0
688 node1.example.com:sdb:/dev/md1
691 In this example, <emphasis>node1.example.com</emphasis> is
692 the name of the node on which the devices have been
693 activated. The <emphasis>sda</emphasis> and
694 <emphasis>sdb</emphasis> are the names of the block devices
695 inside the instance. <emphasis>/dev/md0</emphasis> and
696 <emphasis>/dev/md1</emphasis> are the names of the block
697 devices as visible on the node.
701 Note that it is safe to run this command while the instance
707 <title>DEACTIVATE-DISKS</title>
710 <command>deactivate-disks</command>
711 <arg choice="req"><replaceable>instance</replaceable></arg>
714 De-activates the block devices of the given instance. Note
715 that if you run this command for a remote raid instance
716 type, while it is running, it will not be able to shutdown
717 the block devices on the primary node, but it will shutdown
718 the block devices on the secondary nodes, thus breaking the
727 <title>Recovery</title>
730 <title>FAILOVER</title>
733 <command>failover</command>
735 <arg>--ignore-consistency</arg>
736 <arg choice="req"><replaceable>instance</replaceable></arg>
740 Failover will fail the instance over its secondary
741 node. This works only for instances having a remote raid
746 Normally the failover will check the consistency of the
747 disks before failing over the instance. If you are trying to
748 migrate instances off a dead node, this will fail. Use the
749 <option>--ignore-consistency</option> option for this
756 # gnt-instance failover instance1.example.com
767 <title>ADD-TAGS</title>
770 <command>add-tags</command>
771 <arg choice="opt">--from <replaceable>file</replaceable></arg>
772 <arg choice="req"><replaceable>instancename</replaceable></arg>
774 rep="repeat"><replaceable>tag</replaceable></arg>
778 Add tags to the given instance. If any of the tags contains
779 invalid characters, the entire operation will abort.
782 If the <option>--from</option> option is given, the list of
783 tags will be extended with the contents of that file (each
784 line becomes a tag). In this case, there is not need to pass
785 tags on the command line (if you do, both sources will be
786 used). A file name of - will be interpreted as stdin.
791 <title>LIST-TAGS</title>
794 <command>list-tags</command>
795 <arg choice="req"><replaceable>instancename</replaceable></arg>
798 <para>List the tags of the given instance.</para>
802 <title>REMOVE-TAGS</title>
804 <command>remove-tags</command>
805 <arg choice="opt">--from <replaceable>file</replaceable></arg>
806 <arg choice="req"><replaceable>instancename</replaceable></arg>
808 rep="repeat"><replaceable>tag</replaceable></arg>
812 Remove tags from the given instance. If any of the tags are
813 not existing on the node, the entire operation will abort.
817 If the <option>--from</option> option is given, the list of
818 tags will be extended with the contents of that file (each
819 line becomes a tag). In this case, there is not need to pass
820 tags on the command line (if you do, both sources will be
821 used). A file name of - will be interpreted as stdin.
833 <!-- Keep this comment at the end of the file
838 sgml-minimize-attributes:nil
839 sgml-always-quote-attributes:t
842 sgml-parent-document:nil
843 sgml-default-dtd-file:nil
844 sgml-exposed-tags:nil
845 sgml-local-catalogs:nil
846 sgml-local-ecat-files:nil