Parse double protocol version in drbd8.2
[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>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">
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       <holder>Google Inc.</holder>
24     </copyright>
25     &dhdate;
26   </refentryinfo>
27   <refmeta>
28     &dhucpackage;
29
30     &dhsection;
31     <refmiscinfo>ganeti 1.2</refmiscinfo>
32   </refmeta>
33   <refnamediv>
34     <refname>&dhpackage;</refname>
35
36     <refpurpose>ganeti instance administration</refpurpose>
37   </refnamediv>
38   <refsynopsisdiv>
39     <cmdsynopsis>
40       <command>&dhpackage; </command>
41
42       <arg choice="req">command</arg>
43       <arg>arguments...</arg>
44     </cmdsynopsis>
45   </refsynopsisdiv>
46   <refsect1>
47     <title>DESCRIPTION</title>
48
49     <para>
50       The <command>&dhpackage;</command> is used for instance
51       administration in the ganeti system.
52     </para>
53
54   </refsect1>
55   <refsect1>
56     <title>COMMANDS</title>
57
58     <refsect2>
59       <title>Creation/removal/querying</title>
60
61       <refsect3>
62         <title>ADD</title>
63         <cmdsynopsis>
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>
68           <sbr>
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>
73           <sbr>
74           <arg>--kernel <group choice="req">
75               <arg>default</arg>
76               <arg><replaceable>kernel_path</replaceable></arg>
77             </group></arg>
78           <sbr>
79           <arg>--initrd <group choice="req">
80               <arg>default</arg>
81               <arg>none</arg>
82               <arg><replaceable>initrd_path</replaceable></arg>
83             </group> </arg>
84           <sbr>
85           <arg choice="req">-t<group>
86               <arg>diskless</arg>
87               <arg>plain</arg>
88               <arg>local_raid1</arg>
89               <arg>remote_raid1</arg>
90               <arg>drbd</arg>
91             </group>
92           </arg>
93           <sbr>
94           <arg choice="req">-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg>
95           <arg choice="req"><replaceable>instance</replaceable></arg>
96         </cmdsynopsis>
97
98         <para>
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
102           cluster.
103         </para>
104
105         <para>
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.
113         </para>
114
115         <para>
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.
121         </para>
122
123         <para>
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>).
127         </para>
128
129         <para>
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>.
133         </para>
134
135         <para>
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).
139         </para>
140
141         <para>
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
147           this cluster.
148         </para>
149
150         <para>
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:
155         </para>
156
157         <para>
158           <variablelist>
159             <varlistentry>
160               <term>a</term>
161               <listitem>
162                 <para>
163                   floppy drive
164                 </para>
165               </listitem>
166             </varlistentry>
167             <varlistentry>
168               <term>c</term>
169               <listitem>
170                 <para>
171                   hard disk
172                 </para>
173               </listitem>
174             </varlistentry>
175             <varlistentry>
176               <term>d</term>
177               <listitem>
178                 <para>
179                   CDROM drive
180                 </para>
181               </listitem>
182             </varlistentry>
183             <varlistentry>
184               <term>n</term>
185               <listitem>
186                 <para>
187                   network boot (PXE)
188                 </para>
189               </listitem>
190             </varlistentry>
191           </variablelist>
192         </para>
193
194         <para>
195           The option is only relevant for Xen HVM instances and
196           ignored by all other instances types.
197         </para>
198
199         <para>
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.
204         </para>
205
206         <para>
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.
218         </para>
219
220         <para>
221           The <option>-t</option> options specifies the disk layout type for
222           the instance. The available choices are:
223           <variablelist>
224             <varlistentry>
225               <term>diskless</term>
226               <listitem>
227                 <para>
228                   This creates an instance with no disks. Its useful for
229                   testing only (or other special cases).
230                 </para>
231               </listitem>
232             </varlistentry>
233             <varlistentry>
234               <term>plain</term>
235               <listitem>
236                 <para>Disk devices will be logical volumes.</para>
237               </listitem>
238             </varlistentry>
239             <varlistentry>
240               <term>local_raid1</term>
241               <listitem>
242                 <para>
243                   Disk devices will be md raid1 arrays over two local
244                   logical volumes.
245                 </para>
246               </listitem>
247             </varlistentry>
248             <varlistentry>
249               <term>remote_raid1</term>
250               <listitem>
251                 <para>
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.
257                 </para>
258               </listitem>
259             </varlistentry>
260             <varlistentry>
261               <term>drbd</term>
262               <listitem>
263                 <para>
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
268                   installed).
269                 </para>
270               </listitem>
271             </varlistentry>
272           </variablelist>
273         </para>
274
275         <para>
276           The optional second value of the <option>--node</option> is used for
277           the remote raid template type and specifies the remote node.
278         </para>
279
280         <para>
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>
283           option.
284         </para>
285
286         <para>
287           Example:
288           <screen>
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
293           </screen>
294         </para>
295       </refsect3>
296
297       <refsect3>
298         <title>REMOVE</title>
299
300         <cmdsynopsis>
301           <command>remove</command>
302           <arg>--ignore-failures</arg>
303           <arg choice="req"><replaceable>instance</replaceable></arg>
304         </cmdsynopsis>
305
306         <para>
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.
312
313         </para>
314
315         <para>
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.
321         </para>
322
323         <para>
324           Example:
325           <screen>
326 # gnt-instance remove instance1.example.com
327           </screen>
328         </para>
329       </refsect3>
330
331       <refsect3>
332         <title>LIST</title>
333
334         <cmdsynopsis>
335           <command>list</command>
336           <arg>--no-headers</arg>
337           <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
338           <arg>-o <replaceable>FIELD,...</replaceable></arg>
339         </cmdsynopsis>
340
341         <para>
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
345           restart.
346         </para>
347
348         <para>
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.
353         </para>
354
355         <para>
356           The <option>-o</option> option takes a comma-separated list
357           of output fields. The available fields and their meaning
358           are:
359           <variablelist>
360             <varlistentry>
361               <term>name</term>
362               <listitem>
363                 <simpara>the instance name</simpara>
364               </listitem>
365             </varlistentry>
366             <varlistentry>
367               <term>os</term>
368               <listitem>
369                 <simpara>the OS of the instance</simpara>
370               </listitem>
371             </varlistentry>
372             <varlistentry>
373               <term>pnode</term>
374               <listitem>
375                 <simpara>the primary node of the instance</simpara>
376               </listitem>
377             </varlistentry>
378             <varlistentry>
379               <term>snodes</term>
380               <listitem>
381                 <simpara>comma-separated list of secondary nodes for the
382                   instance; usually this will be just one node</simpara>
383               </listitem>
384             </varlistentry>
385             <varlistentry>
386               <term>admin_state</term>
387               <listitem>
388                 <simpara>the desired state of the instance (either "yes"
389                   or "no" denoting the instance should run or
390                   not)</simpara>
391               </listitem>
392             </varlistentry>
393             <varlistentry>
394               <term>admin_ram</term>
395               <listitem>
396                 <simpara>the desired memory for the instance</simpara>
397               </listitem>
398             </varlistentry>
399             <varlistentry>
400               <term>disk_template</term>
401               <listitem>
402                 <simpara>the disk template of the instance</simpara>
403               </listitem>
404             </varlistentry>
405             <varlistentry>
406               <term>oper_state</term>
407               <listitem>
408                 <simpara>the actual state of the instance; can take of
409                   the values "running", "stopped", "(node down)"</simpara>
410               </listitem>
411             </varlistentry>
412             <varlistentry>
413               <term>oper_ram</term>
414               <listitem>
415                 <simpara>the actual memory usage of the instance as seen
416                   by the hypervisor</simpara>
417               </listitem>
418             </varlistentry>
419             <varlistentry>
420               <term>ip</term>
421               <listitem>
422                 <simpara>the ip address ganeti recognizes as associated with
423                 the instance interface</simpara>
424               </listitem>
425             </varlistentry>
426             <varlistentry>
427               <term>mac</term>
428               <listitem>
429                 <simpara>the instance interface MAC address</simpara>
430               </listitem>
431             </varlistentry>
432             <varlistentry>
433               <term>bridge</term>
434               <listitem>
435                 <simpara>bridge the instance is connected to
436                 </simpara>
437               </listitem>
438             </varlistentry>
439             <varlistentry>
440               <term>sda_size</term>
441               <listitem>
442                 <simpara>the size of the instance's first disk</simpara>
443               </listitem>
444             </varlistentry>
445             <varlistentry>
446               <term>sdb_size</term>
447               <listitem>
448                 <simpara>the size of the instance's second disk</simpara>
449               </listitem>
450             </varlistentry>
451             <varlistentry>
452               <term>vcpus</term>
453               <listitem>
454                 <simpara>the number of VCPUs allocated to the
455                 instance</simpara>
456               </listitem>
457             </varlistentry>
458           </variablelist>
459         </para>
460
461         <para>
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.
471         </para>
472
473         <para>The default output field list is:
474           <simplelist type="inline">
475             <member>name</member>
476             <member>os</member>
477             <member>pnode</member>
478             <member>admin_state</member>
479             <member>oper_state</member>
480             <member>oper_ram</member>
481           </simplelist>.
482         </para>
483       </refsect3>
484
485       <refsect3>
486         <title>INFO</title>
487
488         <cmdsynopsis>
489           <command>info</command>
490           <arg rep="repeat"><replaceable>instance</replaceable></arg>
491         </cmdsynopsis>
492
493         <para>
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).
498         </para>
499       </refsect3>
500
501       <refsect3>
502         <title>MODIFY</title>
503
504         <cmdsynopsis>
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>
512           <sbr>
513           <arg>--kernel <group choice="req">
514               <arg>default</arg>
515               <arg><replaceable>kernel_path</replaceable></arg>
516             </group></arg>
517           <sbr>
518           <arg>--initrd <group choice="req">
519               <arg>default</arg>
520               <arg>none</arg>
521               <arg><replaceable>initrd_path</replaceable></arg>
522             </group> </arg>
523           <sbr>
524           <arg choice="req"><replaceable>instance</replaceable></arg>
525         </cmdsynopsis>
526
527         <para>
528           Modify the memory size, number of vcpus, ip address, MAC
529           address and/or bridge for an instance.
530         </para>
531
532         <para>
533           The memory size is given in MiB. Note that you need to give
534           at least one of the arguments, otherwise the command
535           complains.
536         </para>
537
538         <para>
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.
542         </para>
543
544         <para>
545           Additionally, the HVM boot order can be reset to the default
546           values by using <option>--hvm-boot-order=default</option>.
547         </para>
548
549         <para>
550           All the changes take effect at the next restart. If the
551           instance is running, there is no effect on the instance.
552         </para>
553       </refsect3>
554
555       <refsect3>
556         <title>REINSTALL</title>
557
558         <cmdsynopsis>
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>
563         </cmdsynopsis>
564
565         <para>
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
569           changed.
570         </para>
571       </refsect3>
572
573       <refsect3>
574         <title>RENAME</title>
575
576         <cmdsynopsis>
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>
581         </cmdsynopsis>
582
583         <para>
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.
591         </para>
592       </refsect3>
593
594     </refsect2>
595
596     <refsect2>
597       <title>Starting/stopping/connecting to console</title>
598
599       <refsect3>
600         <title>STARTUP</title>
601
602         <cmdsynopsis>
603           <command>startup</command>
604           <arg>--extra=<replaceable>PARAMS</replaceable></arg>
605           <arg>--force</arg>
606           <sbr>
607           <group choice="opt">
608             <arg>--instance</arg>
609             <arg>--node</arg>
610             <arg>--primary</arg>
611             <arg>--secondary</arg>
612             <arg>--all</arg>
613           </group>
614           <sbr>
615           <arg choice="opt"
616           rep="repeat"><replaceable>name</replaceable></arg>
617         </cmdsynopsis>
618
619         <para>
620           Starts one or more instances, depending on the following
621           options. The four available modes are:
622           <variablelist>
623             <varlistentry>
624               <term><option>--instance</option></term>
625               <listitem>
626                 <simpara>will start the instances given as arguments
627                 (at least one argument required); this is the default
628                 selection</simpara>
629               </listitem>
630             </varlistentry>
631             <varlistentry>
632               <term>--node</term>
633               <listitem>
634                 <simpara>will start the instances who have the given
635                 node as either primary or secondary</simpara>
636               </listitem>
637             </varlistentry>
638             <varlistentry>
639               <term><option>--primary</option></term>
640               <listitem>
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>
644               </listitem>
645             </varlistentry>
646             <varlistentry>
647               <term><option>--secondary</option></term>
648               <listitem>
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>
652               </listitem>
653             </varlistentry>
654             <varlistentry>
655               <term>--all</term>
656               <listitem>
657                 <simpara>will start all instances in the cluster (no
658                 arguments accepted)</simpara>
659               </listitem>
660             </varlistentry>
661           </variablelist>
662         </para>
663
664         <para>
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.
668         </para>
669
670         <para>
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.
676         </para>
677
678         <para>
679           Use <option>--force</option> to start even if secondary disks are
680           failing.
681         </para>
682
683         <para>
684           Example:
685           <screen>
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
690           </screen>
691         </para>
692       </refsect3>
693
694       <refsect3>
695         <title>SHUTDOWN</title>
696
697         <cmdsynopsis>
698           <command>shutdown</command>
699           <sbr>
700           <group choice="opt">
701             <arg>--instance</arg>
702             <arg>--node</arg>
703             <arg>--primary</arg>
704             <arg>--secondary</arg>
705             <arg>--all</arg>
706           </group>
707           <sbr>
708
709           <arg choice="opt"
710           rep="repeat"><replaceable>name</replaceable></arg>
711         </cmdsynopsis>
712
713         <para>
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).
718         </para>
719
720         <para>
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.
726         </para>
727
728         <para>
729           Example:
730           <screen>
731 # gnt-instance shutdown instance1.example.com
732 # gnt-instance shutdown --all
733           </screen>
734         </para>
735       </refsect3>
736
737       <refsect3>
738         <title>REBOOT</title>
739
740         <cmdsynopsis>
741           <command>reboot</command>
742           <sbr>
743           <arg>--extra=<replaceable>PARAMS</replaceable></arg>
744           <sbr>
745           <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
746           <sbr>
747           <arg>--ignore-secondaries</arg>
748           <sbr>
749           <arg>--force-multiple</arg>
750           <sbr>
751           <group choice="opt">
752             <arg>--instance</arg>
753             <arg>--node</arg>
754             <arg>--primary</arg>
755             <arg>--secondary</arg>
756             <arg>--all</arg>
757           </group>
758           <sbr>
759
760           <arg choice="opt"
761           rep="repeat"><replaceable>name</replaceable></arg>
762         </cmdsynopsis>
763
764         <para>
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 &amp;&amp; gnt-instance
771           startup</command>. The default is soft reboot.
772         </para>
773
774         <para>
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.
778         </para>
779
780         <para>
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.
786         </para>
787
788         <para>
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.
792         </para>
793
794         <para>
795           Example:
796           <screen>
797 # gnt-instance reboot instance1.example.com
798 # gnt-instance reboot --type=full instance1.example.com
799           </screen>
800         </para>
801       </refsect3>
802
803       <refsect3>
804         <title>CONSOLE</title>
805         <cmdsynopsis>
806           <command>console</command>
807           <arg choice="req"><replaceable>instance</replaceable></arg>
808         </cmdsynopsis>
809
810         <para>
811           Connects to the console of the given instance. If the instance
812           is not up, an error is returned.
813         </para>
814
815         <para>
816           Example:
817           <screen>
818 # gnt-instance console instance1.example.com
819           </screen>
820         </para>
821       </refsect3>
822
823     </refsect2>
824
825     <refsect2>
826       <title>Disk management</title>
827
828       <refsect3>
829         <title>REPLACE-DISKS</title>
830
831         <cmdsynopsis>
832           <command>replace-disks</command>
833           <arg choice="opt">--new-secondary <replaceable>NODE</replaceable></arg>
834           <arg choice="req"><replaceable>instance</replaceable></arg>
835         </cmdsynopsis>
836
837         <cmdsynopsis>
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>
842         </cmdsynopsis>
843
844         <cmdsynopsis>
845           <command>replace-disks</command>
846           <group>
847           <arg choice="req">-s</arg>
848           <arg choice="req">-p</arg>
849           </group>
850           <arg choice="req"><replaceable>instance</replaceable></arg>
851         </cmdsynopsis>
852
853         <para>
854           This command is a generalized form for adding and replacing
855           disks.
856         </para>
857
858         <para>
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.
864         </para>
865
866         <para>
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.
875         </para>
876
877       </refsect3>
878
879       <refsect3>
880         <title>ADD-MIRROR</title>
881         <cmdsynopsis>
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>
886         </cmdsynopsis>
887         <para>
888           Adds a new mirror to the disk layout of the instance, if the
889           instance has a remote raid disk layout.
890
891           The new mirror member will be between the instance's primary
892           node and the node given with the <option>-n</option> option.
893         </para>
894       </refsect3>
895
896       <refsect3>
897         <title>REMOVE-MIRROR</title>
898
899         <cmdsynopsis>
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>
904         </cmdsynopsis>
905         <para>
906           Removes a mirror componenent from the disk layout of the
907           instance, if the instance has a remote raid disk layout.
908         </para>
909
910         <para>
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.
917         </para>
918
919       <refsect3>
920         <title>ACTIVATE-DISKS</title>
921
922         <cmdsynopsis>
923           <command>activate-disks</command>
924           <arg choice="req"><replaceable>instance</replaceable></arg>
925         </cmdsynopsis>
926         <para>
927           Activates the block devices of the given instance. If
928           successful, the command will show the location and name of
929           the block devices:
930           <screen>
931 node1.example.com:sda:/dev/md0
932 node1.example.com:sdb:/dev/md1
933           </screen>
934
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.
942         </para>
943
944         <para>
945           Note that it is safe to run this command while the instance
946           is already running.
947         </para>
948       </refsect3>
949
950       <refsect3>
951         <title>DEACTIVATE-DISKS</title>
952
953         <cmdsynopsis>
954           <command>deactivate-disks</command>
955           <arg choice="req"><replaceable>instance</replaceable></arg>
956         </cmdsynopsis>
957         <para>
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
963           replication.
964         </para>
965
966       </refsect3>
967
968     </refsect2>
969
970     <refsect2>
971       <title>Recovery</title>
972
973       <refsect3>
974         <title>FAILOVER</title>
975
976         <cmdsynopsis>
977           <command>failover</command>
978           <arg>-f</arg>
979           <arg>--ignore-consistency</arg>
980           <arg choice="req"><replaceable>instance</replaceable></arg>
981         </cmdsynopsis>
982
983         <para>
984           Failover will fail the instance over its secondary
985           node. This works only for instances having a remote raid
986           disk layout.
987         </para>
988
989         <para>
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).
998         </para>
999
1000         <para>
1001           Example:
1002           <screen>
1003 # gnt-instance failover instance1.example.com
1004           </screen>
1005         </para>
1006       </refsect3>
1007
1008     </refsect2>
1009
1010     <refsect2>
1011       <title>TAGS</title>
1012
1013     <refsect3>
1014         <title>ADD-TAGS</title>
1015
1016         <cmdsynopsis>
1017           <command>add-tags</command>
1018           <arg choice="opt">--from <replaceable>file</replaceable></arg>
1019           <arg choice="req"><replaceable>instancename</replaceable></arg>
1020           <arg choice="req"
1021             rep="repeat"><replaceable>tag</replaceable></arg>
1022         </cmdsynopsis>
1023
1024         <para>
1025           Add tags to the given instance. If any of the tags contains
1026           invalid characters, the entire operation will abort.
1027         </para>
1028         <para>
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.
1034         </para>
1035       </refsect3>
1036
1037       <refsect3>
1038         <title>LIST-TAGS</title>
1039
1040         <cmdsynopsis>
1041           <command>list-tags</command>
1042           <arg choice="req"><replaceable>instancename</replaceable></arg>
1043         </cmdsynopsis>
1044
1045         <para>List the tags of the given instance.</para>
1046       </refsect3>
1047
1048       <refsect3>
1049         <title>REMOVE-TAGS</title>
1050         <cmdsynopsis>
1051           <command>remove-tags</command>
1052           <arg choice="opt">--from <replaceable>file</replaceable></arg>
1053           <arg choice="req"><replaceable>instancename</replaceable></arg>
1054           <arg choice="req"
1055             rep="repeat"><replaceable>tag</replaceable></arg>
1056         </cmdsynopsis>
1057
1058         <para>
1059           Remove tags from the given instance. If any of the tags are
1060           not existing on the node, the entire operation will abort.
1061         </para>
1062
1063         <para>
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.
1069         </para>
1070       </refsect3>
1071
1072     </refsect2>
1073
1074   </refsect1>
1075
1076   &footer;
1077
1078 </refentry>
1079
1080 <!-- Keep this comment at the end of the file
1081 Local variables:
1082 mode: sgml
1083 sgml-omittag:t
1084 sgml-shorttag:t
1085 sgml-minimize-attributes:nil
1086 sgml-always-quote-attributes:t
1087 sgml-indent-step:2
1088 sgml-indent-data: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
1094 End:
1095 -->