Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ 78411c60

History | View | Annotate | Download (81.2 kB)

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>February 11, 2009</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
      <holder>Google Inc.</holder>
26
    </copyright>
27
    &dhdate;
28
  </refentryinfo>
29
  <refmeta>
30
    &dhucpackage;
31

    
32
    &dhsection;
33
    <refmiscinfo>ganeti 2.0</refmiscinfo>
34
  </refmeta>
35
  <refnamediv>
36
    <refname>&dhpackage;</refname>
37

    
38
    <refpurpose>ganeti instance administration</refpurpose>
39
  </refnamediv>
40
  <refsynopsisdiv>
41
    <cmdsynopsis>
42
      <command>&dhpackage; </command>
43

    
44
      <arg choice="req">command</arg>
45
      <arg>arguments...</arg>
46
    </cmdsynopsis>
47
  </refsynopsisdiv>
48
  <refsect1>
49
    <title>DESCRIPTION</title>
50

    
51
    <para>
52
      The <command>&dhpackage;</command> is used for instance
53
      administration in the ganeti system.
54
    </para>
55

    
56
  </refsect1>
57
  <refsect1>
58
    <title>COMMANDS</title>
59

    
60
    <refsect2>
61
      <title>Creation/removal/querying</title>
62

    
63
      <refsect3>
64
        <title>ADD</title>
65
        <cmdsynopsis>
66
          <command>add</command>
67
          <sbr>
68
          <arg choice="req">-t<group choice="req">
69
              <arg>diskless</arg>
70
              <arg>file</arg>
71
              <arg>plain</arg>
72
              <arg>drbd</arg>
73
            </group></arg>
74
          <sbr>
75

    
76
          <group choice="req">
77
            <arg rep="repeat">--disk=<replaceable>N</replaceable>:size=<replaceable>VAL</replaceable><arg>,mode=<replaceable>ro|rw</replaceable></arg></arg>
78
            <arg>-s <replaceable>SIZE</replaceable></arg>
79
          </group>
80
          <sbr>
81
          <group>
82
            <arg rep="repeat">--net=<replaceable>N</replaceable><arg rep="repeat">:options</arg></arg>
83
            <arg>--no-nics</arg>
84
          </group>
85
          <sbr>
86
          <arg>-B <replaceable>BEPARAMS</replaceable></arg>
87
          <sbr>
88

    
89
          <arg>-H <replaceable>HYPERVISOR</replaceable><arg>:<arg choice="plain" rep="repeat">option=<replaceable>value</replaceable></arg></arg></arg>
90
          <sbr>
91

    
92
          <arg>--file-storage-dir <replaceable>dir_path</replaceable></arg>
93
          <arg>--file-driver<group choice="req">
94
              <arg>loop</arg>
95
              <arg>blktap</arg>
96
            </group></arg>
97
          <sbr>
98

    
99
          <group choice="req">
100
            <arg>-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg>
101
            <arg>--iallocator <replaceable>name</replaceable></arg>
102
          </group>
103
          <sbr>
104

    
105
          <arg choice="req">-o <replaceable>os-type</replaceable></arg>
106
          <sbr>
107
          <arg>--submit</arg>
108
          <sbr>
109

    
110
          <arg choice="req"><replaceable>instance</replaceable></arg>
111
        </cmdsynopsis>
112

    
113
        <para>
114
          Creates a new instance on the specified host. The
115
          <replaceable>instance</replaceable> argument must be in DNS,
116
          but depending on the bridge/routing setup, need not be in
117
          the same network as the nodes in the cluster.
118
        </para>
119

    
120
        <para>
121
          The <option>disk</option> option specifies the parameters
122
          for the disks of the instance. The numbering of disks starts
123
          at zero, and at least one disk needs to be passed. For each
124
          disk, at least the size needs to be given, and optionally
125
          the access mode (read-only or the default of read-write) can
126
          also be specified.  The size is interpreted (when no unit is
127
          given) in mebibytes. You can also use one of the suffixes
128
          <literal>m</literal>, <literal>g</literal> or
129
          <literal>t</literal> to specificy the exact the units used;
130
          these suffixes map to mebibytes, gibibytes and tebibytes.
131
        </para>
132

    
133
        <para>
134
          Alternatively, a single-disk instance can be created via the
135
          <option>-s</option> option which takes a single argument,
136
          the size of the disk. This is similar to the Ganeti 1.2
137
          version (but will only create one disk).
138
        </para>
139

    
140
        <para>
141
          The minimum disk specification is therefore
142
          <userinput>--disk 0:size=20G</userinput> (or <userinput>-s
143
          20G</userinput> when using the <option>-s</option> option),
144
          and a three-disk instance can be specified as
145
          <userinput>--disk 0:size=20G --disk 1:size=4G --disk
146
          2:size=100G</userinput>.
147
        </para>
148

    
149
        <para>
150
          The NICs of the instances can be specified via the
151
          <option>--net</option> option. By default, one NIC is
152
          created for the instance, with a random MAC, and set
153
          up according the the cluster level nic parameters.
154
          Each NIC can take these parameters (all optional):
155
          <variablelist>
156
            <varlistentry>
157
              <term>mac</term>
158
              <listitem>
159
                <simpara>either a value or <constant>GENERATE</constant>
160
                  to generate a new unique MAC</simpara>
161
              </listitem>
162
            </varlistentry>
163
            <varlistentry>
164
              <term>ip</term>
165
              <listitem>
166
                <simpara>specifies the IP address assigned to the
167
                  instance from the Ganeti side (this is not necessarily
168
                  what the instance will use, but what the node expects
169
                  the instance to use)</simpara>
170
              </listitem>
171
            </varlistentry>
172
            <varlistentry>
173
              <term>mode</term>
174
              <listitem>
175
                <simpara>specifies the connection mode for this nic:
176
                  routed or bridged.</simpara>
177
              </listitem>
178
            </varlistentry>
179
            <varlistentry>
180
              <term>link</term>
181
              <listitem>
182
                <simpara>in bridged mode specifies the bridge to attach
183
                  this NIC to, in routed mode it's intended to
184
                  differentiate between different routing tables/instance
185
                  groups (but the meaning is dependent on the network
186
                  script, see gnt-cluster(8) for more details)</simpara>
187
              </listitem>
188
            </varlistentry>
189
          </variablelist>
190
          Of these "mode" and "link" are nic parameters, and inherit their
191
          default at cluster level.
192
        </para>
193

    
194
        <para>
195
          Alternatively, if no network is desired for the instance, you
196
          can prevent the default of one NIC with the
197
          <option>--no-nics</option> option.
198
        </para>
199

    
200
        <para>
201
          The <option>-o</option> options specifies the operating
202
          system to be installed. The available operating systems can
203
          be listed with <command>gnt-os list</command>.
204
        </para>
205

    
206
        <para>
207
          The <option>-B</option> option specifies the backend
208
          parameters for the instance. If no such parameters are
209
          specified, the values are inherited from the cluster. Possible
210
          parameters are:
211
          <variablelist>
212
            <varlistentry>
213
              <term>memory</term>
214
              <listitem>
215
                <simpara>the memory size of the instance; as usual,
216
                  suffixes can be used to denote the unit, otherwise the
217
                  value is taken in mebibites</simpara>
218
              </listitem>
219
            </varlistentry>
220
            <varlistentry>
221
              <term>vcpus</term>
222
              <listitem>
223
                <simpara>the number of VCPUs to assign to the instance
224
                  (if this value makes sense for the hypervisor)</simpara>
225
              </listitem>
226
            </varlistentry>
227
            <varlistentry>
228
              <term>auto_balance</term>
229
              <listitem>
230
                <simpara>whether the instance is considered in the N+1
231
                  cluster checks (enough redundancy in the cluster to
232
                  survive a node failure)</simpara>
233
              </listitem>
234
            </varlistentry>
235
          </variablelist>
236
        </para>
237

    
238
        <para>
239
          The <option>-H</option> option specified the hypervisor to
240
          use for the instance (must be one of the enabled hypervisors
241
          on the cluster) and optionally custom parameters for this
242
          instance. If not other options are used (i.e. the invocation
243
          is just <userinput>-H
244
          <replaceable>NAME</replaceable></userinput>) the instance
245
          will inherit the cluster options. The defaults below show
246
          the cluster defaults at cluster creation time.
247
        </para>
248

    
249
        <para>
250
          The possible hypervisor options are as follows:
251
          <variablelist>
252
            <varlistentry>
253
              <term>boot_order</term>
254
              <listitem>
255
                <simpara>Valid for the Xen HVM and KVM
256
                hypervisors.</simpara>
257

    
258
                <simpara>A string value denoting the boot order. This
259
                has different meaning for the Xen HVM hypervisor and
260
                for the KVM one.</simpara>
261

    
262
                <simpara>
263
                  For Xen HVM, The boot order is a string of letters
264
                  listing the boot devices, with valid device letters
265
                  being:
266
                </simpara>
267
                  <variablelist>
268
                    <varlistentry>
269
                      <term>a</term>
270
                      <listitem>
271
                        <para>
272
                          floppy drive
273
                        </para>
274
                      </listitem>
275
                    </varlistentry>
276
                    <varlistentry>
277
                      <term>c</term>
278
                      <listitem>
279
                        <para>
280
                          hard disk
281
                        </para>
282
                      </listitem>
283
                    </varlistentry>
284
                    <varlistentry>
285
                      <term>d</term>
286
                      <listitem>
287
                        <para>
288
                          CDROM drive
289
                        </para>
290
                      </listitem>
291
                    </varlistentry>
292
                    <varlistentry>
293
                      <term>n</term>
294
                      <listitem>
295
                        <para>
296
                          network boot (PXE)
297
                        </para>
298
                      </listitem>
299
                    </varlistentry>
300
                  </variablelist>
301
                <simpara>
302
                  The default is not to set an HVM boot order which is
303
                  interpreted as 'dc'.
304
                </simpara>
305

    
306
              </listitem>
307
            </varlistentry>
308
            <varlistentry>
309
              <term>cdrom_image_path</term>
310
              <listitem>
311
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
312

    
313
                <simpara>The path to a CDROM image to attach to the
314
                instance.</simpara>
315

    
316
              </listitem>
317
            </varlistentry>
318
            <varlistentry>
319
              <term>nic_type</term>
320
              <listitem>
321
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
322

    
323
                <para>
324
                  This parameter determines the way the network cards
325
                  are presented to the instance. The possible options are:
326
                  <simplelist>
327
                    <member>rtl8139 (default for Xen HVM) (HVM & KVM)</member>
328
                    <member>ne2k_isa (HVM & KVM)</member>
329
                    <member>ne2k_pci (HVM & KVM)</member>
330
                    <member>i82551 (KVM)</member>
331
                    <member>i82557b (KVM)</member>
332
                    <member>i82559er (KVM)</member>
333
                    <member>pcnet (KVM)</member>
334
                    <member>e1000 (KVM)</member>
335
                    <member>paravirtual (default for KVM) (HVM & KVM)</member>
336
                  </simplelist>
337
                </para>
338
              </listitem>
339
            </varlistentry>
340
            <varlistentry>
341
              <term>disk_type</term>
342
              <listitem>
343
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
344

    
345
                <para>
346
                  This parameter determines the way the disks are
347
                  presented to the instance. The possible options are:
348
                  <simplelist>
349
                    <member>ioemu (default for HVM & KVM) (HVM & KVM)</member>
350
                    <member>ide (HVM & KVM)</member>
351
                    <member>scsi (KVM)</member>
352
                    <member>sd (KVM)</member>
353
                    <member>mtd (KVM)</member>
354
                    <member>pflash (KVM)</member>
355
                  </simplelist>
356
                </para>
357
              </listitem>
358
            </varlistentry>
359
            <varlistentry>
360
              <term>vnc_bind_address</term>
361
              <listitem>
362
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
363

    
364
                <para>Specifies the address that the VNC listener for
365
                this instance should bind to. Valid values are IPv4
366
                addresses. Use the address 0.0.0.0 to bind to all
367
                available interfaces (this is the default) or specify
368
                the address of one of the interfaces on the node to
369
                restrict listening to that interface.</para>
370
              </listitem>
371
            </varlistentry>
372

    
373
            <varlistentry>
374
              <term>vnc_tls</term>
375
              <listitem>
376
                <simpara>Valid for the KVM hypervisor.</simpara>
377

    
378
                <simpara>A boolean option that controls whether the
379
                VNC connection is secured with TLS.</simpara>
380
              </listitem>
381
            </varlistentry>
382

    
383
            <varlistentry>
384
              <term>vnc_x509_path</term>
385
              <listitem>
386
                <simpara>Valid for the KVM hypervisor.</simpara>
387

    
388
                <para>If <option>vnc_tls</option> is enabled, this
389
                options specifies the path to the x509 certificate to
390
                use.</para>
391
              </listitem>
392
            </varlistentry>
393

    
394
            <varlistentry>
395
              <term>vnc_x509_verify</term>
396
              <listitem>
397
                <simpara>Valid for the KVM hypervisor.</simpara>
398
              </listitem>
399
            </varlistentry>
400

    
401
            <varlistentry>
402
              <term>acpi</term>
403
              <listitem>
404
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
405

    
406
                <para>
407
                  A boolean option that specifies if the hypervisor
408
                  should enable ACPI support for this instance. By
409
                  default, ACPI is disabled.
410
                </para>
411
              </listitem>
412
            </varlistentry>
413

    
414
            <varlistentry>
415
              <term>pae</term>
416
              <listitem>
417
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
418

    
419
                <para>
420
                  A boolean option that specifies if the hypervisor
421
                  should enabled PAE support for this instance. The
422
                  default is false, disabling PAE support.
423
                </para>
424
              </listitem>
425
            </varlistentry>
426

    
427
            <varlistentry>
428
              <term>kernel_path</term>
429
              <listitem>
430
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
431

    
432
                <para>
433
                  This option specifies the path (on the node) to the
434
                  kernel to boot the instance with. Xen PVM instances
435
                  always require this, while for KVM if this option is
436
                  empty, it will cause the machine to load the kernel
437
                  from its disks.
438
                </para>
439
              </listitem>
440
            </varlistentry>
441

    
442
            <varlistentry>
443
              <term>kernel_args</term>
444
              <listitem>
445
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
446

    
447
                <para>
448
                  This options specifies extra arguments to the kernel
449
                  that will be loaded.  device. This is always used
450
                  for Xen PVM, while for KVM it is only used if the
451
                  <option>kernel_path</option> option is also
452
                  specified.
453
                </para>
454

    
455
                <para>
456
                  The default setting for this value is simply
457
                  <constant>"ro"</constant>, which mounts the root
458
                  disk (initially) in read-only one. For example,
459
                  setting this to <userinput>single</userinput> will
460
                  cause the instance to start in single-user mode.
461
                </para>
462
              </listitem>
463
            </varlistentry>
464

    
465
            <varlistentry>
466
              <term>initrd_path</term>
467
              <listitem>
468
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
469

    
470
                <para>
471
                  This option specifies the path (on the node) to the
472
                  initrd to boot the instance with. Xen PVM instances
473
                  can use this always, while for KVM if this option is
474
                  only used if the <option>kernel_path</option> option
475
                  is also specified. You can pass here either an
476
                  absolute filename (the path to the initrd) if you
477
                  want to use an initrd, or use the format
478
                  <userinput>no_initrd_path</userinput> for no initrd.
479
                </para>
480
              </listitem>
481
            </varlistentry>
482

    
483
            <varlistentry>
484
              <term>root_path</term>
485
              <listitem>
486
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
487

    
488
                <para>
489
                  This options specifies the name of the root
490
                  device. This is always needed for Xen PVM, while for
491
                  KVM it is only used if the
492
                  <option>kernel_path</option> option is also
493
                  specified.
494
                </para>
495
              </listitem>
496
            </varlistentry>
497

    
498
            <varlistentry>
499
              <term>serial_console</term>
500
              <listitem>
501
                <simpara>Valid for the KVM hypervisor.</simpara>
502

    
503
                <simpara>This boolean option specifies whether to
504
                emulate a serial console for the instance.</simpara>
505
              </listitem>
506
            </varlistentry>
507

    
508
            <varlistentry>
509
              <term>migration_port</term>
510
              <listitem>
511
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
512

    
513
                <para>
514
                  This options specifies the TCP port to use for
515
                  live-migration. Note that this shouldn't (usually)
516
                  be changed at the instance level, but only at
517
                  cluster-level.
518
                </para>
519
              </listitem>
520
            </varlistentry>
521

    
522
          </variablelist>
523

    
524
        </para>
525

    
526
        <para>
527
        </para>
528

    
529
        <para>
530
          The <option>--iallocator</option> option specifies the instance
531
          allocator plugin to use. If you pass in this option the allocator
532
          will select nodes for this instance automatically, so you don't need
533
          to pass them with the <option>-n</option> option. For more
534
          information please refer to the instance allocator documentation.
535
        </para>
536

    
537
        <para>
538
          The <option>-t</option> options specifies the disk layout type for
539
          the instance. The available choices are:
540
          <variablelist>
541
            <varlistentry>
542
              <term>diskless</term>
543
              <listitem>
544
                <para>
545
                  This creates an instance with no disks. Its useful for
546
                  testing only (or other special cases).
547
                </para>
548
              </listitem>
549
            </varlistentry>
550
            <varlistentry>
551
              <term>file</term>
552
              <listitem>
553
                <para>Disk devices will be regular files.</para>
554
              </listitem>
555
            </varlistentry>
556
            <varlistentry>
557
              <term>plain</term>
558
              <listitem>
559
                <para>Disk devices will be logical volumes.</para>
560
              </listitem>
561
            </varlistentry>
562
            <varlistentry>
563
              <term>drbd</term>
564
              <listitem>
565
                <para>
566
                  Disk devices will be drbd (version 8.x) on top of
567
                  lvm volumes.
568
                </para>
569
              </listitem>
570
            </varlistentry>
571
          </variablelist>
572
        </para>
573

    
574
        <para>
575
          The optional second value of the <option>--node</option> is used for
576
          the drbd template type and specifies the remote node.
577
        </para>
578

    
579
        <para>
580
          If you do not want gnt-instance to wait for the disk mirror
581
          to be synced, use the <option>--no-wait-for-sync</option>
582
          option.
583
        </para>
584

    
585
        <para>
586
          The <option>--file-storage-dir</option> specifies the relative path
587
          under the cluster-wide file storage directory to store file-based
588
          disks. It is useful for having different subdirectories for
589
          different instances. The full path of the directory where the disk
590
          files are stored will consist of cluster-wide file storage directory
591
          + optional subdirectory + instance name. Example:
592
          /srv/ganeti/file-storage/mysubdir/instance1.example.com. This option
593
          is only relevant for instances using the file storage backend.
594
        </para>
595

    
596
        <para>
597
          The <option>--file-driver</option> specifies the driver to use for
598
          file-based disks. Note that currently these drivers work with the
599
          xen hypervisor only. This option is only relevant for instances using
600
          the file storage backend. The available choices are:
601
          <variablelist>
602
            <varlistentry>
603
              <term>loop</term>
604
              <listitem>
605
                <para>
606
                  Kernel loopback driver. This driver uses loopback
607
                  devices to access the filesystem within the
608
                  file. However, running I/O intensive applications in
609
                  your instance using the loop driver might result in
610
                  slowdowns.  Furthermore, if you use the loopback
611
                  driver consider increasing the maximum amount of
612
                  loopback devices (on most systems it's 8) using the
613
                  max_loop param.
614
                </para>
615
              </listitem>
616
            </varlistentry>
617
            <varlistentry>
618
              <term>blktap</term>
619
              <listitem>
620
                <para>The blktap driver (for Xen hypervisors). In
621
                order to be able to use the blktap driver you should
622
                check if the 'blktapctrl' user space disk agent is
623
                running (usually automatically started via xend). This
624
                user-level disk I/O interface has the advantage of
625
                better performance. Especially if you use a network
626
                file system (e.g. NFS) to store your instances this is
627
                the recommended choice.
628
                </para>
629
              </listitem>
630
            </varlistentry>
631
          </variablelist>
632
        </para>
633

    
634
        <para>
635
          The <option>--submit</option> option is used to send the job to
636
          the master daemon but not wait for its completion. The job
637
          ID will be shown so that it can be examined via
638
          <command>gnt-job info</command>.
639
        </para>
640

    
641
        <para>
642
          Example:
643
          <screen>
644
# gnt-instance add -t file --disk 0:size=30g -B memory=512 -o debian-etch \
645
  -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
646
# gnt-instance add -t plain --disk 0:size=30g -B memory=512 -o debian-etch \
647
  -n node1.example.com instance1.example.com
648
# gnt-instance add -t drbd --disk 0:size=30g -B memory=512 -o debian-etch \
649
  -n node1.example.com:node2.example.com instance2.example.com
650
          </screen>
651
        </para>
652
      </refsect3>
653

    
654
      <refsect3>
655
        <title>BATCH-CREATE</title>
656
        <cmdsynopsis>
657
          <command>batch-create</command>
658
          <arg choice="req">instances_file.json</arg>
659
        </cmdsynopsis>
660

    
661
        <para>
662
          This command (similar to the Ganeti 1.2
663
          <command>batcher</command> tool) submits multiple instance
664
          creation jobs based on a definition file. The instance
665
          configurations do not encompass all the possible options for
666
          the <command>add</command> command, but only a subset.
667
        </para>
668

    
669
        <para>
670
          The instance file should be a valid-formed JSON file,
671
          containing a dictionary with instance name and instance
672
          parameters. The accepted parameters are:
673

    
674
          <variablelist>
675
            <varlistentry>
676
              <term>disk_size</term>
677
              <listitem>
678
                <simpara>The size of the disks of the instance.</simpara>
679
              </listitem>
680
            </varlistentry>
681
            <varlistentry>
682
              <term>disk_templace</term>
683
              <listitem>
684
                <simpara>The disk template to use for the instance,
685
                the same as in the <command>add</command>
686
                command.</simpara>
687
              </listitem>
688
            </varlistentry>
689
            <varlistentry>
690
              <term>backend</term>
691
              <listitem>
692
                <simpara>A dictionary of backend parameters.</simpara>
693
              </listitem>
694
            </varlistentry>
695
            <varlistentry>
696
              <term>hypervisor</term>
697
              <listitem>
698
                <simpara>A dictionary with a single key (the
699
                hypervisor name), and as value the hypervisor
700
                options. If not passed, the default hypervisor and
701
                hypervisor options will be inherited.</simpara>
702
              </listitem>
703
            </varlistentry>
704
            <varlistentry>
705
              <term>mac, ip, mode, link</term>
706
              <listitem>
707
                <simpara>Specifications for the one NIC that will be
708
                created for the instance. 'bridge' is also accepted
709
                as a backwards compatibile key.</simpara>
710
              </listitem>
711
            </varlistentry>
712
            <varlistentry>
713
              <term>nics</term>
714
              <listitem>
715
                <simpara>List of nics that will be created for the
716
                instance. Each entry should be a dict, with mac, ip, mode
717
                and link as possible keys. Please don't provide the "mac,
718
                ip, mode, link" parent keys if you use this method for
719
                specifying nics.</simpara>
720
              </listitem>
721
            </varlistentry>
722
            <varlistentry>
723
              <term>primary_node, secondary_node</term>
724
              <listitem>
725
                <simpara>The primary and optionally the secondary node
726
                to use for the instance (in case an iallocator script
727
                is not used).</simpara>
728
              </listitem>
729
            </varlistentry>
730
            <varlistentry>
731
              <term>iallocator</term>
732
              <listitem>
733
                <simpara>Instead of specifying the nodes, an
734
                iallocator script can be used to automatically compute
735
                them.</simpara>
736
              </listitem>
737
            </varlistentry>
738
            <varlistentry>
739
              <term>start</term>
740
              <listitem>
741
                <simpara>whether to start the instance</simpara>
742
              </listitem>
743
            </varlistentry>
744
            <varlistentry>
745
              <term>ip_check</term>
746
              <listitem>
747
                <simpara>Skip the check for already-in-use instance;
748
                see the description in the <command>add</command>
749
                command for details.</simpara>
750
              </listitem>
751
            </varlistentry>
752
            <varlistentry>
753
              <term>file_storage_dir, file_driver</term>
754
              <listitem>
755
                <simpara>Configuration for the <literal>file</literal>
756
                disk type, see the <command>add</command> command for
757
                details.</simpara>
758
              </listitem>
759
            </varlistentry>
760
          </variablelist>
761
        </para>
762

    
763
        <para>
764
          A simple definition for one instance can be (with most of
765
          the parameters taken from the cluster defaults):
766
          <screen>
767
{
768
  "instance3": {
769
    "template": "drbd",
770
    "os": "debootstrap",
771
    "disk_size": ["25G"],
772
    "iallocator": "dumb"
773
  },
774
  "instance5": {
775
    "template": "drbd",
776
    "os": "debootstrap",
777
    "disk_size": ["25G"],
778
    "iallocator": "dumb",
779
    "hypervisor": "xen-hvm",
780
    "hvparams": {"acpi": true},
781
    "backend": {"memory": 512}
782
  }
783
}
784
</screen>
785
        </para>
786

    
787
        <para>
788
          The command will display the job id for each submitted instance, as follows:
789
          <screen>
790
# gnt-instance batch-create instances.json
791
instance3: 11224
792
instance5: 11225
793
</screen>
794
        </para>
795

    
796
      </refsect3>
797

    
798
      <refsect3>
799
        <title>REMOVE</title>
800

    
801
        <cmdsynopsis>
802
          <command>remove</command>
803
          <arg>--ignore-failures</arg>
804
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
805
          <arg>--submit</arg>
806
          <arg choice="req"><replaceable>instance</replaceable></arg>
807
        </cmdsynopsis>
808

    
809
        <para>
810
          Remove an instance. This will remove all data from the
811
          instance and there is <emphasis>no way back</emphasis>. If
812
          you are not sure if you use an instance again, use
813
          <command>shutdown</command> first and leave it in the
814
          shutdown state for a while.
815

    
816
        </para>
817

    
818
        <para>
819
          The <option>--ignore-failures</option> option will cause the
820
          removal to proceed even in the presence of errors during the
821
          removal of the instance (e.g. during the shutdown or the
822
          disk removal). If this option is not given, the command will
823
          stop at the first error.
824
        </para>
825

    
826
        <para>
827
          The <option>--shutdown-timeout</option> is used to specify how
828
          much time to wait before forcing the shutdown (xm destroy in xen,
829
          killing the kvm process, for kvm). By default two minutes are
830
          given to each instance to stop.
831
        </para>
832

    
833
        <para>
834
          The <option>--submit</option> option is used to send the job to
835
          the master daemon but not wait for its completion. The job
836
          ID will be shown so that it can be examined via
837
          <command>gnt-job info</command>.
838
        </para>
839

    
840
        <para>
841
          Example:
842
          <screen>
843
# gnt-instance remove instance1.example.com
844
          </screen>
845
        </para>
846
      </refsect3>
847

    
848
      <refsect3>
849
        <title>LIST</title>
850

    
851
        <cmdsynopsis>
852
          <command>list</command>
853
          <arg>--no-headers</arg>
854
          <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
855
          <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
856
          <arg rep="repeat">instance</arg>
857
        </cmdsynopsis>
858

    
859
        <para>
860
          Shows the currently configured instances with memory usage,
861
          disk usage, the node they are running on, and their run
862
          status.
863
        </para>
864

    
865
        <para>
866
          The <option>--no-headers</option> option will skip the
867
          initial header line. The <option>--separator</option> option
868
          takes an argument which denotes what will be used between
869
          the output fields. Both these options are to help scripting.
870
        </para>
871

    
872
        <para>
873
          The <option>-o</option> option takes a comma-separated list
874
          of output fields. The available fields and their meaning
875
          are:
876
          <variablelist>
877
            <varlistentry>
878
              <term>name</term>
879
              <listitem>
880
                <simpara>the instance name</simpara>
881
              </listitem>
882
            </varlistentry>
883
            <varlistentry>
884
              <term>os</term>
885
              <listitem>
886
                <simpara>the OS of the instance</simpara>
887
              </listitem>
888
            </varlistentry>
889
            <varlistentry>
890
              <term>pnode</term>
891
              <listitem>
892
                <simpara>the primary node of the instance</simpara>
893
              </listitem>
894
            </varlistentry>
895
            <varlistentry>
896
              <term>snodes</term>
897
              <listitem>
898
                <simpara>comma-separated list of secondary nodes for the
899
                  instance; usually this will be just one node</simpara>
900
              </listitem>
901
            </varlistentry>
902
            <varlistentry>
903
              <term>admin_state</term>
904
              <listitem>
905
                <simpara>the desired state of the instance (either "yes"
906
                  or "no" denoting the instance should run or
907
                  not)</simpara>
908
              </listitem>
909
            </varlistentry>
910
            <varlistentry>
911
              <term>disk_template</term>
912
              <listitem>
913
                <simpara>the disk template of the instance</simpara>
914
              </listitem>
915
            </varlistentry>
916
            <varlistentry>
917
              <term>oper_state</term>
918
              <listitem>
919
                <simpara>the actual state of the instance; can be
920
                one of the values "running", "stopped", "(node
921
                down)"</simpara>
922
              </listitem>
923
            </varlistentry>
924
            <varlistentry>
925
              <term>status</term>
926
              <listitem>
927
                <simpara>combined form of admin_state and oper_stat;
928
                this can be one of:
929
                <computeroutput>ERROR_nodedown</computeroutput> if the
930
                node of the instance is down,
931
                <computeroutput>ERROR_down</computeroutput> if the
932
                instance should run but is down,
933
                <computeroutput>ERROR_up</computeroutput> if the
934
                instance should be stopped but is actually running,
935
                <computeroutput>ADMIN_down</computeroutput> if the
936
                instance has been stopped (and is stopped) and
937
                <computeroutput>running</computeroutput> if the
938
                instance is set to be running (and is
939
                running)</simpara>
940
              </listitem>
941
            </varlistentry>
942
            <varlistentry>
943
              <term>oper_ram</term>
944
              <listitem>
945
                <simpara>the actual memory usage of the instance as seen
946
                  by the hypervisor</simpara>
947
              </listitem>
948
            </varlistentry>
949
            <varlistentry>
950
              <term>ip</term>
951
              <listitem>
952
                <simpara>the ip address ganeti recognizes as associated with
953
                the first instance interface</simpara>
954
              </listitem>
955
            </varlistentry>
956
            <varlistentry>
957
              <term>mac</term>
958
              <listitem>
959
                <simpara>the first instance interface MAC address</simpara>
960
              </listitem>
961
            </varlistentry>
962

    
963
            <varlistentry>
964
              <term>mode</term>
965
              <listitem>
966
                <simpara>the mode of the first instance NIC
967
                (routed or bridged)</simpara>
968
              </listitem>
969
            </varlistentry>
970
            <varlistentry>
971
              <term>link</term>
972
              <listitem>
973
                <simpara>the link of the first instance NIC
974
                </simpara>
975
              </listitem>
976
            </varlistentry>
977
            <varlistentry>
978
              <term>sda_size</term>
979
              <listitem>
980
                <simpara>the size of the instance's first disk</simpara>
981
              </listitem>
982
            </varlistentry>
983
            <varlistentry>
984
              <term>sdb_size</term>
985
              <listitem>
986
                <simpara>the size of the instance's second disk, if
987
                any</simpara>
988
              </listitem>
989
            </varlistentry>
990
            <varlistentry>
991
              <term>vcpus</term>
992
              <listitem>
993
                <simpara>the number of VCPUs allocated to the
994
                instance</simpara>
995
              </listitem>
996
            </varlistentry>
997
            <varlistentry>
998
              <term>tags</term>
999
              <listitem>
1000
                <simpara>comma-separated list of the instances's
1001
                tags</simpara>
1002
              </listitem>
1003
            </varlistentry>
1004
            <varlistentry>
1005
              <term>serial_no</term>
1006
              <listitem>
1007
                <simpara>the so called 'serial number' of the
1008
                instance; this is a numeric field that is incremented
1009
                each time the instance is modified, and it can be used
1010
                to track modifications</simpara>
1011
              </listitem>
1012
            </varlistentry>
1013
            <varlistentry>
1014
              <term>ctime</term>
1015
              <listitem>
1016
                <para>
1017
                  the creation time of the instance; note that this
1018
                  field contains spaces and as such it's harder to
1019
                  parse
1020
                </para>
1021
                <para>
1022
                  if this attribute is not present (e.g. when
1023
                  upgrading from older versions), then "N/A" will be
1024
                  shown instead
1025
                </para>
1026
              </listitem>
1027
            </varlistentry>
1028
            <varlistentry>
1029
              <term>mtime</term>
1030
              <listitem>
1031
                <para>
1032
                  the last modification time of the instance; note
1033
                  that this field contains spaces and as such it's
1034
                  harder to parse
1035
                </para>
1036
                <para>
1037
                  if this attribute is not present (e.g. when
1038
                  upgrading from older versions), then "N/A" will be
1039
                  shown instead
1040
                </para>
1041
              </listitem>
1042
            </varlistentry>
1043

    
1044
            <varlistentry>
1045
              <term>uuid</term>
1046
              <listitem>
1047
                <simpara>Show the UUID of the instance (generated
1048
                automatically by Ganeti)</simpara>
1049
              </listitem>
1050
            </varlistentry>
1051

    
1052
            <varlistentry>
1053
              <term>network_port</term>
1054
              <listitem>
1055
                <simpara>If the instance has a network port assigned
1056
                to it (e.g. for VNC connections), this will be shown,
1057
                otherwise <literal>-</literal> will be
1058
                displayed.</simpara>
1059
              </listitem>
1060
            </varlistentry>
1061
            <varlistentry>
1062
              <term>beparams</term>
1063
              <listitem>
1064
                <simpara>A text format of the entire beparams for the
1065
                instance. It's more useful to select individual fields
1066
                from this dictionary, see below.</simpara>
1067
              </listitem>
1068
            </varlistentry>
1069
            <varlistentry>
1070
              <term>disk.count</term>
1071
              <listitem>
1072
                <simpara>The number of instance disks.</simpara>
1073
              </listitem>
1074
            </varlistentry>
1075
            <varlistentry>
1076
              <term>disk.size/N</term>
1077
              <listitem>
1078
                <simpara>The size of the instance's Nth disk. This is
1079
                a more generic form of the <literal>sda_size</literal>
1080
                and <literal>sdb_size</literal> fields.</simpara>
1081
              </listitem>
1082
            </varlistentry>
1083
            <varlistentry>
1084
              <term>disk.sizes</term>
1085
              <listitem>
1086
                <simpara>A comma-separated list of the disk sizes for
1087
                this instance.</simpara>
1088
              </listitem>
1089
            </varlistentry>
1090
            <varlistentry>
1091
              <term>disk_usage</term>
1092
              <listitem>
1093
                <simpara>The total disk space used by this instance on
1094
                each of its nodes. This is not the instance-visible
1095
                disk size, but the actual disk "cost" of the
1096
                instance.</simpara>
1097
              </listitem>
1098
            </varlistentry>
1099
            <varlistentry>
1100
              <term>nic.mac/N</term>
1101
              <listitem>
1102
                <simpara>The MAC of the Nth instance NIC.</simpara>
1103
              </listitem>
1104
            </varlistentry>
1105
            <varlistentry>
1106
              <term>nic.ip/N</term>
1107
              <listitem>
1108
                <simpara>The IP address of the Nth instance NIC.</simpara>
1109
              </listitem>
1110
            </varlistentry>
1111
            <varlistentry>
1112
              <term>nic.mode/N</term>
1113
              <listitem>
1114
                <simpara>The mode of the Nth instance NIC</simpara>
1115
              </listitem>
1116
            </varlistentry>
1117
            <varlistentry>
1118
              <term>nic.link/N</term>
1119
              <listitem>
1120
                <simpara>The link of the Nth instance NIC</simpara>
1121
              </listitem>
1122
            </varlistentry>
1123
            <varlistentry>
1124
              <term>nic.macs</term>
1125
              <listitem>
1126
                <simpara>A comma-separated list of all the MACs of the
1127
                instance's NICs.</simpara>
1128
              </listitem>
1129
            </varlistentry>
1130
            <varlistentry>
1131
              <term>nic.ips</term>
1132
              <listitem>
1133
                <simpara>A comma-separated list of all the IP
1134
                addresses of the instance's NICs.</simpara>
1135
              </listitem>
1136
            </varlistentry>
1137
            <varlistentry>
1138
              <term>nic.modes</term>
1139
              <listitem>
1140
                <simpara>A comma-separated list of all the modes of the
1141
                instance's NICs.</simpara>
1142
              </listitem>
1143
            </varlistentry>
1144
            <varlistentry>
1145
              <term>nic.links</term>
1146
              <listitem>
1147
                <simpara>A comma-separated list of all the link parameters
1148
                of the instance's NICs.</simpara>
1149
              </listitem>
1150
            </varlistentry>
1151
            <varlistentry>
1152
              <term>nic.count</term>
1153
              <listitem>
1154
                <simpara>The number of instance nics.</simpara>
1155
              </listitem>
1156
            </varlistentry>
1157
            <varlistentry>
1158
              <term>hv/<replaceable>NAME</replaceable></term>
1159
              <listitem>
1160
                <simpara>The value of the hypervisor parameter called
1161
                <replaceable>NAME</replaceable>. For details of what
1162
                hypervisor parameters exist and their meaning, see the
1163
                <command>add</command> command.</simpara>
1164
              </listitem>
1165
            </varlistentry>
1166
            <varlistentry>
1167
              <term>be/memory</term>
1168
              <listitem>
1169
                <simpara>The configured memory for the instance.</simpara>
1170
              </listitem>
1171
            </varlistentry>
1172
            <varlistentry>
1173
              <term>be/vcpus</term>
1174
              <listitem>
1175
                <simpara>The configured number of VCPUs for the
1176
                instance.</simpara>
1177
              </listitem>
1178
            </varlistentry>
1179
            <varlistentry>
1180
              <term>be/auto_balance</term>
1181
              <listitem>
1182
                <simpara>Whether the instance is considered in N+1
1183
                checks.</simpara>
1184
              </listitem>
1185
            </varlistentry>
1186
          </variablelist>
1187
        </para>
1188

    
1189
        <para>
1190
          If the value of the option starts with the character
1191
          <constant>+</constant>, the new field(s) will be added to the
1192
          default list. This allows to quickly see the default list
1193
          plus a few other fields, instead of retyping the entire list
1194
          of fields.
1195
        </para>
1196

    
1197
        <para>
1198
          There is a subtle grouping about the available output
1199
          fields: all fields except for <option>oper_state</option>,
1200
          <option>oper_ram</option> and <option>status</option> are
1201
          configuration value and not run-time values. So if you don't
1202
          select any of the these fields, the query will be satisfied
1203
          instantly from the cluster configuration, without having to
1204
          ask the remote nodes for the data. This can be helpful for
1205
          big clusters when you only want some data and it makes sense
1206
          to specify a reduced set of output fields.
1207
        </para>
1208

    
1209
        <para>The default output field list is:
1210
          <simplelist type="inline">
1211
            <member>name</member>
1212
            <member>os</member>
1213
            <member>pnode</member>
1214
            <member>admin_state</member>
1215
            <member>oper_state</member>
1216
            <member>oper_ram</member>
1217
          </simplelist>.
1218
        </para>
1219
      </refsect3>
1220

    
1221
      <refsect3>
1222
        <title>INFO</title>
1223

    
1224
        <cmdsynopsis>
1225
          <command>info</command>
1226
          <group>
1227
            <arg>-s</arg>
1228
            <arg>--static</arg>
1229
          </group>
1230
          <group choice="req">
1231
            <arg>--all</arg>
1232
            <arg rep="repeat"><replaceable>instance</replaceable></arg>
1233
          </group>
1234
        </cmdsynopsis>
1235

    
1236
        <para>
1237
          Show detailed information about the given instance(s). This is
1238
          different from <command>list</command> as it shows detailed data
1239
          about the instance's disks (especially useful for the drbd disk
1240
          template).
1241
        </para>
1242

    
1243
        <para>
1244
          If the option <option>-s</option> is used, only information
1245
          available in the configuration file is returned, without
1246
          querying nodes, making the operation faster.
1247
        </para>
1248

    
1249
        <para>
1250
          Use the <option>--all</option> to get info about all instances,
1251
          rather than explicitely passing the ones you're interested in.
1252
        </para>
1253
      </refsect3>
1254

    
1255
      <refsect3>
1256
        <title>MODIFY</title>
1257

    
1258
        <cmdsynopsis>
1259
          <command>modify</command>
1260
          <sbr>
1261
          <arg choice="opt">-H <replaceable>HYPERVISOR_PARAMETERS</replaceable></arg>
1262
          <sbr>
1263
          <arg choice="opt">-B <replaceable>BACKEND_PARAMETERS</replaceable></arg>
1264
          <sbr>
1265
          <group>
1266
            <arg>--net add<replaceable><optional>:options</optional></replaceable></arg>
1267
            <arg>--net remove</arg>
1268
            <arg>--net <replaceable>N:options</replaceable></arg>
1269
          </group>
1270
          <sbr>
1271
          <group>
1272
            <arg>--disk add:size=<replaceable>SIZE</replaceable></arg>
1273
            <arg>--disk remove</arg>
1274
            <arg>--disk <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></arg>
1275
          </group>
1276

    
1277
          <sbr>
1278
          <arg>--submit</arg>
1279
          <sbr>
1280
          <arg choice="req"><replaceable>instance</replaceable></arg>
1281
        </cmdsynopsis>
1282

    
1283
        <para>
1284
          Modifies the memory size, number of vcpus, ip address, MAC
1285
          address and/or nic parameters for an instance. It can also
1286
          add and remove disks and NICs to/from the instance. Note
1287
          that you need to give at least one of the arguments, otherwise
1288
          the command complains.
1289
        </para>
1290

    
1291
        <para>
1292
          The <option>-H</option> option specifies hypervisor options
1293
          in the form of <userinput>name=value[,...]</userinput>. For details which options can be specified, see the <command>add</command> command.
1294
        </para>
1295

    
1296
        <para>
1297
          The <option>--disk
1298
          add:size=<replaceable>SIZE</replaceable></option> option
1299
          adds a disk to the instance. The <option>--disk
1300
          remove</option> will remove the last disk of the
1301
          instance. The <option>--disk
1302
          <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></option>
1303
          option will change the mode of the Nth disk of the instance
1304
          between read-only (<literal>ro</literal>) and read-write
1305
          (<literal>rw</literal>).
1306
        </para>
1307

    
1308
        <para>
1309
          The <option>--net
1310
          add:<replaceable>options</replaceable></option> option will
1311
          add a new NIC to the instance. The available options are the
1312
          same as in the <command>add</command> command (mac, ip, link,
1313
          mode). The <option>--net remove</option> will remove the
1314
          last NIC of the instance, while the <option>--net
1315
          <replaceable>N</replaceable>:<replaceable>options</replaceable></option>
1316
          option will change the parameters of the Nth instance NIC.
1317
        </para>
1318

    
1319
        <para>
1320
          The <option>--submit</option> option is used to send the job to
1321
          the master daemon but not wait for its completion. The job
1322
          ID will be shown so that it can be examined via
1323
          <command>gnt-job info</command>.
1324
        </para>
1325

    
1326
        <para>
1327
          All the changes take effect at the next restart. If the
1328
          instance is running, there is no effect on the instance.
1329
        </para>
1330
      </refsect3>
1331

    
1332
      <refsect3>
1333
        <title>REINSTALL</title>
1334

    
1335
        <cmdsynopsis>
1336
          <command>reinstall</command>
1337
          <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
1338
          <arg>--select-os</arg>
1339
          <arg choice="opt">-f <replaceable>force</replaceable></arg>
1340
          <arg>--force-multiple</arg>
1341
          <sbr>
1342
          <group choice="opt">
1343
            <arg>--instance</arg>
1344
            <arg>--node</arg>
1345
            <arg>--primary</arg>
1346
            <arg>--secondary</arg>
1347
            <arg>--all</arg>
1348
          </group>
1349
          <arg>--submit</arg>
1350
          <arg choice="opt" rep="repeat"><replaceable>instance</replaceable></arg>
1351
        </cmdsynopsis>
1352

    
1353
        <para>
1354
          Reinstalls the operating system on the given instance(s). The
1355
          instance(s) must be stopped when running this command. If the
1356
          <option>--os-type</option> is specified, the operating
1357
          system is changed.
1358
        </para>
1359

    
1360
        <para>
1361
          The <option>--select-os</option> option switches to an
1362
          interactive OS reinstall. The user is prompted to select the OS
1363
          template from the list of available OS templates.
1364
        </para>
1365

    
1366
        <para>
1367
          Since this is a potentially dangerous command, the user will
1368
          be required to confirm this action, unless the
1369
          <option>-f</option> flag is passed. When multiple instances
1370
          are selected (either by passing multiple arguments or by
1371
          using the <option>--node</option>,
1372
          <option>--primary</option>, <option>--secondary</option> or
1373
          <option>--all</option> options), the user must pass both the
1374
          <option>--force</option> and
1375
          <option>--force-multiple</option> options to skip the
1376
          interactive confirmation.
1377
        </para>
1378

    
1379
        <para>
1380
          The <option>--submit</option> option is used to send the job to
1381
          the master daemon but not wait for its completion. The job
1382
          ID will be shown so that it can be examined via
1383
          <command>gnt-job info</command>.
1384
        </para>
1385

    
1386

    
1387
      </refsect3>
1388

    
1389
      <refsect3>
1390
        <title>RENAME</title>
1391

    
1392
        <cmdsynopsis>
1393
          <command>rename</command>
1394
          <arg>--no-ip-check</arg>
1395
          <arg>--submit</arg>
1396
          <arg choice="req"><replaceable>instance</replaceable></arg>
1397
          <arg choice="req"><replaceable>new_name</replaceable></arg>
1398
        </cmdsynopsis>
1399

    
1400
        <para>
1401
          Renames the given instance. The instance must be stopped
1402
          when running this command. The requirements for the new name
1403
          are the same as for adding an instance: the new name must be
1404
          resolvable and the IP it resolves to must not be reachable
1405
          (in order to prevent duplicate IPs the next time the
1406
          instance is started). The IP test can be skipped if the
1407
          <option>--no-ip-check</option> option is passed.
1408
        </para>
1409

    
1410
        <para>
1411
          The <option>--submit</option> option is used to send the job to
1412
          the master daemon but not wait for its completion. The job
1413
          ID will be shown so that it can be examined via
1414
          <command>gnt-job info</command>.
1415
        </para>
1416

    
1417
      </refsect3>
1418

    
1419
    </refsect2>
1420

    
1421
    <refsect2>
1422
      <title>Starting/stopping/connecting to console</title>
1423

    
1424
      <refsect3>
1425
        <title>STARTUP</title>
1426

    
1427
        <cmdsynopsis>
1428
          <command>startup</command>
1429
          <sbr>
1430
          <arg>--force</arg>
1431
          <sbr>
1432
          <arg>--force-multiple</arg>
1433
          <sbr>
1434
          <group choice="opt">
1435
            <arg>--instance</arg>
1436
            <arg>--node</arg>
1437
            <arg>--primary</arg>
1438
            <arg>--secondary</arg>
1439
            <arg>--all</arg>
1440
          </group>
1441
          <sbr>
1442
          <arg>-H <option>key=value...</option></arg>
1443
          <arg>-B <option>key=value...</option></arg>
1444
          <sbr>
1445
          <arg>--submit</arg>
1446
          <sbr>
1447
          <arg choice="opt"
1448
          rep="repeat"><replaceable>name</replaceable></arg>
1449
        </cmdsynopsis>
1450

    
1451
        <para>
1452
          Starts one or more instances, depending on the following
1453
          options. The four available modes are:
1454
          <variablelist>
1455
            <varlistentry>
1456
              <term><option>--instance</option></term>
1457
              <listitem>
1458
                <simpara>will start the instances given as arguments
1459
                (at least one argument required); this is the default
1460
                selection</simpara>
1461
              </listitem>
1462
            </varlistentry>
1463
            <varlistentry>
1464
              <term>--node</term>
1465
              <listitem>
1466
                <simpara>will start the instances who have the given
1467
                node as either primary or secondary</simpara>
1468
              </listitem>
1469
            </varlistentry>
1470
            <varlistentry>
1471
              <term><option>--primary</option></term>
1472
              <listitem>
1473
                <simpara>will start all instances whose primary node
1474
                is in the list of nodes passed as arguments (at least
1475
                one node required)</simpara>
1476
              </listitem>
1477
            </varlistentry>
1478
            <varlistentry>
1479
              <term><option>--secondary</option></term>
1480
              <listitem>
1481
                <simpara>will start all instances whose secondary node
1482
                is in the list of nodes passed as arguments (at least
1483
                one node required)</simpara>
1484
              </listitem>
1485
            </varlistentry>
1486
            <varlistentry>
1487
              <term>--all</term>
1488
              <listitem>
1489
                <simpara>will start all instances in the cluster (no
1490
                arguments accepted)</simpara>
1491
              </listitem>
1492
            </varlistentry>
1493
          </variablelist>
1494
        </para>
1495

    
1496
        <para>
1497
          Note that although you can pass more than one selection
1498
          option, the last one wins, so in order to guarantee the
1499
          desired result, don't pass more than one such option.
1500
        </para>
1501

    
1502
        <para>
1503
          Use <option>--force</option> to start even if secondary disks are
1504
          failing.
1505
        </para>
1506

    
1507
        <para>
1508
          The <option>--force-multiple</option> will skip the
1509
          interactive confirmation in the case the more than one
1510
          instance will be affected.
1511
        </para>
1512

    
1513
        <para>
1514
          The <option>-H</option> and <option>-B</option> options
1515
          specify extra, temporary hypervisor and backend parameters
1516
          that can be used to start an instance with modified
1517
          parameters. They can be useful for quick testing without
1518
          having to modify an instance back and forth, e.g.:
1519
          <screen>
1520
# gnt-instance start -H root_args="single" instance1
1521
# gnt-instance start -B memory=2048 instance2
1522
          </screen>
1523
          The first form will start the instance
1524
          <userinput>instance1</userinput> in single-user mode, and
1525
          the instance <userinput>instance2</userinput> with 2GB of
1526
          RAM (this time only, unless that is the actual instance
1527
          memory size already).
1528
        </para>
1529

    
1530
        <para>
1531
          The <option>--submit</option> option is used to send the job to
1532
          the master daemon but not wait for its completion. The job
1533
          ID will be shown so that it can be examined via
1534
          <command>gnt-job info</command>.
1535
        </para>
1536

    
1537
        <para>
1538
          Example:
1539
          <screen>
1540
# gnt-instance start instance1.example.com
1541
# gnt-instance start --node node1.example.com node2.example.com
1542
# gnt-instance start --all
1543
          </screen>
1544
        </para>
1545
      </refsect3>
1546

    
1547
      <refsect3>
1548
        <title>SHUTDOWN</title>
1549

    
1550
        <cmdsynopsis>
1551
          <command>shutdown</command>
1552
          <sbr>
1553
          <arg>--timeout=<replaceable>N</replaceable></arg>
1554
          <sbr>
1555
          <arg>--force-multiple</arg>
1556
          <sbr>
1557
          <group choice="opt">
1558
            <arg>--instance</arg>
1559
            <arg>--node</arg>
1560
            <arg>--primary</arg>
1561
            <arg>--secondary</arg>
1562
            <arg>--all</arg>
1563
          </group>
1564
          <sbr>
1565
          <arg>--submit</arg>
1566
          <sbr>
1567
          <arg choice="opt"
1568
          rep="repeat"><replaceable>name</replaceable></arg>
1569
        </cmdsynopsis>
1570

    
1571
        <para>
1572
          Stops one or more instances. If the instance cannot be
1573
          cleanly stopped during a hardcoded interval (currently 2
1574
          minutes), it will forcibly stop the instance (equivalent to
1575
          switching off the power on a physical machine).
1576
        </para>
1577

    
1578
        <para>
1579
          The <option>--timeout</option> is used to specify how much time to
1580
          wait before forcing the shutdown (xm destroy in xen, killing the kvm
1581
          process, for kvm). By default two minutes are given to each instance
1582
          to stop.
1583
        </para>
1584

    
1585
        <para>
1586
          The <option>--instance</option>, <option>--node</option>,
1587
          <option>--primary</option>, <option>--secondary</option> and
1588
          <option>--all</option> options are similar as for the
1589
          <command>startup</command> command and they influence the
1590
          actual instances being shutdown.
1591
        </para>
1592

    
1593
        <para>
1594
          The <option>--submit</option> option is used to send the job to
1595
          the master daemon but not wait for its completion. The job
1596
          ID will be shown so that it can be examined via
1597
          <command>gnt-job info</command>.
1598
        </para>
1599

    
1600

    
1601
        <para>
1602
          Example:
1603
          <screen>
1604
# gnt-instance shutdown instance1.example.com
1605
# gnt-instance shutdown --all
1606
          </screen>
1607
        </para>
1608
      </refsect3>
1609

    
1610
      <refsect3>
1611
        <title>REBOOT</title>
1612

    
1613
        <cmdsynopsis>
1614
          <command>reboot</command>
1615
          <sbr>
1616
          <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
1617
          <sbr>
1618
          <arg>--ignore-secondaries</arg>
1619
          <sbr>
1620
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
1621
          <sbr>
1622
          <arg>--force-multiple</arg>
1623
          <sbr>
1624
          <group choice="opt">
1625
            <arg>--instance</arg>
1626
            <arg>--node</arg>
1627
            <arg>--primary</arg>
1628
            <arg>--secondary</arg>
1629
            <arg>--all</arg>
1630
          </group>
1631
          <sbr>
1632
          <arg>--submit</arg>
1633
          <sbr>
1634
          <arg choice="opt"
1635
          rep="repeat"><replaceable>name</replaceable></arg>
1636
        </cmdsynopsis>
1637

    
1638
        <para>
1639
          Reboots one or more instances. The type of reboot depends on
1640
          the value of <option>--type</option>. A soft reboot does a
1641
          hypervisor reboot, a hard reboot does a instance stop,
1642
          recreates the hypervisor config for the instance and
1643
          starts the instance. A full reboot does the equivalent
1644
          of <command>gnt-instance shutdown &amp;&amp; gnt-instance
1645
          startup</command>. The default is hard reboot.
1646
        </para>
1647

    
1648
        <para>
1649
          For the hard reboot the option
1650
          <option>--ignore-secondaries</option> ignores errors for the
1651
          secondary node while re-assembling the instance disks.
1652
        </para>
1653

    
1654
        <para>
1655
          The <option>--instance</option>, <option>--node</option>,
1656
          <option>--primary</option>, <option>--secondary</option> and
1657
          <option>--all</option> options are similar as for the
1658
          <command>startup</command> command and they influence the
1659
          actual instances being rebooted.
1660
        </para>
1661

    
1662
        <para>
1663
          The <option>--shutdown-timeout</option> is used to specify how
1664
          much time to wait before forcing the shutdown (xm destroy in xen,
1665
          killing the kvm process, for kvm). By default two minutes are
1666
          given to each instance to stop.
1667
        </para>
1668

    
1669
        <para>
1670
          The <option>--force-multiple</option> will skip the
1671
          interactive confirmation in the case the more than one
1672
          instance will be affected.
1673
        </para>
1674

    
1675
        <para>
1676
          Example:
1677
          <screen>
1678
# gnt-instance reboot instance1.example.com
1679
# gnt-instance reboot --type=full instance1.example.com
1680
          </screen>
1681
        </para>
1682
      </refsect3>
1683

    
1684
      <refsect3>
1685
        <title>CONSOLE</title>
1686
        <cmdsynopsis>
1687
          <command>console</command>
1688
          <arg choice="opt">--show-cmd</arg>
1689
          <arg choice="req"><replaceable>instance</replaceable></arg>
1690
        </cmdsynopsis>
1691

    
1692
        <para>
1693
          Connects to the console of the given instance. If the
1694
          instance is not up, an error is returned. Use the
1695
          <option>--show-cmd</option> option to display the command
1696
          instead of executing it.
1697
        </para>
1698

    
1699
        <para>
1700
          For HVM instances, this will attempt to connect to the
1701
          serial console of the instance. To connect to the
1702
          virtualized "physical" console of a HVM instance, use a VNC
1703
          client with the connection info from the
1704
          <command>info</command> command.
1705
        </para>
1706

    
1707
        <para>
1708
          Example:
1709
          <screen>
1710
# gnt-instance console instance1.example.com
1711
          </screen>
1712
        </para>
1713
      </refsect3>
1714

    
1715
    </refsect2>
1716

    
1717
    <refsect2>
1718
      <title>Disk management</title>
1719

    
1720
      <refsect3>
1721
        <title>REPLACE-DISKS</title>
1722

    
1723
        <cmdsynopsis>
1724
          <command>replace-disks</command>
1725
          <arg>--submit</arg>
1726
          <arg choice="req">-p</arg>
1727
          <arg>--disks <replaceable>idx</replaceable></arg>
1728
          <arg choice="req"><replaceable>instance</replaceable></arg>
1729
        </cmdsynopsis>
1730

    
1731
        <cmdsynopsis>
1732
          <command>replace-disks</command>
1733
          <arg>--submit</arg>
1734
          <arg choice="req">-s</arg>
1735
          <arg>--disks <replaceable>idx</replaceable></arg>
1736
          <arg choice="req"><replaceable>instance</replaceable></arg>
1737
        </cmdsynopsis>
1738

    
1739
        <cmdsynopsis>
1740
          <command>replace-disks</command>
1741
          <arg>--submit</arg>
1742
          <group choice="req">
1743
            <arg>--iallocator <replaceable>name</replaceable></arg>
1744
            <arg>--new-secondary <replaceable>NODE</replaceable></arg>
1745
          </group>
1746

    
1747
          <arg choice="req"><replaceable>instance</replaceable></arg>
1748
        </cmdsynopsis>
1749

    
1750
        <cmdsynopsis>
1751
          <command>replace-disks</command>
1752
          <arg>--submit</arg>
1753
          <arg choice="req">--auto</arg>
1754
          <arg choice="req"><replaceable>instance</replaceable></arg>
1755
        </cmdsynopsis>
1756

    
1757
        <para>
1758
          This command is a generalized form for replacing disks. It
1759
          is currently only valid for the mirrored (DRBD) disk
1760
          template.
1761
        </para>
1762

    
1763
        <para>
1764
          The first form (when passing the <option>-p</option> option)
1765
          will replace the disks on the primary, while the second form
1766
          (when passing the <option>-s</option> option will replace
1767
          the disks on the secondary node. For these two cases (as the
1768
          node doesn't change), it is possible to only run the replace
1769
          for a subset of the disks, using the option
1770
          <option>--disks</option> which takes a list of
1771
          comma-delimited disk indices (zero-based),
1772
          e.g. <userinput>0,2</userinput> to replace only the first
1773
          and third disks.
1774
        </para>
1775

    
1776
        <para>
1777
          The third form (when passing either the
1778
          <option>--iallocator</option> or the
1779
          <option>--new-secondary</option> option) is designed to
1780
          change secondary node of the instance.  Specifying
1781
          <option>--iallocator</option> makes the new secondary be
1782
          selected automatically by the specified allocator plugin,
1783
          otherwise the new secondary node will be the one chosen
1784
          manually via the <option>--new-secondary</option> option.
1785
        </para>
1786

    
1787
        <para>
1788
          The fourth form (when using <option>--auto</option>) will
1789
          automatically determine which disks of an instance are faulty and
1790
          replace them within the same node. The <option>--auto</option>
1791
          option works only when an instance has only faulty disks on
1792
          either the primary or secondary node; it doesn't work when
1793
          both sides have faulty disks.
1794
        </para>
1795

    
1796
        <para>
1797
          The <option>--submit</option> option is used to send the job to
1798
          the master daemon but not wait for its completion. The job
1799
          ID will be shown so that it can be examined via
1800
          <command>gnt-job info</command>.
1801
        </para>
1802

    
1803
        <para>
1804
          Note that it is not possible to select an offline or drained
1805
          node as a new secondary.
1806
        </para>
1807

    
1808
      </refsect3>
1809

    
1810
      <refsect3>
1811
        <title>ACTIVATE-DISKS</title>
1812

    
1813
        <cmdsynopsis>
1814
          <command>activate-disks</command>
1815
          <arg>--submit</arg>
1816
          <arg>--ignore-size</arg>
1817
          <arg choice="req"><replaceable>instance</replaceable></arg>
1818
        </cmdsynopsis>
1819
        <para>
1820
          Activates the block devices of the given instance. If
1821
          successful, the command will show the location and name of
1822
          the block devices:
1823
          <screen>
1824
node1.example.com:disk/0:/dev/drbd0
1825
node1.example.com:disk/1:/dev/drbd1
1826
          </screen>
1827

    
1828
          In this example, <emphasis>node1.example.com</emphasis> is
1829
          the name of the node on which the devices have been
1830
          activated. The <emphasis>disk/0</emphasis> and
1831
          <emphasis>disk/1</emphasis> are the Ganeti-names of the
1832
          instance disks; how they are visible inside the instance is
1833
          hypervisor-specific. <emphasis>/dev/drbd0</emphasis> and
1834
          <emphasis>/dev/drbd1</emphasis> are the actual block devices
1835
          as visible on the node.
1836
        </para>
1837

    
1838
        <para>
1839
          The <option>--submit</option> option is used to send the job to
1840
          the master daemon but not wait for its completion. The job
1841
          ID will be shown so that it can be examined via
1842
          <command>gnt-job info</command>.
1843
        </para>
1844

    
1845
        <para>
1846
          The <option>--ignore-size</option> option can be used to
1847
          activate disks ignoring the currently configured size in
1848
          Ganeti. This can be used in cases where the configuration
1849
          has gotten out of sync with the real-world (e.g. after a
1850
          partially-failed grow-disk operation or due to rounding in
1851
          LVM devices). This should not be used in normal cases, but
1852
          only when activate-disks fails without it.
1853
        </para>
1854

    
1855
        <para>
1856
          Note that it is safe to run this command while the instance
1857
          is already running.
1858
        </para>
1859
      </refsect3>
1860

    
1861
      <refsect3>
1862
        <title>DEACTIVATE-DISKS</title>
1863

    
1864
        <cmdsynopsis>
1865
          <command>deactivate-disks</command>
1866
          <arg>--submit</arg>
1867
          <arg choice="req"><replaceable>instance</replaceable></arg>
1868
        </cmdsynopsis>
1869
        <para>
1870
          De-activates the block devices of the given instance. Note
1871
          that if you run this command for an instance with a drbd
1872
          disk template, while it is running, it will not be able to
1873
          shutdown the block devices on the primary node, but it will
1874
          shutdown the block devices on the secondary nodes, thus
1875
          breaking the replication.
1876
        </para>
1877

    
1878
        <para>
1879
          The <option>--submit</option> option is used to send the job to
1880
          the master daemon but not wait for its completion. The job
1881
          ID will be shown so that it can be examined via
1882
          <command>gnt-job info</command>.
1883
        </para>
1884

    
1885
      </refsect3>
1886

    
1887
      <refsect3>
1888
        <title>GROW-DISK</title>
1889
        <cmdsynopsis>
1890
          <command>grow-disk</command>
1891
          <arg>--no-wait-for-sync</arg>
1892
          <arg>--submit</arg>
1893
          <arg choice="req"><replaceable>instance</replaceable></arg>
1894
          <arg choice="req"><replaceable>disk</replaceable></arg>
1895
          <arg choice="req"><replaceable>amount</replaceable></arg>
1896
        </cmdsynopsis>
1897

    
1898
        <para>
1899
          Grows an instance's disk. This is only possible for
1900
          instances having a <literal>plain</literal> or
1901
          <literal>drbd</literal> disk template.
1902
        </para>
1903

    
1904
        <para>
1905
          Note that this command only change the block device size; it
1906
          will not grow the actual filesystems, partitions, etc. that
1907
          live on that disk. Usually, you will need to:
1908
          <orderedlist>
1909
            <listitem>
1910
              <simpara>use <command>gnt-instance grow-disk</command></simpara>
1911
            </listitem>
1912
            <listitem>
1913
              <simpara>reboot the instance (later, at a convenient
1914
              time)</simpara>
1915
            </listitem>
1916
            <listitem>
1917
              <simpara>use a filesystem resizer, such as
1918
              <citerefentry> <refentrytitle>ext2online</refentrytitle>
1919
              <manvolnum>8</manvolnum> </citerefentry> or
1920
              <citerefentry> <refentrytitle>xfs_growfs</refentrytitle>
1921
              <manvolnum>8</manvolnum> </citerefentry> to resize the
1922
              filesystem, or use <citerefentry>
1923
              <refentrytitle>fdisk</refentrytitle>
1924
              <manvolnum>8</manvolnum> </citerefentry> to change the
1925
              partition table on the disk
1926
              </simpara>
1927
            </listitem>
1928
          </orderedlist>
1929
        </para>
1930

    
1931

    
1932
        <para>
1933
          The <replaceable>disk</replaceable> argument is the index of
1934
          the instance disk to grow. The
1935
          <replaceable>amount</replaceable> argument is given either
1936
          as a number (and it represents the amount to increase the
1937
          disk with in mebibytes) or can be given similar to the
1938
          arguments in the create instance operation, with a suffix
1939
          denoting the unit.
1940
        </para>
1941

    
1942
        <para>
1943
          Note that the disk grow operation might complete on one node
1944
          but fail on the other; this will leave the instance with
1945
          different-sized LVs on the two nodes, but this will not
1946
          create problems (except for unused space).
1947
        </para>
1948

    
1949
        <para>
1950
          If you do not want gnt-instance to wait for the new disk
1951
          region to be synced, use the
1952
          <option>--no-wait-for-sync</option> option.
1953
        </para>
1954

    
1955
        <para>
1956
          The <option>--submit</option> option is used to send the job to
1957
          the master daemon but not wait for its completion. The job
1958
          ID will be shown so that it can be examined via
1959
          <command>gnt-job info</command>.
1960
        </para>
1961

    
1962

    
1963
        <para>Example (increase the first disk for instance1 by 16GiB):
1964
          <screen>
1965
# gnt-instance grow-disk instance1.example.com 0 16g
1966
          </screen>
1967
        </para>
1968

    
1969
        <para>
1970
          Also note that disk shrinking is not supported; use
1971
          <command>gnt-backup export</command> and then
1972
          <command>gnt-backup import</command> to reduce the disk size
1973
          of an instance.
1974
        </para>
1975
      </refsect3>
1976

    
1977
      <refsect3>
1978
        <title>RECREATE-DISKS</title>
1979

    
1980
        <cmdsynopsis>
1981
          <command>recreate-disks</command>
1982
          <arg>--submit</arg>
1983
          <arg>--disks=<option>indices</option></arg>
1984
          <arg choice="req"><replaceable>instance</replaceable></arg>
1985
        </cmdsynopsis>
1986
        <para>
1987
          Recreates the disks of the given instance, or only a subset
1988
          of the disks (if the option <option>disks</option> is
1989
          passed, which must be a comma-separated list of disk
1990
          indices, starting from zero).
1991
        </para>
1992

    
1993
        <para>
1994
          Note that this functionality should only be used for missing
1995
          disks; if any of the given disks already exists, the
1996
          operation will fail. While this is suboptimal,
1997
          recreate-disks should hopefully not be needed in normal
1998
          operation and as such the impact of this is low.
1999
        </para>
2000

    
2001
        <para>
2002
          The <option>--submit</option> option is used to send the job to
2003
          the master daemon but not wait for its completion. The job
2004
          ID will be shown so that it can be examined via
2005
          <command>gnt-job info</command>.
2006
        </para>
2007

    
2008
      </refsect3>
2009

    
2010
    </refsect2>
2011

    
2012
    <refsect2>
2013
      <title>Recovery</title>
2014

    
2015
      <refsect3>
2016
        <title>FAILOVER</title>
2017

    
2018
        <cmdsynopsis>
2019
          <command>failover</command>
2020
          <arg>-f</arg>
2021
          <arg>--ignore-consistency</arg>
2022
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2023
          <arg>--submit</arg>
2024
          <arg choice="req"><replaceable>instance</replaceable></arg>
2025
        </cmdsynopsis>
2026

    
2027
        <para>
2028
          Failover will fail the instance over its secondary
2029
          node. This works only for instances having a drbd disk
2030
          template.
2031
        </para>
2032

    
2033
        <para>
2034
          Normally the failover will check the consistency of the
2035
          disks before failing over the instance. If you are trying to
2036
          migrate instances off a dead node, this will fail. Use the
2037
          <option>--ignore-consistency</option> option for this
2038
          purpose. Note that this option can be dangerous as errors in
2039
          shutting down the instance will be ignored, resulting in
2040
          possibly having the instance running on two machines in
2041
          parallel (on disconnected DRBD drives).
2042
        </para>
2043

    
2044
        <para>
2045
          The <option>--shutdown-timeout</option> is used to specify how
2046
          much time to wait before forcing the shutdown (xm destroy in xen,
2047
          killing the kvm process, for kvm). By default two minutes are
2048
          given to each instance to stop.
2049
        </para>
2050

    
2051
        <para>
2052
          The <option>--submit</option> option is used to send the job to
2053
          the master daemon but not wait for its completion. The job
2054
          ID will be shown so that it can be examined via
2055
          <command>gnt-job info</command>.
2056
        </para>
2057

    
2058
        <para>
2059
          Example:
2060
          <screen>
2061
# gnt-instance failover instance1.example.com
2062
          </screen>
2063
        </para>
2064
      </refsect3>
2065

    
2066
      <refsect3>
2067
        <title>MIGRATE</title>
2068

    
2069
        <cmdsynopsis>
2070
          <command>migrate</command>
2071
          <arg>-f</arg>
2072
          <arg choice="req">--cleanup</arg>
2073
          <arg choice="req"><replaceable>instance</replaceable></arg>
2074
        </cmdsynopsis>
2075

    
2076
        <cmdsynopsis>
2077
          <command>migrate</command>
2078
          <arg>-f</arg>
2079
          <arg>--non-live</arg>
2080
          <arg choice="req"><replaceable>instance</replaceable></arg>
2081
        </cmdsynopsis>
2082

    
2083
        <para>
2084
          Migrate will move the instance to its secondary node without
2085
          shutdown. It only works for instances having the drbd8 disk
2086
          template type.
2087
        </para>
2088

    
2089
        <para>
2090
          The migration command needs a perfectly healthy instance, as
2091
          we rely on the dual-master capability of drbd8 and the disks
2092
          of the instance are not allowed to be degraded.
2093
        </para>
2094

    
2095
        <para>
2096
          The <option>--non-live</option> option will switch (for the
2097
          hypervisors that support it) between a "fully live"
2098
          (i.e. the interruption is as minimal as possible) migration
2099
          and one in which the instance is frozen, its state saved and
2100
          transported to the remote node, and then resumed there. This
2101
          all depends on the hypervisor support for two different
2102
          methods. In any case, it is not an error to pass this
2103
          parameter (it will just be ignored if the hypervisor doesn't
2104
          support it).
2105
        </para>
2106

    
2107
        <para>
2108
          If the <option>--cleanup</option> option is passed, the
2109
          operation changes from migration to attempting recovery from
2110
          a failed previous migration. In this mode, ganeti checks if
2111
          the instance runs on the correct node (and updates its
2112
          configuration if not) and ensures the instances's disks are
2113
          configured correctly. In this mode, the
2114
          <option>--non-live</option> option is ignored.
2115
        </para>
2116

    
2117
        <para>
2118
          The option <option>-f</option> will skip the prompting for
2119
          confirmation.
2120
        </para>
2121
        <para>
2122
          Example (and expected output):
2123
          <screen>
2124
# gnt-instance migrate instance1
2125
Migrate will happen to the instance instance1. Note that migration is
2126
**experimental** in this version. This might impact the instance if
2127
anything goes wrong. Continue?
2128
y/[n]/?: y
2129
* checking disk consistency between source and target
2130
* ensuring the target is in secondary mode
2131
* changing disks into dual-master mode
2132
 - INFO: Waiting for instance instance1 to sync disks.
2133
 - INFO: Instance instance1's disks are in sync.
2134
* migrating instance to node2.example.com
2135
* changing the instance's disks on source node to secondary
2136
 - INFO: Waiting for instance instance1 to sync disks.
2137
 - INFO: Instance instance1's disks are in sync.
2138
* changing the instance's disks to single-master
2139
#
2140
          </screen>
2141
        </para>
2142
      </refsect3>
2143

    
2144
      <refsect3>
2145
        <title>MOVE</title>
2146

    
2147
        <cmdsynopsis>
2148
          <command>move</command>
2149
          <arg>-f</arg>
2150
          <arg>-n <replaceable>node</replaceable></arg>
2151
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2152
          <arg>--submit</arg>
2153
          <arg choice="req"><replaceable>instance</replaceable></arg>
2154
        </cmdsynopsis>
2155

    
2156
        <para>
2157
          Move will move the instance to an arbitrary node in the
2158
          cluster. This works only for instances having a plain or
2159
          file disk template.
2160
        </para>
2161

    
2162
        <para>
2163
          Note that since this operation is done via data copy, it
2164
          will take a long time for big disks (similar to
2165
          replace-disks for a drbd instance).
2166
        </para>
2167

    
2168
        <para>
2169
          The <option>--shutdown-timeout</option> is used to specify how
2170
          much time to wait before forcing the shutdown (xm destroy in xen,
2171
          killing the kvm process, for kvm). By default two minutes are
2172
          given to each instance to stop.
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
        <para>
2183
          Example:
2184
          <screen>
2185
# gnt-instance move -n node3.example.com instance1.example.com
2186
          </screen>
2187
        </para>
2188
      </refsect3>
2189

    
2190
    </refsect2>
2191

    
2192
    <refsect2>
2193
      <title>TAGS</title>
2194

    
2195
    <refsect3>
2196
        <title>ADD-TAGS</title>
2197

    
2198
        <cmdsynopsis>
2199
          <command>add-tags</command>
2200
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2201
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2202
          <arg choice="req"
2203
            rep="repeat"><replaceable>tag</replaceable></arg>
2204
        </cmdsynopsis>
2205

    
2206
        <para>
2207
          Add tags to the given instance. If any of the tags contains
2208
          invalid characters, the entire operation will abort.
2209
        </para>
2210
        <para>
2211
          If the <option>--from</option> option is given, the list of
2212
          tags will be extended with the contents of that file (each
2213
          line becomes a tag). In this case, there is not need to pass
2214
          tags on the command line (if you do, both sources will be
2215
          used). A file name of - will be interpreted as stdin.
2216
        </para>
2217
      </refsect3>
2218

    
2219
      <refsect3>
2220
        <title>LIST-TAGS</title>
2221

    
2222
        <cmdsynopsis>
2223
          <command>list-tags</command>
2224
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2225
        </cmdsynopsis>
2226

    
2227
        <para>List the tags of the given instance.</para>
2228
      </refsect3>
2229

    
2230
      <refsect3>
2231
        <title>REMOVE-TAGS</title>
2232
        <cmdsynopsis>
2233
          <command>remove-tags</command>
2234
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2235
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2236
          <arg choice="req"
2237
            rep="repeat"><replaceable>tag</replaceable></arg>
2238
        </cmdsynopsis>
2239

    
2240
        <para>
2241
          Remove tags from the given instance. If any of the tags are
2242
          not existing on the node, the entire operation will abort.
2243
        </para>
2244

    
2245
        <para>
2246
          If the <option>--from</option> option is given, the list of
2247
          tags will be extended with the contents of that file (each
2248
          line becomes a tag). In this case, there is not need to pass
2249
          tags on the command line (if you do, both sources will be
2250
          used). A file name of - will be interpreted as stdin.
2251
        </para>
2252
      </refsect3>
2253

    
2254
    </refsect2>
2255

    
2256
  </refsect1>
2257

    
2258
  &footer;
2259

    
2260
</refentry>
2261

    
2262
<!-- Keep this comment at the end of the file
2263
Local variables:
2264
mode: sgml
2265
sgml-omittag:t
2266
sgml-shorttag:t
2267
sgml-minimize-attributes:nil
2268
sgml-always-quote-attributes:t
2269
sgml-indent-step:2
2270
sgml-indent-data:t
2271
sgml-parent-document:nil
2272
sgml-default-dtd-file:nil
2273
sgml-exposed-tags:nil
2274
sgml-local-catalogs:nil
2275
sgml-local-ecat-files:nil
2276
End:
2277
-->