560b665608aa246d0615de64cac12f57711a99cd
[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>June 08, 2010</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       <year>2009</year>
25       <year>2010</year>
26       <holder>Google Inc.</holder>
27     </copyright>
28     &dhdate;
29   </refentryinfo>
30   <refmeta>
31     &dhucpackage;
32
33     &dhsection;
34     <refmiscinfo>Ganeti 2.2</refmiscinfo>
35   </refmeta>
36   <refnamediv>
37     <refname>&dhpackage;</refname>
38
39     <refpurpose>Ganeti instance administration</refpurpose>
40   </refnamediv>
41   <refsynopsisdiv>
42     <cmdsynopsis>
43       <command>&dhpackage; </command>
44
45       <arg choice="req">command</arg>
46       <arg>arguments...</arg>
47     </cmdsynopsis>
48   </refsynopsisdiv>
49   <refsect1>
50     <title>DESCRIPTION</title>
51
52     <para>
53       The <command>&dhpackage;</command> is used for instance
54       administration in the Ganeti system.
55     </para>
56
57   </refsect1>
58   <refsect1>
59     <title>COMMANDS</title>
60
61     <refsect2>
62       <title>Creation/removal/querying</title>
63
64       <refsect3>
65         <title>ADD</title>
66         <cmdsynopsis>
67           <command>add</command>
68           <sbr>
69           <arg choice="req">-t<group choice="req">
70               <arg>diskless</arg>
71               <arg>file</arg>
72               <arg>plain</arg>
73               <arg>drbd</arg>
74             </group></arg>
75           <sbr>
76
77           <group choice="req">
78             <arg rep="repeat">--disk=<replaceable>N</replaceable>:<group choice="req">
79                 <arg>size=<replaceable>VAL</replaceable></arg>
80                 <arg>adopt=<replaceable>LV</replaceable></arg>
81               </group>,mode=<replaceable>ro|rw</replaceable></arg>
82             <arg>-s <replaceable>SIZE</replaceable></arg>
83           </group>
84           <sbr>
85           <arg>--no-ip-check</arg>
86           <arg>--no-name-check</arg>
87           <arg>--no-start</arg>
88           <arg>--no-install</arg>
89           <sbr>
90           <group>
91             <arg rep="repeat">--net=<replaceable>N</replaceable><arg rep="repeat">:options</arg></arg>
92             <arg>--no-nics</arg>
93           </group>
94           <sbr>
95           <arg>-B <replaceable>BEPARAMS</replaceable></arg>
96           <sbr>
97
98           <arg>-H <replaceable>HYPERVISOR</replaceable><arg>:<arg choice="plain" rep="repeat">option=<replaceable>value</replaceable></arg></arg></arg>
99           <sbr>
100
101           <arg>--file-storage-dir <replaceable>dir_path</replaceable></arg>
102           <arg>--file-driver<group choice="req">
103               <arg>loop</arg>
104               <arg>blktap</arg>
105             </group></arg>
106           <sbr>
107
108           <group choice="req">
109             <arg>-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg>
110             <arg>--iallocator <replaceable>name</replaceable></arg>
111           </group>
112           <sbr>
113
114           <arg choice="req">-o <replaceable>os-type</replaceable></arg>
115           <sbr>
116           <arg>--submit</arg>
117           <sbr>
118
119           <arg choice="req"><replaceable>instance</replaceable></arg>
120         </cmdsynopsis>
121
122         <para>
123           Creates a new instance on the specified host. The
124           <replaceable>instance</replaceable> argument must be in DNS,
125           but depending on the bridge/routing setup, need not be in
126           the same network as the nodes in the cluster.
127         </para>
128
129         <para>
130           The <option>disk</option> option specifies the parameters
131           for the disks of the instance. The numbering of disks starts
132           at zero, and at least one disk needs to be passed. For each
133           disk, either the size or the adoption source needs to be
134           given, and optionally the access mode (read-only or the
135           default of read-write) can also be specified.  The size is
136           interpreted (when no unit is given) in mebibytes. You can
137           also use one of the suffixes
138           <literal>m</literal>, <literal>g</literal> or
139           <literal>t</literal> to specificy the exact the units used;
140           these suffixes map to mebibytes, gibibytes and tebibytes.
141         </para>
142
143         <para>
144           When using the <option>adopt</option> key in the disk
145           definition, Ganeti will reuse those volumes (instead of
146           creating new ones) as the instance's disks. Ganeti will
147           rename these volumes to the standard format, and (without
148           installing the OS) will use them as-is for the
149           instance. This allows migrating instances from non-managed
150           mode (e.q. plain KVM with LVM) to being managed via
151           Ganeti. Note that this works only for the `plain' disk
152           template (see below for template details).
153         </para>
154
155         <para>
156           Alternatively, a single-disk instance can be created via the
157           <option>-s</option> option which takes a single argument,
158           the size of the disk. This is similar to the Ganeti 1.2
159           version (but will only create one disk).
160         </para>
161
162         <para>
163           The minimum disk specification is therefore
164           <userinput>--disk 0:size=20G</userinput> (or <userinput>-s
165           20G</userinput> when using the <option>-s</option> option),
166           and a three-disk instance can be specified as
167           <userinput>--disk 0:size=20G --disk 1:size=4G --disk
168           2:size=100G</userinput>.
169         </para>
170
171         <para>
172           The <option>--no-ip-check</option> skips the checks that are
173           done to see if the instance's IP is not already alive
174           (i.e. reachable from the master node).
175         </para>
176
177         <para>
178           The <option>--no-name-check</option> skips the check for the
179           instance name via the resolver (e.g. in DNS or /etc/hosts,
180           depending on your setup). Since the name check is used to
181           compute the IP address, if you pass this option you must
182           also pass the <option>--no-ip-check</option> option.
183         </para>
184
185         <para>
186           If you don't wat the instance to automatically start after
187           creation, this is possible via the
188           <option>--no-start</option> option. This will leave the
189           instance down until a subsequent <command>gnt-instance
190           start</command> command.
191         </para>
192
193         <para>
194           The NICs of the instances can be specified via the
195           <option>--net</option> option. By default, one NIC is
196           created for the instance, with a random MAC, and set
197           up according the the cluster level nic parameters.
198           Each NIC can take these parameters (all optional):
199           <variablelist>
200             <varlistentry>
201               <term>mac</term>
202               <listitem>
203                 <simpara>either a value or 'generate' to generate a
204                   new unique MAC</simpara>
205               </listitem>
206             </varlistentry>
207             <varlistentry>
208               <term>ip</term>
209               <listitem>
210                 <simpara>specifies the IP address assigned to the
211                   instance from the Ganeti side (this is not necessarily
212                   what the instance will use, but what the node expects
213                   the instance to use)</simpara>
214               </listitem>
215             </varlistentry>
216             <varlistentry>
217               <term>mode</term>
218               <listitem>
219                 <simpara>specifies the connection mode for this nic:
220                   routed or bridged.</simpara>
221               </listitem>
222             </varlistentry>
223             <varlistentry>
224               <term>link</term>
225               <listitem>
226                 <simpara>in bridged mode specifies the bridge to attach
227                   this NIC to, in routed mode it's intended to
228                   differentiate between different routing tables/instance
229                   groups (but the meaning is dependent on the network
230                   script, see gnt-cluster(8) for more details)</simpara>
231               </listitem>
232             </varlistentry>
233           </variablelist>
234           Of these "mode" and "link" are nic parameters, and inherit their
235           default at cluster level.
236         </para>
237
238         <para>
239           Alternatively, if no network is desired for the instance, you
240           can prevent the default of one NIC with the
241           <option>--no-nics</option> option.
242         </para>
243
244         <para>
245           The <option>-o</option> options specifies the operating
246           system to be installed. The available operating systems can
247           be listed with <command>gnt-os
248           list</command>. Passing <option>--no-install</option> will
249           however skip the OS installation, allowing a manual import
250           if so desired. Note that the no-installation mode will
251           automatically disable the start-up of the instance (without
252           an OS, it most likely won't be able to start-up
253           successfully).
254         </para>
255
256         <para>
257           The <option>-B</option> option specifies the backend
258           parameters for the instance. If no such parameters are
259           specified, the values are inherited from the cluster. Possible
260           parameters are:
261           <variablelist>
262             <varlistentry>
263               <term>memory</term>
264               <listitem>
265                 <simpara>the memory size of the instance; as usual,
266                   suffixes can be used to denote the unit, otherwise the
267                   value is taken in mebibites</simpara>
268               </listitem>
269             </varlistentry>
270             <varlistentry>
271               <term>vcpus</term>
272               <listitem>
273                 <simpara>the number of VCPUs to assign to the instance
274                   (if this value makes sense for the hypervisor)</simpara>
275               </listitem>
276             </varlistentry>
277             <varlistentry>
278               <term>auto_balance</term>
279               <listitem>
280                 <simpara>whether the instance is considered in the N+1
281                   cluster checks (enough redundancy in the cluster to
282                   survive a node failure)</simpara>
283               </listitem>
284             </varlistentry>
285           </variablelist>
286         </para>
287
288         <para>
289           The <option>-H</option> option specified the hypervisor to
290           use for the instance (must be one of the enabled hypervisors
291           on the cluster) and optionally custom parameters for this
292           instance. If not other options are used (i.e. the invocation
293           is just <userinput>-H
294           <replaceable>NAME</replaceable></userinput>) the instance
295           will inherit the cluster options. The defaults below show
296           the cluster defaults at cluster creation time.
297         </para>
298
299         <para>
300           The possible hypervisor options are as follows:
301           <variablelist>
302             <varlistentry>
303               <term>boot_order</term>
304               <listitem>
305                 <simpara>Valid for the Xen HVM and KVM
306                 hypervisors.</simpara>
307
308                 <simpara>A string value denoting the boot order. This
309                 has different meaning for the Xen HVM hypervisor and
310                 for the KVM one.</simpara>
311
312                 <simpara>
313                   For Xen HVM, The boot order is a string of letters
314                   listing the boot devices, with valid device letters
315                   being:
316                 </simpara>
317                   <variablelist>
318                     <varlistentry>
319                       <term>a</term>
320                       <listitem>
321                         <para>
322                           floppy drive
323                         </para>
324                       </listitem>
325                     </varlistentry>
326                     <varlistentry>
327                       <term>c</term>
328                       <listitem>
329                         <para>
330                           hard disk
331                         </para>
332                       </listitem>
333                     </varlistentry>
334                     <varlistentry>
335                       <term>d</term>
336                       <listitem>
337                         <para>
338                           CDROM drive
339                         </para>
340                       </listitem>
341                     </varlistentry>
342                     <varlistentry>
343                       <term>n</term>
344                       <listitem>
345                         <para>
346                           network boot (PXE)
347                         </para>
348                       </listitem>
349                     </varlistentry>
350                   </variablelist>
351                 <simpara>
352                   The default is not to set an HVM boot order which is
353                   interpreted as 'dc'.
354                 </simpara>
355
356                 <simpara>
357                   For KVM the boot order is either
358                   <quote>cdrom</quote>, <quote>disk</quote> or
359                   <quote>network</quote>. Please note that older
360                   versions of KVM couldn't netboot from virtio
361                   interfaces. This has been fixed in more recent
362                   versions and is confirmed to work at least with
363                   qemu-kvm 0.11.1.
364                 </simpara>
365
366               </listitem>
367             </varlistentry>
368             <varlistentry>
369               <term>cdrom_image_path</term>
370               <listitem>
371                 <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
372
373                 <simpara>The path to a CDROM image to attach to the
374                 instance.</simpara>
375
376               </listitem>
377             </varlistentry>
378             <varlistentry>
379               <term>nic_type</term>
380               <listitem>
381                 <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
382
383                 <para>
384                   This parameter determines the way the network cards
385                   are presented to the instance. The possible options are:
386                   <simplelist>
387                     <member>rtl8139 (default for Xen HVM) (HVM & KVM)</member>
388                     <member>ne2k_isa (HVM & KVM)</member>
389                     <member>ne2k_pci (HVM & KVM)</member>
390                     <member>i82551 (KVM)</member>
391                     <member>i82557b (KVM)</member>
392                     <member>i82559er (KVM)</member>
393                     <member>pcnet (KVM)</member>
394                     <member>e1000 (KVM)</member>
395                     <member>paravirtual (default for KVM) (HVM & KVM)</member>
396                   </simplelist>
397                 </para>
398               </listitem>
399             </varlistentry>
400             <varlistentry>
401               <term>disk_type</term>
402               <listitem>
403                 <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
404
405                 <para>
406                   This parameter determines the way the disks are
407                   presented to the instance. The possible options are:
408                   <simplelist>
409                     <member>ioemu (default for HVM & KVM) (HVM & KVM)</member>
410                     <member>ide (HVM & KVM)</member>
411                     <member>scsi (KVM)</member>
412                     <member>sd (KVM)</member>
413                     <member>mtd (KVM)</member>
414                     <member>pflash (KVM)</member>
415                   </simplelist>
416                 </para>
417               </listitem>
418             </varlistentry>
419             <varlistentry>
420               <term>vnc_bind_address</term>
421               <listitem>
422                 <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
423
424                 <para>Specifies the address that the VNC listener for
425                 this instance should bind to. Valid values are IPv4
426                 addresses. Use the address 0.0.0.0 to bind to all
427                 available interfaces (this is the default) or specify
428                 the address of one of the interfaces on the node to
429                 restrict listening to that interface.</para>
430               </listitem>
431             </varlistentry>
432
433             <varlistentry>
434               <term>vnc_tls</term>
435               <listitem>
436                 <simpara>Valid for the KVM hypervisor.</simpara>
437
438                 <simpara>A boolean option that controls whether the
439                 VNC connection is secured with TLS.</simpara>
440               </listitem>
441             </varlistentry>
442
443             <varlistentry>
444               <term>vnc_x509_path</term>
445               <listitem>
446                 <simpara>Valid for the KVM hypervisor.</simpara>
447
448                 <para>If <option>vnc_tls</option> is enabled, this
449                 options specifies the path to the x509 certificate to
450                 use.</para>
451               </listitem>
452             </varlistentry>
453
454             <varlistentry>
455               <term>vnc_x509_verify</term>
456               <listitem>
457                 <simpara>Valid for the KVM hypervisor.</simpara>
458               </listitem>
459             </varlistentry>
460
461             <varlistentry>
462               <term>acpi</term>
463               <listitem>
464                 <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
465
466                 <para>
467                   A boolean option that specifies if the hypervisor
468                   should enable ACPI support for this instance. By
469                   default, ACPI is disabled.
470                 </para>
471               </listitem>
472             </varlistentry>
473
474             <varlistentry>
475               <term>pae</term>
476               <listitem>
477                 <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
478
479                 <para>
480                   A boolean option that specifies if the hypervisor
481                   should enabled PAE support for this instance. The
482                   default is false, disabling PAE support.
483                 </para>
484               </listitem>
485             </varlistentry>
486
487             <varlistentry>
488               <term>use_localtime</term>
489               <listitem>
490                 <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
491
492                 <para>
493                   A boolean option that specifies if the instance
494                   should be started with its clock set to the
495                   localtime of the machine (when true) or to the UTC
496                   (When false). The default is false, which is useful
497                   for Linux/Unix machines; for Windows OSes, it is
498                   recommended to enable this parameter.
499                 </para>
500               </listitem>
501             </varlistentry>
502
503             <varlistentry>
504               <term>kernel_path</term>
505               <listitem>
506                 <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
507
508                 <para>
509                   This option specifies the path (on the node) to the
510                   kernel to boot the instance with. Xen PVM instances
511                   always require this, while for KVM if this option is
512                   empty, it will cause the machine to load the kernel
513                   from its disks.
514                 </para>
515               </listitem>
516             </varlistentry>
517
518             <varlistentry>
519               <term>kernel_args</term>
520               <listitem>
521                 <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
522
523                 <para>
524                   This options specifies extra arguments to the kernel
525                   that will be loaded.  device. This is always used
526                   for Xen PVM, while for KVM it is only used if the
527                   <option>kernel_path</option> option is also
528                   specified.
529                 </para>
530
531                 <para>
532                   The default setting for this value is simply
533                   <constant>"ro"</constant>, which mounts the root
534                   disk (initially) in read-only one. For example,
535                   setting this to <userinput>single</userinput> will
536                   cause the instance to start in single-user mode.
537                 </para>
538               </listitem>
539             </varlistentry>
540
541             <varlistentry>
542               <term>initrd_path</term>
543               <listitem>
544                 <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
545
546                 <para>
547                   This option specifies the path (on the node) to the
548                   initrd to boot the instance with. Xen PVM instances
549                   can use this always, while for KVM if this option is
550                   only used if the <option>kernel_path</option> option
551                   is also specified. You can pass here either an
552                   absolute filename (the path to the initrd) if you
553                   want to use an initrd, or use the format
554                   <userinput>no_initrd_path</userinput> for no initrd.
555                 </para>
556               </listitem>
557             </varlistentry>
558
559             <varlistentry>
560               <term>root_path</term>
561               <listitem>
562                 <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
563
564                 <para>
565                   This options specifies the name of the root
566                   device. This is always needed for Xen PVM, while for
567                   KVM it is only used if the
568                   <option>kernel_path</option> option is also
569                   specified.
570                 </para>
571               </listitem>
572             </varlistentry>
573
574             <varlistentry>
575               <term>serial_console</term>
576               <listitem>
577                 <simpara>Valid for the KVM hypervisor.</simpara>
578
579                 <simpara>This boolean option specifies whether to
580                 emulate a serial console for the instance.</simpara>
581               </listitem>
582             </varlistentry>
583
584             <varlistentry>
585               <term>disk_cache</term>
586               <listitem>
587                 <simpara>Valid for the KVM hypervisor.</simpara>
588
589                 <simpara>The disk cache mode. It can be either
590                 <userinput>default</userinput> to not pass any cache
591                 option to KVM, or one of the KVM cache modes: none
592                 (for direct I/O), writethrough (to use the host cache
593                 but report completion to the guest only when the host
594                 has committed the changes to disk) or writeback (to
595                 use the host cache and report completion as soon as
596                 the data is in the host cache). Note that there are
597                 special considerations for the cache mode depending on
598                 version of KVM used and disk type (always raw file
599                 under Ganeti), please refer to the KVM documentation
600                 for more details.
601                 </simpara>
602               </listitem>
603             </varlistentry>
604
605             <varlistentry>
606               <term>security_model</term>
607               <listitem>
608                 <simpara>Valid for the KVM hypervisor.</simpara>
609
610                 <simpara>The security model for kvm. Currently one of
611                 <quote>none</quote>, <quote>user</quote> or
612                 <quote>pool</quote>. Under <quote>none</quote>, the
613                 default, nothing is done and instances are run as
614                 the Ganeti daemon user (normally root).
615                 </simpara>
616
617                 <simpara>Under <quote>user</quote> kvm will drop
618                 privileges and become the user specified by the
619                 security_domain parameter.
620                 </simpara>
621
622                 <simpara>Under <quote>pool</quote> a global cluster
623                 pool of users will be used, making sure no two
624                 instances share the same user on the same node.
625                 (this mode is not implemented yet)
626                 </simpara>
627
628               </listitem>
629             </varlistentry>
630
631             <varlistentry>
632               <term>security_domain</term>
633               <listitem>
634                 <simpara>Valid for the KVM hypervisor.</simpara>
635
636                 <simpara>Under security model <quote>user</quote> the username
637                 to run the instance under. It must be a valid username
638                 existing on the host.
639                 </simpara>
640                 <simpara>Cannot be set under security model <quote>none</quote>
641                 or <quote>pool</quote>.
642                 </simpara>
643
644               </listitem>
645             </varlistentry>
646
647             <varlistentry>
648               <term>kvm_flag</term>
649               <listitem>
650                 <simpara>Valid for the KVM hypervisor.</simpara>
651
652                 <simpara>If <quote>enabled</quote> the -enable-kvm flag is
653                 passed to kvm. If <quote>disabled</quote> -disable-kvm is
654                 passed. If unset no flag is passed, and the default running
655                 mode for your kvm binary will be used.
656                 </simpara>
657
658               </listitem>
659             </varlistentry>
660
661             <varlistentry>
662               <term>mem_path</term>
663               <listitem>
664                 <simpara>Valid for the KVM hypervisor.</simpara>
665
666                 <simpara>This option passes the -mem-path argument to kvm with
667                 the path (on the node) to the mount point of the hugetlbfs
668                 file system, along with the -mem-prealloc argument too.
669                 </simpara>
670
671               </listitem>
672             </varlistentry>
673
674             <varlistentry>
675               <term>use_chroot</term>
676               <listitem>
677                 <simpara>Valid for the KVM hypervisor.</simpara>
678
679                 <simpara>This boolean option determines wether to run the KVM
680                 instance in a chroot directory.
681                 </simpara>
682                 <para>If it is set to <quote>true</quote>, an empty directory
683                 is created before starting the instance and its path is passed via
684                 the -chroot flag to kvm.
685                 The directory is removed when the instance is stopped.
686                 </para>
687
688                 <simpara>It is set to <quote>false</quote> by default.</simpara>
689               </listitem>
690             </varlistentry>
691
692             <varlistentry>
693               <term>migration_downtime</term>
694               <listitem>
695                 <simpara>Valid for the KVM hypervisor.</simpara>
696
697                 <simpara>The maximum amount of time (in ms) a KVM instance is
698                 allowed to be frozen during a live migration, in order to copy
699                 dirty memory pages. Default value is 30ms, but you may need to
700                 increase this value for busy instances.
701                 </simpara>
702
703                 <simpara>This option is only effective with kvm versions >= 87
704                 and qemu-kvm versions >= 0.11.0.
705                 </simpara>
706               </listitem>
707             </varlistentry>
708
709             <varlistentry>
710               <term>use_chroot</term>
711               <listitem>
712                 <simpara>Valid for the KVM hypervisor.</simpara>
713
714                 <simpara>This boolean option determines wether to run the KVM
715                 instance in a chroot directory.
716                 </simpara>
717                 <para>If it is set to <quote>true</quote>, an empty directory
718                 is created before starting the instance and its path is passed
719                 via the <option>-chroot</option> flag to kvm.
720                 The directory is removed when the instance is stopped.
721                 </para>
722
723                 <simpara>It is set to <quote>false</quote> by default.</simpara>
724               </listitem>
725             </varlistentry>
726
727             <varlistentry>
728               <term>cpu_mask</term>
729               <listitem>
730                 <simpara>Valid for the LXC hypervisor.</simpara>
731
732                 <simpara>The processes belonging to the given instance are
733                 only scheduled on the specified CPUs.
734                 </simpara>
735
736                 <simpara>
737                 The parameter format is a comma-separated list of CPU IDs or
738                 CPU ID ranges. The ranges are defined by a lower and higher
739                 boundary, separated by a dash. The boundaries are inclusive.
740                 </simpara>
741
742               </listitem>
743             </varlistentry>
744
745             <varlistentry>
746               <term>usb_mouse</term>
747               <listitem>
748                 <simpara>Valid for the KVM hypervisor.</simpara>
749
750                 <simpara>This option specifies the usb mouse type to be used.
751                 It can be <quote>mouse</quote> or <quote>tablet</quote>. When
752                 using VNC it's recommended to set it to <quote>tablet</quote>.
753                 </simpara>
754               </listitem>
755             </varlistentry>
756
757           </variablelist>
758
759         </para>
760
761         <para>
762           The <option>--iallocator</option> option specifies the instance
763           allocator plugin to use. If you pass in this option the allocator
764           will select nodes for this instance automatically, so you don't need
765           to pass them with the <option>-n</option> option. For more
766           information please refer to the instance allocator documentation.
767         </para>
768
769         <para>
770           The <option>-t</option> options specifies the disk layout type for
771           the instance. The available choices are:
772           <variablelist>
773             <varlistentry>
774               <term>diskless</term>
775               <listitem>
776                 <para>
777                   This creates an instance with no disks. Its useful for
778                   testing only (or other special cases).
779                 </para>
780               </listitem>
781             </varlistentry>
782             <varlistentry>
783               <term>file</term>
784               <listitem>
785                 <para>Disk devices will be regular files.</para>
786               </listitem>
787             </varlistentry>
788             <varlistentry>
789               <term>plain</term>
790               <listitem>
791                 <para>Disk devices will be logical volumes.</para>
792               </listitem>
793             </varlistentry>
794             <varlistentry>
795               <term>drbd</term>
796               <listitem>
797                 <para>
798                   Disk devices will be drbd (version 8.x) on top of
799                   lvm volumes.
800                 </para>
801               </listitem>
802             </varlistentry>
803           </variablelist>
804         </para>
805
806         <para>
807           The optional second value of the <option>--node</option> is used for
808           the drbd template type and specifies the remote node.
809         </para>
810
811         <para>
812           If you do not want gnt-instance to wait for the disk mirror
813           to be synced, use the <option>--no-wait-for-sync</option>
814           option.
815         </para>
816
817         <para>
818           The <option>--file-storage-dir</option> specifies the relative path
819           under the cluster-wide file storage directory to store file-based
820           disks. It is useful for having different subdirectories for
821           different instances. The full path of the directory where the disk
822           files are stored will consist of cluster-wide file storage directory
823           + optional subdirectory + instance name. Example:
824           /srv/ganeti/file-storage/mysubdir/instance1.example.com. This option
825           is only relevant for instances using the file storage backend.
826         </para>
827
828         <para>
829           The <option>--file-driver</option> specifies the driver to use for
830           file-based disks. Note that currently these drivers work with the
831           xen hypervisor only. This option is only relevant for instances using
832           the file storage backend. The available choices are:
833           <variablelist>
834             <varlistentry>
835               <term>loop</term>
836               <listitem>
837                 <para>
838                   Kernel loopback driver. This driver uses loopback
839                   devices to access the filesystem within the
840                   file. However, running I/O intensive applications in
841                   your instance using the loop driver might result in
842                   slowdowns.  Furthermore, if you use the loopback
843                   driver consider increasing the maximum amount of
844                   loopback devices (on most systems it's 8) using the
845                   max_loop param.
846                 </para>
847               </listitem>
848             </varlistentry>
849             <varlistentry>
850               <term>blktap</term>
851               <listitem>
852                 <para>The blktap driver (for Xen hypervisors). In
853                 order to be able to use the blktap driver you should
854                 check if the 'blktapctrl' user space disk agent is
855                 running (usually automatically started via xend). This
856                 user-level disk I/O interface has the advantage of
857                 better performance. Especially if you use a network
858                 file system (e.g. NFS) to store your instances this is
859                 the recommended choice.
860                 </para>
861               </listitem>
862             </varlistentry>
863           </variablelist>
864         </para>
865
866         <para>
867           The <option>--submit</option> option is used to send the job to
868           the master daemon but not wait for its completion. The job
869           ID will be shown so that it can be examined via
870           <command>gnt-job info</command>.
871         </para>
872
873         <para>
874           Example:
875           <screen>
876 # gnt-instance add -t file --disk 0:size=30g -B memory=512 -o debian-etch \
877   -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
878 # gnt-instance add -t plain --disk 0:size=30g -B memory=512 -o debian-etch \
879   -n node1.example.com instance1.example.com
880 # gnt-instance add -t drbd --disk 0:size=30g -B memory=512 -o debian-etch \
881   -n node1.example.com:node2.example.com instance2.example.com
882           </screen>
883         </para>
884       </refsect3>
885
886       <refsect3>
887         <title>BATCH-CREATE</title>
888         <cmdsynopsis>
889           <command>batch-create</command>
890           <arg choice="req">instances_file.json</arg>
891         </cmdsynopsis>
892
893         <para>
894           This command (similar to the Ganeti 1.2
895           <command>batcher</command> tool) submits multiple instance
896           creation jobs based on a definition file. The instance
897           configurations do not encompass all the possible options for
898           the <command>add</command> command, but only a subset.
899         </para>
900
901         <para>
902           The instance file should be a valid-formed JSON file,
903           containing a dictionary with instance name and instance
904           parameters. The accepted parameters are:
905
906           <variablelist>
907             <varlistentry>
908               <term>disk_size</term>
909               <listitem>
910                 <simpara>The size of the disks of the instance.</simpara>
911               </listitem>
912             </varlistentry>
913             <varlistentry>
914               <term>disk_template</term>
915               <listitem>
916                 <simpara>The disk template to use for the instance,
917                 the same as in the <command>add</command>
918                 command.</simpara>
919               </listitem>
920             </varlistentry>
921             <varlistentry>
922               <term>backend</term>
923               <listitem>
924                 <simpara>A dictionary of backend parameters.</simpara>
925               </listitem>
926             </varlistentry>
927             <varlistentry>
928               <term>hypervisor</term>
929               <listitem>
930                 <simpara>A dictionary with a single key (the
931                 hypervisor name), and as value the hypervisor
932                 options. If not passed, the default hypervisor and
933                 hypervisor options will be inherited.</simpara>
934               </listitem>
935             </varlistentry>
936             <varlistentry>
937               <term>mac, ip, mode, link</term>
938               <listitem>
939                 <simpara>Specifications for the one NIC that will be
940                 created for the instance. 'bridge' is also accepted
941                 as a backwards compatibile key.</simpara>
942               </listitem>
943             </varlistentry>
944             <varlistentry>
945               <term>nics</term>
946               <listitem>
947                 <simpara>List of nics that will be created for the
948                 instance. Each entry should be a dict, with mac, ip, mode
949                 and link as possible keys. Please don't provide the "mac,
950                 ip, mode, link" parent keys if you use this method for
951                 specifying nics.</simpara>
952               </listitem>
953             </varlistentry>
954             <varlistentry>
955               <term>primary_node, secondary_node</term>
956               <listitem>
957                 <simpara>The primary and optionally the secondary node
958                 to use for the instance (in case an iallocator script
959                 is not used).</simpara>
960               </listitem>
961             </varlistentry>
962             <varlistentry>
963               <term>iallocator</term>
964               <listitem>
965                 <simpara>Instead of specifying the nodes, an
966                 iallocator script can be used to automatically compute
967                 them.</simpara>
968               </listitem>
969             </varlistentry>
970             <varlistentry>
971               <term>start</term>
972               <listitem>
973                 <simpara>whether to start the instance</simpara>
974               </listitem>
975             </varlistentry>
976             <varlistentry>
977               <term>ip_check</term>
978               <listitem>
979                 <simpara>Skip the check for already-in-use instance;
980                 see the description in the <command>add</command>
981                 command for details.</simpara>
982               </listitem>
983             </varlistentry>
984             <varlistentry>
985               <term>name_check</term>
986               <listitem>
987                 <simpara>Skip the name check for instances;
988                 see the description in the <command>add</command>
989                 command for details.</simpara>
990               </listitem>
991             </varlistentry>
992             <varlistentry>
993               <term>file_storage_dir, file_driver</term>
994               <listitem>
995                 <simpara>Configuration for the <literal>file</literal>
996                 disk type, see the <command>add</command> command for
997                 details.</simpara>
998               </listitem>
999             </varlistentry>
1000           </variablelist>
1001         </para>
1002
1003         <para>
1004           A simple definition for one instance can be (with most of
1005           the parameters taken from the cluster defaults):
1006           <screen>
1007 {
1008   "instance3": {
1009     "template": "drbd",
1010     "os": "debootstrap",
1011     "disk_size": ["25G"],
1012     "iallocator": "dumb"
1013   },
1014   "instance5": {
1015     "template": "drbd",
1016     "os": "debootstrap",
1017     "disk_size": ["25G"],
1018     "iallocator": "dumb",
1019     "hypervisor": "xen-hvm",
1020     "hvparams": {"acpi": true},
1021     "backend": {"memory": 512}
1022   }
1023 }
1024 </screen>
1025         </para>
1026
1027         <para>
1028           The command will display the job id for each submitted instance, as follows:
1029           <screen>
1030 # gnt-instance batch-create instances.json
1031 instance3: 11224
1032 instance5: 11225
1033 </screen>
1034         </para>
1035
1036       </refsect3>
1037
1038       <refsect3>
1039         <title>REMOVE</title>
1040
1041         <cmdsynopsis>
1042           <command>remove</command>
1043           <arg>--ignore-failures</arg>
1044           <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
1045           <arg>--submit</arg>
1046           <arg choice="req"><replaceable>instance</replaceable></arg>
1047         </cmdsynopsis>
1048
1049         <para>
1050           Remove an instance. This will remove all data from the
1051           instance and there is <emphasis>no way back</emphasis>. If
1052           you are not sure if you use an instance again, use
1053           <command>shutdown</command> first and leave it in the
1054           shutdown state for a while.
1055
1056         </para>
1057
1058         <para>
1059           The <option>--ignore-failures</option> option will cause the
1060           removal to proceed even in the presence of errors during the
1061           removal of the instance (e.g. during the shutdown or the
1062           disk removal). If this option is not given, the command will
1063           stop at the first error.
1064         </para>
1065
1066         <para>
1067           The <option>--shutdown-timeout</option> is used to specify how
1068           much time to wait before forcing the shutdown (xm destroy in xen,
1069           killing the kvm process, for kvm). By default two minutes are
1070           given to each instance to stop.
1071         </para>
1072
1073         <para>
1074           The <option>--submit</option> option is used to send the job to
1075           the master daemon but not wait for its completion. The job
1076           ID will be shown so that it can be examined via
1077           <command>gnt-job info</command>.
1078         </para>
1079
1080         <para>
1081           Example:
1082           <screen>
1083 # gnt-instance remove instance1.example.com
1084           </screen>
1085         </para>
1086       </refsect3>
1087
1088       <refsect3>
1089         <title>LIST</title>
1090
1091         <cmdsynopsis>
1092           <command>list</command>
1093           <arg>--no-headers</arg>
1094           <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
1095           <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
1096           <arg>--roman</arg>
1097           <arg rep="repeat">instance</arg>
1098         </cmdsynopsis>
1099
1100         <para>
1101           Shows the currently configured instances with memory usage,
1102           disk usage, the node they are running on, and their run
1103           status.
1104         </para>
1105
1106         <para>
1107           The <option>--no-headers</option> option will skip the
1108           initial header line. The <option>--separator</option> option
1109           takes an argument which denotes what will be used between
1110           the output fields. Both these options are to help scripting.
1111         </para>
1112
1113         <para>
1114           The <option>--roman</option> option allows latin people to better
1115           understand the cluster instances' status.
1116         </para>
1117
1118         <para>
1119           The <option>-o</option> option takes a comma-separated list
1120           of output fields. The available fields and their meaning
1121           are:
1122           <variablelist>
1123             <varlistentry>
1124               <term>name</term>
1125               <listitem>
1126                 <simpara>the instance name</simpara>
1127               </listitem>
1128             </varlistentry>
1129             <varlistentry>
1130               <term>os</term>
1131               <listitem>
1132                 <simpara>the OS of the instance</simpara>
1133               </listitem>
1134             </varlistentry>
1135             <varlistentry>
1136               <term>pnode</term>
1137               <listitem>
1138                 <simpara>the primary node of the instance</simpara>
1139               </listitem>
1140             </varlistentry>
1141             <varlistentry>
1142               <term>snodes</term>
1143               <listitem>
1144                 <simpara>comma-separated list of secondary nodes for the
1145                   instance; usually this will be just one node</simpara>
1146               </listitem>
1147             </varlistentry>
1148             <varlistentry>
1149               <term>admin_state</term>
1150               <listitem>
1151                 <simpara>the desired state of the instance (either "yes"
1152                   or "no" denoting the instance should run or
1153                   not)</simpara>
1154               </listitem>
1155             </varlistentry>
1156             <varlistentry>
1157               <term>disk_template</term>
1158               <listitem>
1159                 <simpara>the disk template of the instance</simpara>
1160               </listitem>
1161             </varlistentry>
1162             <varlistentry>
1163               <term>oper_state</term>
1164               <listitem>
1165                 <simpara>the actual state of the instance; can be
1166                 one of the values "running", "stopped", "(node
1167                 down)"</simpara>
1168               </listitem>
1169             </varlistentry>
1170             <varlistentry>
1171               <term>status</term>
1172               <listitem>
1173                 <simpara>combined form of admin_state and oper_stat;
1174                 this can be one of:
1175                 <computeroutput>ERROR_nodedown</computeroutput> if the
1176                 node of the instance is down,
1177                 <computeroutput>ERROR_down</computeroutput> if the
1178                 instance should run but is down,
1179                 <computeroutput>ERROR_up</computeroutput> if the
1180                 instance should be stopped but is actually running,
1181                 <computeroutput>ADMIN_down</computeroutput> if the
1182                 instance has been stopped (and is stopped) and
1183                 <computeroutput>running</computeroutput> if the
1184                 instance is set to be running (and is
1185                 running)</simpara>
1186               </listitem>
1187             </varlistentry>
1188             <varlistentry>
1189               <term>oper_ram</term>
1190               <listitem>
1191                 <simpara>the actual memory usage of the instance as seen
1192                   by the hypervisor</simpara>
1193               </listitem>
1194             </varlistentry>
1195             <varlistentry>
1196               <term>oper_vcpus</term>
1197               <listitem>
1198                 <simpara>the actual number of VCPUs the instance is using
1199                   as seen by the hypervisor</simpara>
1200               </listitem>
1201             </varlistentry>
1202             <varlistentry>
1203               <term>ip</term>
1204               <listitem>
1205                 <simpara>the ip address Ganeti recognizes as associated with
1206                 the first instance interface</simpara>
1207               </listitem>
1208             </varlistentry>
1209             <varlistentry>
1210               <term>mac</term>
1211               <listitem>
1212                 <simpara>the first instance interface MAC address</simpara>
1213               </listitem>
1214             </varlistentry>
1215
1216             <varlistentry>
1217               <term>nic_mode</term>
1218               <listitem>
1219                 <simpara>the mode of the first instance NIC
1220                 (routed or bridged)</simpara>
1221               </listitem>
1222             </varlistentry>
1223             <varlistentry>
1224               <term>nic_link</term>
1225               <listitem>
1226                 <simpara>the link of the first instance NIC
1227                 </simpara>
1228               </listitem>
1229             </varlistentry>
1230             <varlistentry>
1231               <term>sda_size</term>
1232               <listitem>
1233                 <simpara>the size of the instance's first disk</simpara>
1234               </listitem>
1235             </varlistentry>
1236             <varlistentry>
1237               <term>sdb_size</term>
1238               <listitem>
1239                 <simpara>the size of the instance's second disk, if
1240                 any</simpara>
1241               </listitem>
1242             </varlistentry>
1243             <varlistentry>
1244               <term>vcpus</term>
1245               <listitem>
1246                 <simpara>the number of VCPUs allocated to the
1247                 instance</simpara>
1248               </listitem>
1249             </varlistentry>
1250             <varlistentry>
1251               <term>tags</term>
1252               <listitem>
1253                 <simpara>comma-separated list of the instances's
1254                 tags</simpara>
1255               </listitem>
1256             </varlistentry>
1257             <varlistentry>
1258               <term>serial_no</term>
1259               <listitem>
1260                 <simpara>the so called 'serial number' of the
1261                 instance; this is a numeric field that is incremented
1262                 each time the instance is modified, and it can be used
1263                 to track modifications</simpara>
1264               </listitem>
1265             </varlistentry>
1266             <varlistentry>
1267               <term>ctime</term>
1268               <listitem>
1269                 <para>
1270                   the creation time of the instance; note that this
1271                   field contains spaces and as such it's harder to
1272                   parse
1273                 </para>
1274                 <para>
1275                   if this attribute is not present (e.g. when
1276                   upgrading from older versions), then "N/A" will be
1277                   shown instead
1278                 </para>
1279               </listitem>
1280             </varlistentry>
1281             <varlistentry>
1282               <term>mtime</term>
1283               <listitem>
1284                 <para>
1285                   the last modification time of the instance; note
1286                   that this field contains spaces and as such it's
1287                   harder to parse
1288                 </para>
1289                 <para>
1290                   if this attribute is not present (e.g. when
1291                   upgrading from older versions), then "N/A" will be
1292                   shown instead
1293                 </para>
1294               </listitem>
1295             </varlistentry>
1296
1297             <varlistentry>
1298               <term>uuid</term>
1299               <listitem>
1300                 <simpara>Show the UUID of the instance (generated
1301                 automatically by Ganeti)</simpara>
1302               </listitem>
1303             </varlistentry>
1304
1305             <varlistentry>
1306               <term>network_port</term>
1307               <listitem>
1308                 <simpara>If the instance has a network port assigned
1309                 to it (e.g. for VNC connections), this will be shown,
1310                 otherwise <literal>-</literal> will be
1311                 displayed.</simpara>
1312               </listitem>
1313             </varlistentry>
1314             <varlistentry>
1315               <term>beparams</term>
1316               <listitem>
1317                 <simpara>A text format of the entire beparams for the
1318                 instance. It's more useful to select individual fields
1319                 from this dictionary, see below.</simpara>
1320               </listitem>
1321             </varlistentry>
1322             <varlistentry>
1323               <term>disk.count</term>
1324               <listitem>
1325                 <simpara>The number of instance disks.</simpara>
1326               </listitem>
1327             </varlistentry>
1328             <varlistentry>
1329               <term>disk.size/N</term>
1330               <listitem>
1331                 <simpara>The size of the instance's Nth disk. This is
1332                 a more generic form of the <literal>sda_size</literal>
1333                 and <literal>sdb_size</literal> fields.</simpara>
1334               </listitem>
1335             </varlistentry>
1336             <varlistentry>
1337               <term>disk.sizes</term>
1338               <listitem>
1339                 <simpara>A comma-separated list of the disk sizes for
1340                 this instance.</simpara>
1341               </listitem>
1342             </varlistentry>
1343             <varlistentry>
1344               <term>disk_usage</term>
1345               <listitem>
1346                 <simpara>The total disk space used by this instance on
1347                 each of its nodes. This is not the instance-visible
1348                 disk size, but the actual disk "cost" of the
1349                 instance.</simpara>
1350               </listitem>
1351             </varlistentry>
1352             <varlistentry>
1353               <term>nic.mac/N</term>
1354               <listitem>
1355                 <simpara>The MAC of the Nth instance NIC.</simpara>
1356               </listitem>
1357             </varlistentry>
1358             <varlistentry>
1359               <term>nic.ip/N</term>
1360               <listitem>
1361                 <simpara>The IP address of the Nth instance NIC.</simpara>
1362               </listitem>
1363             </varlistentry>
1364             <varlistentry>
1365               <term>nic.mode/N</term>
1366               <listitem>
1367                 <simpara>The mode of the Nth instance NIC</simpara>
1368               </listitem>
1369             </varlistentry>
1370             <varlistentry>
1371               <term>nic.link/N</term>
1372               <listitem>
1373                 <simpara>The link of the Nth instance NIC</simpara>
1374               </listitem>
1375             </varlistentry>
1376             <varlistentry>
1377               <term>nic.macs</term>
1378               <listitem>
1379                 <simpara>A comma-separated list of all the MACs of the
1380                 instance's NICs.</simpara>
1381               </listitem>
1382             </varlistentry>
1383             <varlistentry>
1384               <term>nic.ips</term>
1385               <listitem>
1386                 <simpara>A comma-separated list of all the IP
1387                 addresses of the instance's NICs.</simpara>
1388               </listitem>
1389             </varlistentry>
1390             <varlistentry>
1391               <term>nic.modes</term>
1392               <listitem>
1393                 <simpara>A comma-separated list of all the modes of the
1394                 instance's NICs.</simpara>
1395               </listitem>
1396             </varlistentry>
1397             <varlistentry>
1398               <term>nic.links</term>
1399               <listitem>
1400                 <simpara>A comma-separated list of all the link parameters
1401                 of the instance's NICs.</simpara>
1402               </listitem>
1403             </varlistentry>
1404             <varlistentry>
1405               <term>nic.count</term>
1406               <listitem>
1407                 <simpara>The number of instance nics.</simpara>
1408               </listitem>
1409             </varlistentry>
1410             <varlistentry>
1411               <term>hv/<replaceable>NAME</replaceable></term>
1412               <listitem>
1413                 <simpara>The value of the hypervisor parameter called
1414                 <replaceable>NAME</replaceable>. For details of what
1415                 hypervisor parameters exist and their meaning, see the
1416                 <command>add</command> command.</simpara>
1417               </listitem>
1418             </varlistentry>
1419             <varlistentry>
1420               <term>be/memory</term>
1421               <listitem>
1422                 <simpara>The configured memory for the instance.</simpara>
1423               </listitem>
1424             </varlistentry>
1425             <varlistentry>
1426               <term>be/vcpus</term>
1427               <listitem>
1428                 <simpara>The configured number of VCPUs for the
1429                 instance.</simpara>
1430               </listitem>
1431             </varlistentry>
1432             <varlistentry>
1433               <term>be/auto_balance</term>
1434               <listitem>
1435                 <simpara>Whether the instance is considered in N+1
1436                 checks.</simpara>
1437               </listitem>
1438             </varlistentry>
1439           </variablelist>
1440         </para>
1441
1442         <para>
1443           If the value of the option starts with the character
1444           <constant>+</constant>, the new field(s) will be added to the
1445           default list. This allows to quickly see the default list
1446           plus a few other fields, instead of retyping the entire list
1447           of fields.
1448         </para>
1449
1450         <para>
1451           There is a subtle grouping about the available output
1452           fields: all fields except for <option>oper_state</option>,
1453           <option>oper_ram</option>, <option>oper_vcpus</option> and
1454           <option>status</option> are
1455           configuration value and not run-time values. So if you don't
1456           select any of the these fields, the query will be satisfied
1457           instantly from the cluster configuration, without having to
1458           ask the remote nodes for the data. This can be helpful for
1459           big clusters when you only want some data and it makes sense
1460           to specify a reduced set of output fields.
1461         </para>
1462
1463         <para>The default output field list is:
1464           <simplelist type="inline">
1465             <member>name</member>
1466             <member>os</member>
1467             <member>pnode</member>
1468             <member>admin_state</member>
1469             <member>oper_state</member>
1470             <member>oper_ram</member>
1471           </simplelist>.
1472         </para>
1473       </refsect3>
1474
1475       <refsect3>
1476         <title>INFO</title>
1477
1478         <cmdsynopsis>
1479           <command>info</command>
1480           <group>
1481             <arg>-s</arg>
1482             <arg>--static</arg>
1483           </group>
1484           <arg>--roman</arg>
1485           <group choice="req">
1486             <arg>--all</arg>
1487             <arg rep="repeat"><replaceable>instance</replaceable></arg>
1488           </group>
1489         </cmdsynopsis>
1490
1491         <para>
1492           Show detailed information about the given instance(s). This is
1493           different from <command>list</command> as it shows detailed data
1494           about the instance's disks (especially useful for the drbd disk
1495           template).
1496         </para>
1497
1498         <para>
1499           If the option <option>-s</option> is used, only information
1500           available in the configuration file is returned, without
1501           querying nodes, making the operation faster.
1502         </para>
1503
1504         <para>
1505           Use the <option>--all</option> to get info about all instances,
1506           rather than explicitly passing the ones you're interested in.
1507         </para>
1508
1509         <para>
1510           The <option>--roman</option> option can be used to cause envy among
1511           people who like ancient cultures, but are stuck with non-latin-friendly
1512           cluster virtualization technologies.
1513         </para>
1514
1515       </refsect3>
1516
1517       <refsect3>
1518         <title>MODIFY</title>
1519
1520         <cmdsynopsis>
1521           <command>modify</command>
1522           <sbr>
1523           <arg choice="opt">-H <replaceable>HYPERVISOR_PARAMETERS</replaceable></arg>
1524           <sbr>
1525           <arg choice="opt">-B <replaceable>BACKEND_PARAMETERS</replaceable></arg>
1526           <sbr>
1527           <group>
1528             <arg>--net add<replaceable><optional>:options</optional></replaceable></arg>
1529             <arg>--net remove</arg>
1530             <arg>--net <replaceable>N:options</replaceable></arg>
1531           </group>
1532           <sbr>
1533           <group>
1534             <arg>--disk add:size=<replaceable>SIZE</replaceable></arg>
1535             <arg>--disk remove</arg>
1536             <arg>--disk <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></arg>
1537           </group>
1538
1539           <sbr>
1540           <arg>-t<group choice="req">
1541               <arg>plain</arg>
1542               <arg>drbd</arg>
1543             </group></arg>
1544
1545           <sbr>
1546             <arg>--os-name=<replaceable>OS</replaceable> <arg>--force-variant</arg></arg>
1547
1548           <sbr>
1549           <arg>--submit</arg>
1550           <sbr>
1551           <arg choice="req"><replaceable>instance</replaceable></arg>
1552         </cmdsynopsis>
1553
1554         <para>
1555           Modifies the memory size, number of vcpus, ip address, MAC
1556           address and/or nic parameters for an instance. It can also
1557           add and remove disks and NICs to/from the instance. Note
1558           that you need to give at least one of the arguments, otherwise
1559           the command complains.
1560         </para>
1561
1562         <para>
1563           The <option>-H</option> option specifies hypervisor options
1564           in the form of <userinput>name=value[,...]</userinput>. For details which options can be specified, see the <command>add</command> command.
1565         </para>
1566
1567         <para>
1568           The <option>-t</option> option will change the disk template
1569           of the instance. Currently only conversions between the
1570           plain and drbd disk templates are supported, and the
1571           instance must be stopped before attempting the conversion.
1572         </para>
1573
1574         <para>
1575           The <option>--disk
1576           add:size=<replaceable>SIZE</replaceable></option> option
1577           adds a disk to the instance. The <option>--disk
1578           remove</option> will remove the last disk of the
1579           instance. The <option>--disk
1580           <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></option>
1581           option will change the mode of the Nth disk of the instance
1582           between read-only (<literal>ro</literal>) and read-write
1583           (<literal>rw</literal>).
1584         </para>
1585
1586         <para>
1587           The <option>--net
1588           add:<replaceable>options</replaceable></option> option will
1589           add a new NIC to the instance. The available options are the
1590           same as in the <command>add</command> command (mac, ip, link,
1591           mode). The <option>--net remove</option> will remove the
1592           last NIC of the instance, while the <option>--net
1593           <replaceable>N</replaceable>:<replaceable>options</replaceable></option>
1594           option will change the parameters of the Nth instance NIC.
1595         </para>
1596
1597         <para>
1598           The option <option>--os-name</option> will change the OS
1599           name for the instance (without reinstallation). In case an
1600           OS variant is specified that is not found, then by default
1601           the modification is refused,
1602           unless <option>--force-variant</option> is passed. An
1603           invalid OS will also be refused, unless
1604           the <option>--force</option> option is given.
1605         </para>
1606
1607         <para>
1608           The <option>--submit</option> option is used to send the job to
1609           the master daemon but not wait for its completion. The job
1610           ID will be shown so that it can be examined via
1611           <command>gnt-job info</command>.
1612         </para>
1613
1614         <para>
1615           All the changes take effect at the next restart. If the
1616           instance is running, there is no effect on the instance.
1617         </para>
1618       </refsect3>
1619
1620       <refsect3>
1621         <title>REINSTALL</title>
1622
1623         <cmdsynopsis>
1624           <command>reinstall</command>
1625           <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
1626           <arg>--select-os</arg>
1627           <arg choice="opt">-f <replaceable>force</replaceable></arg>
1628           <arg>--force-multiple</arg>
1629           <sbr>
1630           <group choice="opt">
1631             <arg>--instance</arg>
1632             <arg>--node</arg>
1633             <arg>--primary</arg>
1634             <arg>--secondary</arg>
1635             <arg>--all</arg>
1636           </group>
1637           <arg>--submit</arg>
1638           <arg choice="opt" rep="repeat"><replaceable>instance</replaceable></arg>
1639         </cmdsynopsis>
1640
1641         <para>
1642           Reinstalls the operating system on the given instance(s). The
1643           instance(s) must be stopped when running this command. If the
1644           <option>--os-type</option> is specified, the operating
1645           system is changed.
1646         </para>
1647
1648         <para>
1649           The <option>--select-os</option> option switches to an
1650           interactive OS reinstall. The user is prompted to select the OS
1651           template from the list of available OS templates.
1652         </para>
1653
1654         <para>
1655           Since this is a potentially dangerous command, the user will
1656           be required to confirm this action, unless the
1657           <option>-f</option> flag is passed. When multiple instances
1658           are selected (either by passing multiple arguments or by
1659           using the <option>--node</option>,
1660           <option>--primary</option>, <option>--secondary</option> or
1661           <option>--all</option> options), the user must pass the
1662           <option>--force-multiple</option> options to skip the
1663           interactive confirmation.
1664         </para>
1665
1666         <para>
1667           The <option>--submit</option> option is used to send the job to
1668           the master daemon but not wait for its completion. The job
1669           ID will be shown so that it can be examined via
1670           <command>gnt-job info</command>.
1671         </para>
1672
1673
1674       </refsect3>
1675
1676       <refsect3>
1677         <title>RENAME</title>
1678
1679         <cmdsynopsis>
1680           <command>rename</command>
1681           <arg>--no-ip-check</arg>
1682           <arg>--no-name-check</arg>
1683           <arg>--submit</arg>
1684           <arg choice="req"><replaceable>instance</replaceable></arg>
1685           <arg choice="req"><replaceable>new_name</replaceable></arg>
1686         </cmdsynopsis>
1687
1688         <para>
1689           Renames the given instance. The instance must be stopped
1690           when running this command. The requirements for the new name
1691           are the same as for adding an instance: the new name must be
1692           resolvable and the IP it resolves to must not be reachable
1693           (in order to prevent duplicate IPs the next time the
1694           instance is started). The IP test can be skipped if the
1695           <option>--no-ip-check</option> option is passed.
1696         </para>
1697
1698         <para>
1699           The <option>--no-name-check</option> skips the check for the
1700           new instance name via the resolver (e.g. in DNS or /etc/hosts,
1701           depending on your setup). Since the name check is used to
1702           compute the IP address, if you pass this option you must
1703           also pass the <option>--no-ip-check</option> option.
1704         </para>
1705
1706         <para>
1707           The <option>--submit</option> option is used to send the job to
1708           the master daemon but not wait for its completion. The job
1709           ID will be shown so that it can be examined via
1710           <command>gnt-job info</command>.
1711         </para>
1712
1713       </refsect3>
1714
1715     </refsect2>
1716
1717     <refsect2>
1718       <title>Starting/stopping/connecting to console</title>
1719
1720       <refsect3>
1721         <title>STARTUP</title>
1722
1723         <cmdsynopsis>
1724           <command>startup</command>
1725           <sbr>
1726           <arg>--force</arg>
1727           <sbr>
1728           <arg>--force-multiple</arg>
1729           <sbr>
1730           <group choice="opt">
1731             <arg>--instance</arg>
1732             <arg>--node</arg>
1733             <arg>--primary</arg>
1734             <arg>--secondary</arg>
1735             <arg>--all</arg>
1736             <arg>--tags</arg>
1737             <arg>--node-tags</arg>
1738             <arg>--pri-node-tags</arg>
1739             <arg>--sec-node-tags</arg>
1740           </group>
1741           <sbr>
1742           <arg>-H <option>key=value...</option></arg>
1743           <arg>-B <option>key=value...</option></arg>
1744           <sbr>
1745           <arg>--submit</arg>
1746           <sbr>
1747           <arg choice="opt"
1748           rep="repeat"><replaceable>name</replaceable></arg>
1749         </cmdsynopsis>
1750
1751         <para>
1752           Starts one or more instances, depending on the following
1753           options. The four available modes are:
1754           <variablelist>
1755             <varlistentry>
1756               <term><option>--instance</option></term>
1757               <listitem>
1758                 <simpara>will start the instances given as arguments
1759                 (at least one argument required); this is the default
1760                 selection</simpara>
1761               </listitem>
1762             </varlistentry>
1763             <varlistentry>
1764               <term>--node</term>
1765               <listitem>
1766                 <simpara>will start the instances who have the given
1767                 node as either primary or secondary</simpara>
1768               </listitem>
1769             </varlistentry>
1770             <varlistentry>
1771               <term><option>--primary</option></term>
1772               <listitem>
1773                 <simpara>will start all instances whose primary node
1774                 is in the list of nodes passed as arguments (at least
1775                 one node required)</simpara>
1776               </listitem>
1777             </varlistentry>
1778             <varlistentry>
1779               <term><option>--secondary</option></term>
1780               <listitem>
1781                 <simpara>will start all instances whose secondary node
1782                 is in the list of nodes passed as arguments (at least
1783                 one node required)</simpara>
1784               </listitem>
1785             </varlistentry>
1786             <varlistentry>
1787               <term>--all</term>
1788               <listitem>
1789                 <simpara>will start all instances in the cluster (no
1790                 arguments accepted)</simpara>
1791               </listitem>
1792             </varlistentry>
1793             <varlistentry>
1794               <term>--tags</term>
1795               <listitem>
1796                 <simpara>will start all instances in the cluster with
1797                 the tags given as arguments</simpara>
1798               </listitem>
1799             </varlistentry>
1800             <varlistentry>
1801               <term>--node-tags</term>
1802               <listitem>
1803                 <simpara>will start all instances in the cluster on
1804                 nodes with the tags given as arguments</simpara>
1805               </listitem>
1806             </varlistentry>
1807             <varlistentry>
1808               <term>--pri-node-tags</term>
1809               <listitem>
1810                 <simpara>will start all instances in the cluster on
1811                 primary nodes with the tags given as
1812                 arguments</simpara>
1813               </listitem>
1814             </varlistentry>
1815             <varlistentry>
1816               <term>--sec-node-tags</term>
1817               <listitem>
1818                 <simpara>will start all instances in the cluster on
1819                 secondary nodes with the tags given as
1820                 arguments</simpara>
1821               </listitem>
1822             </varlistentry>
1823           </variablelist>
1824         </para>
1825
1826         <para>
1827           Note that although you can pass more than one selection
1828           option, the last one wins, so in order to guarantee the
1829           desired result, don't pass more than one such option.
1830         </para>
1831
1832         <para>
1833           Use <option>--force</option> to start even if secondary disks are
1834           failing.
1835         </para>
1836
1837         <para>
1838           The <option>--force-multiple</option> will skip the
1839           interactive confirmation in the case the more than one
1840           instance will be affected.
1841         </para>
1842
1843         <para>
1844           The <option>-H</option> and <option>-B</option> options
1845           specify temporary hypervisor and backend parameters that can
1846           be used to start an instance with modified parameters. They
1847           can be useful for quick testing without having to modify an
1848           instance back and forth, e.g.:
1849           <screen>
1850 # gnt-instance start -H root_args="single" instance1
1851 # gnt-instance start -B memory=2048 instance2
1852           </screen>
1853           The first form will start the instance
1854           <userinput>instance1</userinput> in single-user mode, and
1855           the instance <userinput>instance2</userinput> with 2GB of
1856           RAM (this time only, unless that is the actual instance
1857           memory size already). Note that the values override the
1858           instance parameters (and not extend them): an instance with
1859           "root_args=ro" when started with <userinput>-H
1860           root_args=single</userinput> will result in "single", not
1861           "ro single".
1862         </para>
1863
1864         <para>
1865           The <option>--submit</option> option is used to send the job to
1866           the master daemon but not wait for its completion. The job
1867           ID will be shown so that it can be examined via
1868           <command>gnt-job info</command>.
1869         </para>
1870
1871         <para>
1872           Example:
1873           <screen>
1874 # gnt-instance start instance1.example.com
1875 # gnt-instance start --node node1.example.com node2.example.com
1876 # gnt-instance start --all
1877           </screen>
1878         </para>
1879       </refsect3>
1880
1881       <refsect3>
1882         <title>SHUTDOWN</title>
1883
1884         <cmdsynopsis>
1885           <command>shutdown</command>
1886           <sbr>
1887           <arg>--timeout=<replaceable>N</replaceable></arg>
1888           <sbr>
1889           <arg>--force-multiple</arg>
1890           <sbr>
1891           <group choice="opt">
1892             <arg>--instance</arg>
1893             <arg>--node</arg>
1894             <arg>--primary</arg>
1895             <arg>--secondary</arg>
1896             <arg>--all</arg>
1897             <arg>--tags</arg>
1898             <arg>--node-tags</arg>
1899             <arg>--pri-node-tags</arg>
1900             <arg>--sec-node-tags</arg>
1901           </group>
1902           <sbr>
1903           <arg>--submit</arg>
1904           <sbr>
1905           <arg choice="opt"
1906           rep="repeat"><replaceable>name</replaceable></arg>
1907         </cmdsynopsis>
1908
1909         <para>
1910           Stops one or more instances. If the instance cannot be
1911           cleanly stopped during a hardcoded interval (currently 2
1912           minutes), it will forcibly stop the instance (equivalent to
1913           switching off the power on a physical machine).
1914         </para>
1915
1916         <para>
1917           The <option>--timeout</option> is used to specify how much time to
1918           wait before forcing the shutdown (xm destroy in xen, killing the kvm
1919           process, for kvm). By default two minutes are given to each instance
1920           to stop.
1921         </para>
1922
1923         <para>
1924           The <option>--instance</option>, <option>--node</option>,
1925           <option>--primary</option>, <option>--secondary</option>,
1926           <option>--all</option>, <option>--tags</option>,
1927           <option>--node-tags</option>, <option>--pri-node-tags</option> and
1928           <option>--sec-node-tags</option> options are similar as for the
1929           <command>startup</command> command and they influence the
1930           actual instances being shutdown.
1931         </para>
1932
1933         <para>
1934           The <option>--submit</option> option is used to send the job to
1935           the master daemon but not wait for its completion. The job
1936           ID will be shown so that it can be examined via
1937           <command>gnt-job info</command>.
1938         </para>
1939
1940
1941         <para>
1942           Example:
1943           <screen>
1944 # gnt-instance shutdown instance1.example.com
1945 # gnt-instance shutdown --all
1946           </screen>
1947         </para>
1948       </refsect3>
1949
1950       <refsect3>
1951         <title>REBOOT</title>
1952
1953         <cmdsynopsis>
1954           <command>reboot</command>
1955           <sbr>
1956           <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
1957           <sbr>
1958           <arg>--ignore-secondaries</arg>
1959           <sbr>
1960           <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
1961           <sbr>
1962           <arg>--force-multiple</arg>
1963           <sbr>
1964           <group choice="opt">
1965             <arg>--instance</arg>
1966             <arg>--node</arg>
1967             <arg>--primary</arg>
1968             <arg>--secondary</arg>
1969             <arg>--all</arg>
1970             <arg>--tags</arg>
1971             <arg>--node-tags</arg>
1972             <arg>--pri-node-tags</arg>
1973             <arg>--sec-node-tags</arg>
1974           </group>
1975           <sbr>
1976           <arg>--submit</arg>
1977           <sbr>
1978           <arg choice="opt"
1979           rep="repeat"><replaceable>name</replaceable></arg>
1980         </cmdsynopsis>
1981
1982         <para>
1983           Reboots one or more instances. The type of reboot depends on
1984           the value of <option>--type</option>. A soft reboot does a
1985           hypervisor reboot, a hard reboot does a instance stop,
1986           recreates the hypervisor config for the instance and
1987           starts the instance. A full reboot does the equivalent
1988           of <command>gnt-instance shutdown &amp;&amp; gnt-instance
1989           startup</command>. The default is hard reboot.
1990         </para>
1991
1992         <para>
1993           For the hard reboot the option
1994           <option>--ignore-secondaries</option> ignores errors for the
1995           secondary node while re-assembling the instance disks.
1996         </para>
1997
1998         <para>
1999           The <option>--instance</option>, <option>--node</option>,
2000           <option>--primary</option>, <option>--secondary</option>,
2001           <option>--all</option>, <option>--tags</option>,
2002           <option>--node-tags</option>, <option>--pri-node-tags</option> and
2003           <option>--sec-node-tags</option> options are similar as for the
2004           <command>startup</command> command and they influence the
2005           actual instances being rebooted.
2006         </para>
2007
2008         <para>
2009           The <option>--shutdown-timeout</option> is used to specify how
2010           much time to wait before forcing the shutdown (xm destroy in xen,
2011           killing the kvm process, for kvm). By default two minutes are
2012           given to each instance to stop.
2013         </para>
2014
2015         <para>
2016           The <option>--force-multiple</option> will skip the
2017           interactive confirmation in the case the more than one
2018           instance will be affected.
2019         </para>
2020
2021         <para>
2022           Example:
2023           <screen>
2024 # gnt-instance reboot instance1.example.com
2025 # gnt-instance reboot --type=full instance1.example.com
2026           </screen>
2027         </para>
2028       </refsect3>
2029
2030       <refsect3>
2031         <title>CONSOLE</title>
2032         <cmdsynopsis>
2033           <command>console</command>
2034           <arg choice="opt">--show-cmd</arg>
2035           <arg choice="req"><replaceable>instance</replaceable></arg>
2036         </cmdsynopsis>
2037
2038         <para>
2039           Connects to the console of the given instance. If the
2040           instance is not up, an error is returned. Use the
2041           <option>--show-cmd</option> option to display the command
2042           instead of executing it.
2043         </para>
2044
2045         <para>
2046           For HVM instances, this will attempt to connect to the
2047           serial console of the instance. To connect to the
2048           virtualized "physical" console of a HVM instance, use a VNC
2049           client with the connection info from the
2050           <command>info</command> command.
2051         </para>
2052
2053         <para>
2054           Example:
2055           <screen>
2056 # gnt-instance console instance1.example.com
2057           </screen>
2058         </para>
2059       </refsect3>
2060
2061     </refsect2>
2062
2063     <refsect2>
2064       <title>Disk management</title>
2065
2066       <refsect3>
2067         <title>REPLACE-DISKS</title>
2068
2069         <cmdsynopsis>
2070           <command>replace-disks</command>
2071           <arg>--submit</arg>
2072           <arg>--early-release</arg>
2073           <arg choice="req">-p</arg>
2074           <arg>--disks <replaceable>idx</replaceable></arg>
2075           <arg choice="req"><replaceable>instance</replaceable></arg>
2076         </cmdsynopsis>
2077
2078         <cmdsynopsis>
2079           <command>replace-disks</command>
2080           <arg>--submit</arg>
2081           <arg>--early-release</arg>
2082           <arg choice="req">-s</arg>
2083           <arg>--disks <replaceable>idx</replaceable></arg>
2084           <arg choice="req"><replaceable>instance</replaceable></arg>
2085         </cmdsynopsis>
2086
2087         <cmdsynopsis>
2088           <command>replace-disks</command>
2089           <arg>--submit</arg>
2090           <arg>--early-release</arg>
2091           <group choice="req">
2092             <arg>--iallocator <replaceable>name</replaceable></arg>
2093             <arg>--new-secondary <replaceable>NODE</replaceable></arg>
2094           </group>
2095
2096           <arg choice="req"><replaceable>instance</replaceable></arg>
2097         </cmdsynopsis>
2098
2099         <cmdsynopsis>
2100           <command>replace-disks</command>
2101           <arg>--submit</arg>
2102           <arg>--early-release</arg>
2103           <arg choice="req">--auto</arg>
2104           <arg choice="req"><replaceable>instance</replaceable></arg>
2105         </cmdsynopsis>
2106
2107         <para>
2108           This command is a generalized form for replacing disks. It
2109           is currently only valid for the mirrored (DRBD) disk
2110           template.
2111         </para>
2112
2113         <para>
2114           The first form (when passing the <option>-p</option> option)
2115           will replace the disks on the primary, while the second form
2116           (when passing the <option>-s</option> option will replace
2117           the disks on the secondary node. For these two cases (as the
2118           node doesn't change), it is possible to only run the replace
2119           for a subset of the disks, using the option
2120           <option>--disks</option> which takes a list of
2121           comma-delimited disk indices (zero-based),
2122           e.g. <userinput>0,2</userinput> to replace only the first
2123           and third disks.
2124         </para>
2125
2126         <para>
2127           The third form (when passing either the
2128           <option>--iallocator</option> or the
2129           <option>--new-secondary</option> option) is designed to
2130           change secondary node of the instance.  Specifying
2131           <option>--iallocator</option> makes the new secondary be
2132           selected automatically by the specified allocator plugin,
2133           otherwise the new secondary node will be the one chosen
2134           manually via the <option>--new-secondary</option> option.
2135         </para>
2136
2137         <para>
2138           The fourth form (when using <option>--auto</option>) will
2139           automatically determine which disks of an instance are faulty and
2140           replace them within the same node. The <option>--auto</option>
2141           option works only when an instance has only faulty disks on
2142           either the primary or secondary node; it doesn't work when
2143           both sides have faulty disks.
2144         </para>
2145
2146         <para>
2147           The <option>--submit</option> option is used to send the job to
2148           the master daemon but not wait for its completion. The job
2149           ID will be shown so that it can be examined via
2150           <command>gnt-job info</command>.
2151         </para>
2152
2153         <para>
2154           The <option>--early-release</option> changes the code so
2155           that the old storage on secondary node(s) is removed early
2156           (before the resync is completed) and the internal Ganeti
2157           locks for the current (and new, if any) secondary node are
2158           also released, thus allowing more parallelism in the cluster
2159           operation. This should be used only when recovering from a
2160           disk failure on the current secondary (thus the old storage
2161           is already broken) or when the storage on the primary node
2162           is known to be fine (thus we won't need the old storage for
2163           potential recovery).
2164         </para>
2165
2166         <para>
2167           Note that it is not possible to select an offline or drained
2168           node as a new secondary.
2169         </para>
2170
2171       </refsect3>
2172
2173       <refsect3>
2174         <title>ACTIVATE-DISKS</title>
2175
2176         <cmdsynopsis>
2177           <command>activate-disks</command>
2178           <arg>--submit</arg>
2179           <arg>--ignore-size</arg>
2180           <arg choice="req"><replaceable>instance</replaceable></arg>
2181         </cmdsynopsis>
2182         <para>
2183           Activates the block devices of the given instance. If
2184           successful, the command will show the location and name of
2185           the block devices:
2186           <screen>
2187 node1.example.com:disk/0:/dev/drbd0
2188 node1.example.com:disk/1:/dev/drbd1
2189           </screen>
2190
2191           In this example, <emphasis>node1.example.com</emphasis> is
2192           the name of the node on which the devices have been
2193           activated. The <emphasis>disk/0</emphasis> and
2194           <emphasis>disk/1</emphasis> are the Ganeti-names of the
2195           instance disks; how they are visible inside the instance is
2196           hypervisor-specific. <emphasis>/dev/drbd0</emphasis> and
2197           <emphasis>/dev/drbd1</emphasis> are the actual block devices
2198           as visible on the node.
2199         </para>
2200
2201         <para>
2202           The <option>--submit</option> option is used to send the job to
2203           the master daemon but not wait for its completion. The job
2204           ID will be shown so that it can be examined via
2205           <command>gnt-job info</command>.
2206         </para>
2207
2208         <para>
2209           The <option>--ignore-size</option> option can be used to
2210           activate disks ignoring the currently configured size in
2211           Ganeti. This can be used in cases where the configuration
2212           has gotten out of sync with the real-world (e.g. after a
2213           partially-failed grow-disk operation or due to rounding in
2214           LVM devices). This should not be used in normal cases, but
2215           only when activate-disks fails without it.
2216         </para>
2217
2218         <para>
2219           Note that it is safe to run this command while the instance
2220           is already running.
2221         </para>
2222       </refsect3>
2223
2224       <refsect3>
2225         <title>DEACTIVATE-DISKS</title>
2226
2227         <cmdsynopsis>
2228           <command>deactivate-disks</command>
2229           <arg>--submit</arg>
2230           <arg choice="req"><replaceable>instance</replaceable></arg>
2231         </cmdsynopsis>
2232         <para>
2233           De-activates the block devices of the given instance. Note
2234           that if you run this command for an instance with a drbd
2235           disk template, while it is running, it will not be able to
2236           shutdown the block devices on the primary node, but it will
2237           shutdown the block devices on the secondary nodes, thus
2238           breaking the replication.
2239         </para>
2240
2241         <para>
2242           The <option>--submit</option> option is used to send the job to
2243           the master daemon but not wait for its completion. The job
2244           ID will be shown so that it can be examined via
2245           <command>gnt-job info</command>.
2246         </para>
2247
2248       </refsect3>
2249
2250       <refsect3>
2251         <title>GROW-DISK</title>
2252         <cmdsynopsis>
2253           <command>grow-disk</command>
2254           <arg>--no-wait-for-sync</arg>
2255           <arg>--submit</arg>
2256           <arg choice="req"><replaceable>instance</replaceable></arg>
2257           <arg choice="req"><replaceable>disk</replaceable></arg>
2258           <arg choice="req"><replaceable>amount</replaceable></arg>
2259         </cmdsynopsis>
2260
2261         <para>
2262           Grows an instance's disk. This is only possible for
2263           instances having a <literal>plain</literal> or
2264           <literal>drbd</literal> disk template.
2265         </para>
2266
2267         <para>
2268           Note that this command only change the block device size; it
2269           will not grow the actual filesystems, partitions, etc. that
2270           live on that disk. Usually, you will need to:
2271           <orderedlist>
2272             <listitem>
2273               <simpara>use <command>gnt-instance grow-disk</command></simpara>
2274             </listitem>
2275             <listitem>
2276               <simpara>reboot the instance (later, at a convenient
2277               time)</simpara>
2278             </listitem>
2279             <listitem>
2280               <simpara>use a filesystem resizer, such as
2281               <citerefentry> <refentrytitle>ext2online</refentrytitle>
2282               <manvolnum>8</manvolnum> </citerefentry> or
2283               <citerefentry> <refentrytitle>xfs_growfs</refentrytitle>
2284               <manvolnum>8</manvolnum> </citerefentry> to resize the
2285               filesystem, or use <citerefentry>
2286               <refentrytitle>fdisk</refentrytitle>
2287               <manvolnum>8</manvolnum> </citerefentry> to change the
2288               partition table on the disk
2289               </simpara>
2290             </listitem>
2291           </orderedlist>
2292         </para>
2293
2294
2295         <para>
2296           The <replaceable>disk</replaceable> argument is the index of
2297           the instance disk to grow. The
2298           <replaceable>amount</replaceable> argument is given either
2299           as a number (and it represents the amount to increase the
2300           disk with in mebibytes) or can be given similar to the
2301           arguments in the create instance operation, with a suffix
2302           denoting the unit.
2303         </para>
2304
2305         <para>
2306           Note that the disk grow operation might complete on one node
2307           but fail on the other; this will leave the instance with
2308           different-sized LVs on the two nodes, but this will not
2309           create problems (except for unused space).
2310         </para>
2311
2312         <para>
2313           If you do not want gnt-instance to wait for the new disk
2314           region to be synced, use the
2315           <option>--no-wait-for-sync</option> option.
2316         </para>
2317
2318         <para>
2319           The <option>--submit</option> option is used to send the job to
2320           the master daemon but not wait for its completion. The job
2321           ID will be shown so that it can be examined via
2322           <command>gnt-job info</command>.
2323         </para>
2324
2325
2326         <para>Example (increase the first disk for instance1 by 16GiB):
2327           <screen>
2328 # gnt-instance grow-disk instance1.example.com 0 16g
2329           </screen>
2330         </para>
2331
2332         <para>
2333           Also note that disk shrinking is not supported; use
2334           <command>gnt-backup export</command> and then
2335           <command>gnt-backup import</command> to reduce the disk size
2336           of an instance.
2337         </para>
2338       </refsect3>
2339
2340       <refsect3>
2341         <title>RECREATE-DISKS</title>
2342
2343         <cmdsynopsis>
2344           <command>recreate-disks</command>
2345           <arg>--submit</arg>
2346           <arg>--disks=<option>indices</option></arg>
2347           <arg choice="req"><replaceable>instance</replaceable></arg>
2348         </cmdsynopsis>
2349         <para>
2350           Recreates the disks of the given instance, or only a subset
2351           of the disks (if the option <option>disks</option> is
2352           passed, which must be a comma-separated list of disk
2353           indices, starting from zero).
2354         </para>
2355
2356         <para>
2357           Note that this functionality should only be used for missing
2358           disks; if any of the given disks already exists, the
2359           operation will fail. While this is suboptimal,
2360           recreate-disks should hopefully not be needed in normal
2361           operation and as such the impact of this is low.
2362         </para>
2363
2364         <para>
2365           The <option>--submit</option> option is used to send the job to
2366           the master daemon but not wait for its completion. The job
2367           ID will be shown so that it can be examined via
2368           <command>gnt-job info</command>.
2369         </para>
2370
2371       </refsect3>
2372
2373     </refsect2>
2374
2375     <refsect2>
2376       <title>Recovery</title>
2377
2378       <refsect3>
2379         <title>FAILOVER</title>
2380
2381         <cmdsynopsis>
2382           <command>failover</command>
2383           <arg>-f</arg>
2384           <arg>--ignore-consistency</arg>
2385           <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2386           <arg>--submit</arg>
2387           <arg choice="req"><replaceable>instance</replaceable></arg>
2388         </cmdsynopsis>
2389
2390         <para>
2391           Failover will fail the instance over its secondary
2392           node. This works only for instances having a drbd disk
2393           template.
2394         </para>
2395
2396         <para>
2397           Normally the failover will check the consistency of the
2398           disks before failing over the instance. If you are trying to
2399           migrate instances off a dead node, this will fail. Use the
2400           <option>--ignore-consistency</option> option for this
2401           purpose. Note that this option can be dangerous as errors in
2402           shutting down the instance will be ignored, resulting in
2403           possibly having the instance running on two machines in
2404           parallel (on disconnected DRBD drives).
2405         </para>
2406
2407         <para>
2408           The <option>--shutdown-timeout</option> is used to specify how
2409           much time to wait before forcing the shutdown (xm destroy in xen,
2410           killing the kvm process, for kvm). By default two minutes are
2411           given to each instance to stop.
2412         </para>
2413
2414         <para>
2415           The <option>--submit</option> option is used to send the job to
2416           the master daemon but not wait for its completion. The job
2417           ID will be shown so that it can be examined via
2418           <command>gnt-job info</command>.
2419         </para>
2420
2421         <para>
2422           Example:
2423           <screen>
2424 # gnt-instance failover instance1.example.com
2425           </screen>
2426         </para>
2427       </refsect3>
2428
2429       <refsect3>
2430         <title>MIGRATE</title>
2431
2432         <cmdsynopsis>
2433           <command>migrate</command>
2434           <arg>-f</arg>
2435           <arg choice="req">--cleanup</arg>
2436           <arg choice="req"><replaceable>instance</replaceable></arg>
2437         </cmdsynopsis>
2438
2439         <cmdsynopsis>
2440           <command>migrate</command>
2441           <arg>-f</arg>
2442           <arg>--non-live</arg>
2443           <arg>--migration-mode=live|non-live</arg>
2444           <arg choice="req"><replaceable>instance</replaceable></arg>
2445         </cmdsynopsis>
2446
2447         <para>
2448           Migrate will move the instance to its secondary node without
2449           shutdown. It only works for instances having the drbd8 disk
2450           template type.
2451         </para>
2452
2453         <para>
2454           The migration command needs a perfectly healthy instance, as
2455           we rely on the dual-master capability of drbd8 and the disks
2456           of the instance are not allowed to be degraded.
2457         </para>
2458
2459         <para>
2460           The <option>--non-live</option>
2461           and <option>--migration-mode=non-live</option> options will
2462           switch (for the hypervisors that support it) between a
2463           "fully live" (i.e. the interruption is as minimal as
2464           possible) migration and one in which the instance is frozen,
2465           its state saved and transported to the remote node, and then
2466           resumed there. This all depends on the hypervisor support
2467           for two different methods. In any case, it is not an error
2468           to pass this parameter (it will just be ignored if the
2469           hypervisor doesn't support it). The
2470           option <option>--migration-mode=live</option> option will
2471           request a fully-live migration. The default, when neither
2472           option is passed, depends on the hypervisor parameters (and
2473           can be viewed with the <command>gnt-cluster info</command>
2474           command).
2475         </para>
2476
2477         <para>
2478           If the <option>--cleanup</option> option is passed, the
2479           operation changes from migration to attempting recovery from
2480           a failed previous migration. In this mode, Ganeti checks if
2481           the instance runs on the correct node (and updates its
2482           configuration if not) and ensures the instances's disks are
2483           configured correctly. In this mode, the
2484           <option>--non-live</option> option is ignored.
2485         </para>
2486
2487         <para>
2488           The option <option>-f</option> will skip the prompting for
2489           confirmation.
2490         </para>
2491         <para>
2492           Example (and expected output):
2493           <screen>
2494 # gnt-instance migrate instance1
2495 Migrate will happen to the instance instance1. Note that migration is
2496 **experimental** in this version. This might impact the instance if
2497 anything goes wrong. Continue?
2498 y/[n]/?: y
2499 * checking disk consistency between source and target
2500 * ensuring the target is in secondary mode
2501 * changing disks into dual-master mode
2502  - INFO: Waiting for instance instance1 to sync disks.
2503  - INFO: Instance instance1's disks are in sync.
2504 * migrating instance to node2.example.com
2505 * changing the instance's disks on source node to secondary
2506  - INFO: Waiting for instance instance1 to sync disks.
2507  - INFO: Instance instance1's disks are in sync.
2508 * changing the instance's disks to single-master
2509 #
2510           </screen>
2511         </para>
2512       </refsect3>
2513
2514       <refsect3>
2515         <title>MOVE</title>
2516
2517         <cmdsynopsis>
2518           <command>move</command>
2519           <arg>-f</arg>
2520           <arg>-n <replaceable>node</replaceable></arg>
2521           <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2522           <arg>--submit</arg>
2523           <arg choice="req"><replaceable>instance</replaceable></arg>
2524         </cmdsynopsis>
2525
2526         <para>
2527           Move will move the instance to an arbitrary node in the
2528           cluster. This works only for instances having a plain or
2529           file disk template.
2530         </para>
2531
2532         <para>
2533           Note that since this operation is done via data copy, it
2534           will take a long time for big disks (similar to
2535           replace-disks for a drbd instance).
2536         </para>
2537
2538         <para>
2539           The <option>--shutdown-timeout</option> is used to specify how
2540           much time to wait before forcing the shutdown (xm destroy in xen,
2541           killing the kvm process, for kvm). By default two minutes are
2542           given to each instance to stop.
2543         </para>
2544
2545         <para>
2546           The <option>--submit</option> option is used to send the job to
2547           the master daemon but not wait for its completion. The job
2548           ID will be shown so that it can be examined via
2549           <command>gnt-job info</command>.
2550         </para>
2551
2552         <para>
2553           Example:
2554           <screen>
2555 # gnt-instance move -n node3.example.com instance1.example.com
2556           </screen>
2557         </para>
2558       </refsect3>
2559
2560     </refsect2>
2561
2562     <refsect2>
2563       <title>TAGS</title>
2564
2565     <refsect3>
2566         <title>ADD-TAGS</title>
2567
2568         <cmdsynopsis>
2569           <command>add-tags</command>
2570           <arg choice="opt">--from <replaceable>file</replaceable></arg>
2571           <arg choice="req"><replaceable>instancename</replaceable></arg>
2572           <arg choice="req"
2573             rep="repeat"><replaceable>tag</replaceable></arg>
2574         </cmdsynopsis>
2575
2576         <para>
2577           Add tags to the given instance. If any of the tags contains
2578           invalid characters, the entire operation will abort.
2579         </para>
2580         <para>
2581           If the <option>--from</option> option is given, the list of
2582           tags will be extended with the contents of that file (each
2583           line becomes a tag). In this case, there is not need to pass
2584           tags on the command line (if you do, both sources will be
2585           used). A file name of - will be interpreted as stdin.
2586         </para>
2587       </refsect3>
2588
2589       <refsect3>
2590         <title>LIST-TAGS</title>
2591
2592         <cmdsynopsis>
2593           <command>list-tags</command>
2594           <arg choice="req"><replaceable>instancename</replaceable></arg>
2595         </cmdsynopsis>
2596
2597         <para>List the tags of the given instance.</para>
2598       </refsect3>
2599
2600       <refsect3>
2601         <title>REMOVE-TAGS</title>
2602         <cmdsynopsis>
2603           <command>remove-tags</command>
2604           <arg choice="opt">--from <replaceable>file</replaceable></arg>
2605           <arg choice="req"><replaceable>instancename</replaceable></arg>
2606           <arg choice="req"
2607             rep="repeat"><replaceable>tag</replaceable></arg>
2608         </cmdsynopsis>
2609
2610         <para>
2611           Remove tags from the given instance. If any of the tags are
2612           not existing on the node, the entire operation will abort.
2613         </para>
2614
2615         <para>
2616           If the <option>--from</option> option is given, the list of
2617           tags will be extended with the contents of that file (each
2618           line becomes a tag). In this case, there is not need to pass
2619           tags on the command line (if you do, both sources will be
2620           used). A file name of - will be interpreted as stdin.
2621         </para>
2622       </refsect3>
2623
2624     </refsect2>
2625
2626   </refsect1>
2627
2628   &footer;
2629
2630 </refentry>
2631
2632 <!-- Keep this comment at the end of the file
2633 Local variables:
2634 mode: sgml
2635 sgml-omittag:t
2636 sgml-shorttag:t
2637 sgml-minimize-attributes:nil
2638 sgml-always-quote-attributes:t
2639 sgml-indent-step:2
2640 sgml-indent-data:t
2641 sgml-parent-document:nil
2642 sgml-default-dtd-file:nil
2643 sgml-exposed-tags:nil
2644 sgml-local-catalogs:nil
2645 sgml-local-ecat-files:nil
2646 End:
2647 -->