Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ 73a19fcd

History | View | Annotate | Download (87 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>January 22, 2010</date>">
6
  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
7
       allowed: see man(7), man(1). -->
8
  <!ENTITY dhsection   "<manvolnum>8</manvolnum>">
9
  <!ENTITY dhucpackage "<refentrytitle>gnt-instance</refentrytitle>">
10
  <!ENTITY dhpackage   "gnt-instance">
11

    
12
  <!ENTITY debian      "<productname>Debian</productname>">
13
  <!ENTITY gnu         "<acronym>GNU</acronym>">
14
  <!ENTITY gpl         "&gnu; <acronym>GPL</acronym>">
15
  <!ENTITY footer SYSTEM "footer.sgml">
16
]>
17

    
18
<refentry>
19
  <refentryinfo>
20
    <copyright>
21
      <year>2006</year>
22
      <year>2007</year>
23
      <year>2008</year>
24
      <year>2009</year>
25
      <year>2010</year>
26
      <holder>Google Inc.</holder>
27
    </copyright>
28
    &dhdate;
29
  </refentryinfo>
30
  <refmeta>
31
    &dhucpackage;
32

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

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

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

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

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

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

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

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

    
94
          <arg>-H <replaceable>HYPERVISOR</replaceable><arg>:<arg choice="plain" rep="repeat">option=<replaceable>value</replaceable></arg></arg></arg>
95
          <sbr>
96

    
97
          <arg>--file-storage-dir <replaceable>dir_path</replaceable></arg>
98
          <arg>--file-driver<group choice="req">
99
              <arg>loop</arg>
100
              <arg>blktap</arg>
101
            </group></arg>
102
          <sbr>
103

    
104
          <group choice="req">
105
            <arg>-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg>
106
            <arg>--iallocator <replaceable>name</replaceable></arg>
107
          </group>
108
          <sbr>
109

    
110
          <arg choice="req">-o <replaceable>os-type</replaceable></arg>
111
          <sbr>
112
          <arg>--submit</arg>
113
          <sbr>
114

    
115
          <arg choice="req"><replaceable>instance</replaceable></arg>
116
        </cmdsynopsis>
117

    
118
        <para>
119
          Creates a new instance on the specified host. The
120
          <replaceable>instance</replaceable> argument must be in DNS,
121
          but depending on the bridge/routing setup, need not be in
122
          the same network as the nodes in the cluster.
123
        </para>
124

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

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

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

    
154
        <para>
155
          The <option>--no-ip-check</option> skips the checks that are
156
          done to see if the instance's IP is not already alive
157
          (i.e. reachable from the master node).
158
        </para>
159

    
160
        <para>
161
          The <option>--no-name-check</option> skips the check for the
162
          instance name via the resolver (e.g. in DNS or /etc/hosts,
163
          depending on your setup). Since the name check is used to
164
          compute the IP address, if you pass this option you must
165
          also pass the <option>--no-ip-check</option> option.
166
        </para>
167

    
168
        <para>
169
          If you don't wat the instance to automatically start after
170
          creation, this is possible via the
171
          <option>--no-start</option> option. This will leave the
172
          instance down until a subsequent <command>gnt-instance
173
          start</command> command.
174
        </para>
175

    
176
        <para>
177
          The NICs of the instances can be specified via the
178
          <option>--net</option> option. By default, one NIC is
179
          created for the instance, with a random MAC, and set
180
          up according the the cluster level nic parameters.
181
          Each NIC can take these parameters (all optional):
182
          <variablelist>
183
            <varlistentry>
184
              <term>mac</term>
185
              <listitem>
186
                <simpara>either a value or <constant>GENERATE</constant>
187
                  to generate a new unique MAC</simpara>
188
              </listitem>
189
            </varlistentry>
190
            <varlistentry>
191
              <term>ip</term>
192
              <listitem>
193
                <simpara>specifies the IP address assigned to the
194
                  instance from the Ganeti side (this is not necessarily
195
                  what the instance will use, but what the node expects
196
                  the instance to use)</simpara>
197
              </listitem>
198
            </varlistentry>
199
            <varlistentry>
200
              <term>mode</term>
201
              <listitem>
202
                <simpara>specifies the connection mode for this nic:
203
                  routed or bridged.</simpara>
204
              </listitem>
205
            </varlistentry>
206
            <varlistentry>
207
              <term>link</term>
208
              <listitem>
209
                <simpara>in bridged mode specifies the bridge to attach
210
                  this NIC to, in routed mode it's intended to
211
                  differentiate between different routing tables/instance
212
                  groups (but the meaning is dependent on the network
213
                  script, see gnt-cluster(8) for more details)</simpara>
214
              </listitem>
215
            </varlistentry>
216
          </variablelist>
217
          Of these "mode" and "link" are nic parameters, and inherit their
218
          default at cluster level.
219
        </para>
220

    
221
        <para>
222
          Alternatively, if no network is desired for the instance, you
223
          can prevent the default of one NIC with the
224
          <option>--no-nics</option> option.
225
        </para>
226

    
227
        <para>
228
          The <option>-o</option> options specifies the operating
229
          system to be installed. The available operating systems can
230
          be listed with <command>gnt-os list</command>.
231
        </para>
232

    
233
        <para>
234
          The <option>-B</option> option specifies the backend
235
          parameters for the instance. If no such parameters are
236
          specified, the values are inherited from the cluster. Possible
237
          parameters are:
238
          <variablelist>
239
            <varlistentry>
240
              <term>memory</term>
241
              <listitem>
242
                <simpara>the memory size of the instance; as usual,
243
                  suffixes can be used to denote the unit, otherwise the
244
                  value is taken in mebibites</simpara>
245
              </listitem>
246
            </varlistentry>
247
            <varlistentry>
248
              <term>vcpus</term>
249
              <listitem>
250
                <simpara>the number of VCPUs to assign to the instance
251
                  (if this value makes sense for the hypervisor)</simpara>
252
              </listitem>
253
            </varlistentry>
254
            <varlistentry>
255
              <term>auto_balance</term>
256
              <listitem>
257
                <simpara>whether the instance is considered in the N+1
258
                  cluster checks (enough redundancy in the cluster to
259
                  survive a node failure)</simpara>
260
              </listitem>
261
            </varlistentry>
262
          </variablelist>
263
        </para>
264

    
265
        <para>
266
          The <option>-H</option> option specified the hypervisor to
267
          use for the instance (must be one of the enabled hypervisors
268
          on the cluster) and optionally custom parameters for this
269
          instance. If not other options are used (i.e. the invocation
270
          is just <userinput>-H
271
          <replaceable>NAME</replaceable></userinput>) the instance
272
          will inherit the cluster options. The defaults below show
273
          the cluster defaults at cluster creation time.
274
        </para>
275

    
276
        <para>
277
          The possible hypervisor options are as follows:
278
          <variablelist>
279
            <varlistentry>
280
              <term>boot_order</term>
281
              <listitem>
282
                <simpara>Valid for the Xen HVM and KVM
283
                hypervisors.</simpara>
284

    
285
                <simpara>A string value denoting the boot order. This
286
                has different meaning for the Xen HVM hypervisor and
287
                for the KVM one.</simpara>
288

    
289
                <simpara>
290
                  For Xen HVM, The boot order is a string of letters
291
                  listing the boot devices, with valid device letters
292
                  being:
293
                </simpara>
294
                  <variablelist>
295
                    <varlistentry>
296
                      <term>a</term>
297
                      <listitem>
298
                        <para>
299
                          floppy drive
300
                        </para>
301
                      </listitem>
302
                    </varlistentry>
303
                    <varlistentry>
304
                      <term>c</term>
305
                      <listitem>
306
                        <para>
307
                          hard disk
308
                        </para>
309
                      </listitem>
310
                    </varlistentry>
311
                    <varlistentry>
312
                      <term>d</term>
313
                      <listitem>
314
                        <para>
315
                          CDROM drive
316
                        </para>
317
                      </listitem>
318
                    </varlistentry>
319
                    <varlistentry>
320
                      <term>n</term>
321
                      <listitem>
322
                        <para>
323
                          network boot (PXE)
324
                        </para>
325
                      </listitem>
326
                    </varlistentry>
327
                  </variablelist>
328
                <simpara>
329
                  The default is not to set an HVM boot order which is
330
                  interpreted as 'dc'.
331
                </simpara>
332

    
333
                <simpara>
334
                  For KVM the boot order is either
335
                  <quote>cdrom</quote>, <quote>disk</quote> or
336
                  <quote>network</quote>. Please note that older
337
                  versions of KVM couldn't netboot from virtio
338
                  interfaces. This has been fixed in more recent
339
                  versions and is confirmed to work at least with
340
                  qemu-kvm 0.11.1.
341
                </simpara>
342

    
343
              </listitem>
344
            </varlistentry>
345
            <varlistentry>
346
              <term>cdrom_image_path</term>
347
              <listitem>
348
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
349

    
350
                <simpara>The path to a CDROM image to attach to the
351
                instance.</simpara>
352

    
353
              </listitem>
354
            </varlistentry>
355
            <varlistentry>
356
              <term>nic_type</term>
357
              <listitem>
358
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
359

    
360
                <para>
361
                  This parameter determines the way the network cards
362
                  are presented to the instance. The possible options are:
363
                  <simplelist>
364
                    <member>rtl8139 (default for Xen HVM) (HVM & KVM)</member>
365
                    <member>ne2k_isa (HVM & KVM)</member>
366
                    <member>ne2k_pci (HVM & KVM)</member>
367
                    <member>i82551 (KVM)</member>
368
                    <member>i82557b (KVM)</member>
369
                    <member>i82559er (KVM)</member>
370
                    <member>pcnet (KVM)</member>
371
                    <member>e1000 (KVM)</member>
372
                    <member>paravirtual (default for KVM) (HVM & KVM)</member>
373
                  </simplelist>
374
                </para>
375
              </listitem>
376
            </varlistentry>
377
            <varlistentry>
378
              <term>disk_type</term>
379
              <listitem>
380
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
381

    
382
                <para>
383
                  This parameter determines the way the disks are
384
                  presented to the instance. The possible options are:
385
                  <simplelist>
386
                    <member>ioemu (default for HVM & KVM) (HVM & KVM)</member>
387
                    <member>ide (HVM & KVM)</member>
388
                    <member>scsi (KVM)</member>
389
                    <member>sd (KVM)</member>
390
                    <member>mtd (KVM)</member>
391
                    <member>pflash (KVM)</member>
392
                  </simplelist>
393
                </para>
394
              </listitem>
395
            </varlistentry>
396
            <varlistentry>
397
              <term>vnc_bind_address</term>
398
              <listitem>
399
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
400

    
401
                <para>Specifies the address that the VNC listener for
402
                this instance should bind to. Valid values are IPv4
403
                addresses. Use the address 0.0.0.0 to bind to all
404
                available interfaces (this is the default) or specify
405
                the address of one of the interfaces on the node to
406
                restrict listening to that interface.</para>
407
              </listitem>
408
            </varlistentry>
409

    
410
            <varlistentry>
411
              <term>vnc_tls</term>
412
              <listitem>
413
                <simpara>Valid for the KVM hypervisor.</simpara>
414

    
415
                <simpara>A boolean option that controls whether the
416
                VNC connection is secured with TLS.</simpara>
417
              </listitem>
418
            </varlistentry>
419

    
420
            <varlistentry>
421
              <term>vnc_x509_path</term>
422
              <listitem>
423
                <simpara>Valid for the KVM hypervisor.</simpara>
424

    
425
                <para>If <option>vnc_tls</option> is enabled, this
426
                options specifies the path to the x509 certificate to
427
                use.</para>
428
              </listitem>
429
            </varlistentry>
430

    
431
            <varlistentry>
432
              <term>vnc_x509_verify</term>
433
              <listitem>
434
                <simpara>Valid for the KVM hypervisor.</simpara>
435
              </listitem>
436
            </varlistentry>
437

    
438
            <varlistentry>
439
              <term>acpi</term>
440
              <listitem>
441
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
442

    
443
                <para>
444
                  A boolean option that specifies if the hypervisor
445
                  should enable ACPI support for this instance. By
446
                  default, ACPI is disabled.
447
                </para>
448
              </listitem>
449
            </varlistentry>
450

    
451
            <varlistentry>
452
              <term>pae</term>
453
              <listitem>
454
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
455

    
456
                <para>
457
                  A boolean option that specifies if the hypervisor
458
                  should enabled PAE support for this instance. The
459
                  default is false, disabling PAE support.
460
                </para>
461
              </listitem>
462
            </varlistentry>
463

    
464
            <varlistentry>
465
              <term>use_localtime</term>
466
              <listitem>
467
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
468

    
469
                <para>
470
                  A boolean option that specifies if the instance
471
                  should be started with its clock set to the
472
                  localtime of the machine (when true) or to the UTC
473
                  (When false). The default is false, which is useful
474
                  for Linux/Unix machines; for Windows OSes, it is
475
                  recommended to enable this parameter.
476
                </para>
477
              </listitem>
478
            </varlistentry>
479

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

    
485
                <para>
486
                  This option specifies the path (on the node) to the
487
                  kernel to boot the instance with. Xen PVM instances
488
                  always require this, while for KVM if this option is
489
                  empty, it will cause the machine to load the kernel
490
                  from its disks.
491
                </para>
492
              </listitem>
493
            </varlistentry>
494

    
495
            <varlistentry>
496
              <term>kernel_args</term>
497
              <listitem>
498
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
499

    
500
                <para>
501
                  This options specifies extra arguments to the kernel
502
                  that will be loaded.  device. This is always used
503
                  for Xen PVM, while for KVM it is only used if the
504
                  <option>kernel_path</option> option is also
505
                  specified.
506
                </para>
507

    
508
                <para>
509
                  The default setting for this value is simply
510
                  <constant>"ro"</constant>, which mounts the root
511
                  disk (initially) in read-only one. For example,
512
                  setting this to <userinput>single</userinput> will
513
                  cause the instance to start in single-user mode.
514
                </para>
515
              </listitem>
516
            </varlistentry>
517

    
518
            <varlistentry>
519
              <term>initrd_path</term>
520
              <listitem>
521
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
522

    
523
                <para>
524
                  This option specifies the path (on the node) to the
525
                  initrd to boot the instance with. Xen PVM instances
526
                  can use this always, while for KVM if this option is
527
                  only used if the <option>kernel_path</option> option
528
                  is also specified. You can pass here either an
529
                  absolute filename (the path to the initrd) if you
530
                  want to use an initrd, or use the format
531
                  <userinput>no_initrd_path</userinput> for no initrd.
532
                </para>
533
              </listitem>
534
            </varlistentry>
535

    
536
            <varlistentry>
537
              <term>root_path</term>
538
              <listitem>
539
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
540

    
541
                <para>
542
                  This options specifies the name of the root
543
                  device. This is always needed for Xen PVM, while for
544
                  KVM it is only used if the
545
                  <option>kernel_path</option> option is also
546
                  specified.
547
                </para>
548
              </listitem>
549
            </varlistentry>
550

    
551
            <varlistentry>
552
              <term>serial_console</term>
553
              <listitem>
554
                <simpara>Valid for the KVM hypervisor.</simpara>
555

    
556
                <simpara>This boolean option specifies whether to
557
                emulate a serial console for the instance.</simpara>
558
              </listitem>
559
            </varlistentry>
560

    
561
            <varlistentry>
562
              <term>disk_cache</term>
563
              <listitem>
564
                <simpara>Valid for the KVM hypervisor.</simpara>
565

    
566
                <simpara>The disk cache mode. It can be either
567
                <userinput>default</userinput> to not pass any cache
568
                option to KVM, or one of the KVM cache modes: none
569
                (for direct I/O), writethrough (to use the host cache
570
                but report completion to the guest only when the host
571
                has commited the changes to disk) or writeback (to use
572
                the host cache and report completion as soon as the
573
                data is in the host cache). Note that there are
574
                special considerations for the cache mode depending on
575
                version of KVM used and disk type (always raw file
576
                under Ganeti), please refer to the KVM documentation
577
                for more details.
578
                </simpara>
579
              </listitem>
580
            </varlistentry>
581

    
582
          </variablelist>
583

    
584
        </para>
585

    
586
        <para>
587
          The <option>--iallocator</option> option specifies the instance
588
          allocator plugin to use. If you pass in this option the allocator
589
          will select nodes for this instance automatically, so you don't need
590
          to pass them with the <option>-n</option> option. For more
591
          information please refer to the instance allocator documentation.
592
        </para>
593

    
594
        <para>
595
          The <option>-t</option> options specifies the disk layout type for
596
          the instance. The available choices are:
597
          <variablelist>
598
            <varlistentry>
599
              <term>diskless</term>
600
              <listitem>
601
                <para>
602
                  This creates an instance with no disks. Its useful for
603
                  testing only (or other special cases).
604
                </para>
605
              </listitem>
606
            </varlistentry>
607
            <varlistentry>
608
              <term>file</term>
609
              <listitem>
610
                <para>Disk devices will be regular files.</para>
611
              </listitem>
612
            </varlistentry>
613
            <varlistentry>
614
              <term>plain</term>
615
              <listitem>
616
                <para>Disk devices will be logical volumes.</para>
617
              </listitem>
618
            </varlistentry>
619
            <varlistentry>
620
              <term>drbd</term>
621
              <listitem>
622
                <para>
623
                  Disk devices will be drbd (version 8.x) on top of
624
                  lvm volumes.
625
                </para>
626
              </listitem>
627
            </varlistentry>
628
          </variablelist>
629
        </para>
630

    
631
        <para>
632
          The optional second value of the <option>--node</option> is used for
633
          the drbd template type and specifies the remote node.
634
        </para>
635

    
636
        <para>
637
          If you do not want gnt-instance to wait for the disk mirror
638
          to be synced, use the <option>--no-wait-for-sync</option>
639
          option.
640
        </para>
641

    
642
        <para>
643
          The <option>--file-storage-dir</option> specifies the relative path
644
          under the cluster-wide file storage directory to store file-based
645
          disks. It is useful for having different subdirectories for
646
          different instances. The full path of the directory where the disk
647
          files are stored will consist of cluster-wide file storage directory
648
          + optional subdirectory + instance name. Example:
649
          /srv/ganeti/file-storage/mysubdir/instance1.example.com. This option
650
          is only relevant for instances using the file storage backend.
651
        </para>
652

    
653
        <para>
654
          The <option>--file-driver</option> specifies the driver to use for
655
          file-based disks. Note that currently these drivers work with the
656
          xen hypervisor only. This option is only relevant for instances using
657
          the file storage backend. The available choices are:
658
          <variablelist>
659
            <varlistentry>
660
              <term>loop</term>
661
              <listitem>
662
                <para>
663
                  Kernel loopback driver. This driver uses loopback
664
                  devices to access the filesystem within the
665
                  file. However, running I/O intensive applications in
666
                  your instance using the loop driver might result in
667
                  slowdowns.  Furthermore, if you use the loopback
668
                  driver consider increasing the maximum amount of
669
                  loopback devices (on most systems it's 8) using the
670
                  max_loop param.
671
                </para>
672
              </listitem>
673
            </varlistentry>
674
            <varlistentry>
675
              <term>blktap</term>
676
              <listitem>
677
                <para>The blktap driver (for Xen hypervisors). In
678
                order to be able to use the blktap driver you should
679
                check if the 'blktapctrl' user space disk agent is
680
                running (usually automatically started via xend). This
681
                user-level disk I/O interface has the advantage of
682
                better performance. Especially if you use a network
683
                file system (e.g. NFS) to store your instances this is
684
                the recommended choice.
685
                </para>
686
              </listitem>
687
            </varlistentry>
688
          </variablelist>
689
        </para>
690

    
691
        <para>
692
          The <option>--submit</option> option is used to send the job to
693
          the master daemon but not wait for its completion. The job
694
          ID will be shown so that it can be examined via
695
          <command>gnt-job info</command>.
696
        </para>
697

    
698
        <para>
699
          Example:
700
          <screen>
701
# gnt-instance add -t file --disk 0:size=30g -B memory=512 -o debian-etch \
702
  -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
703
# gnt-instance add -t plain --disk 0:size=30g -B memory=512 -o debian-etch \
704
  -n node1.example.com instance1.example.com
705
# gnt-instance add -t drbd --disk 0:size=30g -B memory=512 -o debian-etch \
706
  -n node1.example.com:node2.example.com instance2.example.com
707
          </screen>
708
        </para>
709
      </refsect3>
710

    
711
      <refsect3>
712
        <title>BATCH-CREATE</title>
713
        <cmdsynopsis>
714
          <command>batch-create</command>
715
          <arg choice="req">instances_file.json</arg>
716
        </cmdsynopsis>
717

    
718
        <para>
719
          This command (similar to the Ganeti 1.2
720
          <command>batcher</command> tool) submits multiple instance
721
          creation jobs based on a definition file. The instance
722
          configurations do not encompass all the possible options for
723
          the <command>add</command> command, but only a subset.
724
        </para>
725

    
726
        <para>
727
          The instance file should be a valid-formed JSON file,
728
          containing a dictionary with instance name and instance
729
          parameters. The accepted parameters are:
730

    
731
          <variablelist>
732
            <varlistentry>
733
              <term>disk_size</term>
734
              <listitem>
735
                <simpara>The size of the disks of the instance.</simpara>
736
              </listitem>
737
            </varlistentry>
738
            <varlistentry>
739
              <term>disk_templace</term>
740
              <listitem>
741
                <simpara>The disk template to use for the instance,
742
                the same as in the <command>add</command>
743
                command.</simpara>
744
              </listitem>
745
            </varlistentry>
746
            <varlistentry>
747
              <term>backend</term>
748
              <listitem>
749
                <simpara>A dictionary of backend parameters.</simpara>
750
              </listitem>
751
            </varlistentry>
752
            <varlistentry>
753
              <term>hypervisor</term>
754
              <listitem>
755
                <simpara>A dictionary with a single key (the
756
                hypervisor name), and as value the hypervisor
757
                options. If not passed, the default hypervisor and
758
                hypervisor options will be inherited.</simpara>
759
              </listitem>
760
            </varlistentry>
761
            <varlistentry>
762
              <term>mac, ip, mode, link</term>
763
              <listitem>
764
                <simpara>Specifications for the one NIC that will be
765
                created for the instance. 'bridge' is also accepted
766
                as a backwards compatibile key.</simpara>
767
              </listitem>
768
            </varlistentry>
769
            <varlistentry>
770
              <term>nics</term>
771
              <listitem>
772
                <simpara>List of nics that will be created for the
773
                instance. Each entry should be a dict, with mac, ip, mode
774
                and link as possible keys. Please don't provide the "mac,
775
                ip, mode, link" parent keys if you use this method for
776
                specifying nics.</simpara>
777
              </listitem>
778
            </varlistentry>
779
            <varlistentry>
780
              <term>primary_node, secondary_node</term>
781
              <listitem>
782
                <simpara>The primary and optionally the secondary node
783
                to use for the instance (in case an iallocator script
784
                is not used).</simpara>
785
              </listitem>
786
            </varlistentry>
787
            <varlistentry>
788
              <term>iallocator</term>
789
              <listitem>
790
                <simpara>Instead of specifying the nodes, an
791
                iallocator script can be used to automatically compute
792
                them.</simpara>
793
              </listitem>
794
            </varlistentry>
795
            <varlistentry>
796
              <term>start</term>
797
              <listitem>
798
                <simpara>whether to start the instance</simpara>
799
              </listitem>
800
            </varlistentry>
801
            <varlistentry>
802
              <term>ip_check</term>
803
              <listitem>
804
                <simpara>Skip the check for already-in-use instance;
805
                see the description in the <command>add</command>
806
                command for details.</simpara>
807
              </listitem>
808
            </varlistentry>
809
            <varlistentry>
810
              <term>name_check</term>
811
              <listitem>
812
                <simpara>Skip the name check for instances;
813
                see the description in the <command>add</command>
814
                command for details.</simpara>
815
              </listitem>
816
            </varlistentry>
817
            <varlistentry>
818
              <term>file_storage_dir, file_driver</term>
819
              <listitem>
820
                <simpara>Configuration for the <literal>file</literal>
821
                disk type, see the <command>add</command> command for
822
                details.</simpara>
823
              </listitem>
824
            </varlistentry>
825
          </variablelist>
826
        </para>
827

    
828
        <para>
829
          A simple definition for one instance can be (with most of
830
          the parameters taken from the cluster defaults):
831
          <screen>
832
{
833
  "instance3": {
834
    "template": "drbd",
835
    "os": "debootstrap",
836
    "disk_size": ["25G"],
837
    "iallocator": "dumb"
838
  },
839
  "instance5": {
840
    "template": "drbd",
841
    "os": "debootstrap",
842
    "disk_size": ["25G"],
843
    "iallocator": "dumb",
844
    "hypervisor": "xen-hvm",
845
    "hvparams": {"acpi": true},
846
    "backend": {"memory": 512}
847
  }
848
}
849
</screen>
850
        </para>
851

    
852
        <para>
853
          The command will display the job id for each submitted instance, as follows:
854
          <screen>
855
# gnt-instance batch-create instances.json
856
instance3: 11224
857
instance5: 11225
858
</screen>
859
        </para>
860

    
861
      </refsect3>
862

    
863
      <refsect3>
864
        <title>REMOVE</title>
865

    
866
        <cmdsynopsis>
867
          <command>remove</command>
868
          <arg>--ignore-failures</arg>
869
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
870
          <arg>--submit</arg>
871
          <arg choice="req"><replaceable>instance</replaceable></arg>
872
        </cmdsynopsis>
873

    
874
        <para>
875
          Remove an instance. This will remove all data from the
876
          instance and there is <emphasis>no way back</emphasis>. If
877
          you are not sure if you use an instance again, use
878
          <command>shutdown</command> first and leave it in the
879
          shutdown state for a while.
880

    
881
        </para>
882

    
883
        <para>
884
          The <option>--ignore-failures</option> option will cause the
885
          removal to proceed even in the presence of errors during the
886
          removal of the instance (e.g. during the shutdown or the
887
          disk removal). If this option is not given, the command will
888
          stop at the first error.
889
        </para>
890

    
891
        <para>
892
          The <option>--shutdown-timeout</option> is used to specify how
893
          much time to wait before forcing the shutdown (xm destroy in xen,
894
          killing the kvm process, for kvm). By default two minutes are
895
          given to each instance to stop.
896
        </para>
897

    
898
        <para>
899
          The <option>--submit</option> option is used to send the job to
900
          the master daemon but not wait for its completion. The job
901
          ID will be shown so that it can be examined via
902
          <command>gnt-job info</command>.
903
        </para>
904

    
905
        <para>
906
          Example:
907
          <screen>
908
# gnt-instance remove instance1.example.com
909
          </screen>
910
        </para>
911
      </refsect3>
912

    
913
      <refsect3>
914
        <title>LIST</title>
915

    
916
        <cmdsynopsis>
917
          <command>list</command>
918
          <arg>--no-headers</arg>
919
          <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
920
          <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
921
          <arg rep="repeat">instance</arg>
922
        </cmdsynopsis>
923

    
924
        <para>
925
          Shows the currently configured instances with memory usage,
926
          disk usage, the node they are running on, and their run
927
          status.
928
        </para>
929

    
930
        <para>
931
          The <option>--no-headers</option> option will skip the
932
          initial header line. The <option>--separator</option> option
933
          takes an argument which denotes what will be used between
934
          the output fields. Both these options are to help scripting.
935
        </para>
936

    
937
        <para>
938
          The <option>-o</option> option takes a comma-separated list
939
          of output fields. The available fields and their meaning
940
          are:
941
          <variablelist>
942
            <varlistentry>
943
              <term>name</term>
944
              <listitem>
945
                <simpara>the instance name</simpara>
946
              </listitem>
947
            </varlistentry>
948
            <varlistentry>
949
              <term>os</term>
950
              <listitem>
951
                <simpara>the OS of the instance</simpara>
952
              </listitem>
953
            </varlistentry>
954
            <varlistentry>
955
              <term>pnode</term>
956
              <listitem>
957
                <simpara>the primary node of the instance</simpara>
958
              </listitem>
959
            </varlistentry>
960
            <varlistentry>
961
              <term>snodes</term>
962
              <listitem>
963
                <simpara>comma-separated list of secondary nodes for the
964
                  instance; usually this will be just one node</simpara>
965
              </listitem>
966
            </varlistentry>
967
            <varlistentry>
968
              <term>admin_state</term>
969
              <listitem>
970
                <simpara>the desired state of the instance (either "yes"
971
                  or "no" denoting the instance should run or
972
                  not)</simpara>
973
              </listitem>
974
            </varlistentry>
975
            <varlistentry>
976
              <term>disk_template</term>
977
              <listitem>
978
                <simpara>the disk template of the instance</simpara>
979
              </listitem>
980
            </varlistentry>
981
            <varlistentry>
982
              <term>oper_state</term>
983
              <listitem>
984
                <simpara>the actual state of the instance; can be
985
                one of the values "running", "stopped", "(node
986
                down)"</simpara>
987
              </listitem>
988
            </varlistentry>
989
            <varlistentry>
990
              <term>status</term>
991
              <listitem>
992
                <simpara>combined form of admin_state and oper_stat;
993
                this can be one of:
994
                <computeroutput>ERROR_nodedown</computeroutput> if the
995
                node of the instance is down,
996
                <computeroutput>ERROR_down</computeroutput> if the
997
                instance should run but is down,
998
                <computeroutput>ERROR_up</computeroutput> if the
999
                instance should be stopped but is actually running,
1000
                <computeroutput>ADMIN_down</computeroutput> if the
1001
                instance has been stopped (and is stopped) and
1002
                <computeroutput>running</computeroutput> if the
1003
                instance is set to be running (and is
1004
                running)</simpara>
1005
              </listitem>
1006
            </varlistentry>
1007
            <varlistentry>
1008
              <term>oper_ram</term>
1009
              <listitem>
1010
                <simpara>the actual memory usage of the instance as seen
1011
                  by the hypervisor</simpara>
1012
              </listitem>
1013
            </varlistentry>
1014
            <varlistentry>
1015
              <term>ip</term>
1016
              <listitem>
1017
                <simpara>the ip address ganeti recognizes as associated with
1018
                the first instance interface</simpara>
1019
              </listitem>
1020
            </varlistentry>
1021
            <varlistentry>
1022
              <term>mac</term>
1023
              <listitem>
1024
                <simpara>the first instance interface MAC address</simpara>
1025
              </listitem>
1026
            </varlistentry>
1027

    
1028
            <varlistentry>
1029
              <term>nic_mode</term>
1030
              <listitem>
1031
                <simpara>the mode of the first instance NIC
1032
                (routed or bridged)</simpara>
1033
              </listitem>
1034
            </varlistentry>
1035
            <varlistentry>
1036
              <term>nic_link</term>
1037
              <listitem>
1038
                <simpara>the link of the first instance NIC
1039
                </simpara>
1040
              </listitem>
1041
            </varlistentry>
1042
            <varlistentry>
1043
              <term>sda_size</term>
1044
              <listitem>
1045
                <simpara>the size of the instance's first disk</simpara>
1046
              </listitem>
1047
            </varlistentry>
1048
            <varlistentry>
1049
              <term>sdb_size</term>
1050
              <listitem>
1051
                <simpara>the size of the instance's second disk, if
1052
                any</simpara>
1053
              </listitem>
1054
            </varlistentry>
1055
            <varlistentry>
1056
              <term>vcpus</term>
1057
              <listitem>
1058
                <simpara>the number of VCPUs allocated to the
1059
                instance</simpara>
1060
              </listitem>
1061
            </varlistentry>
1062
            <varlistentry>
1063
              <term>tags</term>
1064
              <listitem>
1065
                <simpara>comma-separated list of the instances's
1066
                tags</simpara>
1067
              </listitem>
1068
            </varlistentry>
1069
            <varlistentry>
1070
              <term>serial_no</term>
1071
              <listitem>
1072
                <simpara>the so called 'serial number' of the
1073
                instance; this is a numeric field that is incremented
1074
                each time the instance is modified, and it can be used
1075
                to track modifications</simpara>
1076
              </listitem>
1077
            </varlistentry>
1078
            <varlistentry>
1079
              <term>ctime</term>
1080
              <listitem>
1081
                <para>
1082
                  the creation time of the instance; note that this
1083
                  field contains spaces and as such it's harder to
1084
                  parse
1085
                </para>
1086
                <para>
1087
                  if this attribute is not present (e.g. when
1088
                  upgrading from older versions), then "N/A" will be
1089
                  shown instead
1090
                </para>
1091
              </listitem>
1092
            </varlistentry>
1093
            <varlistentry>
1094
              <term>mtime</term>
1095
              <listitem>
1096
                <para>
1097
                  the last modification time of the instance; note
1098
                  that this field contains spaces and as such it's
1099
                  harder to parse
1100
                </para>
1101
                <para>
1102
                  if this attribute is not present (e.g. when
1103
                  upgrading from older versions), then "N/A" will be
1104
                  shown instead
1105
                </para>
1106
              </listitem>
1107
            </varlistentry>
1108

    
1109
            <varlistentry>
1110
              <term>uuid</term>
1111
              <listitem>
1112
                <simpara>Show the UUID of the instance (generated
1113
                automatically by Ganeti)</simpara>
1114
              </listitem>
1115
            </varlistentry>
1116

    
1117
            <varlistentry>
1118
              <term>network_port</term>
1119
              <listitem>
1120
                <simpara>If the instance has a network port assigned
1121
                to it (e.g. for VNC connections), this will be shown,
1122
                otherwise <literal>-</literal> will be
1123
                displayed.</simpara>
1124
              </listitem>
1125
            </varlistentry>
1126
            <varlistentry>
1127
              <term>beparams</term>
1128
              <listitem>
1129
                <simpara>A text format of the entire beparams for the
1130
                instance. It's more useful to select individual fields
1131
                from this dictionary, see below.</simpara>
1132
              </listitem>
1133
            </varlistentry>
1134
            <varlistentry>
1135
              <term>disk.count</term>
1136
              <listitem>
1137
                <simpara>The number of instance disks.</simpara>
1138
              </listitem>
1139
            </varlistentry>
1140
            <varlistentry>
1141
              <term>disk.size/N</term>
1142
              <listitem>
1143
                <simpara>The size of the instance's Nth disk. This is
1144
                a more generic form of the <literal>sda_size</literal>
1145
                and <literal>sdb_size</literal> fields.</simpara>
1146
              </listitem>
1147
            </varlistentry>
1148
            <varlistentry>
1149
              <term>disk.sizes</term>
1150
              <listitem>
1151
                <simpara>A comma-separated list of the disk sizes for
1152
                this instance.</simpara>
1153
              </listitem>
1154
            </varlistentry>
1155
            <varlistentry>
1156
              <term>disk_usage</term>
1157
              <listitem>
1158
                <simpara>The total disk space used by this instance on
1159
                each of its nodes. This is not the instance-visible
1160
                disk size, but the actual disk "cost" of the
1161
                instance.</simpara>
1162
              </listitem>
1163
            </varlistentry>
1164
            <varlistentry>
1165
              <term>nic.mac/N</term>
1166
              <listitem>
1167
                <simpara>The MAC of the Nth instance NIC.</simpara>
1168
              </listitem>
1169
            </varlistentry>
1170
            <varlistentry>
1171
              <term>nic.ip/N</term>
1172
              <listitem>
1173
                <simpara>The IP address of the Nth instance NIC.</simpara>
1174
              </listitem>
1175
            </varlistentry>
1176
            <varlistentry>
1177
              <term>nic.mode/N</term>
1178
              <listitem>
1179
                <simpara>The mode of the Nth instance NIC</simpara>
1180
              </listitem>
1181
            </varlistentry>
1182
            <varlistentry>
1183
              <term>nic.link/N</term>
1184
              <listitem>
1185
                <simpara>The link of the Nth instance NIC</simpara>
1186
              </listitem>
1187
            </varlistentry>
1188
            <varlistentry>
1189
              <term>nic.macs</term>
1190
              <listitem>
1191
                <simpara>A comma-separated list of all the MACs of the
1192
                instance's NICs.</simpara>
1193
              </listitem>
1194
            </varlistentry>
1195
            <varlistentry>
1196
              <term>nic.ips</term>
1197
              <listitem>
1198
                <simpara>A comma-separated list of all the IP
1199
                addresses of the instance's NICs.</simpara>
1200
              </listitem>
1201
            </varlistentry>
1202
            <varlistentry>
1203
              <term>nic.modes</term>
1204
              <listitem>
1205
                <simpara>A comma-separated list of all the modes of the
1206
                instance's NICs.</simpara>
1207
              </listitem>
1208
            </varlistentry>
1209
            <varlistentry>
1210
              <term>nic.links</term>
1211
              <listitem>
1212
                <simpara>A comma-separated list of all the link parameters
1213
                of the instance's NICs.</simpara>
1214
              </listitem>
1215
            </varlistentry>
1216
            <varlistentry>
1217
              <term>nic.count</term>
1218
              <listitem>
1219
                <simpara>The number of instance nics.</simpara>
1220
              </listitem>
1221
            </varlistentry>
1222
            <varlistentry>
1223
              <term>hv/<replaceable>NAME</replaceable></term>
1224
              <listitem>
1225
                <simpara>The value of the hypervisor parameter called
1226
                <replaceable>NAME</replaceable>. For details of what
1227
                hypervisor parameters exist and their meaning, see the
1228
                <command>add</command> command.</simpara>
1229
              </listitem>
1230
            </varlistentry>
1231
            <varlistentry>
1232
              <term>be/memory</term>
1233
              <listitem>
1234
                <simpara>The configured memory for the instance.</simpara>
1235
              </listitem>
1236
            </varlistentry>
1237
            <varlistentry>
1238
              <term>be/vcpus</term>
1239
              <listitem>
1240
                <simpara>The configured number of VCPUs for the
1241
                instance.</simpara>
1242
              </listitem>
1243
            </varlistentry>
1244
            <varlistentry>
1245
              <term>be/auto_balance</term>
1246
              <listitem>
1247
                <simpara>Whether the instance is considered in N+1
1248
                checks.</simpara>
1249
              </listitem>
1250
            </varlistentry>
1251
          </variablelist>
1252
        </para>
1253

    
1254
        <para>
1255
          If the value of the option starts with the character
1256
          <constant>+</constant>, the new field(s) will be added to the
1257
          default list. This allows to quickly see the default list
1258
          plus a few other fields, instead of retyping the entire list
1259
          of fields.
1260
        </para>
1261

    
1262
        <para>
1263
          There is a subtle grouping about the available output
1264
          fields: all fields except for <option>oper_state</option>,
1265
          <option>oper_ram</option> and <option>status</option> are
1266
          configuration value and not run-time values. So if you don't
1267
          select any of the these fields, the query will be satisfied
1268
          instantly from the cluster configuration, without having to
1269
          ask the remote nodes for the data. This can be helpful for
1270
          big clusters when you only want some data and it makes sense
1271
          to specify a reduced set of output fields.
1272
        </para>
1273

    
1274
        <para>The default output field list is:
1275
          <simplelist type="inline">
1276
            <member>name</member>
1277
            <member>os</member>
1278
            <member>pnode</member>
1279
            <member>admin_state</member>
1280
            <member>oper_state</member>
1281
            <member>oper_ram</member>
1282
          </simplelist>.
1283
        </para>
1284
      </refsect3>
1285

    
1286
      <refsect3>
1287
        <title>INFO</title>
1288

    
1289
        <cmdsynopsis>
1290
          <command>info</command>
1291
          <group>
1292
            <arg>-s</arg>
1293
            <arg>--static</arg>
1294
          </group>
1295
          <group choice="req">
1296
            <arg>--all</arg>
1297
            <arg rep="repeat"><replaceable>instance</replaceable></arg>
1298
          </group>
1299
        </cmdsynopsis>
1300

    
1301
        <para>
1302
          Show detailed information about the given instance(s). This is
1303
          different from <command>list</command> as it shows detailed data
1304
          about the instance's disks (especially useful for the drbd disk
1305
          template).
1306
        </para>
1307

    
1308
        <para>
1309
          If the option <option>-s</option> is used, only information
1310
          available in the configuration file is returned, without
1311
          querying nodes, making the operation faster.
1312
        </para>
1313

    
1314
        <para>
1315
          Use the <option>--all</option> to get info about all instances,
1316
          rather than explicitly passing the ones you're interested in.
1317
        </para>
1318
      </refsect3>
1319

    
1320
      <refsect3>
1321
        <title>MODIFY</title>
1322

    
1323
        <cmdsynopsis>
1324
          <command>modify</command>
1325
          <sbr>
1326
          <arg choice="opt">-H <replaceable>HYPERVISOR_PARAMETERS</replaceable></arg>
1327
          <sbr>
1328
          <arg choice="opt">-B <replaceable>BACKEND_PARAMETERS</replaceable></arg>
1329
          <sbr>
1330
          <group>
1331
            <arg>--net add<replaceable><optional>:options</optional></replaceable></arg>
1332
            <arg>--net remove</arg>
1333
            <arg>--net <replaceable>N:options</replaceable></arg>
1334
          </group>
1335
          <sbr>
1336
          <group>
1337
            <arg>--disk add:size=<replaceable>SIZE</replaceable></arg>
1338
            <arg>--disk remove</arg>
1339
            <arg>--disk <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></arg>
1340
          </group>
1341

    
1342
          <sbr>
1343
          <arg>--submit</arg>
1344
          <sbr>
1345
          <arg choice="req"><replaceable>instance</replaceable></arg>
1346
        </cmdsynopsis>
1347

    
1348
        <para>
1349
          Modifies the memory size, number of vcpus, ip address, MAC
1350
          address and/or nic parameters for an instance. It can also
1351
          add and remove disks and NICs to/from the instance. Note
1352
          that you need to give at least one of the arguments, otherwise
1353
          the command complains.
1354
        </para>
1355

    
1356
        <para>
1357
          The <option>-H</option> option specifies hypervisor options
1358
          in the form of <userinput>name=value[,...]</userinput>. For details which options can be specified, see the <command>add</command> command.
1359
        </para>
1360

    
1361
        <para>
1362
          The <option>--disk
1363
          add:size=<replaceable>SIZE</replaceable></option> option
1364
          adds a disk to the instance. The <option>--disk
1365
          remove</option> will remove the last disk of the
1366
          instance. The <option>--disk
1367
          <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></option>
1368
          option will change the mode of the Nth disk of the instance
1369
          between read-only (<literal>ro</literal>) and read-write
1370
          (<literal>rw</literal>).
1371
        </para>
1372

    
1373
        <para>
1374
          The <option>--net
1375
          add:<replaceable>options</replaceable></option> option will
1376
          add a new NIC to the instance. The available options are the
1377
          same as in the <command>add</command> command (mac, ip, link,
1378
          mode). The <option>--net remove</option> will remove the
1379
          last NIC of the instance, while the <option>--net
1380
          <replaceable>N</replaceable>:<replaceable>options</replaceable></option>
1381
          option will change the parameters of the Nth instance NIC.
1382
        </para>
1383

    
1384
        <para>
1385
          The <option>--submit</option> option is used to send the job to
1386
          the master daemon but not wait for its completion. The job
1387
          ID will be shown so that it can be examined via
1388
          <command>gnt-job info</command>.
1389
        </para>
1390

    
1391
        <para>
1392
          All the changes take effect at the next restart. If the
1393
          instance is running, there is no effect on the instance.
1394
        </para>
1395
      </refsect3>
1396

    
1397
      <refsect3>
1398
        <title>REINSTALL</title>
1399

    
1400
        <cmdsynopsis>
1401
          <command>reinstall</command>
1402
          <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
1403
          <arg>--select-os</arg>
1404
          <arg choice="opt">-f <replaceable>force</replaceable></arg>
1405
          <arg>--force-multiple</arg>
1406
          <sbr>
1407
          <group choice="opt">
1408
            <arg>--instance</arg>
1409
            <arg>--node</arg>
1410
            <arg>--primary</arg>
1411
            <arg>--secondary</arg>
1412
            <arg>--all</arg>
1413
          </group>
1414
          <arg>--submit</arg>
1415
          <arg choice="opt" rep="repeat"><replaceable>instance</replaceable></arg>
1416
        </cmdsynopsis>
1417

    
1418
        <para>
1419
          Reinstalls the operating system on the given instance(s). The
1420
          instance(s) must be stopped when running this command. If the
1421
          <option>--os-type</option> is specified, the operating
1422
          system is changed.
1423
        </para>
1424

    
1425
        <para>
1426
          The <option>--select-os</option> option switches to an
1427
          interactive OS reinstall. The user is prompted to select the OS
1428
          template from the list of available OS templates.
1429
        </para>
1430

    
1431
        <para>
1432
          Since this is a potentially dangerous command, the user will
1433
          be required to confirm this action, unless the
1434
          <option>-f</option> flag is passed. When multiple instances
1435
          are selected (either by passing multiple arguments or by
1436
          using the <option>--node</option>,
1437
          <option>--primary</option>, <option>--secondary</option> or
1438
          <option>--all</option> options), the user must pass both the
1439
          <option>--force</option> and
1440
          <option>--force-multiple</option> options to skip the
1441
          interactive confirmation.
1442
        </para>
1443

    
1444
        <para>
1445
          The <option>--submit</option> option is used to send the job to
1446
          the master daemon but not wait for its completion. The job
1447
          ID will be shown so that it can be examined via
1448
          <command>gnt-job info</command>.
1449
        </para>
1450

    
1451

    
1452
      </refsect3>
1453

    
1454
      <refsect3>
1455
        <title>RENAME</title>
1456

    
1457
        <cmdsynopsis>
1458
          <command>rename</command>
1459
          <arg>--no-ip-check</arg>
1460
          <arg>--submit</arg>
1461
          <arg choice="req"><replaceable>instance</replaceable></arg>
1462
          <arg choice="req"><replaceable>new_name</replaceable></arg>
1463
        </cmdsynopsis>
1464

    
1465
        <para>
1466
          Renames the given instance. The instance must be stopped
1467
          when running this command. The requirements for the new name
1468
          are the same as for adding an instance: the new name must be
1469
          resolvable and the IP it resolves to must not be reachable
1470
          (in order to prevent duplicate IPs the next time the
1471
          instance is started). The IP test can be skipped if the
1472
          <option>--no-ip-check</option> option is passed.
1473
        </para>
1474

    
1475
        <para>
1476
          The <option>--submit</option> option is used to send the job to
1477
          the master daemon but not wait for its completion. The job
1478
          ID will be shown so that it can be examined via
1479
          <command>gnt-job info</command>.
1480
        </para>
1481

    
1482
      </refsect3>
1483

    
1484
    </refsect2>
1485

    
1486
    <refsect2>
1487
      <title>Starting/stopping/connecting to console</title>
1488

    
1489
      <refsect3>
1490
        <title>STARTUP</title>
1491

    
1492
        <cmdsynopsis>
1493
          <command>startup</command>
1494
          <sbr>
1495
          <arg>--force</arg>
1496
          <sbr>
1497
          <arg>--force-multiple</arg>
1498
          <sbr>
1499
          <group choice="opt">
1500
            <arg>--instance</arg>
1501
            <arg>--node</arg>
1502
            <arg>--primary</arg>
1503
            <arg>--secondary</arg>
1504
            <arg>--all</arg>
1505
            <arg>--tags</arg>
1506
            <arg>--node-tags</arg>
1507
            <arg>--pri-node-tags</arg>
1508
            <arg>--sec-node-tags</arg>
1509
          </group>
1510
          <sbr>
1511
          <arg>-H <option>key=value...</option></arg>
1512
          <arg>-B <option>key=value...</option></arg>
1513
          <sbr>
1514
          <arg>--submit</arg>
1515
          <sbr>
1516
          <arg choice="opt"
1517
          rep="repeat"><replaceable>name</replaceable></arg>
1518
        </cmdsynopsis>
1519

    
1520
        <para>
1521
          Starts one or more instances, depending on the following
1522
          options. The four available modes are:
1523
          <variablelist>
1524
            <varlistentry>
1525
              <term><option>--instance</option></term>
1526
              <listitem>
1527
                <simpara>will start the instances given as arguments
1528
                (at least one argument required); this is the default
1529
                selection</simpara>
1530
              </listitem>
1531
            </varlistentry>
1532
            <varlistentry>
1533
              <term>--node</term>
1534
              <listitem>
1535
                <simpara>will start the instances who have the given
1536
                node as either primary or secondary</simpara>
1537
              </listitem>
1538
            </varlistentry>
1539
            <varlistentry>
1540
              <term><option>--primary</option></term>
1541
              <listitem>
1542
                <simpara>will start all instances whose primary node
1543
                is in the list of nodes passed as arguments (at least
1544
                one node required)</simpara>
1545
              </listitem>
1546
            </varlistentry>
1547
            <varlistentry>
1548
              <term><option>--secondary</option></term>
1549
              <listitem>
1550
                <simpara>will start all instances whose secondary node
1551
                is in the list of nodes passed as arguments (at least
1552
                one node required)</simpara>
1553
              </listitem>
1554
            </varlistentry>
1555
            <varlistentry>
1556
              <term>--all</term>
1557
              <listitem>
1558
                <simpara>will start all instances in the cluster (no
1559
                arguments accepted)</simpara>
1560
              </listitem>
1561
            </varlistentry>
1562
            <varlistentry>
1563
              <term>--tags</term>
1564
              <listitem>
1565
                <simpara>will start all instances in the cluster with
1566
                the tags given as arguments</simpara>
1567
              </listitem>
1568
            </varlistentry>
1569
            <varlistentry>
1570
              <term>--node-tags</term>
1571
              <listitem>
1572
                <simpara>will start all instances in the cluster on
1573
                nodes with the tags given as arguments</simpara>
1574
              </listitem>
1575
            </varlistentry>
1576
            <varlistentry>
1577
              <term>--pri-node-tags</term>
1578
              <listitem>
1579
                <simpara>will start all instances in the cluster on
1580
                primary nodes with the tags given as
1581
                arguments</simpara>
1582
              </listitem>
1583
            </varlistentry>
1584
            <varlistentry>
1585
              <term>--sec-node-tags</term>
1586
              <listitem>
1587
                <simpara>will start all instances in the cluster on
1588
                secondary nodes with the tags given as
1589
                arguments</simpara>
1590
              </listitem>
1591
            </varlistentry>
1592
          </variablelist>
1593
        </para>
1594

    
1595
        <para>
1596
          Note that although you can pass more than one selection
1597
          option, the last one wins, so in order to guarantee the
1598
          desired result, don't pass more than one such option.
1599
        </para>
1600

    
1601
        <para>
1602
          Use <option>--force</option> to start even if secondary disks are
1603
          failing.
1604
        </para>
1605

    
1606
        <para>
1607
          The <option>--force-multiple</option> will skip the
1608
          interactive confirmation in the case the more than one
1609
          instance will be affected.
1610
        </para>
1611

    
1612
        <para>
1613
          The <option>-H</option> and <option>-B</option> options
1614
          specify temporary hypervisor and backend parameters that can
1615
          be used to start an instance with modified parameters. They
1616
          can be useful for quick testing without having to modify an
1617
          instance back and forth, e.g.:
1618
          <screen>
1619
# gnt-instance start -H root_args="single" instance1
1620
# gnt-instance start -B memory=2048 instance2
1621
          </screen>
1622
          The first form will start the instance
1623
          <userinput>instance1</userinput> in single-user mode, and
1624
          the instance <userinput>instance2</userinput> with 2GB of
1625
          RAM (this time only, unless that is the actual instance
1626
          memory size already). Note that the values override the
1627
          instance parameters (and not extend them): an instance with
1628
          "root_args=ro" when started with <userinput>-H
1629
          root_args=single</userinput> will result in "single", not
1630
          "ro single".
1631
        </para>
1632

    
1633
        <para>
1634
          The <option>--submit</option> option is used to send the job to
1635
          the master daemon but not wait for its completion. The job
1636
          ID will be shown so that it can be examined via
1637
          <command>gnt-job info</command>.
1638
        </para>
1639

    
1640
        <para>
1641
          Example:
1642
          <screen>
1643
# gnt-instance start instance1.example.com
1644
# gnt-instance start --node node1.example.com node2.example.com
1645
# gnt-instance start --all
1646
          </screen>
1647
        </para>
1648
      </refsect3>
1649

    
1650
      <refsect3>
1651
        <title>SHUTDOWN</title>
1652

    
1653
        <cmdsynopsis>
1654
          <command>shutdown</command>
1655
          <sbr>
1656
          <arg>--timeout=<replaceable>N</replaceable></arg>
1657
          <sbr>
1658
          <arg>--force-multiple</arg>
1659
          <sbr>
1660
          <group choice="opt">
1661
            <arg>--instance</arg>
1662
            <arg>--node</arg>
1663
            <arg>--primary</arg>
1664
            <arg>--secondary</arg>
1665
            <arg>--all</arg>
1666
            <arg>--tags</arg>
1667
            <arg>--node-tags</arg>
1668
            <arg>--pri-node-tags</arg>
1669
            <arg>--sec-node-tags</arg>
1670
          </group>
1671
          <sbr>
1672
          <arg>--submit</arg>
1673
          <sbr>
1674
          <arg choice="opt"
1675
          rep="repeat"><replaceable>name</replaceable></arg>
1676
        </cmdsynopsis>
1677

    
1678
        <para>
1679
          Stops one or more instances. If the instance cannot be
1680
          cleanly stopped during a hardcoded interval (currently 2
1681
          minutes), it will forcibly stop the instance (equivalent to
1682
          switching off the power on a physical machine).
1683
        </para>
1684

    
1685
        <para>
1686
          The <option>--timeout</option> is used to specify how much time to
1687
          wait before forcing the shutdown (xm destroy in xen, killing the kvm
1688
          process, for kvm). By default two minutes are given to each instance
1689
          to stop.
1690
        </para>
1691

    
1692
        <para>
1693
          The <option>--instance</option>, <option>--node</option>,
1694
          <option>--primary</option>, <option>--secondary</option>,
1695
          <option>--all</option>, <option>--tags</option>,
1696
          <option>--node-tags</option>, <option>--pri-node-tags</option> and
1697
          <option>--sec-node-tags</option> options are similar as for the
1698
          <command>startup</command> command and they influence the
1699
          actual instances being shutdown.
1700
        </para>
1701

    
1702
        <para>
1703
          The <option>--submit</option> option is used to send the job to
1704
          the master daemon but not wait for its completion. The job
1705
          ID will be shown so that it can be examined via
1706
          <command>gnt-job info</command>.
1707
        </para>
1708

    
1709

    
1710
        <para>
1711
          Example:
1712
          <screen>
1713
# gnt-instance shutdown instance1.example.com
1714
# gnt-instance shutdown --all
1715
          </screen>
1716
        </para>
1717
      </refsect3>
1718

    
1719
      <refsect3>
1720
        <title>REBOOT</title>
1721

    
1722
        <cmdsynopsis>
1723
          <command>reboot</command>
1724
          <sbr>
1725
          <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
1726
          <sbr>
1727
          <arg>--ignore-secondaries</arg>
1728
          <sbr>
1729
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
1730
          <sbr>
1731
          <arg>--force-multiple</arg>
1732
          <sbr>
1733
          <group choice="opt">
1734
            <arg>--instance</arg>
1735
            <arg>--node</arg>
1736
            <arg>--primary</arg>
1737
            <arg>--secondary</arg>
1738
            <arg>--all</arg>
1739
            <arg>--tags</arg>
1740
            <arg>--node-tags</arg>
1741
            <arg>--pri-node-tags</arg>
1742
            <arg>--sec-node-tags</arg>
1743
          </group>
1744
          <sbr>
1745
          <arg>--submit</arg>
1746
          <sbr>
1747
          <arg choice="opt"
1748
          rep="repeat"><replaceable>name</replaceable></arg>
1749
        </cmdsynopsis>
1750

    
1751
        <para>
1752
          Reboots one or more instances. The type of reboot depends on
1753
          the value of <option>--type</option>. A soft reboot does a
1754
          hypervisor reboot, a hard reboot does a instance stop,
1755
          recreates the hypervisor config for the instance and
1756
          starts the instance. A full reboot does the equivalent
1757
          of <command>gnt-instance shutdown &amp;&amp; gnt-instance
1758
          startup</command>. The default is hard reboot.
1759
        </para>
1760

    
1761
        <para>
1762
          For the hard reboot the option
1763
          <option>--ignore-secondaries</option> ignores errors for the
1764
          secondary node while re-assembling the instance disks.
1765
        </para>
1766

    
1767
        <para>
1768
          The <option>--instance</option>, <option>--node</option>,
1769
          <option>--primary</option>, <option>--secondary</option>,
1770
          <option>--all</option>, <option>--tags</option>,
1771
          <option>--node-tags</option>, <option>--pri-node-tags</option> and
1772
          <option>--sec-node-tags</option> options are similar as for the
1773
          <command>startup</command> command and they influence the
1774
          actual instances being rebooted.
1775
        </para>
1776

    
1777
        <para>
1778
          The <option>--shutdown-timeout</option> is used to specify how
1779
          much time to wait before forcing the shutdown (xm destroy in xen,
1780
          killing the kvm process, for kvm). By default two minutes are
1781
          given to each instance to stop.
1782
        </para>
1783

    
1784
        <para>
1785
          The <option>--force-multiple</option> will skip the
1786
          interactive confirmation in the case the more than one
1787
          instance will be affected.
1788
        </para>
1789

    
1790
        <para>
1791
          Example:
1792
          <screen>
1793
# gnt-instance reboot instance1.example.com
1794
# gnt-instance reboot --type=full instance1.example.com
1795
          </screen>
1796
        </para>
1797
      </refsect3>
1798

    
1799
      <refsect3>
1800
        <title>CONSOLE</title>
1801
        <cmdsynopsis>
1802
          <command>console</command>
1803
          <arg choice="opt">--show-cmd</arg>
1804
          <arg choice="req"><replaceable>instance</replaceable></arg>
1805
        </cmdsynopsis>
1806

    
1807
        <para>
1808
          Connects to the console of the given instance. If the
1809
          instance is not up, an error is returned. Use the
1810
          <option>--show-cmd</option> option to display the command
1811
          instead of executing it.
1812
        </para>
1813

    
1814
        <para>
1815
          For HVM instances, this will attempt to connect to the
1816
          serial console of the instance. To connect to the
1817
          virtualized "physical" console of a HVM instance, use a VNC
1818
          client with the connection info from the
1819
          <command>info</command> command.
1820
        </para>
1821

    
1822
        <para>
1823
          Example:
1824
          <screen>
1825
# gnt-instance console instance1.example.com
1826
          </screen>
1827
        </para>
1828
      </refsect3>
1829

    
1830
    </refsect2>
1831

    
1832
    <refsect2>
1833
      <title>Disk management</title>
1834

    
1835
      <refsect3>
1836
        <title>REPLACE-DISKS</title>
1837

    
1838
        <cmdsynopsis>
1839
          <command>replace-disks</command>
1840
          <arg>--submit</arg>
1841
          <arg>--early-release</arg>
1842
          <arg choice="req">-p</arg>
1843
          <arg>--disks <replaceable>idx</replaceable></arg>
1844
          <arg choice="req"><replaceable>instance</replaceable></arg>
1845
        </cmdsynopsis>
1846

    
1847
        <cmdsynopsis>
1848
          <command>replace-disks</command>
1849
          <arg>--submit</arg>
1850
          <arg>--early-release</arg>
1851
          <arg choice="req">-s</arg>
1852
          <arg>--disks <replaceable>idx</replaceable></arg>
1853
          <arg choice="req"><replaceable>instance</replaceable></arg>
1854
        </cmdsynopsis>
1855

    
1856
        <cmdsynopsis>
1857
          <command>replace-disks</command>
1858
          <arg>--submit</arg>
1859
          <arg>--early-release</arg>
1860
          <group choice="req">
1861
            <arg>--iallocator <replaceable>name</replaceable></arg>
1862
            <arg>--new-secondary <replaceable>NODE</replaceable></arg>
1863
          </group>
1864

    
1865
          <arg choice="req"><replaceable>instance</replaceable></arg>
1866
        </cmdsynopsis>
1867

    
1868
        <cmdsynopsis>
1869
          <command>replace-disks</command>
1870
          <arg>--submit</arg>
1871
          <arg>--early-release</arg>
1872
          <arg choice="req">--auto</arg>
1873
          <arg choice="req"><replaceable>instance</replaceable></arg>
1874
        </cmdsynopsis>
1875

    
1876
        <para>
1877
          This command is a generalized form for replacing disks. It
1878
          is currently only valid for the mirrored (DRBD) disk
1879
          template.
1880
        </para>
1881

    
1882
        <para>
1883
          The first form (when passing the <option>-p</option> option)
1884
          will replace the disks on the primary, while the second form
1885
          (when passing the <option>-s</option> option will replace
1886
          the disks on the secondary node. For these two cases (as the
1887
          node doesn't change), it is possible to only run the replace
1888
          for a subset of the disks, using the option
1889
          <option>--disks</option> which takes a list of
1890
          comma-delimited disk indices (zero-based),
1891
          e.g. <userinput>0,2</userinput> to replace only the first
1892
          and third disks.
1893
        </para>
1894

    
1895
        <para>
1896
          The third form (when passing either the
1897
          <option>--iallocator</option> or the
1898
          <option>--new-secondary</option> option) is designed to
1899
          change secondary node of the instance.  Specifying
1900
          <option>--iallocator</option> makes the new secondary be
1901
          selected automatically by the specified allocator plugin,
1902
          otherwise the new secondary node will be the one chosen
1903
          manually via the <option>--new-secondary</option> option.
1904
        </para>
1905

    
1906
        <para>
1907
          The fourth form (when using <option>--auto</option>) will
1908
          automatically determine which disks of an instance are faulty and
1909
          replace them within the same node. The <option>--auto</option>
1910
          option works only when an instance has only faulty disks on
1911
          either the primary or secondary node; it doesn't work when
1912
          both sides have faulty disks.
1913
        </para>
1914

    
1915
        <para>
1916
          The <option>--submit</option> option is used to send the job to
1917
          the master daemon but not wait for its completion. The job
1918
          ID will be shown so that it can be examined via
1919
          <command>gnt-job info</command>.
1920
        </para>
1921

    
1922
        <para>
1923
          The <option>--early-release</option> changes the code so
1924
          that the old storage on secondary node(s) is removed early
1925
          (before the resync is completed) and the internal Ganeti
1926
          locks for the current (and new, if any) secondary node are
1927
          also released, thus allowing more parallelism in the cluster
1928
          operation. This should be used only when recovering from a
1929
          disk failure on the current secondary (thus the old storage
1930
          is already broken) or when the storage on the primary node
1931
          is known to be fine (thus we won't need the old storage for
1932
          potential recovery).
1933
        </para>
1934

    
1935
        <para>
1936
          Note that it is not possible to select an offline or drained
1937
          node as a new secondary.
1938
        </para>
1939

    
1940
      </refsect3>
1941

    
1942
      <refsect3>
1943
        <title>ACTIVATE-DISKS</title>
1944

    
1945
        <cmdsynopsis>
1946
          <command>activate-disks</command>
1947
          <arg>--submit</arg>
1948
          <arg>--ignore-size</arg>
1949
          <arg choice="req"><replaceable>instance</replaceable></arg>
1950
        </cmdsynopsis>
1951
        <para>
1952
          Activates the block devices of the given instance. If
1953
          successful, the command will show the location and name of
1954
          the block devices:
1955
          <screen>
1956
node1.example.com:disk/0:/dev/drbd0
1957
node1.example.com:disk/1:/dev/drbd1
1958
          </screen>
1959

    
1960
          In this example, <emphasis>node1.example.com</emphasis> is
1961
          the name of the node on which the devices have been
1962
          activated. The <emphasis>disk/0</emphasis> and
1963
          <emphasis>disk/1</emphasis> are the Ganeti-names of the
1964
          instance disks; how they are visible inside the instance is
1965
          hypervisor-specific. <emphasis>/dev/drbd0</emphasis> and
1966
          <emphasis>/dev/drbd1</emphasis> are the actual block devices
1967
          as visible on the node.
1968
        </para>
1969

    
1970
        <para>
1971
          The <option>--submit</option> option is used to send the job to
1972
          the master daemon but not wait for its completion. The job
1973
          ID will be shown so that it can be examined via
1974
          <command>gnt-job info</command>.
1975
        </para>
1976

    
1977
        <para>
1978
          The <option>--ignore-size</option> option can be used to
1979
          activate disks ignoring the currently configured size in
1980
          Ganeti. This can be used in cases where the configuration
1981
          has gotten out of sync with the real-world (e.g. after a
1982
          partially-failed grow-disk operation or due to rounding in
1983
          LVM devices). This should not be used in normal cases, but
1984
          only when activate-disks fails without it.
1985
        </para>
1986

    
1987
        <para>
1988
          Note that it is safe to run this command while the instance
1989
          is already running.
1990
        </para>
1991
      </refsect3>
1992

    
1993
      <refsect3>
1994
        <title>DEACTIVATE-DISKS</title>
1995

    
1996
        <cmdsynopsis>
1997
          <command>deactivate-disks</command>
1998
          <arg>--submit</arg>
1999
          <arg choice="req"><replaceable>instance</replaceable></arg>
2000
        </cmdsynopsis>
2001
        <para>
2002
          De-activates the block devices of the given instance. Note
2003
          that if you run this command for an instance with a drbd
2004
          disk template, while it is running, it will not be able to
2005
          shutdown the block devices on the primary node, but it will
2006
          shutdown the block devices on the secondary nodes, thus
2007
          breaking the replication.
2008
        </para>
2009

    
2010
        <para>
2011
          The <option>--submit</option> option is used to send the job to
2012
          the master daemon but not wait for its completion. The job
2013
          ID will be shown so that it can be examined via
2014
          <command>gnt-job info</command>.
2015
        </para>
2016

    
2017
      </refsect3>
2018

    
2019
      <refsect3>
2020
        <title>GROW-DISK</title>
2021
        <cmdsynopsis>
2022
          <command>grow-disk</command>
2023
          <arg>--no-wait-for-sync</arg>
2024
          <arg>--submit</arg>
2025
          <arg choice="req"><replaceable>instance</replaceable></arg>
2026
          <arg choice="req"><replaceable>disk</replaceable></arg>
2027
          <arg choice="req"><replaceable>amount</replaceable></arg>
2028
        </cmdsynopsis>
2029

    
2030
        <para>
2031
          Grows an instance's disk. This is only possible for
2032
          instances having a <literal>plain</literal> or
2033
          <literal>drbd</literal> disk template.
2034
        </para>
2035

    
2036
        <para>
2037
          Note that this command only change the block device size; it
2038
          will not grow the actual filesystems, partitions, etc. that
2039
          live on that disk. Usually, you will need to:
2040
          <orderedlist>
2041
            <listitem>
2042
              <simpara>use <command>gnt-instance grow-disk</command></simpara>
2043
            </listitem>
2044
            <listitem>
2045
              <simpara>reboot the instance (later, at a convenient
2046
              time)</simpara>
2047
            </listitem>
2048
            <listitem>
2049
              <simpara>use a filesystem resizer, such as
2050
              <citerefentry> <refentrytitle>ext2online</refentrytitle>
2051
              <manvolnum>8</manvolnum> </citerefentry> or
2052
              <citerefentry> <refentrytitle>xfs_growfs</refentrytitle>
2053
              <manvolnum>8</manvolnum> </citerefentry> to resize the
2054
              filesystem, or use <citerefentry>
2055
              <refentrytitle>fdisk</refentrytitle>
2056
              <manvolnum>8</manvolnum> </citerefentry> to change the
2057
              partition table on the disk
2058
              </simpara>
2059
            </listitem>
2060
          </orderedlist>
2061
        </para>
2062

    
2063

    
2064
        <para>
2065
          The <replaceable>disk</replaceable> argument is the index of
2066
          the instance disk to grow. The
2067
          <replaceable>amount</replaceable> argument is given either
2068
          as a number (and it represents the amount to increase the
2069
          disk with in mebibytes) or can be given similar to the
2070
          arguments in the create instance operation, with a suffix
2071
          denoting the unit.
2072
        </para>
2073

    
2074
        <para>
2075
          Note that the disk grow operation might complete on one node
2076
          but fail on the other; this will leave the instance with
2077
          different-sized LVs on the two nodes, but this will not
2078
          create problems (except for unused space).
2079
        </para>
2080

    
2081
        <para>
2082
          If you do not want gnt-instance to wait for the new disk
2083
          region to be synced, use the
2084
          <option>--no-wait-for-sync</option> option.
2085
        </para>
2086

    
2087
        <para>
2088
          The <option>--submit</option> option is used to send the job to
2089
          the master daemon but not wait for its completion. The job
2090
          ID will be shown so that it can be examined via
2091
          <command>gnt-job info</command>.
2092
        </para>
2093

    
2094

    
2095
        <para>Example (increase the first disk for instance1 by 16GiB):
2096
          <screen>
2097
# gnt-instance grow-disk instance1.example.com 0 16g
2098
          </screen>
2099
        </para>
2100

    
2101
        <para>
2102
          Also note that disk shrinking is not supported; use
2103
          <command>gnt-backup export</command> and then
2104
          <command>gnt-backup import</command> to reduce the disk size
2105
          of an instance.
2106
        </para>
2107
      </refsect3>
2108

    
2109
      <refsect3>
2110
        <title>RECREATE-DISKS</title>
2111

    
2112
        <cmdsynopsis>
2113
          <command>recreate-disks</command>
2114
          <arg>--submit</arg>
2115
          <arg>--disks=<option>indices</option></arg>
2116
          <arg choice="req"><replaceable>instance</replaceable></arg>
2117
        </cmdsynopsis>
2118
        <para>
2119
          Recreates the disks of the given instance, or only a subset
2120
          of the disks (if the option <option>disks</option> is
2121
          passed, which must be a comma-separated list of disk
2122
          indices, starting from zero).
2123
        </para>
2124

    
2125
        <para>
2126
          Note that this functionality should only be used for missing
2127
          disks; if any of the given disks already exists, the
2128
          operation will fail. While this is suboptimal,
2129
          recreate-disks should hopefully not be needed in normal
2130
          operation and as such the impact of this is low.
2131
        </para>
2132

    
2133
        <para>
2134
          The <option>--submit</option> option is used to send the job to
2135
          the master daemon but not wait for its completion. The job
2136
          ID will be shown so that it can be examined via
2137
          <command>gnt-job info</command>.
2138
        </para>
2139

    
2140
      </refsect3>
2141

    
2142
    </refsect2>
2143

    
2144
    <refsect2>
2145
      <title>Recovery</title>
2146

    
2147
      <refsect3>
2148
        <title>FAILOVER</title>
2149

    
2150
        <cmdsynopsis>
2151
          <command>failover</command>
2152
          <arg>-f</arg>
2153
          <arg>--ignore-consistency</arg>
2154
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2155
          <arg>--submit</arg>
2156
          <arg choice="req"><replaceable>instance</replaceable></arg>
2157
        </cmdsynopsis>
2158

    
2159
        <para>
2160
          Failover will fail the instance over its secondary
2161
          node. This works only for instances having a drbd disk
2162
          template.
2163
        </para>
2164

    
2165
        <para>
2166
          Normally the failover will check the consistency of the
2167
          disks before failing over the instance. If you are trying to
2168
          migrate instances off a dead node, this will fail. Use the
2169
          <option>--ignore-consistency</option> option for this
2170
          purpose. Note that this option can be dangerous as errors in
2171
          shutting down the instance will be ignored, resulting in
2172
          possibly having the instance running on two machines in
2173
          parallel (on disconnected DRBD drives).
2174
        </para>
2175

    
2176
        <para>
2177
          The <option>--shutdown-timeout</option> is used to specify how
2178
          much time to wait before forcing the shutdown (xm destroy in xen,
2179
          killing the kvm process, for kvm). By default two minutes are
2180
          given to each instance to stop.
2181
        </para>
2182

    
2183
        <para>
2184
          The <option>--submit</option> option is used to send the job to
2185
          the master daemon but not wait for its completion. The job
2186
          ID will be shown so that it can be examined via
2187
          <command>gnt-job info</command>.
2188
        </para>
2189

    
2190
        <para>
2191
          Example:
2192
          <screen>
2193
# gnt-instance failover instance1.example.com
2194
          </screen>
2195
        </para>
2196
      </refsect3>
2197

    
2198
      <refsect3>
2199
        <title>MIGRATE</title>
2200

    
2201
        <cmdsynopsis>
2202
          <command>migrate</command>
2203
          <arg>-f</arg>
2204
          <arg choice="req">--cleanup</arg>
2205
          <arg choice="req"><replaceable>instance</replaceable></arg>
2206
        </cmdsynopsis>
2207

    
2208
        <cmdsynopsis>
2209
          <command>migrate</command>
2210
          <arg>-f</arg>
2211
          <arg>--non-live</arg>
2212
          <arg choice="req"><replaceable>instance</replaceable></arg>
2213
        </cmdsynopsis>
2214

    
2215
        <para>
2216
          Migrate will move the instance to its secondary node without
2217
          shutdown. It only works for instances having the drbd8 disk
2218
          template type.
2219
        </para>
2220

    
2221
        <para>
2222
          The migration command needs a perfectly healthy instance, as
2223
          we rely on the dual-master capability of drbd8 and the disks
2224
          of the instance are not allowed to be degraded.
2225
        </para>
2226

    
2227
        <para>
2228
          The <option>--non-live</option> option will switch (for the
2229
          hypervisors that support it) between a "fully live"
2230
          (i.e. the interruption is as minimal as possible) migration
2231
          and one in which the instance is frozen, its state saved and
2232
          transported to the remote node, and then resumed there. This
2233
          all depends on the hypervisor support for two different
2234
          methods. In any case, it is not an error to pass this
2235
          parameter (it will just be ignored if the hypervisor doesn't
2236
          support it).
2237
        </para>
2238

    
2239
        <para>
2240
          If the <option>--cleanup</option> option is passed, the
2241
          operation changes from migration to attempting recovery from
2242
          a failed previous migration. In this mode, ganeti checks if
2243
          the instance runs on the correct node (and updates its
2244
          configuration if not) and ensures the instances's disks are
2245
          configured correctly. In this mode, the
2246
          <option>--non-live</option> option is ignored.
2247
        </para>
2248

    
2249
        <para>
2250
          The option <option>-f</option> will skip the prompting for
2251
          confirmation.
2252
        </para>
2253
        <para>
2254
          Example (and expected output):
2255
          <screen>
2256
# gnt-instance migrate instance1
2257
Migrate will happen to the instance instance1. Note that migration is
2258
**experimental** in this version. This might impact the instance if
2259
anything goes wrong. Continue?
2260
y/[n]/?: y
2261
* checking disk consistency between source and target
2262
* ensuring the target is in secondary mode
2263
* changing disks into dual-master mode
2264
 - INFO: Waiting for instance instance1 to sync disks.
2265
 - INFO: Instance instance1's disks are in sync.
2266
* migrating instance to node2.example.com
2267
* changing the instance's disks on source node to secondary
2268
 - INFO: Waiting for instance instance1 to sync disks.
2269
 - INFO: Instance instance1's disks are in sync.
2270
* changing the instance's disks to single-master
2271
#
2272
          </screen>
2273
        </para>
2274
      </refsect3>
2275

    
2276
      <refsect3>
2277
        <title>MOVE</title>
2278

    
2279
        <cmdsynopsis>
2280
          <command>move</command>
2281
          <arg>-f</arg>
2282
          <arg>-n <replaceable>node</replaceable></arg>
2283
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2284
          <arg>--submit</arg>
2285
          <arg choice="req"><replaceable>instance</replaceable></arg>
2286
        </cmdsynopsis>
2287

    
2288
        <para>
2289
          Move will move the instance to an arbitrary node in the
2290
          cluster. This works only for instances having a plain or
2291
          file disk template.
2292
        </para>
2293

    
2294
        <para>
2295
          Note that since this operation is done via data copy, it
2296
          will take a long time for big disks (similar to
2297
          replace-disks for a drbd instance).
2298
        </para>
2299

    
2300
        <para>
2301
          The <option>--shutdown-timeout</option> is used to specify how
2302
          much time to wait before forcing the shutdown (xm destroy in xen,
2303
          killing the kvm process, for kvm). By default two minutes are
2304
          given to each instance to stop.
2305
        </para>
2306

    
2307
        <para>
2308
          The <option>--submit</option> option is used to send the job to
2309
          the master daemon but not wait for its completion. The job
2310
          ID will be shown so that it can be examined via
2311
          <command>gnt-job info</command>.
2312
        </para>
2313

    
2314
        <para>
2315
          Example:
2316
          <screen>
2317
# gnt-instance move -n node3.example.com instance1.example.com
2318
          </screen>
2319
        </para>
2320
      </refsect3>
2321

    
2322
    </refsect2>
2323

    
2324
    <refsect2>
2325
      <title>TAGS</title>
2326

    
2327
    <refsect3>
2328
        <title>ADD-TAGS</title>
2329

    
2330
        <cmdsynopsis>
2331
          <command>add-tags</command>
2332
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2333
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2334
          <arg choice="req"
2335
            rep="repeat"><replaceable>tag</replaceable></arg>
2336
        </cmdsynopsis>
2337

    
2338
        <para>
2339
          Add tags to the given instance. If any of the tags contains
2340
          invalid characters, the entire operation will abort.
2341
        </para>
2342
        <para>
2343
          If the <option>--from</option> option is given, the list of
2344
          tags will be extended with the contents of that file (each
2345
          line becomes a tag). In this case, there is not need to pass
2346
          tags on the command line (if you do, both sources will be
2347
          used). A file name of - will be interpreted as stdin.
2348
        </para>
2349
      </refsect3>
2350

    
2351
      <refsect3>
2352
        <title>LIST-TAGS</title>
2353

    
2354
        <cmdsynopsis>
2355
          <command>list-tags</command>
2356
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2357
        </cmdsynopsis>
2358

    
2359
        <para>List the tags of the given instance.</para>
2360
      </refsect3>
2361

    
2362
      <refsect3>
2363
        <title>REMOVE-TAGS</title>
2364
        <cmdsynopsis>
2365
          <command>remove-tags</command>
2366
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2367
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2368
          <arg choice="req"
2369
            rep="repeat"><replaceable>tag</replaceable></arg>
2370
        </cmdsynopsis>
2371

    
2372
        <para>
2373
          Remove tags from the given instance. If any of the tags are
2374
          not existing on the node, the entire operation will abort.
2375
        </para>
2376

    
2377
        <para>
2378
          If the <option>--from</option> option is given, the list of
2379
          tags will be extended with the contents of that file (each
2380
          line becomes a tag). In this case, there is not need to pass
2381
          tags on the command line (if you do, both sources will be
2382
          used). A file name of - will be interpreted as stdin.
2383
        </para>
2384
      </refsect3>
2385

    
2386
    </refsect2>
2387

    
2388
  </refsect1>
2389

    
2390
  &footer;
2391

    
2392
</refentry>
2393

    
2394
<!-- Keep this comment at the end of the file
2395
Local variables:
2396
mode: sgml
2397
sgml-omittag:t
2398
sgml-shorttag:t
2399
sgml-minimize-attributes:nil
2400
sgml-always-quote-attributes:t
2401
sgml-indent-step:2
2402
sgml-indent-data:t
2403
sgml-parent-document:nil
2404
sgml-default-dtd-file:nil
2405
sgml-exposed-tags:nil
2406
sgml-local-catalogs:nil
2407
sgml-local-ecat-files:nil
2408
End:
2409
-->