ace4a9e8c5ca7776dfb87f0cbd46b6359a0d0807
[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>drbd</arg>
89             </group>
90           </arg>
91           <sbr>
92           <arg choice="req">-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg>
93           <arg choice="req"><replaceable>instance</replaceable></arg>
94         </cmdsynopsis>
95
96         <para>
97           Creates a new instance on the specified
98           host. <replaceable>instance</replaceable> must be in DNS and
99           resolve to a IP in the same network as the nodes in the
100           cluster.
101         </para>
102
103         <para>
104           The <option>-s</option> option specifies the disk size for
105           the instance, in mebibytes (defaults to
106           <constant>20480MiB</constant> =
107           <constant>20GiB</constant>). You can also use one of the
108           suffixes <literal>m</literal>, <literal>g</literal> or
109           <literal>t</literal> to specificy the exact the units used;
110           these suffixes map to mebibytes, gibibytes and tebibytes.
111         </para>
112
113         <para>
114           The <option>--swap-size</option> option specifies the swap
115           disk size (in mebibytes) for the instance (the one presented
116           as <filename class="devicefile">/dev/sdb</filename>). The
117           default is <constant>4096MiB</constant>. As for the disk
118           size, you can specify other suffixes.
119         </para>
120
121         <para>
122           The <option>-m</option> option specifies the memory size for
123           the instance, in mebibytes (defaults to 128 MiB). Again, you
124           can use other suffixes (e.g. <userinput>2g</userinput>).
125         </para>
126
127         <para>
128           The <option>-o</option> options specifies the operating
129           system to be installed. The available operating systems can
130           be listed with <command>gnt-os list</command>.
131         </para>
132
133         <para>
134           The <option>-b</option> option specifies the bridge to which the
135           instance will be connected. (defaults to the cluster-wide default
136           bridge specified at cluster initialization time).
137         </para>
138
139         <para>
140           The <option>--mac</option> option specifies the MAC address
141           of the ethernet interface for the instance. If this option
142           is not specified, a new MAC address is generated randomly with
143           the configured MAC prefix. The randomly generated MAC
144           address is guaranteed to be unique among the instances of
145           this cluster.
146         </para>
147
148         <para>
149           The <option>--hvm-boot-order</option> option specifies the
150           boot device order for Xen HVM instances. The boot order is a
151           string of letters listing the boot devices, with valid
152           device letters being:
153         </para>
154
155         <para>
156           <variablelist>
157             <varlistentry>
158               <term>a</term>
159               <listitem>
160                 <para>
161                   floppy drive
162                 </para>
163               </listitem>
164             </varlistentry>
165             <varlistentry>
166               <term>c</term>
167               <listitem>
168                 <para>
169                   hard disk
170                 </para>
171               </listitem>
172             </varlistentry>
173             <varlistentry>
174               <term>d</term>
175               <listitem>
176                 <para>
177                   CDROM drive
178                 </para>
179               </listitem>
180             </varlistentry>
181             <varlistentry>
182               <term>n</term>
183               <listitem>
184                 <para>
185                   network boot (PXE)
186                 </para>
187               </listitem>
188             </varlistentry>
189           </variablelist>
190         </para>
191
192         <para>
193           The option is only relevant for Xen HVM instances and
194           ignored by all other instances types.
195         </para>
196
197         <para>
198           The <option>--kernel</option> options allows the instance to
199           use a custom kernel (if a filename is passed) or to use the
200           default kernel (<filename>@CUSTOM_XEN_KERNEL@</filename>), if the
201           string <constant>default</constant> is passed.
202         </para>
203
204         <para>
205           The <option>--initrd</option> option is similar: it allows
206           the instance to use a custom initrd (if a filename is
207           passed) or to use the default initrd
208           (<filename>@CUSTOM_XEN_INITRD@</filename>), if the string
209           <constant>default</constant> is passed, or to disable the
210           use of an initrd, if the string <constant>none</constant> is
211           passed. Note that in the case the instance is set to use the
212           default initrd and it doesn't exist, it will be silently
213           ignored; if the instance is set to use a custom initrd and
214           it doesn't exist, this will be treated as an error and will
215           prevent the startup of the instance.
216         </para>
217
218         <para>
219           The <option>-t</option> options specifies the disk layout type for
220           the instance. The available choices are:
221           <variablelist>
222             <varlistentry>
223               <term>diskless</term>
224               <listitem>
225                 <para>
226                   This creates an instance with no disks. Its useful for
227                   testing only (or other special cases).
228                 </para>
229               </listitem>
230             </varlistentry>
231             <varlistentry>
232               <term>plain</term>
233               <listitem>
234                 <para>Disk devices will be logical volumes.</para>
235               </listitem>
236             </varlistentry>
237             <varlistentry>
238               <term>drbd</term>
239               <listitem>
240                 <para>
241                   Disk devices will be drbd (version 8.x) on top of
242                   lvm volumes.
243                 </para>
244               </listitem>
245             </varlistentry>
246           </variablelist>
247         </para>
248
249         <para>
250           The optional second value of the <option>--node</option> is used for
251           the remote raid template type and specifies the remote node.
252         </para>
253
254         <para>
255           If you do not want gnt-instance to wait for the disk mirror
256           to be synced, use the <option>--no-wait-for-sync</option>
257           option.
258         </para>
259
260         <para>
261           Example:
262           <screen>
263 # gnt-instance add -t plain -s 30g -m 512 -o debian-etch \
264   -n node1.example.com instance1.example.com
265 # gnt-instance add -t drbd -s 30g -m 512 -o debian-etch \
266   -n node1.example.com:node2.example.com instance2.example.com
267           </screen>
268         </para>
269       </refsect3>
270
271       <refsect3>
272         <title>REMOVE</title>
273
274         <cmdsynopsis>
275           <command>remove</command>
276           <arg>--ignore-failures</arg>
277           <arg choice="req"><replaceable>instance</replaceable></arg>
278         </cmdsynopsis>
279
280         <para>
281           Remove an instance. This will remove all data from the
282           instance and there is <emphasis>no way back</emphasis>. If
283           you are not sure if you use an instance again, use
284           <command>shutdown</command> first and leave it in the
285           shutdown state for a while.
286
287         </para>
288
289         <para>
290           The <option>--ignore-failures</option> option will cause the
291           removal to proceed even in the presence of errors during the
292           removal of the instance (e.g. during the shutdown or the
293           disk removal). If this option is not given, the command will
294           stop at the first error.
295         </para>
296
297         <para>
298           Example:
299           <screen>
300 # gnt-instance remove instance1.example.com
301           </screen>
302         </para>
303       </refsect3>
304
305       <refsect3>
306         <title>LIST</title>
307
308         <cmdsynopsis>
309           <command>list</command>
310           <arg>--no-headers</arg>
311           <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
312           <arg>-o <replaceable>FIELD,...</replaceable></arg>
313         </cmdsynopsis>
314
315         <para>
316           Shows the currently configured instances with memory usage,
317           disk usage, the node they are running on, and the CPU time,
318           counted in seconds, used by each instance since its latest
319           restart.
320         </para>
321
322         <para>
323           The <option>--no-headers</option> option will skip the
324           initial header line. The <option>--separator</option> option
325           takes an argument which denotes what will be used between
326           the output fields. Both these options are to help scripting.
327         </para>
328
329         <para>
330           The <option>-o</option> option takes a comma-separated list
331           of output fields. The available fields and their meaning
332           are:
333           <variablelist>
334             <varlistentry>
335               <term>name</term>
336               <listitem>
337                 <simpara>the instance name</simpara>
338               </listitem>
339             </varlistentry>
340             <varlistentry>
341               <term>os</term>
342               <listitem>
343                 <simpara>the OS of the instance</simpara>
344               </listitem>
345             </varlistentry>
346             <varlistentry>
347               <term>pnode</term>
348               <listitem>
349                 <simpara>the primary node of the instance</simpara>
350               </listitem>
351             </varlistentry>
352             <varlistentry>
353               <term>snodes</term>
354               <listitem>
355                 <simpara>comma-separated list of secondary nodes for the
356                   instance; usually this will be just one node</simpara>
357               </listitem>
358             </varlistentry>
359             <varlistentry>
360               <term>admin_state</term>
361               <listitem>
362                 <simpara>the desired state of the instance (either "yes"
363                   or "no" denoting the instance should run or
364                   not)</simpara>
365               </listitem>
366             </varlistentry>
367             <varlistentry>
368               <term>admin_ram</term>
369               <listitem>
370                 <simpara>the desired memory for the instance</simpara>
371               </listitem>
372             </varlistentry>
373             <varlistentry>
374               <term>disk_template</term>
375               <listitem>
376                 <simpara>the disk template of the instance</simpara>
377               </listitem>
378             </varlistentry>
379             <varlistentry>
380               <term>oper_state</term>
381               <listitem>
382                 <simpara>the actual state of the instance; can be
383                 one of the values "running", "stopped", "(node
384                 down)"</simpara>
385               </listitem>
386             </varlistentry>
387             <varlistentry>
388               <term>status</term>
389               <listitem>
390                 <simpara>combined form of admin_state and oper_stat;
391                 this can be one of:
392                 <computeroutput>ERROR_nodedown</computeroutput> if the
393                 node of the instance is down,
394                 <computeroutput>ERROR_down</computeroutput> if the
395                 instance should run but is down,
396                 <computeroutput>ERROR_up</computeroutput> if the
397                 instance should be stopped but is actually running,
398                 <computeroutput>ADMIN_down</computeroutput> if the
399                 instance has been stopped (and is stopped) and
400                 <computeroutput>running</computeroutput> if the
401                 instance is set to be running (and is
402                 running)</simpara>
403               </listitem>
404             </varlistentry>
405             <varlistentry>
406               <term>oper_ram</term>
407               <listitem>
408                 <simpara>the actual memory usage of the instance as seen
409                   by the hypervisor</simpara>
410               </listitem>
411             </varlistentry>
412             <varlistentry>
413               <term>ip</term>
414               <listitem>
415                 <simpara>the ip address ganeti recognizes as associated with
416                 the instance interface</simpara>
417               </listitem>
418             </varlistentry>
419             <varlistentry>
420               <term>mac</term>
421               <listitem>
422                 <simpara>the instance interface MAC address</simpara>
423               </listitem>
424             </varlistentry>
425             <varlistentry>
426               <term>bridge</term>
427               <listitem>
428                 <simpara>bridge the instance is connected to
429                 </simpara>
430               </listitem>
431             </varlistentry>
432             <varlistentry>
433               <term>sda_size</term>
434               <listitem>
435                 <simpara>the size of the instance's first disk</simpara>
436               </listitem>
437             </varlistentry>
438             <varlistentry>
439               <term>sdb_size</term>
440               <listitem>
441                 <simpara>the size of the instance's second disk</simpara>
442               </listitem>
443             </varlistentry>
444             <varlistentry>
445               <term>vcpus</term>
446               <listitem>
447                 <simpara>the number of VCPUs allocated to the
448                 instance</simpara>
449               </listitem>
450             </varlistentry>
451           </variablelist>
452         </para>
453
454         <para>
455           There is a subtle grouping about the available output
456           fields: all fields except for <option>oper_state</option>
457           and <option>oper_ram</option> are configuration value and
458           not run-time values. So if you don't select any of the
459           <option>oper_*</option> fields, the query will be satisfied
460           instantly from the cluster configuration, without having to
461           ask the remote nodes for the data. This can be helpful for
462           big clusters when you only want some data and it makes sense
463           to specify a reduced set of output fields.
464         </para>
465
466         <para>The default output field list is:
467           <simplelist type="inline">
468             <member>name</member>
469             <member>os</member>
470             <member>pnode</member>
471             <member>admin_state</member>
472             <member>oper_state</member>
473             <member>oper_ram</member>
474           </simplelist>.
475         </para>
476       </refsect3>
477
478       <refsect3>
479         <title>INFO</title>
480
481         <cmdsynopsis>
482           <command>info</command>
483           <arg rep="repeat"><replaceable>instance</replaceable></arg>
484         </cmdsynopsis>
485
486         <para>
487           Show detailed information about the (given) instances. This
488           is different from <command>list</command> as it shows
489           detailed data about the instance's disks (especially useful
490           for remote raid templates).
491         </para>
492       </refsect3>
493
494       <refsect3>
495         <title>MODIFY</title>
496
497         <cmdsynopsis>
498           <command>modify</command>
499           <arg choice="opt">-m <replaceable>memsize</replaceable></arg>
500           <arg choice="opt">-p <replaceable>vcpus</replaceable></arg>
501           <arg choice="opt">-i <replaceable>ip</replaceable></arg>
502           <arg choice="opt">-b <replaceable>bridge</replaceable></arg>
503           <arg choice="opt">--mac <replaceable>MAC-address</replaceable></arg>
504           <arg>--hvm-boot-order <replaceable>boot-order</replaceable></arg>
505           <sbr>
506           <arg>--kernel <group choice="req">
507               <arg>default</arg>
508               <arg><replaceable>kernel_path</replaceable></arg>
509             </group></arg>
510           <sbr>
511           <arg>--initrd <group choice="req">
512               <arg>default</arg>
513               <arg>none</arg>
514               <arg><replaceable>initrd_path</replaceable></arg>
515             </group> </arg>
516           <sbr>
517           <arg choice="req"><replaceable>instance</replaceable></arg>
518         </cmdsynopsis>
519
520         <para>
521           Modify the memory size, number of vcpus, ip address, MAC
522           address and/or bridge for an instance.
523         </para>
524
525         <para>
526           The memory size is given in MiB. Note that you need to give
527           at least one of the arguments, otherwise the command
528           complains.
529         </para>
530
531         <para>
532           The <option>--kernel</option>, <option>--initrd</option>
533           and <option>--hvm-boot-order</option>
534           options are described in the <command>add</command> command.
535         </para>
536
537         <para>
538           Additionally, the HVM boot order can be reset to the default
539           values by using <option>--hvm-boot-order=default</option>.
540         </para>
541
542         <para>
543           All the changes take effect at the next restart. If the
544           instance is running, there is no effect on the instance.
545         </para>
546       </refsect3>
547
548       <refsect3>
549         <title>REINSTALL</title>
550
551         <cmdsynopsis>
552           <command>reinstall</command>
553           <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
554           <arg choice="opt">-f <replaceable>force</replaceable></arg>
555           <arg choice="req"><replaceable>instance</replaceable></arg>
556         </cmdsynopsis>
557
558         <para>
559           Reinstalls the operating system on the given instance. The instance
560           must be stopped when running this command. If the
561           <option>--os-type</option> is specified, the operating system is
562           changed.
563         </para>
564       </refsect3>
565
566       <refsect3>
567         <title>RENAME</title>
568
569         <cmdsynopsis>
570           <command>rename</command>
571           <arg>--no-ip-check</arg>
572           <arg choice="req"><replaceable>instance</replaceable></arg>
573           <arg choice="req"><replaceable>new_name</replaceable></arg>
574         </cmdsynopsis>
575
576         <para>
577           Renames the given instance. The instance must be stopped
578           when running this command. The requirements for the new name
579           are the same as for adding an instance: the new name must be
580           resolvable and the IP it resolves to must not be reachable
581           (in order to prevent duplicate IPs the next time the
582           instance is started). The IP test can be skipped if the
583           <option>--no-ip-check</option> option is passed.
584         </para>
585       </refsect3>
586
587     </refsect2>
588
589     <refsect2>
590       <title>Starting/stopping/connecting to console</title>
591
592       <refsect3>
593         <title>STARTUP</title>
594
595         <cmdsynopsis>
596           <command>startup</command>
597           <arg>--extra=<replaceable>PARAMS</replaceable></arg>
598           <arg>--force</arg>
599           <sbr>
600           <group choice="opt">
601             <arg>--instance</arg>
602             <arg>--node</arg>
603             <arg>--primary</arg>
604             <arg>--secondary</arg>
605             <arg>--all</arg>
606           </group>
607           <sbr>
608           <arg choice="opt"
609           rep="repeat"><replaceable>name</replaceable></arg>
610         </cmdsynopsis>
611
612         <para>
613           Starts one or more instances, depending on the following
614           options. The four available modes are:
615           <variablelist>
616             <varlistentry>
617               <term><option>--instance</option></term>
618               <listitem>
619                 <simpara>will start the instances given as arguments
620                 (at least one argument required); this is the default
621                 selection</simpara>
622               </listitem>
623             </varlistentry>
624             <varlistentry>
625               <term>--node</term>
626               <listitem>
627                 <simpara>will start the instances who have the given
628                 node as either primary or secondary</simpara>
629               </listitem>
630             </varlistentry>
631             <varlistentry>
632               <term><option>--primary</option></term>
633               <listitem>
634                 <simpara>will start all instances whose primary node
635                 is in the list of nodes passed as arguments (at least
636                 one node required)</simpara>
637               </listitem>
638             </varlistentry>
639             <varlistentry>
640               <term><option>--secondary</option></term>
641               <listitem>
642                 <simpara>will start all instances whose secondary node
643                 is in the list of nodes passed as arguments (at least
644                 one node required)</simpara>
645               </listitem>
646             </varlistentry>
647             <varlistentry>
648               <term>--all</term>
649               <listitem>
650                 <simpara>will start all instances in the cluster (no
651                 arguments accepted)</simpara>
652               </listitem>
653             </varlistentry>
654           </variablelist>
655         </para>
656
657         <para>
658           Note that although you can pass more than one selection
659           option, the last one wins, so in order to guarantee the
660           desired result, don't pass more than one such option.
661         </para>
662
663         <para>
664           The <option>--extra</option> option is used to pass
665           additional argument to the instance's kernel for this start
666           only. Currently there is no way to specify a persistent set
667           of arguments (beside the one hardcoded). Note that this may
668           not apply to all virtualization types.
669         </para>
670
671         <para>
672           Use <option>--force</option> to start even if secondary disks are
673           failing.
674         </para>
675
676         <para>
677           Example:
678           <screen>
679 # gnt-instance start instance1.example.com
680 # gnt-instance start --extra single test1.example.com
681 # gnt-instance start --node node1.example.com node2.example.com
682 # gnt-instance start --all
683           </screen>
684         </para>
685       </refsect3>
686
687       <refsect3>
688         <title>SHUTDOWN</title>
689
690         <cmdsynopsis>
691           <command>shutdown</command>
692           <sbr>
693           <group choice="opt">
694             <arg>--instance</arg>
695             <arg>--node</arg>
696             <arg>--primary</arg>
697             <arg>--secondary</arg>
698             <arg>--all</arg>
699           </group>
700           <sbr>
701
702           <arg choice="opt"
703           rep="repeat"><replaceable>name</replaceable></arg>
704         </cmdsynopsis>
705
706         <para>
707           Stops one or more instances. If the instance cannot be
708           cleanly stopped during a hardcoded interval (currently 2
709           minutes), it will forcibly stop the instance (equivalent to
710           switching off the power on a physical machine).
711         </para>
712
713         <para>
714           The <option>--instance</option>, <option>--node</option>,
715           <option>--primary</option>, <option>--secondary</option> and
716           <option>--all</option> options are similar as for the
717           <command>startup</command> command and they influence the
718           actual instances being shutdown.
719         </para>
720
721         <para>
722           Example:
723           <screen>
724 # gnt-instance shutdown instance1.example.com
725 # gnt-instance shutdown --all
726           </screen>
727         </para>
728       </refsect3>
729
730       <refsect3>
731         <title>REBOOT</title>
732
733         <cmdsynopsis>
734           <command>reboot</command>
735           <sbr>
736           <arg>--extra=<replaceable>PARAMS</replaceable></arg>
737           <sbr>
738           <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
739           <sbr>
740           <arg>--ignore-secondaries</arg>
741           <sbr>
742           <arg>--force-multiple</arg>
743           <sbr>
744           <group choice="opt">
745             <arg>--instance</arg>
746             <arg>--node</arg>
747             <arg>--primary</arg>
748             <arg>--secondary</arg>
749             <arg>--all</arg>
750           </group>
751           <sbr>
752
753           <arg choice="opt"
754           rep="repeat"><replaceable>name</replaceable></arg>
755         </cmdsynopsis>
756
757         <para>
758           Reboots one or more instances. The type of reboot depends on
759           the value of <option>--type</option>. A soft reboot does a
760           hypervisor reboot, a hard reboot does a instance stop,
761           recreates the hypervisor config for the instance and
762           starts the instance. A full reboot does the equivalent
763           of <command>gnt-instance shutdown &amp;&amp; gnt-instance
764           startup</command>. The default is soft reboot.
765         </para>
766
767         <para>
768           For the hard reboot the option
769           <option>--ignore-secondaries</option> ignores errors for the
770           secondary node while re-assembling the instance disks.
771         </para>
772
773         <para>
774           The <option>--instance</option>, <option>--node</option>,
775           <option>--primary</option>, <option>--secondary</option> and
776           <option>--all</option> options are similar as for the
777           <command>startup</command> command and they influence the
778           actual instances being rebooted.
779         </para>
780
781         <para>
782           Use the <option>--force-multiple</option> option to keep
783           gnt-instance from asking for confirmation when more than one
784           instance is affected.
785         </para>
786
787         <para>
788           Example:
789           <screen>
790 # gnt-instance reboot instance1.example.com
791 # gnt-instance reboot --type=full instance1.example.com
792           </screen>
793         </para>
794       </refsect3>
795
796       <refsect3>
797         <title>CONSOLE</title>
798         <cmdsynopsis>
799           <command>console</command>
800           <arg choice="req"><replaceable>instance</replaceable></arg>
801         </cmdsynopsis>
802
803         <para>
804           Connects to the console of the given instance. If the instance
805           is not up, an error is returned.
806         </para>
807
808         <para>
809           Example:
810           <screen>
811 # gnt-instance console instance1.example.com
812           </screen>
813         </para>
814       </refsect3>
815
816     </refsect2>
817
818     <refsect2>
819       <title>Disk management</title>
820
821       <refsect3>
822         <title>REPLACE-DISKS</title>
823
824         <cmdsynopsis>
825           <command>replace-disks</command>
826           <arg choice="opt">--new-secondary <replaceable>NODE</replaceable></arg>
827           <arg choice="req"><replaceable>instance</replaceable></arg>
828         </cmdsynopsis>
829
830         <cmdsynopsis>
831           <command>replace-disks</command>
832           <arg choice="opt">-s</arg>
833           <arg choice="req">--new-secondary <replaceable>NODE</replaceable></arg>
834           <arg choice="req"><replaceable>instance</replaceable></arg>
835         </cmdsynopsis>
836
837         <cmdsynopsis>
838           <command>replace-disks</command>
839           <group>
840           <arg choice="req">-s</arg>
841           <arg choice="req">-p</arg>
842           </group>
843           <arg choice="req"><replaceable>instance</replaceable></arg>
844         </cmdsynopsis>
845
846         <para>
847           This command is a generalized form for adding and replacing
848           disks.
849         </para>
850
851         <para>
852           The first form is usable with the
853           <literal>remote_raid1</literal> disk template. This will
854           replace the disks on both the primary and secondary node,
855           and optionally will change the secondary node to a new one
856           if you pass the <option>--new-secondary</option> option.
857         </para>
858
859         <para>
860           The second and third forms are usable with the
861           <literal>drbd</literal> disk template. The second form will
862           do a secondary replacement, but as opposed to the
863           <literal>remote_raid1</literal> will not replace the disks
864           on the primary, therefore it will execute faster. The third
865           form will replace the disks on either the primary
866           (<option>-p</option>) or the secondary (<option>-s</option>)
867           node of the instance only, without changing the node.
868         </para>
869
870       </refsect3>
871
872       <refsect3>
873         <title>ACTIVATE-DISKS</title>
874
875         <cmdsynopsis>
876           <command>activate-disks</command>
877           <arg choice="req"><replaceable>instance</replaceable></arg>
878         </cmdsynopsis>
879         <para>
880           Activates the block devices of the given instance. If
881           successful, the command will show the location and name of
882           the block devices:
883           <screen>
884 node1.example.com:sda:/dev/md0
885 node1.example.com:sdb:/dev/md1
886           </screen>
887
888           In this example, <emphasis>node1.example.com</emphasis> is
889           the name of the node on which the devices have been
890           activated. The <emphasis>sda</emphasis> and
891           <emphasis>sdb</emphasis> are the names of the block devices
892           inside the instance. <emphasis>/dev/md0</emphasis> and
893           <emphasis>/dev/md1</emphasis> are the names of the block
894           devices as visible on the node.
895         </para>
896
897         <para>
898           Note that it is safe to run this command while the instance
899           is already running.
900         </para>
901       </refsect3>
902
903       <refsect3>
904         <title>DEACTIVATE-DISKS</title>
905
906         <cmdsynopsis>
907           <command>deactivate-disks</command>
908           <arg choice="req"><replaceable>instance</replaceable></arg>
909         </cmdsynopsis>
910         <para>
911           De-activates the block devices of the given instance. Note
912           that if you run this command for a remote raid instance
913           type, while it is running, it will not be able to shutdown
914           the block devices on the primary node, but it will shutdown
915           the block devices on the secondary nodes, thus breaking the
916           replication.
917         </para>
918
919       </refsect3>
920
921     </refsect2>
922
923     <refsect2>
924       <title>Recovery</title>
925
926       <refsect3>
927         <title>FAILOVER</title>
928
929         <cmdsynopsis>
930           <command>failover</command>
931           <arg>-f</arg>
932           <arg>--ignore-consistency</arg>
933           <arg choice="req"><replaceable>instance</replaceable></arg>
934         </cmdsynopsis>
935
936         <para>
937           Failover will fail the instance over its secondary
938           node. This works only for instances having a remote raid
939           disk layout.
940         </para>
941
942         <para>
943           Normally the failover will check the consistency of the
944           disks before failing over the instance. If you are trying to
945           migrate instances off a dead node, this will fail. Use the
946           <option>--ignore-consistency</option> option for this
947           purpose. Note that this option can be dangerous as errors in
948           shutting down the instance will be ignored, resulting in
949           possibly having the instance running on two machines in
950           parallel (on disconnected DRBD drives).
951         </para>
952
953         <para>
954           Example:
955           <screen>
956 # gnt-instance failover instance1.example.com
957           </screen>
958         </para>
959       </refsect3>
960
961     </refsect2>
962
963     <refsect2>
964       <title>TAGS</title>
965
966     <refsect3>
967         <title>ADD-TAGS</title>
968
969         <cmdsynopsis>
970           <command>add-tags</command>
971           <arg choice="opt">--from <replaceable>file</replaceable></arg>
972           <arg choice="req"><replaceable>instancename</replaceable></arg>
973           <arg choice="req"
974             rep="repeat"><replaceable>tag</replaceable></arg>
975         </cmdsynopsis>
976
977         <para>
978           Add tags to the given instance. If any of the tags contains
979           invalid characters, the entire operation will abort.
980         </para>
981         <para>
982           If the <option>--from</option> option is given, the list of
983           tags will be extended with the contents of that file (each
984           line becomes a tag). In this case, there is not need to pass
985           tags on the command line (if you do, both sources will be
986           used). A file name of - will be interpreted as stdin.
987         </para>
988       </refsect3>
989
990       <refsect3>
991         <title>LIST-TAGS</title>
992
993         <cmdsynopsis>
994           <command>list-tags</command>
995           <arg choice="req"><replaceable>instancename</replaceable></arg>
996         </cmdsynopsis>
997
998         <para>List the tags of the given instance.</para>
999       </refsect3>
1000
1001       <refsect3>
1002         <title>REMOVE-TAGS</title>
1003         <cmdsynopsis>
1004           <command>remove-tags</command>
1005           <arg choice="opt">--from <replaceable>file</replaceable></arg>
1006           <arg choice="req"><replaceable>instancename</replaceable></arg>
1007           <arg choice="req"
1008             rep="repeat"><replaceable>tag</replaceable></arg>
1009         </cmdsynopsis>
1010
1011         <para>
1012           Remove tags from the given instance. If any of the tags are
1013           not existing on the node, the entire operation will abort.
1014         </para>
1015
1016         <para>
1017           If the <option>--from</option> option is given, the list of
1018           tags will be extended with the contents of that file (each
1019           line becomes a tag). In this case, there is not need to pass
1020           tags on the command line (if you do, both sources will be
1021           used). A file name of - will be interpreted as stdin.
1022         </para>
1023       </refsect3>
1024
1025     </refsect2>
1026
1027   </refsect1>
1028
1029   &footer;
1030
1031 </refentry>
1032
1033 <!-- Keep this comment at the end of the file
1034 Local variables:
1035 mode: sgml
1036 sgml-omittag:t
1037 sgml-shorttag:t
1038 sgml-minimize-attributes:nil
1039 sgml-always-quote-attributes:t
1040 sgml-indent-step:2
1041 sgml-indent-data:t
1042 sgml-parent-document:nil
1043 sgml-default-dtd-file:nil
1044 sgml-exposed-tags:nil
1045 sgml-local-catalogs:nil
1046 sgml-local-ecat-files:nil
1047 End:
1048 -->