Document gnt-instance reinstall --interactive
[ganeti-local] / man / gnt-instance.sgml
1 <!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
2
3   <!-- Fill in your name for FIRSTNAME and SURNAME. -->
4   <!-- Please adjust the date whenever revising the manpage. -->
5   <!ENTITY dhdate      "<date>July 01, 2008</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">
11
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">
16 ]>
17
18 <refentry>
19   <refentryinfo>
20     <copyright>
21       <year>2006</year>
22       <year>2007</year>
23       <year>2008</year>
24       <holder>Google Inc.</holder>
25     </copyright>
26     &dhdate;
27   </refentryinfo>
28   <refmeta>
29     &dhucpackage;
30
31     &dhsection;
32     <refmiscinfo>ganeti 1.2</refmiscinfo>
33   </refmeta>
34   <refnamediv>
35     <refname>&dhpackage;</refname>
36
37     <refpurpose>ganeti instance administration</refpurpose>
38   </refnamediv>
39   <refsynopsisdiv>
40     <cmdsynopsis>
41       <command>&dhpackage; </command>
42
43       <arg choice="req">command</arg>
44       <arg>arguments...</arg>
45     </cmdsynopsis>
46   </refsynopsisdiv>
47   <refsect1>
48     <title>DESCRIPTION</title>
49
50     <para>
51       The <command>&dhpackage;</command> is used for instance
52       administration in the ganeti system.
53     </para>
54
55   </refsect1>
56   <refsect1>
57     <title>COMMANDS</title>
58
59     <refsect2>
60       <title>Creation/removal/querying</title>
61
62       <refsect3>
63         <title>ADD</title>
64         <cmdsynopsis>
65           <command>add</command>
66           <arg>-s <replaceable>disksize</replaceable></arg>
67           <arg>--swap-size <replaceable>disksize</replaceable></arg>
68           <arg>-m <replaceable>memsize</replaceable></arg>
69           <sbr>
70
71           <arg>-b <replaceable>bridge</replaceable></arg>
72           <arg>--mac <replaceable>MAC-address</replaceable></arg>
73           <sbr>
74
75           <arg>--hvm-boot-order <replaceable>boot-order</replaceable></arg>
76           <arg>--hvm-acpi <replaceable>ACPI-support</replaceable></arg>
77           <sbr>
78
79           <arg>--hvm-pae <replaceable>PAE-support</replaceable></arg>
80           <sbr>
81
82           <arg>--hvm-cdrom-image-path
83             <replaceable>cdrom-image-path</replaceable></arg>
84           <sbr>
85
86           <arg>--hvm-nic-type <replaceable>NICTYPE</replacable></arg>
87           <sbr>
88
89           <arg>--hvm-disk-type
90           <replaceale>DISKTYPE</replaceable></arg>
91           <sbr>
92
93           <arg>--vnc-bind-address
94             <replaceable>vnc-bind-address</replaceable></arg>
95           <sbr>
96
97           <arg>--kernel<group choice="req">
98               <arg>default</arg>
99               <arg><replaceable>kernel_path</replaceable></arg>
100             </group></arg>
101           <sbr>
102
103           <arg>--initrd<group choice="req">
104               <arg>default</arg>
105               <arg>none</arg>
106               <arg><replaceable>initrd_path</replaceable></arg>
107             </group></arg>
108           <sbr>
109
110           <arg>--cpu <replaceable>vcpus</replaceable></arg>
111           <arg>--ip<group choice="req">
112               <arg>default</arg>
113               <arg>none</arg>
114               <arg><replaceable>ip-address</replaceable></arg>
115             </group></arg>
116           <sbr>
117
118           <arg>--no-wait-for-sync</arg>
119           <arg>--no-start</arg>
120           <arg>--no-ip-check</arg>
121           <sbr>
122
123           <arg choice="req">-t<group choice="req">
124               <arg>diskless</arg>
125               <arg>plain</arg>
126               <arg>local_raid1</arg>
127               <arg>remote_raid1</arg>
128               <arg>drbd</arg>
129             </group></arg>
130           <sbr>
131
132           <group choice="req">
133             <arg>-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg>
134             <arg>--iallocator <replaceable>name</replaceable></arg>
135           </group>
136           <sbr>
137
138           <arg choice="req">-o <replaceable>os-type</replaceable></arg>
139           <sbr>
140
141           <arg choice="req"><replaceable>instance</replaceable></arg>
142         </cmdsynopsis>
143
144         <para>
145           Creates a new instance on the specified
146           host. <replaceable>instance</replaceable> must be in DNS and
147           resolve to a IP in the same network as the nodes in the
148           cluster.
149         </para>
150
151         <para>
152           The <option>-s</option> option specifies the disk size for
153           the instance, in mebibytes (defaults to
154           <constant>20480MiB</constant> =
155           <constant>20GiB</constant>). You can also use one of the
156           suffixes <literal>m</literal>, <literal>g</literal> or
157           <literal>t</literal> to specificy the exact the units used;
158           these suffixes map to mebibytes, gibibytes and tebibytes.
159         </para>
160
161         <para>
162           The <option>--swap-size</option> option specifies the swap
163           disk size (in mebibytes) for the instance (the one presented
164           as <filename class="devicefile">/dev/sdb</filename>). The
165           default is <constant>4096MiB</constant>. As for the disk
166           size, you can specify other suffixes.
167         </para>
168
169         <para>
170           The <option>-m</option> option specifies the memory size for
171           the instance, in mebibytes (defaults to 128 MiB). Again, you
172           can use other suffixes (e.g. <userinput>2g</userinput>).
173         </para>
174
175         <para>
176           The <option>-o</option> options specifies the operating
177           system to be installed. The available operating systems can
178           be listed with <command>gnt-os list</command>.
179         </para>
180
181         <para>
182           The <option>-b</option> option specifies the bridge to which the
183           instance will be connected. (defaults to the cluster-wide default
184           bridge specified at cluster initialization time).
185         </para>
186
187         <para>
188           The <option>--mac</option> option specifies the MAC address
189           of the ethernet interface for the instance. If this option
190           is not specified, a new MAC address is generated randomly with
191           the configured MAC prefix. The randomly generated MAC
192           address is guaranteed to be unique among the instances of
193           this cluster.
194         </para>
195
196         <para>
197           The <option>--hvm-boot-order</option> option specifies the
198           boot device order for Xen HVM instances. The boot order is a
199           string of letters listing the boot devices, with valid
200           device letters being:
201         </para>
202
203         <para>
204           <variablelist>
205             <varlistentry>
206               <term>a</term>
207               <listitem>
208                 <para>
209                   floppy drive
210                 </para>
211               </listitem>
212             </varlistentry>
213             <varlistentry>
214               <term>c</term>
215               <listitem>
216                 <para>
217                   hard disk
218                 </para>
219               </listitem>
220             </varlistentry>
221             <varlistentry>
222               <term>d</term>
223               <listitem>
224                 <para>
225                   CDROM drive
226                 </para>
227               </listitem>
228             </varlistentry>
229             <varlistentry>
230               <term>n</term>
231               <listitem>
232                 <para>
233                   network boot (PXE)
234                 </para>
235               </listitem>
236             </varlistentry>
237           </variablelist>
238         </para>
239
240         <para>
241           The default is not to set an HVM boot order which is
242           interpreted as 'dc'. This option, like all options starting
243           with 'hvm', is only relevant for Xen HVM instances and
244           ignored by all other instance types.
245         </para>
246
247         <para>
248           The <option>--hvm-acpi</option> option specifies if Xen
249           should enable ACPI support for this HVM instance. Valid
250           values are true or false. The default value is false,
251           disabling ACPI support for this instance.
252         </para>
253
254         <para>
255           The <option>--hvm-pae</option> option specifies if Xen
256           should enabled PAE support for this HVM instance. Valid
257           values are true or false. The default is false, disabling
258           PAE support for this instance.
259         </para>
260
261         <para>
262           The <option>--hvm-cdrom-image-path</option> option specifies the
263           path to the file Xen uses to emulate a virtual CDROM drive
264           for this HVM instance. Valid values are either an
265           absolute path to an existing file or None, which disables
266           virtual CDROM support for this instance. The default is
267           None, disabling virtual CDROM support.
268         </para>
269
270         <para>
271           The <option>--hvm-nic-type</option> specifies the NIC type
272           Xen should use for this HVM instance. Valid choices are
273           rtl8139, ne2k_pci, ne2k_isa and paravirtual with rtl8139
274           as the default. The paravirtual setting is intended for use
275           with the GPL PV drivers inside HVM Windows instances.
276         </para>
277
278         <para>
279           The <option>--hvm-disk-type</option> specifies the disk type
280           Xen should use for the HVM instance. Valid choices are ioemu
281           and paravirtual with ioemu as the default. The paravirtual
282           setting is intended for use with the GPL PV drivers inside
283           HVM Windows instances.
284         </para>
285
286         <para>
287           The <option>--vnc-bind-address</option> option specifies the
288           address that the VNC listener for this instance should bind
289           to. Valid values are IPv4 addresses. Use the address 0.0.0.0
290           to bind to all available interfaces (this is the default)
291           or specify the address of one of the interfaces on the node
292           to restrict listing to that interface.
293         </para>
294
295         <para>
296           The <option>--iallocator</option> option specifies the instance
297           allocator plugin to use. If you pass in this option the allocator
298           will select nodes for this instance automatically, so you don't need
299           to pass them with the <option>-n</option> option. For more
300           information please refer to the instance allocator documentation.
301         </para>
302
303         <para>
304           The <option>--kernel</option> option allows the instance to
305           use a custom kernel (if a filename is passed) or to use the
306           default kernel (<filename>@CUSTOM_XEN_KERNEL@</filename>), if the
307           string <constant>default</constant> is passed.
308         </para>
309
310         <para>
311           The <option>--initrd</option> option is similar: it allows
312           the instance to use a custom initrd (if a filename is
313           passed) or to use the default initrd
314           (<filename>@CUSTOM_XEN_INITRD@</filename>), if the string
315           <constant>default</constant> is passed, or to disable the
316           use of an initrd, if the string <constant>none</constant> is
317           passed. Note that in the case the instance is set to use the
318           default initrd and it doesn't exist, it will be silently
319           ignored; if the instance is set to use a custom initrd and
320           it doesn't exist, this will be treated as an error and will
321           prevent the startup of the instance.
322         </para>
323
324         <para>
325           The <option>-t</option> options specifies the disk layout type for
326           the instance. The available choices are:
327           <variablelist>
328             <varlistentry>
329               <term>diskless</term>
330               <listitem>
331                 <para>
332                   This creates an instance with no disks. Its useful for
333                   testing only (or other special cases).
334                 </para>
335               </listitem>
336             </varlistentry>
337             <varlistentry>
338               <term>plain</term>
339               <listitem>
340                 <para>Disk devices will be logical volumes.</para>
341               </listitem>
342             </varlistentry>
343             <varlistentry>
344               <term>local_raid1</term>
345               <listitem>
346                 <para>
347                   Disk devices will be md raid1 arrays over two local
348                   logical volumes.
349                 </para>
350               </listitem>
351             </varlistentry>
352             <varlistentry>
353               <term>remote_raid1</term>
354               <listitem>
355                 <para>
356                   Disk devices will be md raid1 arrays with one
357                   component (so it's not actually raid1): a drbd
358                   (0.7.x) device between the instance's primary node
359                   and the node given by the second value of the
360                   <option>--node</option> option.
361                 </para>
362               </listitem>
363             </varlistentry>
364             <varlistentry>
365               <term>drbd</term>
366               <listitem>
367                 <para>
368                   Disk devices will be drbd (version 8.x) on top of
369                   lvm volumes. They are equivalent in functionality to
370                   <replaceable>remote_raid1</replaceable>, but are
371                   recommended for new instances (if you have drbd 8.x
372                   installed).
373                 </para>
374               </listitem>
375             </varlistentry>
376           </variablelist>
377         </para>
378
379         <para>
380           The optional second value of the <option>--node</option> is used for
381           the remote raid template type and specifies the remote node.
382         </para>
383
384         <para>
385           If you do not want gnt-instance to wait for the disk mirror
386           to be synced, use the <option>--no-wait-for-sync</option>
387           option.
388         </para>
389
390         <para>
391           Use the <option>--cpu</option> option to set the number of virtual
392           CPUs.
393         </para>
394
395         <para>
396           To pass an IPv4 address to the hypervisor, specify the
397           <option>--ip</option> option. Note that this IP address will not be
398           used by the OS scripts and changing it later will change the address
399           that the instance will actually use.
400         </para>
401
402         <para>
403           In case you don't want the new instance to be automatically started,
404           specify the <option>--no-start</option> option.
405         </para>
406
407         <para>
408           Ganeti will not check whether an instance's IP address is already
409           alive if the <option>--no-ip-check</option> option is specified.
410         </para>
411
412         <para>
413           Example:
414           <screen>
415 # gnt-instance add -t plain -s 30g -m 512 -o debian-etch \
416   -n node1.example.com instance1.example.com
417 # gnt-instance add -t remote_raid1 -s 30g -m 512 -o debian-etch \
418   -n node1.example.com:node2.example.com instance2.example.com
419           </screen>
420         </para>
421       </refsect3>
422
423       <refsect3>
424         <title>REMOVE</title>
425
426         <cmdsynopsis>
427           <command>remove</command>
428           <arg>--ignore-failures</arg>
429           <arg choice="req"><replaceable>instance</replaceable></arg>
430         </cmdsynopsis>
431
432         <para>
433           Remove an instance. This will remove all data from the
434           instance and there is <emphasis>no way back</emphasis>. If
435           you are not sure if you use an instance again, use
436           <command>shutdown</command> first and leave it in the
437           shutdown state for a while.
438
439         </para>
440
441         <para>
442           The <option>--ignore-failures</option> option will cause the
443           removal to proceed even in the presence of errors during the
444           removal of the instance (e.g. during the shutdown or the
445           disk removal). If this option is not given, the command will
446           stop at the first error.
447         </para>
448
449         <para>
450           Example:
451           <screen>
452 # gnt-instance remove instance1.example.com
453           </screen>
454         </para>
455       </refsect3>
456
457       <refsect3>
458         <title>LIST</title>
459
460         <cmdsynopsis>
461           <command>list</command>
462           <arg>--no-headers</arg>
463           <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
464           <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
465         </cmdsynopsis>
466
467         <para>
468           Shows the currently configured instances with memory usage,
469           disk usage, the node they are running on, and the CPU time,
470           counted in seconds, used by each instance since its latest
471           restart.
472         </para>
473
474         <para>
475           The <option>--no-headers</option> option will skip the
476           initial header line. The <option>--separator</option> option
477           takes an argument which denotes what will be used between
478           the output fields. Both these options are to help scripting.
479         </para>
480
481         <para>
482           The <option>-o</option> option takes a comma-separated list
483           of output fields. The available fields and their meaning
484           are:
485           <variablelist>
486             <varlistentry>
487               <term>name</term>
488               <listitem>
489                 <simpara>the instance name</simpara>
490               </listitem>
491             </varlistentry>
492             <varlistentry>
493               <term>os</term>
494               <listitem>
495                 <simpara>the OS of the instance</simpara>
496               </listitem>
497             </varlistentry>
498             <varlistentry>
499               <term>pnode</term>
500               <listitem>
501                 <simpara>the primary node of the instance</simpara>
502               </listitem>
503             </varlistentry>
504             <varlistentry>
505               <term>snodes</term>
506               <listitem>
507                 <simpara>comma-separated list of secondary nodes for the
508                   instance; usually this will be just one node</simpara>
509               </listitem>
510             </varlistentry>
511             <varlistentry>
512               <term>admin_state</term>
513               <listitem>
514                 <simpara>the desired state of the instance (either "yes"
515                   or "no" denoting the instance should run or
516                   not)</simpara>
517               </listitem>
518             </varlistentry>
519             <varlistentry>
520               <term>admin_ram</term>
521               <listitem>
522                 <simpara>the desired memory for the instance</simpara>
523               </listitem>
524             </varlistentry>
525             <varlistentry>
526               <term>disk_template</term>
527               <listitem>
528                 <simpara>the disk template of the instance</simpara>
529               </listitem>
530             </varlistentry>
531             <varlistentry>
532               <term>oper_state</term>
533               <listitem>
534                 <simpara>the actual state of the instance; can be
535                 one of the values "running", "stopped", "(node
536                 down)"</simpara>
537               </listitem>
538             </varlistentry>
539             <varlistentry>
540               <term>status</term>
541               <listitem>
542                 <simpara>combined form of admin_state and oper_stat;
543                 this can be one of:
544                 <computeroutput>ERROR_nodedown</computeroutput> if the
545                 node of the instance is down,
546                 <computeroutput>ERROR_down</computeroutput> if the
547                 instance should run but is down,
548                 <computeroutput>ERROR_up</computeroutput> if the
549                 instance should be stopped but is actually running,
550                 <computeroutput>ADMIN_down</computeroutput> if the
551                 instance has been stopped (and is stopped) and
552                 <computeroutput>running</computeroutput> if the
553                 instance is set to be running (and is
554                 running)</simpara>
555               </listitem>
556             </varlistentry>
557             <varlistentry>
558               <term>oper_ram</term>
559               <listitem>
560                 <simpara>the actual memory usage of the instance as seen
561                   by the hypervisor</simpara>
562               </listitem>
563             </varlistentry>
564             <varlistentry>
565               <term>ip</term>
566               <listitem>
567                 <simpara>the ip address ganeti recognizes as associated with
568                 the instance interface</simpara>
569               </listitem>
570             </varlistentry>
571             <varlistentry>
572               <term>mac</term>
573               <listitem>
574                 <simpara>the instance interface MAC address</simpara>
575               </listitem>
576             </varlistentry>
577             <varlistentry>
578               <term>bridge</term>
579               <listitem>
580                 <simpara>bridge the instance is connected to
581                 </simpara>
582               </listitem>
583             </varlistentry>
584             <varlistentry>
585               <term>sda_size</term>
586               <listitem>
587                 <simpara>the size of the instance's first disk</simpara>
588               </listitem>
589             </varlistentry>
590             <varlistentry>
591               <term>sdb_size</term>
592               <listitem>
593                 <simpara>the size of the instance's second disk</simpara>
594               </listitem>
595             </varlistentry>
596             <varlistentry>
597               <term>vcpus</term>
598               <listitem>
599                 <simpara>the number of VCPUs allocated to the
600                 instance</simpara>
601               </listitem>
602             </varlistentry>
603             <varlistentry>
604               <term>tags</term>
605               <listitem>
606                 <simpara>comma-separated list of the instances's
607                 tags</simpara>
608               </listitem>
609             </varlistentry>
610           </variablelist>
611         </para>
612
613         <para>
614           If the value of the option starts with the character
615           <constant>+</constant>, the new fields will be added to the
616           default list. This allows to quickly see the default list
617           plus a few other fields, instead of retyping the entire list
618           of fields.
619         </para>
620
621         <para>
622           There is a subtle grouping about the available output
623           fields: all fields except for <option>oper_state</option>,
624           <option>oper_ram</option> and <option>status</option> are
625           configuration value and not run-time values. So if you don't
626           select any of the these fields, the query will be satisfied
627           instantly from the cluster configuration, without having to
628           ask the remote nodes for the data. This can be helpful for
629           big clusters when you only want some data and it makes sense
630           to specify a reduced set of output fields.
631         </para>
632
633         <para>The default output field list is:
634           <simplelist type="inline">
635             <member>name</member>
636             <member>os</member>
637             <member>pnode</member>
638             <member>admin_state</member>
639             <member>oper_state</member>
640             <member>oper_ram</member>
641           </simplelist>.
642         </para>
643       </refsect3>
644
645       <refsect3>
646         <title>INFO</title>
647
648         <cmdsynopsis>
649           <command>info</command>
650           <arg rep="repeat"><replaceable>instance</replaceable></arg>
651         </cmdsynopsis>
652
653         <para>
654           Show detailed information about the (given) instances. This
655           is different from <command>list</command> as it shows
656           detailed data about the instance's disks (especially useful
657           for remote raid templates).
658         </para>
659       </refsect3>
660
661       <refsect3>
662         <title>MODIFY</title>
663
664         <cmdsynopsis>
665           <command>modify</command>
666           <arg choice="opt">-m <replaceable>memsize</replaceable></arg>
667           <arg choice="opt">-p <replaceable>vcpus</replaceable></arg>
668           <arg choice="opt">-i <replaceable>ip</replaceable></arg>
669           <arg choice="opt">-b <replaceable>bridge</replaceable></arg>
670           <arg choice="opt">--mac <replaceable>MAC-address</replaceable></arg>
671           <arg>--hvm-boot-order <replaceable>boot-order</replaceable></arg>
672           <arg>--hvm-acpi <replaceable>ACPI-support</replaceable></arg>
673           <arg>--hvm-pae <replaceable>PAE-support</replaceable></arg>
674           <arg>--hvm-cdrom-image-path
675             <replaceable>cdrom-image-path</replaceable></arg>
676           <arg>--hvm-nic-type <replaceable>NICTYPE</replaceable></arg>
677           <arg>--hvm-disk-type <replaceable>DISKTYPE</replaceable></arg>
678           <arg>--vnc-bind-address
679             <replaceable>vnc-bind-address</replaceable></arg>
680
681           <sbr>
682           <arg>--kernel <group choice="req">
683               <arg>default</arg>
684               <arg><replaceable>kernel_path</replaceable></arg>
685             </group></arg>
686           <sbr>
687           <arg>--initrd <group choice="req">
688               <arg>default</arg>
689               <arg>none</arg>
690               <arg><replaceable>initrd_path</replaceable></arg>
691             </group> </arg>
692           <sbr>
693           <arg choice="req"><replaceable>instance</replaceable></arg>
694         </cmdsynopsis>
695
696         <para>
697           Modify the memory size, number of vcpus, ip address, MAC
698           address and/or bridge for an instance.
699         </para>
700
701         <para>
702           The memory size is given in MiB. Note that you need to give
703           at least one of the arguments, otherwise the command
704           complains.
705         </para>
706
707         <para>
708           The <option>--kernel</option>, <option>--initrd</option>
709           and <option>--hvm-boot-order</option>
710           options are described in the <command>add</command> command.
711         </para>
712
713         <para>
714           Additionally, the HVM boot order can be reset to the default
715           values by using <option>--hvm-boot-order=default</option>.
716         </para>
717
718         <para>
719           The <option>--hvm-acpi</option> option specifies if Xen
720           should enable ACPI support for this HVM instance. Valid
721           values are true or false.
722         </para>
723
724         <para>
725           The <option>--hvm-pae</option> option specifies if Xen
726           should enabled PAE support for this HVM instance. Valid
727           values are true or false.
728         </para>
729
730         <para>
731           The <option>--hvm-cdrom-image-path</option> specifies the
732           path to the file xen uses to emulate a virtual CDROM drive
733           for this HVM instance. Valid values are either an
734           absolute path to an existing file or None, which disables
735           virtual CDROM support for this instance.
736         </para>
737
738         <para>
739           The <option>--hvm-nic-type</option> specifies the NIC type
740           Xen should use for this HVM instance. Valid choices are
741           rtl8139, ne2k_pci, ne2k_isa and paravirtual with rtl8139
742           as the default. The paravirtual setting is intended for use
743           with the GPL PV drivers inside HVM Windows instances.
744         </para>
745
746         <para>
747           The <option>--hvm-disk-type</option> specifies the disk type
748           Xen should use for the HVM instance. Valid choices are ioemu
749           and paravirtual with ioemu as the default. The paravirtual
750           setting is intended for use with the GPL PV drivers inside
751           HVM Windows instances.
752         </para>
753
754         <para>
755           The <option>--vnc-bind-address</option> specifies the
756           address that the VNC listener for this instance should bind
757           to. Valid values are IPv4 addresses. Use the address 0.0.0.0
758           to bind to all available interfaces.
759         </para>
760
761         <para>
762           All the changes take effect at the next restart. If the
763           instance is running, there is no effect on the instance.
764         </para>
765       </refsect3>
766
767       <refsect3>
768         <title>REINSTALL</title>
769
770         <cmdsynopsis>
771           <command>reinstall</command>
772           <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
773           <arg choice="opt">-f <replaceable>force</replaceable></arg>
774           <arg>--interactive</arg>
775           <arg choice="req"><replaceable>instance</replaceable></arg>
776         </cmdsynopsis>
777
778         <para>
779           Reinstalls the operating system on the given instance. The instance
780           must be stopped when running this command. If the
781           <option>--os-type</option> is specified, the operating system is
782           changed.
783         </para>
784
785         <para>
786           The <option>--interactive</option> option switches to an
787           interactive reinstall. The user is prompted to select the OS
788           template from the list of available OS templates.
789         </para>
790       </refsect3>
791
792       <refsect3>
793         <title>RENAME</title>
794
795         <cmdsynopsis>
796           <command>rename</command>
797           <arg>--no-ip-check</arg>
798           <arg choice="req"><replaceable>instance</replaceable></arg>
799           <arg choice="req"><replaceable>new_name</replaceable></arg>
800         </cmdsynopsis>
801
802         <para>
803           Renames the given instance. The instance must be stopped
804           when running this command. The requirements for the new name
805           are the same as for adding an instance: the new name must be
806           resolvable and the IP it resolves to must not be reachable
807           (in order to prevent duplicate IPs the next time the
808           instance is started). The IP test can be skipped if the
809           <option>--no-ip-check</option> option is passed.
810         </para>
811       </refsect3>
812
813     </refsect2>
814
815     <refsect2>
816       <title>Starting/stopping/connecting to console</title>
817
818       <refsect3>
819         <title>STARTUP</title>
820
821         <cmdsynopsis>
822           <command>startup</command>
823           <arg>--extra=<replaceable>PARAMS</replaceable></arg>
824           <arg>--force</arg>
825           <sbr>
826           <group choice="opt">
827             <arg>--instance</arg>
828             <arg>--node</arg>
829             <arg>--primary</arg>
830             <arg>--secondary</arg>
831             <arg>--all</arg>
832           </group>
833           <sbr>
834           <arg choice="opt"
835           rep="repeat"><replaceable>name</replaceable></arg>
836         </cmdsynopsis>
837
838         <para>
839           Starts one or more instances, depending on the following
840           options. The four available modes are:
841           <variablelist>
842             <varlistentry>
843               <term><option>--instance</option></term>
844               <listitem>
845                 <simpara>will start the instances given as arguments
846                 (at least one argument required); this is the default
847                 selection</simpara>
848               </listitem>
849             </varlistentry>
850             <varlistentry>
851               <term>--node</term>
852               <listitem>
853                 <simpara>will start the instances who have the given
854                 node as either primary or secondary</simpara>
855               </listitem>
856             </varlistentry>
857             <varlistentry>
858               <term><option>--primary</option></term>
859               <listitem>
860                 <simpara>will start all instances whose primary node
861                 is in the list of nodes passed as arguments (at least
862                 one node required)</simpara>
863               </listitem>
864             </varlistentry>
865             <varlistentry>
866               <term><option>--secondary</option></term>
867               <listitem>
868                 <simpara>will start all instances whose secondary node
869                 is in the list of nodes passed as arguments (at least
870                 one node required)</simpara>
871               </listitem>
872             </varlistentry>
873             <varlistentry>
874               <term>--all</term>
875               <listitem>
876                 <simpara>will start all instances in the cluster (no
877                 arguments accepted)</simpara>
878               </listitem>
879             </varlistentry>
880           </variablelist>
881         </para>
882
883         <para>
884           Note that although you can pass more than one selection
885           option, the last one wins, so in order to guarantee the
886           desired result, don't pass more than one such option.
887         </para>
888
889         <para>
890           The <option>--extra</option> option is used to pass
891           additional argument to the instance's kernel for this start
892           only. Currently there is no way to specify a persistent set
893           of arguments (beside the one hardcoded). Note that this may
894           not apply to all virtualization types.
895         </para>
896
897         <para>
898           Use <option>--force</option> to start even if secondary disks are
899           failing.
900         </para>
901
902         <para>
903           Example:
904           <screen>
905 # gnt-instance start instance1.example.com
906 # gnt-instance start --extra single test1.example.com
907 # gnt-instance start --node node1.example.com node2.example.com
908 # gnt-instance start --all
909           </screen>
910         </para>
911       </refsect3>
912
913       <refsect3>
914         <title>SHUTDOWN</title>
915
916         <cmdsynopsis>
917           <command>shutdown</command>
918           <sbr>
919           <group choice="opt">
920             <arg>--instance</arg>
921             <arg>--node</arg>
922             <arg>--primary</arg>
923             <arg>--secondary</arg>
924             <arg>--all</arg>
925           </group>
926           <sbr>
927
928           <arg choice="opt"
929           rep="repeat"><replaceable>name</replaceable></arg>
930         </cmdsynopsis>
931
932         <para>
933           Stops one or more instances. If the instance cannot be
934           cleanly stopped during a hardcoded interval (currently 2
935           minutes), it will forcibly stop the instance (equivalent to
936           switching off the power on a physical machine).
937         </para>
938
939         <para>
940           The <option>--instance</option>, <option>--node</option>,
941           <option>--primary</option>, <option>--secondary</option> and
942           <option>--all</option> options are similar as for the
943           <command>startup</command> command and they influence the
944           actual instances being shutdown.
945         </para>
946
947         <para>
948           Example:
949           <screen>
950 # gnt-instance shutdown instance1.example.com
951 # gnt-instance shutdown --all
952           </screen>
953         </para>
954       </refsect3>
955
956       <refsect3>
957         <title>REBOOT</title>
958
959         <cmdsynopsis>
960           <command>reboot</command>
961           <sbr>
962           <arg>--extra=<replaceable>PARAMS</replaceable></arg>
963           <sbr>
964           <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
965           <sbr>
966           <arg>--ignore-secondaries</arg>
967           <sbr>
968           <arg>--force-multiple</arg>
969           <sbr>
970           <group choice="opt">
971             <arg>--instance</arg>
972             <arg>--node</arg>
973             <arg>--primary</arg>
974             <arg>--secondary</arg>
975             <arg>--all</arg>
976           </group>
977           <sbr>
978
979           <arg choice="opt"
980           rep="repeat"><replaceable>name</replaceable></arg>
981         </cmdsynopsis>
982
983         <para>
984           Reboots one or more instances. The type of reboot depends on
985           the value of <option>--type</option>. A soft reboot does a
986           hypervisor reboot, a hard reboot does a instance stop,
987           recreates the hypervisor config for the instance and
988           starts the instance. A full reboot does the equivalent
989           of <command>gnt-instance shutdown &amp;&amp; gnt-instance
990           startup</command>. The default is soft reboot.
991         </para>
992
993         <para>
994           For the hard reboot the option
995           <option>--ignore-secondaries</option> ignores errors for the
996           secondary node while re-assembling the instance disks.
997         </para>
998
999         <para>
1000           The <option>--instance</option>, <option>--node</option>,
1001           <option>--primary</option>, <option>--secondary</option> and
1002           <option>--all</option> options are similar as for the
1003           <command>startup</command> command and they influence the
1004           actual instances being rebooted.
1005         </para>
1006
1007         <para>
1008           Use the <option>--force-multiple</option> option to keep
1009           gnt-instance from asking for confirmation when more than one
1010           instance is affected.
1011         </para>
1012
1013         <para>
1014           Example:
1015           <screen>
1016 # gnt-instance reboot instance1.example.com
1017 # gnt-instance reboot --type=full instance1.example.com
1018           </screen>
1019         </para>
1020       </refsect3>
1021
1022       <refsect3>
1023         <title>CONSOLE</title>
1024         <cmdsynopsis>
1025           <command>console</command>
1026           <arg choice="req"><replaceable>instance</replaceable></arg>
1027         </cmdsynopsis>
1028
1029         <para>
1030           Connects to the console of the given instance. If the instance
1031           is not up, an error is returned.
1032         </para>
1033
1034         <para>
1035           Example:
1036           <screen>
1037 # gnt-instance console instance1.example.com
1038           </screen>
1039         </para>
1040       </refsect3>
1041
1042     </refsect2>
1043
1044     <refsect2>
1045       <title>Disk management</title>
1046
1047       <refsect3>
1048         <title>REPLACE-DISKS</title>
1049
1050         <cmdsynopsis>
1051           <command>replace-disks</command>
1052
1053           <group choice="req">
1054             <arg>--new-secondary <replaceable>NODE</replaceable></arg>
1055             <arg>--iallocator <replaceable>name</replaceable></arg>
1056           </group>
1057
1058           <arg choice="req"><replaceable>instance</replaceable></arg>
1059         </cmdsynopsis>
1060
1061         <cmdsynopsis>
1062           <command>replace-disks</command>
1063
1064           <group choice="req">
1065             <arg>--iallocator <replaceable>name</replaceable></arg>
1066             <arg>--new-secondary <replaceable>NODE</replaceable></arg>
1067           </group>
1068           <sbr>
1069
1070           <arg choice="opt">-s</arg>
1071           <arg choice="req"><replaceable>instance</replaceable></arg>
1072         </cmdsynopsis>
1073
1074         <cmdsynopsis>
1075           <command>replace-disks</command>
1076
1077           <group>
1078           <arg choice="req">-s</arg>
1079           <arg choice="req">-p</arg>
1080           </group>
1081           <arg choice="req"><replaceable>instance</replaceable></arg>
1082         </cmdsynopsis>
1083
1084         <para>
1085           This command is a generalized form for adding and replacing
1086           disks.
1087         </para>
1088
1089         <para>
1090           The first form is usable with the
1091           <literal>remote_raid1</literal> disk template. This will
1092           replace the disks on both the primary and secondary node,
1093           and optionally will change the secondary node to a new one
1094           if you pass the <option>--new-secondary</option> option.
1095         </para>
1096
1097         <para>
1098           The second and third forms are usable with the
1099           <literal>drbd</literal> disk template. The second form will
1100           do a secondary replacement, but as opposed to the
1101           <literal>remote_raid1</literal> will not replace the disks
1102           on the primary, therefore it will execute faster. The third
1103           form will replace the disks on either the primary
1104           (<option>-p</option>) or the secondary (<option>-s</option>)
1105           node of the instance only, without changing the node.
1106         </para>
1107
1108         <para>
1109           Specifying <option>--iallocator</option> enables secondary node
1110           replacement and and makes the new secondary be selected automatically
1111           by the specified allocator plugin.
1112         </para>
1113       </refsect3>
1114
1115       <refsect3>
1116         <title>ADD-MIRROR</title>
1117         <cmdsynopsis>
1118           <command>add-mirror</command>
1119           <arg choice="req">-b <replaceable>sdX</replaceable></arg>
1120           <arg choice="req">-n <replaceable>node</replaceable></arg>
1121           <arg choice="req"><replaceable>instance</replaceable></arg>
1122         </cmdsynopsis>
1123         <para>
1124           Adds a new mirror to the disk layout of the instance, if the
1125           instance has a remote raid disk layout.
1126
1127           The new mirror member will be between the instance's primary
1128           node and the node given with the <option>-n</option> option.
1129         </para>
1130       </refsect3>
1131
1132       <refsect3>
1133         <title>REMOVE-MIRROR</title>
1134
1135         <cmdsynopsis>
1136           <command>removemirror</command>
1137           <arg choice="req">-b <replaceable>sdX</replaceable></arg>
1138           <arg choice="req">-p <replaceable>id</replaceable></arg>
1139           <arg choice="req"><replaceable>instance</replaceable></arg>
1140         </cmdsynopsis>
1141         <para>
1142           Removes a mirror componenent from the disk layout of the
1143           instance, if the instance has a remote raid disk layout.
1144         </para>
1145
1146         <para>
1147           You need to specifiy on which disk to act on using the
1148           <option>-b</option> option (either <filename>sda</filename>
1149           or <filename>sdb</filename>) and the mirror component, which
1150           is identified by the <option>-p</option> option. You can
1151           find the list of valid identifiers with the
1152           <command>info</command> command.
1153         </para>
1154
1155       <refsect3>
1156         <title>ACTIVATE-DISKS</title>
1157
1158         <cmdsynopsis>
1159           <command>activate-disks</command>
1160           <arg choice="req"><replaceable>instance</replaceable></arg>
1161         </cmdsynopsis>
1162         <para>
1163           Activates the block devices of the given instance. If
1164           successful, the command will show the location and name of
1165           the block devices:
1166           <screen>
1167 node1.example.com:sda:/dev/md0
1168 node1.example.com:sdb:/dev/md1
1169           </screen>
1170
1171           In this example, <emphasis>node1.example.com</emphasis> is
1172           the name of the node on which the devices have been
1173           activated. The <emphasis>sda</emphasis> and
1174           <emphasis>sdb</emphasis> are the names of the block devices
1175           inside the instance. <emphasis>/dev/md0</emphasis> and
1176           <emphasis>/dev/md1</emphasis> are the names of the block
1177           devices as visible on the node.
1178         </para>
1179
1180         <para>
1181           Note that it is safe to run this command while the instance
1182           is already running.
1183         </para>
1184       </refsect3>
1185
1186       <refsect3>
1187         <title>DEACTIVATE-DISKS</title>
1188
1189         <cmdsynopsis>
1190           <command>deactivate-disks</command>
1191           <arg choice="req"><replaceable>instance</replaceable></arg>
1192         </cmdsynopsis>
1193         <para>
1194           De-activates the block devices of the given instance. Note
1195           that if you run this command for a remote raid instance
1196           type, while it is running, it will not be able to shutdown
1197           the block devices on the primary node, but it will shutdown
1198           the block devices on the secondary nodes, thus breaking the
1199           replication.
1200         </para>
1201
1202       </refsect3>
1203
1204       <refsect3>
1205         <title>GROW-DISK</title>
1206         <cmdsynopsis>
1207           <command>grow-disk</command>
1208           <arg>--no-wait-for-sync</arg>
1209           <arg choice="req"><replaceable>instance</replaceable></arg>
1210           <arg choice="req"><replaceable>disk</replaceable></arg>
1211           <arg choice="req"><replaceable>amount</replaceable></arg>
1212         </cmdsynopsis>
1213
1214         <para>
1215           Grows an instance's disk. This is only possible for
1216           instances having a <literal>plain</literal> or
1217           <literal>drbd</literal> disk template.
1218         </para>
1219
1220         <para>
1221           Note that this command only change the block device size; it
1222           will not grow the actual filesystems, partitions, etc. that
1223           live on that disk. Usually, you will need to:
1224           <orderedlist>
1225             <listitem>
1226               <simpara>use <command>gnt-instance grow-disk</command></simpara>
1227             </listitem>
1228             <listitem>
1229               <simpara>reboot the instance (later, at a convenient
1230               time)</simpara>
1231             </listitem>
1232             <listitem>
1233               <simpara>use a filesystem resizer, such as
1234               <citerefentry> <refentrytitle>ext2online</refentrytitle>
1235               <manvolnum>8</manvolnum> </citerefentry> or
1236               <citerefentry> <refentrytitle>xfs_growfs</refentrytitle>
1237               <manvolnum>8</manvolnum> </citerefentry> to resize the
1238               filesystem, or use <citerefentry>
1239               <refentrytitle>fdisk</refentrytitle>
1240               <manvolnum>8</manvolnum> </citerefentry> to change the
1241               partition table on the disk
1242               </simpara>
1243             </listitem>
1244           </orderedlist>
1245         </para>
1246
1247
1248         <para>
1249           The <replaceable>disk</replaceable> argument is either
1250           <literal>sda</literal> or <literal>sdb</literal>. The
1251           <replaceable>amount</replaceable> argument is given either
1252           as a number (and it represents the amount to increase the
1253           disk with in mebibytes) or can be given similar to the
1254           arguments in the create instance operation, with a suffix
1255           denoting the unit.
1256         </para>
1257
1258         <para>
1259           Note that the disk grow operation might complete on one node
1260           but fail on the other; this will leave the instance with
1261           different-sized LVs on the two nodes, but this will not
1262           create problems (except for unused space).
1263         </para>
1264
1265         <para>
1266           If you do not want gnt-instance to wait for the new disk
1267           region to be synced, use the
1268           <option>--no-wait-for-sync</option> option.
1269         </para>
1270
1271
1272         <para>Example (increase sda for instance1 by 16GiB):
1273           <screen>
1274 # gnt-instance grow-disk instance1.example.com sda 16g
1275           </screen>
1276         </para>
1277
1278         <para>
1279           Also note that disk shrinking will not be supported; use
1280           <command>gnt-backup export</command> and then
1281           <command>gnt-backup import</command> to reduce the disk size
1282           of an instance.
1283         </para>
1284       </refsect3>
1285
1286     </refsect2>
1287
1288     <refsect2>
1289       <title>Recovery</title>
1290
1291       <refsect3>
1292         <title>FAILOVER</title>
1293
1294         <cmdsynopsis>
1295           <command>failover</command>
1296           <arg>-f</arg>
1297           <arg>--ignore-consistency</arg>
1298           <arg choice="req"><replaceable>instance</replaceable></arg>
1299         </cmdsynopsis>
1300
1301         <para>
1302           Failover will fail the instance over its secondary
1303           node. This works only for instances having a remote raid
1304           disk layout.
1305         </para>
1306
1307         <para>
1308           Normally the failover will check the consistency of the
1309           disks before failing over the instance. If you are trying to
1310           migrate instances off a dead node, this will fail. Use the
1311           <option>--ignore-consistency</option> option for this
1312           purpose. Note that this option can be dangerous as errors in
1313           shutting down the instance will be ignored, resulting in
1314           possibly having the instance running on two machines in
1315           parallel (on disconnected DRBD drives).
1316         </para>
1317
1318         <para>
1319           Example:
1320           <screen>
1321 # gnt-instance failover instance1.example.com
1322           </screen>
1323         </para>
1324       </refsect3>
1325
1326       <refsect3>
1327         <title>MIGRATE</title>
1328
1329         <cmdsynopsis>
1330           <command>migrate</command>
1331           <arg>-f</arg>
1332           <arg choice="req">--cleanup</arg>
1333           <arg choice="req"><replaceable>instance</replaceable></arg>
1334         </cmdsynopsis>
1335
1336         <cmdsynopsis>
1337           <command>migrate</command>
1338           <arg>-f</arg>
1339           <arg>--non-live</arg>
1340           <arg choice="req"><replaceable>instance</replaceable></arg>
1341         </cmdsynopsis>
1342
1343         <para>
1344           Migrate will move the instance to its secondary node without
1345           shutdown. It only works for instances having the drbd8 disk
1346           template type.
1347         </para>
1348
1349         <para>
1350           The migration command needs a perfectly healthy instance, as
1351           we rely on the dual-master capability of drbd8 and the disks
1352           of the instance are not allowed to be degraded.
1353         </para>
1354
1355         <para>
1356           The <option>--non-live</option> option will switch (for the
1357           hypervisors that support it) between a "fully live"
1358           (i.e. the interruption is as minimal as possible) migration
1359           and one in which the instance is frozen, its state saved and
1360           transported to the remote node, and then resumed there. This
1361           all depends on the hypervisor support for two different
1362           methods. In any case, it is not an error to pass this
1363           parameter (it will just be ignored if the hypervisor doesn't
1364           support it).
1365         </para>
1366
1367         <para>
1368           If the <option>--cleanup</option> option is passed, the
1369           operation changes from migration to attempting recovery from
1370           a failed previous migration. In this mode, ganeti checks if
1371           the instance runs on the correct node (and updates its
1372           configuration if not) and ensures the instances's disks are
1373           configured correctly. In this mode, the
1374           <option>--non-live</option> option is ignored.
1375         </para>
1376
1377         <para>
1378           The option <option>-f</option> will skip the prompting for
1379           confirmation.
1380         </para>
1381
1382         <para>
1383           Example (and expected output):
1384           <screen>
1385 # gnt-instance migrate instance1
1386 Migrate will happen to the instance instance1. Note that migration is
1387 **experimental** in this version. This might impact the instance if
1388 anything goes wrong. Continue?
1389 y/[n]/?: y
1390 * checking disk consistency between source and target
1391 * ensuring the target is in secondary mode
1392 * changing disks into dual-master mode
1393  - INFO: Waiting for instance instance1 to sync disks.
1394  - INFO: Instance instance1's disks are in sync.
1395 * migrating instance to node2.example.com
1396 * changing the instance's disks on source node to secondary
1397  - INFO: Waiting for instance instance1 to sync disks.
1398  - INFO: Instance instance1's disks are in sync.
1399 * changing the instance's disks to single-master
1400 #
1401           </screen>
1402         </para>
1403       </refsect3>
1404
1405     </refsect2>
1406
1407     <refsect2>
1408       <title>TAGS</title>
1409
1410     <refsect3>
1411         <title>ADD-TAGS</title>
1412
1413         <cmdsynopsis>
1414           <command>add-tags</command>
1415           <arg choice="opt">--from <replaceable>file</replaceable></arg>
1416           <arg choice="req"><replaceable>instancename</replaceable></arg>
1417           <arg choice="req"
1418             rep="repeat"><replaceable>tag</replaceable></arg>
1419         </cmdsynopsis>
1420
1421         <para>
1422           Add tags to the given instance. If any of the tags contains
1423           invalid characters, the entire operation will abort.
1424         </para>
1425         <para>
1426           If the <option>--from</option> option is given, the list of
1427           tags will be extended with the contents of that file (each
1428           line becomes a tag). In this case, there is not need to pass
1429           tags on the command line (if you do, both sources will be
1430           used). A file name of - will be interpreted as stdin.
1431         </para>
1432       </refsect3>
1433
1434       <refsect3>
1435         <title>LIST-TAGS</title>
1436
1437         <cmdsynopsis>
1438           <command>list-tags</command>
1439           <arg choice="req"><replaceable>instancename</replaceable></arg>
1440         </cmdsynopsis>
1441
1442         <para>List the tags of the given instance.</para>
1443       </refsect3>
1444
1445       <refsect3>
1446         <title>REMOVE-TAGS</title>
1447         <cmdsynopsis>
1448           <command>remove-tags</command>
1449           <arg choice="opt">--from <replaceable>file</replaceable></arg>
1450           <arg choice="req"><replaceable>instancename</replaceable></arg>
1451           <arg choice="req"
1452             rep="repeat"><replaceable>tag</replaceable></arg>
1453         </cmdsynopsis>
1454
1455         <para>
1456           Remove tags from the given instance. If any of the tags are
1457           not existing on the node, the entire operation will abort.
1458         </para>
1459
1460         <para>
1461           If the <option>--from</option> option is given, the list of
1462           tags will be extended with the contents of that file (each
1463           line becomes a tag). In this case, there is not need to pass
1464           tags on the command line (if you do, both sources will be
1465           used). A file name of - will be interpreted as stdin.
1466         </para>
1467       </refsect3>
1468
1469     </refsect2>
1470
1471   </refsect1>
1472
1473   &footer;
1474
1475 </refentry>
1476
1477 <!-- Keep this comment at the end of the file
1478 Local variables:
1479 mode: sgml
1480 sgml-omittag:t
1481 sgml-shorttag:t
1482 sgml-minimize-attributes:nil
1483 sgml-always-quote-attributes:t
1484 sgml-indent-step:2
1485 sgml-indent-data:t
1486 sgml-parent-document:nil
1487 sgml-default-dtd-file:nil
1488 sgml-exposed-tags:nil
1489 sgml-local-catalogs:nil
1490 sgml-local-ecat-files:nil
1491 End:
1492 -->