Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ 9b94905f

History | View | Annotate | Download (80.7 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
          </variablelist>
508
        </para>
509

    
510
        <para>
511
        </para>
512

    
513
        <para>
514
          The <option>--iallocator</option> option specifies the instance
515
          allocator plugin to use. If you pass in this option the allocator
516
          will select nodes for this instance automatically, so you don't need
517
          to pass them with the <option>-n</option> option. For more
518
          information please refer to the instance allocator documentation.
519
        </para>
520

    
521
        <para>
522
          The <option>-t</option> options specifies the disk layout type for
523
          the instance. The available choices are:
524
          <variablelist>
525
            <varlistentry>
526
              <term>diskless</term>
527
              <listitem>
528
                <para>
529
                  This creates an instance with no disks. Its useful for
530
                  testing only (or other special cases).
531
                </para>
532
              </listitem>
533
            </varlistentry>
534
            <varlistentry>
535
              <term>file</term>
536
              <listitem>
537
                <para>Disk devices will be regular files.</para>
538
              </listitem>
539
            </varlistentry>
540
            <varlistentry>
541
              <term>plain</term>
542
              <listitem>
543
                <para>Disk devices will be logical volumes.</para>
544
              </listitem>
545
            </varlistentry>
546
            <varlistentry>
547
              <term>drbd</term>
548
              <listitem>
549
                <para>
550
                  Disk devices will be drbd (version 8.x) on top of
551
                  lvm volumes.
552
                </para>
553
              </listitem>
554
            </varlistentry>
555
          </variablelist>
556
        </para>
557

    
558
        <para>
559
          The optional second value of the <option>--node</option> is used for
560
          the drbd template type and specifies the remote node.
561
        </para>
562

    
563
        <para>
564
          If you do not want gnt-instance to wait for the disk mirror
565
          to be synced, use the <option>--no-wait-for-sync</option>
566
          option.
567
        </para>
568

    
569
        <para>
570
          The <option>--file-storage-dir</option> specifies the relative path
571
          under the cluster-wide file storage directory to store file-based
572
          disks. It is useful for having different subdirectories for
573
          different instances. The full path of the directory where the disk
574
          files are stored will consist of cluster-wide file storage directory
575
          + optional subdirectory + instance name. Example:
576
          /srv/ganeti/file-storage/mysubdir/instance1.example.com. This option
577
          is only relevant for instances using the file storage backend.
578
        </para>
579

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

    
618
        <para>
619
          The <option>--submit</option> option is used to send the job to
620
          the master daemon but not wait for its completion. The job
621
          ID will be shown so that it can be examined via
622
          <command>gnt-job info</command>.
623
        </para>
624

    
625
        <para>
626
          Example:
627
          <screen>
628
# gnt-instance add -t file --disk 0:size=30g -B memory=512 -o debian-etch \
629
  -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
630
# gnt-instance add -t plain --disk 0:size=30g -B memory=512 -o debian-etch \
631
  -n node1.example.com instance1.example.com
632
# gnt-instance add -t drbd --disk 0:size=30g -B memory=512 -o debian-etch \
633
  -n node1.example.com:node2.example.com instance2.example.com
634
          </screen>
635
        </para>
636
      </refsect3>
637

    
638
      <refsect3>
639
        <title>BATCH-CREATE</title>
640
        <cmdsynopsis>
641
          <command>batch-create</command>
642
          <arg choice="req">instances_file.json</arg>
643
        </cmdsynopsis>
644

    
645
        <para>
646
          This command (similar to the Ganeti 1.2
647
          <command>batcher</command> tool) submits multiple instance
648
          creation jobs based on a definition file. The instance
649
          configurations do not encompass all the possible options for
650
          the <command>add</command> command, but only a subset.
651
        </para>
652

    
653
        <para>
654
          The instance file should be a valid-formed JSON file,
655
          containing a dictionary with instance name and instance
656
          parameters. The accepted parameters are:
657

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

    
747
        <para>
748
          A simple definition for one instance can be (with most of
749
          the parameters taken from the cluster defaults):
750
          <screen>
751
{
752
  "instance3": {
753
    "template": "drbd",
754
    "os": "debootstrap",
755
    "disk_size": ["25G"],
756
    "iallocator": "dumb"
757
  },
758
  "instance5": {
759
    "template": "drbd",
760
    "os": "debootstrap",
761
    "disk_size": ["25G"],
762
    "iallocator": "dumb",
763
    "hypervisor": "xen-hvm",
764
    "hvparams": {"acpi": true},
765
    "backend": {"memory": 512}
766
  }
767
}
768
</screen>
769
        </para>
770

    
771
        <para>
772
          The command will display the job id for each submitted instance, as follows:
773
          <screen>
774
# gnt-instance batch-create instances.json
775
instance3: 11224
776
instance5: 11225
777
</screen>
778
        </para>
779

    
780
      </refsect3>
781

    
782
      <refsect3>
783
        <title>REMOVE</title>
784

    
785
        <cmdsynopsis>
786
          <command>remove</command>
787
          <arg>--ignore-failures</arg>
788
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
789
          <arg>--submit</arg>
790
          <arg choice="req"><replaceable>instance</replaceable></arg>
791
        </cmdsynopsis>
792

    
793
        <para>
794
          Remove an instance. This will remove all data from the
795
          instance and there is <emphasis>no way back</emphasis>. If
796
          you are not sure if you use an instance again, use
797
          <command>shutdown</command> first and leave it in the
798
          shutdown state for a while.
799

    
800
        </para>
801

    
802
        <para>
803
          The <option>--ignore-failures</option> option will cause the
804
          removal to proceed even in the presence of errors during the
805
          removal of the instance (e.g. during the shutdown or the
806
          disk removal). If this option is not given, the command will
807
          stop at the first error.
808
        </para>
809

    
810
        <para>
811
          The <option>--shutdown-timeout</option> is used to specify how
812
          much time to wait before forcing the shutdown (xm destroy in xen,
813
          killing the kvm process, for kvm). By default two minutes are
814
          given to each instance to stop.
815
        </para>
816

    
817
        <para>
818
          The <option>--submit</option> option is used to send the job to
819
          the master daemon but not wait for its completion. The job
820
          ID will be shown so that it can be examined via
821
          <command>gnt-job info</command>.
822
        </para>
823

    
824
        <para>
825
          Example:
826
          <screen>
827
# gnt-instance remove instance1.example.com
828
          </screen>
829
        </para>
830
      </refsect3>
831

    
832
      <refsect3>
833
        <title>LIST</title>
834

    
835
        <cmdsynopsis>
836
          <command>list</command>
837
          <arg>--no-headers</arg>
838
          <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
839
          <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
840
          <arg rep="repeat">instance</arg>
841
        </cmdsynopsis>
842

    
843
        <para>
844
          Shows the currently configured instances with memory usage,
845
          disk usage, the node they are running on, and their run
846
          status.
847
        </para>
848

    
849
        <para>
850
          The <option>--no-headers</option> option will skip the
851
          initial header line. The <option>--separator</option> option
852
          takes an argument which denotes what will be used between
853
          the output fields. Both these options are to help scripting.
854
        </para>
855

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

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

    
1028
            <varlistentry>
1029
              <term>uuid</term>
1030
              <listitem>
1031
                <simpara>Show the UUID of the instance (generated
1032
                automatically by Ganeti)</simpara>
1033
              </listitem>
1034
            </varlistentry>
1035

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

    
1173
        <para>
1174
          If the value of the option starts with the character
1175
          <constant>+</constant>, the new field(s) will be added to the
1176
          default list. This allows to quickly see the default list
1177
          plus a few other fields, instead of retyping the entire list
1178
          of fields.
1179
        </para>
1180

    
1181
        <para>
1182
          There is a subtle grouping about the available output
1183
          fields: all fields except for <option>oper_state</option>,
1184
          <option>oper_ram</option> and <option>status</option> are
1185
          configuration value and not run-time values. So if you don't
1186
          select any of the these fields, the query will be satisfied
1187
          instantly from the cluster configuration, without having to
1188
          ask the remote nodes for the data. This can be helpful for
1189
          big clusters when you only want some data and it makes sense
1190
          to specify a reduced set of output fields.
1191
        </para>
1192

    
1193
        <para>The default output field list is:
1194
          <simplelist type="inline">
1195
            <member>name</member>
1196
            <member>os</member>
1197
            <member>pnode</member>
1198
            <member>admin_state</member>
1199
            <member>oper_state</member>
1200
            <member>oper_ram</member>
1201
          </simplelist>.
1202
        </para>
1203
      </refsect3>
1204

    
1205
      <refsect3>
1206
        <title>INFO</title>
1207

    
1208
        <cmdsynopsis>
1209
          <command>info</command>
1210
          <group>
1211
            <arg>-s</arg>
1212
            <arg>--static</arg>
1213
          </group>
1214
          <group choice="req">
1215
            <arg>--all</arg>
1216
            <arg rep="repeat"><replaceable>instance</replaceable></arg>
1217
          </group>
1218
        </cmdsynopsis>
1219

    
1220
        <para>
1221
          Show detailed information about the given instance(s). This is
1222
          different from <command>list</command> as it shows detailed data
1223
          about the instance's disks (especially useful for the drbd disk
1224
          template).
1225
        </para>
1226

    
1227
        <para>
1228
          If the option <option>-s</option> is used, only information
1229
          available in the configuration file is returned, without
1230
          querying nodes, making the operation faster.
1231
        </para>
1232

    
1233
        <para>
1234
          Use the <option>--all</option> to get info about all instances,
1235
          rather than explicitely passing the ones you're interested in.
1236
        </para>
1237
      </refsect3>
1238

    
1239
      <refsect3>
1240
        <title>MODIFY</title>
1241

    
1242
        <cmdsynopsis>
1243
          <command>modify</command>
1244
          <sbr>
1245
          <arg choice="opt">-H <replaceable>HYPERVISOR_PARAMETERS</replaceable></arg>
1246
          <sbr>
1247
          <arg choice="opt">-B <replaceable>BACKEND_PARAMETERS</replaceable></arg>
1248
          <sbr>
1249
          <group>
1250
            <arg>--net add<replaceable><optional>:options</optional></replaceable></arg>
1251
            <arg>--net remove</arg>
1252
            <arg>--net <replaceable>N:options</replaceable></arg>
1253
          </group>
1254
          <sbr>
1255
          <group>
1256
            <arg>--disk add:size=<replaceable>SIZE</replaceable></arg>
1257
            <arg>--disk remove</arg>
1258
            <arg>--disk <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></arg>
1259
          </group>
1260

    
1261
          <sbr>
1262
          <arg>--submit</arg>
1263
          <sbr>
1264
          <arg choice="req"><replaceable>instance</replaceable></arg>
1265
        </cmdsynopsis>
1266

    
1267
        <para>
1268
          Modifies the memory size, number of vcpus, ip address, MAC
1269
          address and/or nic parameters for an instance. It can also
1270
          add and remove disks and NICs to/from the instance. Note
1271
          that you need to give at least one of the arguments, otherwise
1272
          the command complains.
1273
        </para>
1274

    
1275
        <para>
1276
          The <option>-H</option> option specifies hypervisor options
1277
          in the form of <userinput>name=value[,...]</userinput>. For details which options can be specified, see the <command>add</command> command.
1278
        </para>
1279

    
1280
        <para>
1281
          The <option>--disk
1282
          add:size=<replaceable>SIZE</replaceable></option> option
1283
          adds a disk to the instance. The <option>--disk
1284
          remove</option> will remove the last disk of the
1285
          instance. The <option>--disk
1286
          <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></option>
1287
          option will change the mode of the Nth disk of the instance
1288
          between read-only (<literal>ro</literal>) and read-write
1289
          (<literal>rw</literal>).
1290
        </para>
1291

    
1292
        <para>
1293
          The <option>--net
1294
          add:<replaceable>options</replaceable></option> option will
1295
          add a new NIC to the instance. The available options are the
1296
          same as in the <command>add</command> command (mac, ip, link,
1297
          mode). The <option>--net remove</option> will remove the
1298
          last NIC of the instance, while the <option>--net
1299
          <replaceable>N</replaceable>:<replaceable>options</replaceable></option>
1300
          option will change the parameters of the Nth instance NIC.
1301
        </para>
1302

    
1303
        <para>
1304
          The <option>--submit</option> option is used to send the job to
1305
          the master daemon but not wait for its completion. The job
1306
          ID will be shown so that it can be examined via
1307
          <command>gnt-job info</command>.
1308
        </para>
1309

    
1310
        <para>
1311
          All the changes take effect at the next restart. If the
1312
          instance is running, there is no effect on the instance.
1313
        </para>
1314
      </refsect3>
1315

    
1316
      <refsect3>
1317
        <title>REINSTALL</title>
1318

    
1319
        <cmdsynopsis>
1320
          <command>reinstall</command>
1321
          <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
1322
          <arg>--select-os</arg>
1323
          <arg choice="opt">-f <replaceable>force</replaceable></arg>
1324
          <arg>--force-multiple</arg>
1325
          <sbr>
1326
          <group choice="opt">
1327
            <arg>--instance</arg>
1328
            <arg>--node</arg>
1329
            <arg>--primary</arg>
1330
            <arg>--secondary</arg>
1331
            <arg>--all</arg>
1332
          </group>
1333
          <arg>--submit</arg>
1334
          <arg choice="opt" rep="repeat"><replaceable>instance</replaceable></arg>
1335
        </cmdsynopsis>
1336

    
1337
        <para>
1338
          Reinstalls the operating system on the given instance(s). The
1339
          instance(s) must be stopped when running this command. If the
1340
          <option>--os-type</option> is specified, the operating
1341
          system is changed.
1342
        </para>
1343

    
1344
        <para>
1345
          The <option>--select-os</option> option switches to an
1346
          interactive OS reinstall. The user is prompted to select the OS
1347
          template from the list of available OS templates.
1348
        </para>
1349

    
1350
        <para>
1351
          Since this is a potentially dangerous command, the user will
1352
          be required to confirm this action, unless the
1353
          <option>-f</option> flag is passed. When multiple instances
1354
          are selected (either by passing multiple arguments or by
1355
          using the <option>--node</option>,
1356
          <option>--primary</option>, <option>--secondary</option> or
1357
          <option>--all</option> options), the user must pass both the
1358
          <option>--force</option> and
1359
          <option>--force-multiple</option> options to skip the
1360
          interactive confirmation.
1361
        </para>
1362

    
1363
        <para>
1364
          The <option>--submit</option> option is used to send the job to
1365
          the master daemon but not wait for its completion. The job
1366
          ID will be shown so that it can be examined via
1367
          <command>gnt-job info</command>.
1368
        </para>
1369

    
1370

    
1371
      </refsect3>
1372

    
1373
      <refsect3>
1374
        <title>RENAME</title>
1375

    
1376
        <cmdsynopsis>
1377
          <command>rename</command>
1378
          <arg>--no-ip-check</arg>
1379
          <arg>--submit</arg>
1380
          <arg choice="req"><replaceable>instance</replaceable></arg>
1381
          <arg choice="req"><replaceable>new_name</replaceable></arg>
1382
        </cmdsynopsis>
1383

    
1384
        <para>
1385
          Renames the given instance. The instance must be stopped
1386
          when running this command. The requirements for the new name
1387
          are the same as for adding an instance: the new name must be
1388
          resolvable and the IP it resolves to must not be reachable
1389
          (in order to prevent duplicate IPs the next time the
1390
          instance is started). The IP test can be skipped if the
1391
          <option>--no-ip-check</option> option is passed.
1392
        </para>
1393

    
1394
        <para>
1395
          The <option>--submit</option> option is used to send the job to
1396
          the master daemon but not wait for its completion. The job
1397
          ID will be shown so that it can be examined via
1398
          <command>gnt-job info</command>.
1399
        </para>
1400

    
1401
      </refsect3>
1402

    
1403
    </refsect2>
1404

    
1405
    <refsect2>
1406
      <title>Starting/stopping/connecting to console</title>
1407

    
1408
      <refsect3>
1409
        <title>STARTUP</title>
1410

    
1411
        <cmdsynopsis>
1412
          <command>startup</command>
1413
          <sbr>
1414
          <arg>--force</arg>
1415
          <sbr>
1416
          <arg>--force-multiple</arg>
1417
          <sbr>
1418
          <group choice="opt">
1419
            <arg>--instance</arg>
1420
            <arg>--node</arg>
1421
            <arg>--primary</arg>
1422
            <arg>--secondary</arg>
1423
            <arg>--all</arg>
1424
          </group>
1425
          <sbr>
1426
          <arg>-H <option>key=value...</option></arg>
1427
          <arg>-B <option>key=value...</option></arg>
1428
          <sbr>
1429
          <arg>--submit</arg>
1430
          <sbr>
1431
          <arg choice="opt"
1432
          rep="repeat"><replaceable>name</replaceable></arg>
1433
        </cmdsynopsis>
1434

    
1435
        <para>
1436
          Starts one or more instances, depending on the following
1437
          options. The four available modes are:
1438
          <variablelist>
1439
            <varlistentry>
1440
              <term><option>--instance</option></term>
1441
              <listitem>
1442
                <simpara>will start the instances given as arguments
1443
                (at least one argument required); this is the default
1444
                selection</simpara>
1445
              </listitem>
1446
            </varlistentry>
1447
            <varlistentry>
1448
              <term>--node</term>
1449
              <listitem>
1450
                <simpara>will start the instances who have the given
1451
                node as either primary or secondary</simpara>
1452
              </listitem>
1453
            </varlistentry>
1454
            <varlistentry>
1455
              <term><option>--primary</option></term>
1456
              <listitem>
1457
                <simpara>will start all instances whose primary node
1458
                is in the list of nodes passed as arguments (at least
1459
                one node required)</simpara>
1460
              </listitem>
1461
            </varlistentry>
1462
            <varlistentry>
1463
              <term><option>--secondary</option></term>
1464
              <listitem>
1465
                <simpara>will start all instances whose secondary node
1466
                is in the list of nodes passed as arguments (at least
1467
                one node required)</simpara>
1468
              </listitem>
1469
            </varlistentry>
1470
            <varlistentry>
1471
              <term>--all</term>
1472
              <listitem>
1473
                <simpara>will start all instances in the cluster (no
1474
                arguments accepted)</simpara>
1475
              </listitem>
1476
            </varlistentry>
1477
          </variablelist>
1478
        </para>
1479

    
1480
        <para>
1481
          Note that although you can pass more than one selection
1482
          option, the last one wins, so in order to guarantee the
1483
          desired result, don't pass more than one such option.
1484
        </para>
1485

    
1486
        <para>
1487
          Use <option>--force</option> to start even if secondary disks are
1488
          failing.
1489
        </para>
1490

    
1491
        <para>
1492
          The <option>--force-multiple</option> will skip the
1493
          interactive confirmation in the case the more than one
1494
          instance will be affected.
1495
        </para>
1496

    
1497
        <para>
1498
          The <option>-H</option> and <option>-B</option> options
1499
          specify extra, temporary hypervisor and backend parameters
1500
          that can be used to start an instance with modified
1501
          parameters. They can be useful for quick testing without
1502
          having to modify an instance back and forth, e.g.:
1503
          <screen>
1504
# gnt-instance start -H root_args="single" instance1
1505
# gnt-instance start -B memory=2048 instance2
1506
          </screen>
1507
          The first form will start the instance
1508
          <userinput>instance1</userinput> in single-user mode, and
1509
          the instance <userinput>instance2</userinput> with 2GB of
1510
          RAM (this time only, unless that is the actual instance
1511
          memory size already).
1512
        </para>
1513

    
1514
        <para>
1515
          The <option>--submit</option> option is used to send the job to
1516
          the master daemon but not wait for its completion. The job
1517
          ID will be shown so that it can be examined via
1518
          <command>gnt-job info</command>.
1519
        </para>
1520

    
1521
        <para>
1522
          Example:
1523
          <screen>
1524
# gnt-instance start instance1.example.com
1525
# gnt-instance start --node node1.example.com node2.example.com
1526
# gnt-instance start --all
1527
          </screen>
1528
        </para>
1529
      </refsect3>
1530

    
1531
      <refsect3>
1532
        <title>SHUTDOWN</title>
1533

    
1534
        <cmdsynopsis>
1535
          <command>shutdown</command>
1536
          <sbr>
1537
          <arg>--timeout=<replaceable>N</replaceable></arg>
1538
          <sbr>
1539
          <arg>--force-multiple</arg>
1540
          <sbr>
1541
          <group choice="opt">
1542
            <arg>--instance</arg>
1543
            <arg>--node</arg>
1544
            <arg>--primary</arg>
1545
            <arg>--secondary</arg>
1546
            <arg>--all</arg>
1547
          </group>
1548
          <sbr>
1549
          <arg>--submit</arg>
1550
          <sbr>
1551
          <arg choice="opt"
1552
          rep="repeat"><replaceable>name</replaceable></arg>
1553
        </cmdsynopsis>
1554

    
1555
        <para>
1556
          Stops one or more instances. If the instance cannot be
1557
          cleanly stopped during a hardcoded interval (currently 2
1558
          minutes), it will forcibly stop the instance (equivalent to
1559
          switching off the power on a physical machine).
1560
        </para>
1561

    
1562
        <para>
1563
          The <option>--timeout</option> is used to specify how much time to
1564
          wait before forcing the shutdown (xm destroy in xen, killing the kvm
1565
          process, for kvm). By default two minutes are given to each instance
1566
          to stop.
1567
        </para>
1568

    
1569
        <para>
1570
          The <option>--instance</option>, <option>--node</option>,
1571
          <option>--primary</option>, <option>--secondary</option> and
1572
          <option>--all</option> options are similar as for the
1573
          <command>startup</command> command and they influence the
1574
          actual instances being shutdown.
1575
        </para>
1576

    
1577
        <para>
1578
          The <option>--submit</option> option is used to send the job to
1579
          the master daemon but not wait for its completion. The job
1580
          ID will be shown so that it can be examined via
1581
          <command>gnt-job info</command>.
1582
        </para>
1583

    
1584

    
1585
        <para>
1586
          Example:
1587
          <screen>
1588
# gnt-instance shutdown instance1.example.com
1589
# gnt-instance shutdown --all
1590
          </screen>
1591
        </para>
1592
      </refsect3>
1593

    
1594
      <refsect3>
1595
        <title>REBOOT</title>
1596

    
1597
        <cmdsynopsis>
1598
          <command>reboot</command>
1599
          <sbr>
1600
          <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
1601
          <sbr>
1602
          <arg>--ignore-secondaries</arg>
1603
          <sbr>
1604
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
1605
          <sbr>
1606
          <arg>--force-multiple</arg>
1607
          <sbr>
1608
          <group choice="opt">
1609
            <arg>--instance</arg>
1610
            <arg>--node</arg>
1611
            <arg>--primary</arg>
1612
            <arg>--secondary</arg>
1613
            <arg>--all</arg>
1614
          </group>
1615
          <sbr>
1616
          <arg>--submit</arg>
1617
          <sbr>
1618
          <arg choice="opt"
1619
          rep="repeat"><replaceable>name</replaceable></arg>
1620
        </cmdsynopsis>
1621

    
1622
        <para>
1623
          Reboots one or more instances. The type of reboot depends on
1624
          the value of <option>--type</option>. A soft reboot does a
1625
          hypervisor reboot, a hard reboot does a instance stop,
1626
          recreates the hypervisor config for the instance and
1627
          starts the instance. A full reboot does the equivalent
1628
          of <command>gnt-instance shutdown &amp;&amp; gnt-instance
1629
          startup</command>. The default is hard reboot.
1630
        </para>
1631

    
1632
        <para>
1633
          For the hard reboot the option
1634
          <option>--ignore-secondaries</option> ignores errors for the
1635
          secondary node while re-assembling the instance disks.
1636
        </para>
1637

    
1638
        <para>
1639
          The <option>--instance</option>, <option>--node</option>,
1640
          <option>--primary</option>, <option>--secondary</option> and
1641
          <option>--all</option> options are similar as for the
1642
          <command>startup</command> command and they influence the
1643
          actual instances being rebooted.
1644
        </para>
1645

    
1646
        <para>
1647
          The <option>--shutdown-timeout</option> is used to specify how
1648
          much time to wait before forcing the shutdown (xm destroy in xen,
1649
          killing the kvm process, for kvm). By default two minutes are
1650
          given to each instance to stop.
1651
        </para>
1652

    
1653
        <para>
1654
          The <option>--force-multiple</option> will skip the
1655
          interactive confirmation in the case the more than one
1656
          instance will be affected.
1657
        </para>
1658

    
1659
        <para>
1660
          Example:
1661
          <screen>
1662
# gnt-instance reboot instance1.example.com
1663
# gnt-instance reboot --type=full instance1.example.com
1664
          </screen>
1665
        </para>
1666
      </refsect3>
1667

    
1668
      <refsect3>
1669
        <title>CONSOLE</title>
1670
        <cmdsynopsis>
1671
          <command>console</command>
1672
          <arg choice="opt">--show-cmd</arg>
1673
          <arg choice="req"><replaceable>instance</replaceable></arg>
1674
        </cmdsynopsis>
1675

    
1676
        <para>
1677
          Connects to the console of the given instance. If the
1678
          instance is not up, an error is returned. Use the
1679
          <option>--show-cmd</option> option to display the command
1680
          instead of executing it.
1681
        </para>
1682

    
1683
        <para>
1684
          For HVM instances, this will attempt to connect to the
1685
          serial console of the instance. To connect to the
1686
          virtualized "physical" console of a HVM instance, use a VNC
1687
          client with the connection info from the
1688
          <command>info</command> command.
1689
        </para>
1690

    
1691
        <para>
1692
          Example:
1693
          <screen>
1694
# gnt-instance console instance1.example.com
1695
          </screen>
1696
        </para>
1697
      </refsect3>
1698

    
1699
    </refsect2>
1700

    
1701
    <refsect2>
1702
      <title>Disk management</title>
1703

    
1704
      <refsect3>
1705
        <title>REPLACE-DISKS</title>
1706

    
1707
        <cmdsynopsis>
1708
          <command>replace-disks</command>
1709
          <arg>--submit</arg>
1710
          <arg choice="req">-p</arg>
1711
          <arg>--disks <replaceable>idx</replaceable></arg>
1712
          <arg choice="req"><replaceable>instance</replaceable></arg>
1713
        </cmdsynopsis>
1714

    
1715
        <cmdsynopsis>
1716
          <command>replace-disks</command>
1717
          <arg>--submit</arg>
1718
          <arg choice="req">-s</arg>
1719
          <arg>--disks <replaceable>idx</replaceable></arg>
1720
          <arg choice="req"><replaceable>instance</replaceable></arg>
1721
        </cmdsynopsis>
1722

    
1723
        <cmdsynopsis>
1724
          <command>replace-disks</command>
1725
          <arg>--submit</arg>
1726
          <group choice="req">
1727
            <arg>--iallocator <replaceable>name</replaceable></arg>
1728
            <arg>--new-secondary <replaceable>NODE</replaceable></arg>
1729
          </group>
1730

    
1731
          <arg choice="req"><replaceable>instance</replaceable></arg>
1732
        </cmdsynopsis>
1733

    
1734
        <cmdsynopsis>
1735
          <command>replace-disks</command>
1736
          <arg>--submit</arg>
1737
          <arg choice="req">--auto</arg>
1738
          <arg choice="req"><replaceable>instance</replaceable></arg>
1739
        </cmdsynopsis>
1740

    
1741
        <para>
1742
          This command is a generalized form for replacing disks. It
1743
          is currently only valid for the mirrored (DRBD) disk
1744
          template.
1745
        </para>
1746

    
1747
        <para>
1748
          The first form (when passing the <option>-p</option> option)
1749
          will replace the disks on the primary, while the second form
1750
          (when passing the <option>-s</option> option will replace
1751
          the disks on the secondary node. For these two cases (as the
1752
          node doesn't change), it is possible to only run the replace
1753
          for a subset of the disks, using the option
1754
          <option>--disks</option> which takes a list of
1755
          comma-delimited disk indices (zero-based),
1756
          e.g. <userinput>0,2</userinput> to replace only the first
1757
          and third disks.
1758
        </para>
1759

    
1760
        <para>
1761
          The third form (when passing either the
1762
          <option>--iallocator</option> or the
1763
          <option>--new-secondary</option> option) is designed to
1764
          change secondary node of the instance.  Specifying
1765
          <option>--iallocator</option> makes the new secondary be
1766
          selected automatically by the specified allocator plugin,
1767
          otherwise the new secondary node will be the one chosen
1768
          manually via the <option>--new-secondary</option> option.
1769
        </para>
1770

    
1771
        <para>
1772
          The fourth form (when using <option>--auto</option>) will
1773
          automatically determine which disks of an instance are faulty and
1774
          replace them within the same node. The <option>--auto</option>
1775
          option works only when an instance has only faulty disks on
1776
          either the primary or secondary node; it doesn't work when
1777
          both sides have faulty disks.
1778
        </para>
1779

    
1780
        <para>
1781
          The <option>--submit</option> option is used to send the job to
1782
          the master daemon but not wait for its completion. The job
1783
          ID will be shown so that it can be examined via
1784
          <command>gnt-job info</command>.
1785
        </para>
1786

    
1787
        <para>
1788
          Note that it is not possible to select an offline or drained
1789
          node as a new secondary.
1790
        </para>
1791

    
1792
      </refsect3>
1793

    
1794
      <refsect3>
1795
        <title>ACTIVATE-DISKS</title>
1796

    
1797
        <cmdsynopsis>
1798
          <command>activate-disks</command>
1799
          <arg>--submit</arg>
1800
          <arg>--ignore-size</arg>
1801
          <arg choice="req"><replaceable>instance</replaceable></arg>
1802
        </cmdsynopsis>
1803
        <para>
1804
          Activates the block devices of the given instance. If
1805
          successful, the command will show the location and name of
1806
          the block devices:
1807
          <screen>
1808
node1.example.com:disk/0:/dev/drbd0
1809
node1.example.com:disk/1:/dev/drbd1
1810
          </screen>
1811

    
1812
          In this example, <emphasis>node1.example.com</emphasis> is
1813
          the name of the node on which the devices have been
1814
          activated. The <emphasis>disk/0</emphasis> and
1815
          <emphasis>disk/1</emphasis> are the Ganeti-names of the
1816
          instance disks; how they are visible inside the instance is
1817
          hypervisor-specific. <emphasis>/dev/drbd0</emphasis> and
1818
          <emphasis>/dev/drbd1</emphasis> are the actual block devices
1819
          as visible on the node.
1820
        </para>
1821

    
1822
        <para>
1823
          The <option>--submit</option> option is used to send the job to
1824
          the master daemon but not wait for its completion. The job
1825
          ID will be shown so that it can be examined via
1826
          <command>gnt-job info</command>.
1827
        </para>
1828

    
1829
        <para>
1830
          The <option>--ignore-size</option> option can be used to
1831
          activate disks ignoring the currently configured size in
1832
          Ganeti. This can be used in cases where the configuration
1833
          has gotten out of sync with the real-world (e.g. after a
1834
          partially-failed grow-disk operation or due to rounding in
1835
          LVM devices). This should not be used in normal cases, but
1836
          only when activate-disks fails without it.
1837
        </para>
1838

    
1839
        <para>
1840
          Note that it is safe to run this command while the instance
1841
          is already running.
1842
        </para>
1843
      </refsect3>
1844

    
1845
      <refsect3>
1846
        <title>DEACTIVATE-DISKS</title>
1847

    
1848
        <cmdsynopsis>
1849
          <command>deactivate-disks</command>
1850
          <arg>--submit</arg>
1851
          <arg choice="req"><replaceable>instance</replaceable></arg>
1852
        </cmdsynopsis>
1853
        <para>
1854
          De-activates the block devices of the given instance. Note
1855
          that if you run this command for an instance with a drbd
1856
          disk template, while it is running, it will not be able to
1857
          shutdown the block devices on the primary node, but it will
1858
          shutdown the block devices on the secondary nodes, thus
1859
          breaking the replication.
1860
        </para>
1861

    
1862
        <para>
1863
          The <option>--submit</option> option is used to send the job to
1864
          the master daemon but not wait for its completion. The job
1865
          ID will be shown so that it can be examined via
1866
          <command>gnt-job info</command>.
1867
        </para>
1868

    
1869
      </refsect3>
1870

    
1871
      <refsect3>
1872
        <title>GROW-DISK</title>
1873
        <cmdsynopsis>
1874
          <command>grow-disk</command>
1875
          <arg>--no-wait-for-sync</arg>
1876
          <arg>--submit</arg>
1877
          <arg choice="req"><replaceable>instance</replaceable></arg>
1878
          <arg choice="req"><replaceable>disk</replaceable></arg>
1879
          <arg choice="req"><replaceable>amount</replaceable></arg>
1880
        </cmdsynopsis>
1881

    
1882
        <para>
1883
          Grows an instance's disk. This is only possible for
1884
          instances having a <literal>plain</literal> or
1885
          <literal>drbd</literal> disk template.
1886
        </para>
1887

    
1888
        <para>
1889
          Note that this command only change the block device size; it
1890
          will not grow the actual filesystems, partitions, etc. that
1891
          live on that disk. Usually, you will need to:
1892
          <orderedlist>
1893
            <listitem>
1894
              <simpara>use <command>gnt-instance grow-disk</command></simpara>
1895
            </listitem>
1896
            <listitem>
1897
              <simpara>reboot the instance (later, at a convenient
1898
              time)</simpara>
1899
            </listitem>
1900
            <listitem>
1901
              <simpara>use a filesystem resizer, such as
1902
              <citerefentry> <refentrytitle>ext2online</refentrytitle>
1903
              <manvolnum>8</manvolnum> </citerefentry> or
1904
              <citerefentry> <refentrytitle>xfs_growfs</refentrytitle>
1905
              <manvolnum>8</manvolnum> </citerefentry> to resize the
1906
              filesystem, or use <citerefentry>
1907
              <refentrytitle>fdisk</refentrytitle>
1908
              <manvolnum>8</manvolnum> </citerefentry> to change the
1909
              partition table on the disk
1910
              </simpara>
1911
            </listitem>
1912
          </orderedlist>
1913
        </para>
1914

    
1915

    
1916
        <para>
1917
          The <replaceable>disk</replaceable> argument is the index of
1918
          the instance disk to grow. The
1919
          <replaceable>amount</replaceable> argument is given either
1920
          as a number (and it represents the amount to increase the
1921
          disk with in mebibytes) or can be given similar to the
1922
          arguments in the create instance operation, with a suffix
1923
          denoting the unit.
1924
        </para>
1925

    
1926
        <para>
1927
          Note that the disk grow operation might complete on one node
1928
          but fail on the other; this will leave the instance with
1929
          different-sized LVs on the two nodes, but this will not
1930
          create problems (except for unused space).
1931
        </para>
1932

    
1933
        <para>
1934
          If you do not want gnt-instance to wait for the new disk
1935
          region to be synced, use the
1936
          <option>--no-wait-for-sync</option> option.
1937
        </para>
1938

    
1939
        <para>
1940
          The <option>--submit</option> option is used to send the job to
1941
          the master daemon but not wait for its completion. The job
1942
          ID will be shown so that it can be examined via
1943
          <command>gnt-job info</command>.
1944
        </para>
1945

    
1946

    
1947
        <para>Example (increase the first disk for instance1 by 16GiB):
1948
          <screen>
1949
# gnt-instance grow-disk instance1.example.com 0 16g
1950
          </screen>
1951
        </para>
1952

    
1953
        <para>
1954
          Also note that disk shrinking is not supported; use
1955
          <command>gnt-backup export</command> and then
1956
          <command>gnt-backup import</command> to reduce the disk size
1957
          of an instance.
1958
        </para>
1959
      </refsect3>
1960

    
1961
      <refsect3>
1962
        <title>RECREATE-DISKS</title>
1963

    
1964
        <cmdsynopsis>
1965
          <command>recreate-disks</command>
1966
          <arg>--submit</arg>
1967
          <arg>--disks=<option>indices</option></arg>
1968
          <arg choice="req"><replaceable>instance</replaceable></arg>
1969
        </cmdsynopsis>
1970
        <para>
1971
          Recreates the disks of the given instance, or only a subset
1972
          of the disks (if the option <option>disks</option> is
1973
          passed, which must be a comma-separated list of disk
1974
          indices, starting from zero).
1975
        </para>
1976

    
1977
        <para>
1978
          Note that this functionality should only be used for missing
1979
          disks; if any of the given disks already exists, the
1980
          operation will fail. While this is suboptimal,
1981
          recreate-disks should hopefully not be needed in normal
1982
          operation and as such the impact of this is low.
1983
        </para>
1984

    
1985
        <para>
1986
          The <option>--submit</option> option is used to send the job to
1987
          the master daemon but not wait for its completion. The job
1988
          ID will be shown so that it can be examined via
1989
          <command>gnt-job info</command>.
1990
        </para>
1991

    
1992
      </refsect3>
1993

    
1994
    </refsect2>
1995

    
1996
    <refsect2>
1997
      <title>Recovery</title>
1998

    
1999
      <refsect3>
2000
        <title>FAILOVER</title>
2001

    
2002
        <cmdsynopsis>
2003
          <command>failover</command>
2004
          <arg>-f</arg>
2005
          <arg>--ignore-consistency</arg>
2006
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2007
          <arg>--submit</arg>
2008
          <arg choice="req"><replaceable>instance</replaceable></arg>
2009
        </cmdsynopsis>
2010

    
2011
        <para>
2012
          Failover will fail the instance over its secondary
2013
          node. This works only for instances having a drbd disk
2014
          template.
2015
        </para>
2016

    
2017
        <para>
2018
          Normally the failover will check the consistency of the
2019
          disks before failing over the instance. If you are trying to
2020
          migrate instances off a dead node, this will fail. Use the
2021
          <option>--ignore-consistency</option> option for this
2022
          purpose. Note that this option can be dangerous as errors in
2023
          shutting down the instance will be ignored, resulting in
2024
          possibly having the instance running on two machines in
2025
          parallel (on disconnected DRBD drives).
2026
        </para>
2027

    
2028
        <para>
2029
          The <option>--shutdown-timeout</option> is used to specify how
2030
          much time to wait before forcing the shutdown (xm destroy in xen,
2031
          killing the kvm process, for kvm). By default two minutes are
2032
          given to each instance to stop.
2033
        </para>
2034

    
2035
        <para>
2036
          The <option>--submit</option> option is used to send the job to
2037
          the master daemon but not wait for its completion. The job
2038
          ID will be shown so that it can be examined via
2039
          <command>gnt-job info</command>.
2040
        </para>
2041

    
2042
        <para>
2043
          Example:
2044
          <screen>
2045
# gnt-instance failover instance1.example.com
2046
          </screen>
2047
        </para>
2048
      </refsect3>
2049

    
2050
      <refsect3>
2051
        <title>MIGRATE</title>
2052

    
2053
        <cmdsynopsis>
2054
          <command>migrate</command>
2055
          <arg>-f</arg>
2056
          <arg choice="req">--cleanup</arg>
2057
          <arg choice="req"><replaceable>instance</replaceable></arg>
2058
        </cmdsynopsis>
2059

    
2060
        <cmdsynopsis>
2061
          <command>migrate</command>
2062
          <arg>-f</arg>
2063
          <arg>--non-live</arg>
2064
          <arg choice="req"><replaceable>instance</replaceable></arg>
2065
        </cmdsynopsis>
2066

    
2067
        <para>
2068
          Migrate will move the instance to its secondary node without
2069
          shutdown. It only works for instances having the drbd8 disk
2070
          template type.
2071
        </para>
2072

    
2073
        <para>
2074
          The migration command needs a perfectly healthy instance, as
2075
          we rely on the dual-master capability of drbd8 and the disks
2076
          of the instance are not allowed to be degraded.
2077
        </para>
2078

    
2079
        <para>
2080
          The <option>--non-live</option> option will switch (for the
2081
          hypervisors that support it) between a "fully live"
2082
          (i.e. the interruption is as minimal as possible) migration
2083
          and one in which the instance is frozen, its state saved and
2084
          transported to the remote node, and then resumed there. This
2085
          all depends on the hypervisor support for two different
2086
          methods. In any case, it is not an error to pass this
2087
          parameter (it will just be ignored if the hypervisor doesn't
2088
          support it).
2089
        </para>
2090

    
2091
        <para>
2092
          If the <option>--cleanup</option> option is passed, the
2093
          operation changes from migration to attempting recovery from
2094
          a failed previous migration. In this mode, ganeti checks if
2095
          the instance runs on the correct node (and updates its
2096
          configuration if not) and ensures the instances's disks are
2097
          configured correctly. In this mode, the
2098
          <option>--non-live</option> option is ignored.
2099
        </para>
2100

    
2101
        <para>
2102
          The option <option>-f</option> will skip the prompting for
2103
          confirmation.
2104
        </para>
2105
        <para>
2106
          Example (and expected output):
2107
          <screen>
2108
# gnt-instance migrate instance1
2109
Migrate will happen to the instance instance1. Note that migration is
2110
**experimental** in this version. This might impact the instance if
2111
anything goes wrong. Continue?
2112
y/[n]/?: y
2113
* checking disk consistency between source and target
2114
* ensuring the target is in secondary mode
2115
* changing disks into dual-master mode
2116
 - INFO: Waiting for instance instance1 to sync disks.
2117
 - INFO: Instance instance1's disks are in sync.
2118
* migrating instance to node2.example.com
2119
* changing the instance's disks on source node to secondary
2120
 - INFO: Waiting for instance instance1 to sync disks.
2121
 - INFO: Instance instance1's disks are in sync.
2122
* changing the instance's disks to single-master
2123
#
2124
          </screen>
2125
        </para>
2126
      </refsect3>
2127

    
2128
      <refsect3>
2129
        <title>MOVE</title>
2130

    
2131
        <cmdsynopsis>
2132
          <command>move</command>
2133
          <arg>-f</arg>
2134
          <arg>-n <replaceable>node</replaceable></arg>
2135
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2136
          <arg>--submit</arg>
2137
          <arg choice="req"><replaceable>instance</replaceable></arg>
2138
        </cmdsynopsis>
2139

    
2140
        <para>
2141
          Move will move the instance to an arbitrary node in the
2142
          cluster. This works only for instances having a plain or
2143
          file disk template.
2144
        </para>
2145

    
2146
        <para>
2147
          Note that since this operation is done via data copy, it
2148
          will take a long time for big disks (similar to
2149
          replace-disks for a drbd instance).
2150
        </para>
2151

    
2152
        <para>
2153
          The <option>--shutdown-timeout</option> is used to specify how
2154
          much time to wait before forcing the shutdown (xm destroy in xen,
2155
          killing the kvm process, for kvm). By default two minutes are
2156
          given to each instance to stop.
2157
        </para>
2158

    
2159
        <para>
2160
          The <option>--submit</option> option is used to send the job to
2161
          the master daemon but not wait for its completion. The job
2162
          ID will be shown so that it can be examined via
2163
          <command>gnt-job info</command>.
2164
        </para>
2165

    
2166
        <para>
2167
          Example:
2168
          <screen>
2169
# gnt-instance move -n node3.example.com instance1.example.com
2170
          </screen>
2171
        </para>
2172
      </refsect3>
2173

    
2174
    </refsect2>
2175

    
2176
    <refsect2>
2177
      <title>TAGS</title>
2178

    
2179
    <refsect3>
2180
        <title>ADD-TAGS</title>
2181

    
2182
        <cmdsynopsis>
2183
          <command>add-tags</command>
2184
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2185
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2186
          <arg choice="req"
2187
            rep="repeat"><replaceable>tag</replaceable></arg>
2188
        </cmdsynopsis>
2189

    
2190
        <para>
2191
          Add tags to the given instance. If any of the tags contains
2192
          invalid characters, the entire operation will abort.
2193
        </para>
2194
        <para>
2195
          If the <option>--from</option> option is given, the list of
2196
          tags will be extended with the contents of that file (each
2197
          line becomes a tag). In this case, there is not need to pass
2198
          tags on the command line (if you do, both sources will be
2199
          used). A file name of - will be interpreted as stdin.
2200
        </para>
2201
      </refsect3>
2202

    
2203
      <refsect3>
2204
        <title>LIST-TAGS</title>
2205

    
2206
        <cmdsynopsis>
2207
          <command>list-tags</command>
2208
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2209
        </cmdsynopsis>
2210

    
2211
        <para>List the tags of the given instance.</para>
2212
      </refsect3>
2213

    
2214
      <refsect3>
2215
        <title>REMOVE-TAGS</title>
2216
        <cmdsynopsis>
2217
          <command>remove-tags</command>
2218
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2219
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2220
          <arg choice="req"
2221
            rep="repeat"><replaceable>tag</replaceable></arg>
2222
        </cmdsynopsis>
2223

    
2224
        <para>
2225
          Remove tags from the given instance. If any of the tags are
2226
          not existing on the node, the entire operation will abort.
2227
        </para>
2228

    
2229
        <para>
2230
          If the <option>--from</option> option is given, the list of
2231
          tags will be extended with the contents of that file (each
2232
          line becomes a tag). In this case, there is not need to pass
2233
          tags on the command line (if you do, both sources will be
2234
          used). A file name of - will be interpreted as stdin.
2235
        </para>
2236
      </refsect3>
2237

    
2238
    </refsect2>
2239

    
2240
  </refsect1>
2241

    
2242
  &footer;
2243

    
2244
</refentry>
2245

    
2246
<!-- Keep this comment at the end of the file
2247
Local variables:
2248
mode: sgml
2249
sgml-omittag:t
2250
sgml-shorttag:t
2251
sgml-minimize-attributes:nil
2252
sgml-always-quote-attributes:t
2253
sgml-indent-step:2
2254
sgml-indent-data:t
2255
sgml-parent-document:nil
2256
sgml-default-dtd-file:nil
2257
sgml-exposed-tags:nil
2258
sgml-local-catalogs:nil
2259
sgml-local-ecat-files:nil
2260
End:
2261
-->