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