Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ 8619a3bd

History | View | Annotate | Download (81.3 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>use_localtime</term>
429
              <listitem>
430
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
431

    
432
                <para>
433
                  A boolean option that specifies if the instance
434
                  should be started with its clock set to the
435
                  localtime of the machine (when true) or to the UTC
436
                  (When false). The default is false, which is useful
437
                  for Linux/Unix machines; for Windows OSes, it is
438
                  recommended to enable this parameter.
439
                </para>
440
              </listitem>
441
            </varlistentry>
442

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

    
448
                <para>
449
                  This option specifies the path (on the node) to the
450
                  kernel to boot the instance with. Xen PVM instances
451
                  always require this, while for KVM if this option is
452
                  empty, it will cause the machine to load the kernel
453
                  from its disks.
454
                </para>
455
              </listitem>
456
            </varlistentry>
457

    
458
            <varlistentry>
459
              <term>kernel_args</term>
460
              <listitem>
461
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
462

    
463
                <para>
464
                  This options specifies extra arguments to the kernel
465
                  that will be loaded.  device. This is always used
466
                  for Xen PVM, while for KVM it is only used if the
467
                  <option>kernel_path</option> option is also
468
                  specified.
469
                </para>
470

    
471
                <para>
472
                  The default setting for this value is simply
473
                  <constant>"ro"</constant>, which mounts the root
474
                  disk (initially) in read-only one. For example,
475
                  setting this to <userinput>single</userinput> will
476
                  cause the instance to start in single-user mode.
477
                </para>
478
              </listitem>
479
            </varlistentry>
480

    
481
            <varlistentry>
482
              <term>initrd_path</term>
483
              <listitem>
484
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
485

    
486
                <para>
487
                  This option specifies the path (on the node) to the
488
                  initrd to boot the instance with. Xen PVM instances
489
                  can use this always, while for KVM if this option is
490
                  only used if the <option>kernel_path</option> option
491
                  is also specified. You can pass here either an
492
                  absolute filename (the path to the initrd) if you
493
                  want to use an initrd, or use the format
494
                  <userinput>no_initrd_path</userinput> for no initrd.
495
                </para>
496
              </listitem>
497
            </varlistentry>
498

    
499
            <varlistentry>
500
              <term>root_path</term>
501
              <listitem>
502
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
503

    
504
                <para>
505
                  This options specifies the name of the root
506
                  device. This is always needed for Xen PVM, while for
507
                  KVM it is only used if the
508
                  <option>kernel_path</option> option is also
509
                  specified.
510
                </para>
511
              </listitem>
512
            </varlistentry>
513

    
514
            <varlistentry>
515
              <term>serial_console</term>
516
              <listitem>
517
                <simpara>Valid for the KVM hypervisor.</simpara>
518

    
519
                <simpara>This boolean option specifies whether to
520
                emulate a serial console for the instance.</simpara>
521
              </listitem>
522
            </varlistentry>
523

    
524
          </variablelist>
525

    
526
        </para>
527

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
795
      </refsect3>
796

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

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

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

    
815
        </para>
816

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
1385

    
1386
      </refsect3>
1387

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

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

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

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

    
1416
      </refsect3>
1417

    
1418
    </refsect2>
1419

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
1599

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

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

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

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

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

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

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

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

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

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

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

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

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

    
1714
    </refsect2>
1715

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

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

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

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

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

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

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

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

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

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

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

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

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

    
1807
      </refsect3>
1808

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

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

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

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

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

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

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

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

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

    
1884
      </refsect3>
1885

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

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

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

    
1930

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

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

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

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

    
1961

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

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

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

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

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

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

    
2007
      </refsect3>
2008

    
2009
    </refsect2>
2010

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
2167
        <para>
2168
          The <option>--shutdown-timeout</option> is used to specify how
2169
          much time to wait before forcing the shutdown (xm destroy in xen,
2170
          killing the kvm process, for kvm). By default two minutes are
2171
          given to each instance to stop.
2172
        </para>
2173

    
2174
        <para>
2175
          The <option>--submit</option> option is used to send the job to
2176
          the master daemon but not wait for its completion. The job
2177
          ID will be shown so that it can be examined via
2178
          <command>gnt-job info</command>.
2179
        </para>
2180

    
2181
        <para>
2182
          Example:
2183
          <screen>
2184
# gnt-instance move -n node3.example.com instance1.example.com
2185
          </screen>
2186
        </para>
2187
      </refsect3>
2188

    
2189
    </refsect2>
2190

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

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

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

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

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

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

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

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

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

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

    
2253
    </refsect2>
2254

    
2255
  </refsect1>
2256

    
2257
  &footer;
2258

    
2259
</refentry>
2260

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