Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ 7ea7bcf6

History | View | Annotate | Download (86.6 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
              </listitem>
334
            </varlistentry>
335
            <varlistentry>
336
              <term>cdrom_image_path</term>
337
              <listitem>
338
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
339

    
340
                <simpara>The path to a CDROM image to attach to the
341
                instance.</simpara>
342

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

    
350
                <para>
351
                  This parameter determines the way the network cards
352
                  are presented to the instance. The possible options are:
353
                  <simplelist>
354
                    <member>rtl8139 (default for Xen HVM) (HVM & KVM)</member>
355
                    <member>ne2k_isa (HVM & KVM)</member>
356
                    <member>ne2k_pci (HVM & KVM)</member>
357
                    <member>i82551 (KVM)</member>
358
                    <member>i82557b (KVM)</member>
359
                    <member>i82559er (KVM)</member>
360
                    <member>pcnet (KVM)</member>
361
                    <member>e1000 (KVM)</member>
362
                    <member>paravirtual (default for KVM) (HVM & KVM)</member>
363
                  </simplelist>
364
                </para>
365
              </listitem>
366
            </varlistentry>
367
            <varlistentry>
368
              <term>disk_type</term>
369
              <listitem>
370
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
371

    
372
                <para>
373
                  This parameter determines the way the disks are
374
                  presented to the instance. The possible options are:
375
                  <simplelist>
376
                    <member>ioemu (default for HVM & KVM) (HVM & KVM)</member>
377
                    <member>ide (HVM & KVM)</member>
378
                    <member>scsi (KVM)</member>
379
                    <member>sd (KVM)</member>
380
                    <member>mtd (KVM)</member>
381
                    <member>pflash (KVM)</member>
382
                  </simplelist>
383
                </para>
384
              </listitem>
385
            </varlistentry>
386
            <varlistentry>
387
              <term>vnc_bind_address</term>
388
              <listitem>
389
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
390

    
391
                <para>Specifies the address that the VNC listener for
392
                this instance should bind to. Valid values are IPv4
393
                addresses. Use the address 0.0.0.0 to bind to all
394
                available interfaces (this is the default) or specify
395
                the address of one of the interfaces on the node to
396
                restrict listening to that interface.</para>
397
              </listitem>
398
            </varlistentry>
399

    
400
            <varlistentry>
401
              <term>vnc_tls</term>
402
              <listitem>
403
                <simpara>Valid for the KVM hypervisor.</simpara>
404

    
405
                <simpara>A boolean option that controls whether the
406
                VNC connection is secured with TLS.</simpara>
407
              </listitem>
408
            </varlistentry>
409

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

    
415
                <para>If <option>vnc_tls</option> is enabled, this
416
                options specifies the path to the x509 certificate to
417
                use.</para>
418
              </listitem>
419
            </varlistentry>
420

    
421
            <varlistentry>
422
              <term>vnc_x509_verify</term>
423
              <listitem>
424
                <simpara>Valid for the KVM hypervisor.</simpara>
425
              </listitem>
426
            </varlistentry>
427

    
428
            <varlistentry>
429
              <term>acpi</term>
430
              <listitem>
431
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
432

    
433
                <para>
434
                  A boolean option that specifies if the hypervisor
435
                  should enable ACPI support for this instance. By
436
                  default, ACPI is disabled.
437
                </para>
438
              </listitem>
439
            </varlistentry>
440

    
441
            <varlistentry>
442
              <term>pae</term>
443
              <listitem>
444
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
445

    
446
                <para>
447
                  A boolean option that specifies if the hypervisor
448
                  should enabled PAE support for this instance. The
449
                  default is false, disabling PAE support.
450
                </para>
451
              </listitem>
452
            </varlistentry>
453

    
454
            <varlistentry>
455
              <term>use_localtime</term>
456
              <listitem>
457
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
458

    
459
                <para>
460
                  A boolean option that specifies if the instance
461
                  should be started with its clock set to the
462
                  localtime of the machine (when true) or to the UTC
463
                  (When false). The default is false, which is useful
464
                  for Linux/Unix machines; for Windows OSes, it is
465
                  recommended to enable this parameter.
466
                </para>
467
              </listitem>
468
            </varlistentry>
469

    
470
            <varlistentry>
471
              <term>kernel_path</term>
472
              <listitem>
473
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
474

    
475
                <para>
476
                  This option specifies the path (on the node) to the
477
                  kernel to boot the instance with. Xen PVM instances
478
                  always require this, while for KVM if this option is
479
                  empty, it will cause the machine to load the kernel
480
                  from its disks.
481
                </para>
482
              </listitem>
483
            </varlistentry>
484

    
485
            <varlistentry>
486
              <term>kernel_args</term>
487
              <listitem>
488
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
489

    
490
                <para>
491
                  This options specifies extra arguments to the kernel
492
                  that will be loaded.  device. This is always used
493
                  for Xen PVM, while for KVM it is only used if the
494
                  <option>kernel_path</option> option is also
495
                  specified.
496
                </para>
497

    
498
                <para>
499
                  The default setting for this value is simply
500
                  <constant>"ro"</constant>, which mounts the root
501
                  disk (initially) in read-only one. For example,
502
                  setting this to <userinput>single</userinput> will
503
                  cause the instance to start in single-user mode.
504
                </para>
505
              </listitem>
506
            </varlistentry>
507

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

    
513
                <para>
514
                  This option specifies the path (on the node) to the
515
                  initrd to boot the instance with. Xen PVM instances
516
                  can use this always, while for KVM if this option is
517
                  only used if the <option>kernel_path</option> option
518
                  is also specified. You can pass here either an
519
                  absolute filename (the path to the initrd) if you
520
                  want to use an initrd, or use the format
521
                  <userinput>no_initrd_path</userinput> for no initrd.
522
                </para>
523
              </listitem>
524
            </varlistentry>
525

    
526
            <varlistentry>
527
              <term>root_path</term>
528
              <listitem>
529
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
530

    
531
                <para>
532
                  This options specifies the name of the root
533
                  device. This is always needed for Xen PVM, while for
534
                  KVM it is only used if the
535
                  <option>kernel_path</option> option is also
536
                  specified.
537
                </para>
538
              </listitem>
539
            </varlistentry>
540

    
541
            <varlistentry>
542
              <term>serial_console</term>
543
              <listitem>
544
                <simpara>Valid for the KVM hypervisor.</simpara>
545

    
546
                <simpara>This boolean option specifies whether to
547
                emulate a serial console for the instance.</simpara>
548
              </listitem>
549
            </varlistentry>
550

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

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

    
572
          </variablelist>
573

    
574
        </para>
575

    
576
        <para>
577
          The <option>--iallocator</option> option specifies the instance
578
          allocator plugin to use. If you pass in this option the allocator
579
          will select nodes for this instance automatically, so you don't need
580
          to pass them with the <option>-n</option> option. For more
581
          information please refer to the instance allocator documentation.
582
        </para>
583

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

    
621
        <para>
622
          The optional second value of the <option>--node</option> is used for
623
          the drbd template type and specifies the remote node.
624
        </para>
625

    
626
        <para>
627
          If you do not want gnt-instance to wait for the disk mirror
628
          to be synced, use the <option>--no-wait-for-sync</option>
629
          option.
630
        </para>
631

    
632
        <para>
633
          The <option>--file-storage-dir</option> specifies the relative path
634
          under the cluster-wide file storage directory to store file-based
635
          disks. It is useful for having different subdirectories for
636
          different instances. The full path of the directory where the disk
637
          files are stored will consist of cluster-wide file storage directory
638
          + optional subdirectory + instance name. Example:
639
          /srv/ganeti/file-storage/mysubdir/instance1.example.com. This option
640
          is only relevant for instances using the file storage backend.
641
        </para>
642

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

    
681
        <para>
682
          The <option>--submit</option> option is used to send the job to
683
          the master daemon but not wait for its completion. The job
684
          ID will be shown so that it can be examined via
685
          <command>gnt-job info</command>.
686
        </para>
687

    
688
        <para>
689
          Example:
690
          <screen>
691
# gnt-instance add -t file --disk 0:size=30g -B memory=512 -o debian-etch \
692
  -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
693
# gnt-instance add -t plain --disk 0:size=30g -B memory=512 -o debian-etch \
694
  -n node1.example.com instance1.example.com
695
# gnt-instance add -t drbd --disk 0:size=30g -B memory=512 -o debian-etch \
696
  -n node1.example.com:node2.example.com instance2.example.com
697
          </screen>
698
        </para>
699
      </refsect3>
700

    
701
      <refsect3>
702
        <title>BATCH-CREATE</title>
703
        <cmdsynopsis>
704
          <command>batch-create</command>
705
          <arg choice="req">instances_file.json</arg>
706
        </cmdsynopsis>
707

    
708
        <para>
709
          This command (similar to the Ganeti 1.2
710
          <command>batcher</command> tool) submits multiple instance
711
          creation jobs based on a definition file. The instance
712
          configurations do not encompass all the possible options for
713
          the <command>add</command> command, but only a subset.
714
        </para>
715

    
716
        <para>
717
          The instance file should be a valid-formed JSON file,
718
          containing a dictionary with instance name and instance
719
          parameters. The accepted parameters are:
720

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

    
818
        <para>
819
          A simple definition for one instance can be (with most of
820
          the parameters taken from the cluster defaults):
821
          <screen>
822
{
823
  "instance3": {
824
    "template": "drbd",
825
    "os": "debootstrap",
826
    "disk_size": ["25G"],
827
    "iallocator": "dumb"
828
  },
829
  "instance5": {
830
    "template": "drbd",
831
    "os": "debootstrap",
832
    "disk_size": ["25G"],
833
    "iallocator": "dumb",
834
    "hypervisor": "xen-hvm",
835
    "hvparams": {"acpi": true},
836
    "backend": {"memory": 512}
837
  }
838
}
839
</screen>
840
        </para>
841

    
842
        <para>
843
          The command will display the job id for each submitted instance, as follows:
844
          <screen>
845
# gnt-instance batch-create instances.json
846
instance3: 11224
847
instance5: 11225
848
</screen>
849
        </para>
850

    
851
      </refsect3>
852

    
853
      <refsect3>
854
        <title>REMOVE</title>
855

    
856
        <cmdsynopsis>
857
          <command>remove</command>
858
          <arg>--ignore-failures</arg>
859
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
860
          <arg>--submit</arg>
861
          <arg choice="req"><replaceable>instance</replaceable></arg>
862
        </cmdsynopsis>
863

    
864
        <para>
865
          Remove an instance. This will remove all data from the
866
          instance and there is <emphasis>no way back</emphasis>. If
867
          you are not sure if you use an instance again, use
868
          <command>shutdown</command> first and leave it in the
869
          shutdown state for a while.
870

    
871
        </para>
872

    
873
        <para>
874
          The <option>--ignore-failures</option> option will cause the
875
          removal to proceed even in the presence of errors during the
876
          removal of the instance (e.g. during the shutdown or the
877
          disk removal). If this option is not given, the command will
878
          stop at the first error.
879
        </para>
880

    
881
        <para>
882
          The <option>--shutdown-timeout</option> is used to specify how
883
          much time to wait before forcing the shutdown (xm destroy in xen,
884
          killing the kvm process, for kvm). By default two minutes are
885
          given to each instance to stop.
886
        </para>
887

    
888
        <para>
889
          The <option>--submit</option> option is used to send the job to
890
          the master daemon but not wait for its completion. The job
891
          ID will be shown so that it can be examined via
892
          <command>gnt-job info</command>.
893
        </para>
894

    
895
        <para>
896
          Example:
897
          <screen>
898
# gnt-instance remove instance1.example.com
899
          </screen>
900
        </para>
901
      </refsect3>
902

    
903
      <refsect3>
904
        <title>LIST</title>
905

    
906
        <cmdsynopsis>
907
          <command>list</command>
908
          <arg>--no-headers</arg>
909
          <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
910
          <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
911
          <arg rep="repeat">instance</arg>
912
        </cmdsynopsis>
913

    
914
        <para>
915
          Shows the currently configured instances with memory usage,
916
          disk usage, the node they are running on, and their run
917
          status.
918
        </para>
919

    
920
        <para>
921
          The <option>--no-headers</option> option will skip the
922
          initial header line. The <option>--separator</option> option
923
          takes an argument which denotes what will be used between
924
          the output fields. Both these options are to help scripting.
925
        </para>
926

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

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

    
1099
            <varlistentry>
1100
              <term>uuid</term>
1101
              <listitem>
1102
                <simpara>Show the UUID of the instance (generated
1103
                automatically by Ganeti)</simpara>
1104
              </listitem>
1105
            </varlistentry>
1106

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

    
1244
        <para>
1245
          If the value of the option starts with the character
1246
          <constant>+</constant>, the new field(s) will be added to the
1247
          default list. This allows to quickly see the default list
1248
          plus a few other fields, instead of retyping the entire list
1249
          of fields.
1250
        </para>
1251

    
1252
        <para>
1253
          There is a subtle grouping about the available output
1254
          fields: all fields except for <option>oper_state</option>,
1255
          <option>oper_ram</option> and <option>status</option> are
1256
          configuration value and not run-time values. So if you don't
1257
          select any of the these fields, the query will be satisfied
1258
          instantly from the cluster configuration, without having to
1259
          ask the remote nodes for the data. This can be helpful for
1260
          big clusters when you only want some data and it makes sense
1261
          to specify a reduced set of output fields.
1262
        </para>
1263

    
1264
        <para>The default output field list is:
1265
          <simplelist type="inline">
1266
            <member>name</member>
1267
            <member>os</member>
1268
            <member>pnode</member>
1269
            <member>admin_state</member>
1270
            <member>oper_state</member>
1271
            <member>oper_ram</member>
1272
          </simplelist>.
1273
        </para>
1274
      </refsect3>
1275

    
1276
      <refsect3>
1277
        <title>INFO</title>
1278

    
1279
        <cmdsynopsis>
1280
          <command>info</command>
1281
          <group>
1282
            <arg>-s</arg>
1283
            <arg>--static</arg>
1284
          </group>
1285
          <group choice="req">
1286
            <arg>--all</arg>
1287
            <arg rep="repeat"><replaceable>instance</replaceable></arg>
1288
          </group>
1289
        </cmdsynopsis>
1290

    
1291
        <para>
1292
          Show detailed information about the given instance(s). This is
1293
          different from <command>list</command> as it shows detailed data
1294
          about the instance's disks (especially useful for the drbd disk
1295
          template).
1296
        </para>
1297

    
1298
        <para>
1299
          If the option <option>-s</option> is used, only information
1300
          available in the configuration file is returned, without
1301
          querying nodes, making the operation faster.
1302
        </para>
1303

    
1304
        <para>
1305
          Use the <option>--all</option> to get info about all instances,
1306
          rather than explicitly passing the ones you're interested in.
1307
        </para>
1308
      </refsect3>
1309

    
1310
      <refsect3>
1311
        <title>MODIFY</title>
1312

    
1313
        <cmdsynopsis>
1314
          <command>modify</command>
1315
          <sbr>
1316
          <arg choice="opt">-H <replaceable>HYPERVISOR_PARAMETERS</replaceable></arg>
1317
          <sbr>
1318
          <arg choice="opt">-B <replaceable>BACKEND_PARAMETERS</replaceable></arg>
1319
          <sbr>
1320
          <group>
1321
            <arg>--net add<replaceable><optional>:options</optional></replaceable></arg>
1322
            <arg>--net remove</arg>
1323
            <arg>--net <replaceable>N:options</replaceable></arg>
1324
          </group>
1325
          <sbr>
1326
          <group>
1327
            <arg>--disk add:size=<replaceable>SIZE</replaceable></arg>
1328
            <arg>--disk remove</arg>
1329
            <arg>--disk <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></arg>
1330
          </group>
1331

    
1332
          <sbr>
1333
          <arg>--submit</arg>
1334
          <sbr>
1335
          <arg choice="req"><replaceable>instance</replaceable></arg>
1336
        </cmdsynopsis>
1337

    
1338
        <para>
1339
          Modifies the memory size, number of vcpus, ip address, MAC
1340
          address and/or nic parameters for an instance. It can also
1341
          add and remove disks and NICs to/from the instance. Note
1342
          that you need to give at least one of the arguments, otherwise
1343
          the command complains.
1344
        </para>
1345

    
1346
        <para>
1347
          The <option>-H</option> option specifies hypervisor options
1348
          in the form of <userinput>name=value[,...]</userinput>. For details which options can be specified, see the <command>add</command> command.
1349
        </para>
1350

    
1351
        <para>
1352
          The <option>--disk
1353
          add:size=<replaceable>SIZE</replaceable></option> option
1354
          adds a disk to the instance. The <option>--disk
1355
          remove</option> will remove the last disk of the
1356
          instance. The <option>--disk
1357
          <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></option>
1358
          option will change the mode of the Nth disk of the instance
1359
          between read-only (<literal>ro</literal>) and read-write
1360
          (<literal>rw</literal>).
1361
        </para>
1362

    
1363
        <para>
1364
          The <option>--net
1365
          add:<replaceable>options</replaceable></option> option will
1366
          add a new NIC to the instance. The available options are the
1367
          same as in the <command>add</command> command (mac, ip, link,
1368
          mode). The <option>--net remove</option> will remove the
1369
          last NIC of the instance, while the <option>--net
1370
          <replaceable>N</replaceable>:<replaceable>options</replaceable></option>
1371
          option will change the parameters of the Nth instance NIC.
1372
        </para>
1373

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

    
1381
        <para>
1382
          All the changes take effect at the next restart. If the
1383
          instance is running, there is no effect on the instance.
1384
        </para>
1385
      </refsect3>
1386

    
1387
      <refsect3>
1388
        <title>REINSTALL</title>
1389

    
1390
        <cmdsynopsis>
1391
          <command>reinstall</command>
1392
          <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
1393
          <arg>--select-os</arg>
1394
          <arg choice="opt">-f <replaceable>force</replaceable></arg>
1395
          <arg>--force-multiple</arg>
1396
          <sbr>
1397
          <group choice="opt">
1398
            <arg>--instance</arg>
1399
            <arg>--node</arg>
1400
            <arg>--primary</arg>
1401
            <arg>--secondary</arg>
1402
            <arg>--all</arg>
1403
          </group>
1404
          <arg>--submit</arg>
1405
          <arg choice="opt" rep="repeat"><replaceable>instance</replaceable></arg>
1406
        </cmdsynopsis>
1407

    
1408
        <para>
1409
          Reinstalls the operating system on the given instance(s). The
1410
          instance(s) must be stopped when running this command. If the
1411
          <option>--os-type</option> is specified, the operating
1412
          system is changed.
1413
        </para>
1414

    
1415
        <para>
1416
          The <option>--select-os</option> option switches to an
1417
          interactive OS reinstall. The user is prompted to select the OS
1418
          template from the list of available OS templates.
1419
        </para>
1420

    
1421
        <para>
1422
          Since this is a potentially dangerous command, the user will
1423
          be required to confirm this action, unless the
1424
          <option>-f</option> flag is passed. When multiple instances
1425
          are selected (either by passing multiple arguments or by
1426
          using the <option>--node</option>,
1427
          <option>--primary</option>, <option>--secondary</option> or
1428
          <option>--all</option> options), the user must pass both the
1429
          <option>--force</option> and
1430
          <option>--force-multiple</option> options to skip the
1431
          interactive confirmation.
1432
        </para>
1433

    
1434
        <para>
1435
          The <option>--submit</option> option is used to send the job to
1436
          the master daemon but not wait for its completion. The job
1437
          ID will be shown so that it can be examined via
1438
          <command>gnt-job info</command>.
1439
        </para>
1440

    
1441

    
1442
      </refsect3>
1443

    
1444
      <refsect3>
1445
        <title>RENAME</title>
1446

    
1447
        <cmdsynopsis>
1448
          <command>rename</command>
1449
          <arg>--no-ip-check</arg>
1450
          <arg>--submit</arg>
1451
          <arg choice="req"><replaceable>instance</replaceable></arg>
1452
          <arg choice="req"><replaceable>new_name</replaceable></arg>
1453
        </cmdsynopsis>
1454

    
1455
        <para>
1456
          Renames the given instance. The instance must be stopped
1457
          when running this command. The requirements for the new name
1458
          are the same as for adding an instance: the new name must be
1459
          resolvable and the IP it resolves to must not be reachable
1460
          (in order to prevent duplicate IPs the next time the
1461
          instance is started). The IP test can be skipped if the
1462
          <option>--no-ip-check</option> option is passed.
1463
        </para>
1464

    
1465
        <para>
1466
          The <option>--submit</option> option is used to send the job to
1467
          the master daemon but not wait for its completion. The job
1468
          ID will be shown so that it can be examined via
1469
          <command>gnt-job info</command>.
1470
        </para>
1471

    
1472
      </refsect3>
1473

    
1474
    </refsect2>
1475

    
1476
    <refsect2>
1477
      <title>Starting/stopping/connecting to console</title>
1478

    
1479
      <refsect3>
1480
        <title>STARTUP</title>
1481

    
1482
        <cmdsynopsis>
1483
          <command>startup</command>
1484
          <sbr>
1485
          <arg>--force</arg>
1486
          <sbr>
1487
          <arg>--force-multiple</arg>
1488
          <sbr>
1489
          <group choice="opt">
1490
            <arg>--instance</arg>
1491
            <arg>--node</arg>
1492
            <arg>--primary</arg>
1493
            <arg>--secondary</arg>
1494
            <arg>--all</arg>
1495
            <arg>--tags</arg>
1496
            <arg>--node-tags</arg>
1497
            <arg>--pri-node-tags</arg>
1498
            <arg>--sec-node-tags</arg>
1499
          </group>
1500
          <sbr>
1501
          <arg>-H <option>key=value...</option></arg>
1502
          <arg>-B <option>key=value...</option></arg>
1503
          <sbr>
1504
          <arg>--submit</arg>
1505
          <sbr>
1506
          <arg choice="opt"
1507
          rep="repeat"><replaceable>name</replaceable></arg>
1508
        </cmdsynopsis>
1509

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

    
1585
        <para>
1586
          Note that although you can pass more than one selection
1587
          option, the last one wins, so in order to guarantee the
1588
          desired result, don't pass more than one such option.
1589
        </para>
1590

    
1591
        <para>
1592
          Use <option>--force</option> to start even if secondary disks are
1593
          failing.
1594
        </para>
1595

    
1596
        <para>
1597
          The <option>--force-multiple</option> will skip the
1598
          interactive confirmation in the case the more than one
1599
          instance will be affected.
1600
        </para>
1601

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

    
1623
        <para>
1624
          The <option>--submit</option> option is used to send the job to
1625
          the master daemon but not wait for its completion. The job
1626
          ID will be shown so that it can be examined via
1627
          <command>gnt-job info</command>.
1628
        </para>
1629

    
1630
        <para>
1631
          Example:
1632
          <screen>
1633
# gnt-instance start instance1.example.com
1634
# gnt-instance start --node node1.example.com node2.example.com
1635
# gnt-instance start --all
1636
          </screen>
1637
        </para>
1638
      </refsect3>
1639

    
1640
      <refsect3>
1641
        <title>SHUTDOWN</title>
1642

    
1643
        <cmdsynopsis>
1644
          <command>shutdown</command>
1645
          <sbr>
1646
          <arg>--timeout=<replaceable>N</replaceable></arg>
1647
          <sbr>
1648
          <arg>--force-multiple</arg>
1649
          <sbr>
1650
          <group choice="opt">
1651
            <arg>--instance</arg>
1652
            <arg>--node</arg>
1653
            <arg>--primary</arg>
1654
            <arg>--secondary</arg>
1655
            <arg>--all</arg>
1656
            <arg>--tags</arg>
1657
            <arg>--node-tags</arg>
1658
            <arg>--pri-node-tags</arg>
1659
            <arg>--sec-node-tags</arg>
1660
          </group>
1661
          <sbr>
1662
          <arg>--submit</arg>
1663
          <sbr>
1664
          <arg choice="opt"
1665
          rep="repeat"><replaceable>name</replaceable></arg>
1666
        </cmdsynopsis>
1667

    
1668
        <para>
1669
          Stops one or more instances. If the instance cannot be
1670
          cleanly stopped during a hardcoded interval (currently 2
1671
          minutes), it will forcibly stop the instance (equivalent to
1672
          switching off the power on a physical machine).
1673
        </para>
1674

    
1675
        <para>
1676
          The <option>--timeout</option> is used to specify how much time to
1677
          wait before forcing the shutdown (xm destroy in xen, killing the kvm
1678
          process, for kvm). By default two minutes are given to each instance
1679
          to stop.
1680
        </para>
1681

    
1682
        <para>
1683
          The <option>--instance</option>, <option>--node</option>,
1684
          <option>--primary</option>, <option>--secondary</option>,
1685
          <option>--all</option>, <option>--tags</option>,
1686
          <option>--node-tags</option>, <option>--pri-node-tags</option> and
1687
          <option>--sec-node-tags</option> options are similar as for the
1688
          <command>startup</command> command and they influence the
1689
          actual instances being shutdown.
1690
        </para>
1691

    
1692
        <para>
1693
          The <option>--submit</option> option is used to send the job to
1694
          the master daemon but not wait for its completion. The job
1695
          ID will be shown so that it can be examined via
1696
          <command>gnt-job info</command>.
1697
        </para>
1698

    
1699

    
1700
        <para>
1701
          Example:
1702
          <screen>
1703
# gnt-instance shutdown instance1.example.com
1704
# gnt-instance shutdown --all
1705
          </screen>
1706
        </para>
1707
      </refsect3>
1708

    
1709
      <refsect3>
1710
        <title>REBOOT</title>
1711

    
1712
        <cmdsynopsis>
1713
          <command>reboot</command>
1714
          <sbr>
1715
          <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
1716
          <sbr>
1717
          <arg>--ignore-secondaries</arg>
1718
          <sbr>
1719
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
1720
          <sbr>
1721
          <arg>--force-multiple</arg>
1722
          <sbr>
1723
          <group choice="opt">
1724
            <arg>--instance</arg>
1725
            <arg>--node</arg>
1726
            <arg>--primary</arg>
1727
            <arg>--secondary</arg>
1728
            <arg>--all</arg>
1729
            <arg>--tags</arg>
1730
            <arg>--node-tags</arg>
1731
            <arg>--pri-node-tags</arg>
1732
            <arg>--sec-node-tags</arg>
1733
          </group>
1734
          <sbr>
1735
          <arg>--submit</arg>
1736
          <sbr>
1737
          <arg choice="opt"
1738
          rep="repeat"><replaceable>name</replaceable></arg>
1739
        </cmdsynopsis>
1740

    
1741
        <para>
1742
          Reboots one or more instances. The type of reboot depends on
1743
          the value of <option>--type</option>. A soft reboot does a
1744
          hypervisor reboot, a hard reboot does a instance stop,
1745
          recreates the hypervisor config for the instance and
1746
          starts the instance. A full reboot does the equivalent
1747
          of <command>gnt-instance shutdown &amp;&amp; gnt-instance
1748
          startup</command>. The default is hard reboot.
1749
        </para>
1750

    
1751
        <para>
1752
          For the hard reboot the option
1753
          <option>--ignore-secondaries</option> ignores errors for the
1754
          secondary node while re-assembling the instance disks.
1755
        </para>
1756

    
1757
        <para>
1758
          The <option>--instance</option>, <option>--node</option>,
1759
          <option>--primary</option>, <option>--secondary</option>,
1760
          <option>--all</option>, <option>--tags</option>,
1761
          <option>--node-tags</option>, <option>--pri-node-tags</option> and
1762
          <option>--sec-node-tags</option> options are similar as for the
1763
          <command>startup</command> command and they influence the
1764
          actual instances being rebooted.
1765
        </para>
1766

    
1767
        <para>
1768
          The <option>--shutdown-timeout</option> is used to specify how
1769
          much time to wait before forcing the shutdown (xm destroy in xen,
1770
          killing the kvm process, for kvm). By default two minutes are
1771
          given to each instance to stop.
1772
        </para>
1773

    
1774
        <para>
1775
          The <option>--force-multiple</option> will skip the
1776
          interactive confirmation in the case the more than one
1777
          instance will be affected.
1778
        </para>
1779

    
1780
        <para>
1781
          Example:
1782
          <screen>
1783
# gnt-instance reboot instance1.example.com
1784
# gnt-instance reboot --type=full instance1.example.com
1785
          </screen>
1786
        </para>
1787
      </refsect3>
1788

    
1789
      <refsect3>
1790
        <title>CONSOLE</title>
1791
        <cmdsynopsis>
1792
          <command>console</command>
1793
          <arg choice="opt">--show-cmd</arg>
1794
          <arg choice="req"><replaceable>instance</replaceable></arg>
1795
        </cmdsynopsis>
1796

    
1797
        <para>
1798
          Connects to the console of the given instance. If the
1799
          instance is not up, an error is returned. Use the
1800
          <option>--show-cmd</option> option to display the command
1801
          instead of executing it.
1802
        </para>
1803

    
1804
        <para>
1805
          For HVM instances, this will attempt to connect to the
1806
          serial console of the instance. To connect to the
1807
          virtualized "physical" console of a HVM instance, use a VNC
1808
          client with the connection info from the
1809
          <command>info</command> command.
1810
        </para>
1811

    
1812
        <para>
1813
          Example:
1814
          <screen>
1815
# gnt-instance console instance1.example.com
1816
          </screen>
1817
        </para>
1818
      </refsect3>
1819

    
1820
    </refsect2>
1821

    
1822
    <refsect2>
1823
      <title>Disk management</title>
1824

    
1825
      <refsect3>
1826
        <title>REPLACE-DISKS</title>
1827

    
1828
        <cmdsynopsis>
1829
          <command>replace-disks</command>
1830
          <arg>--submit</arg>
1831
          <arg>--early-release</arg>
1832
          <arg choice="req">-p</arg>
1833
          <arg>--disks <replaceable>idx</replaceable></arg>
1834
          <arg choice="req"><replaceable>instance</replaceable></arg>
1835
        </cmdsynopsis>
1836

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

    
1846
        <cmdsynopsis>
1847
          <command>replace-disks</command>
1848
          <arg>--submit</arg>
1849
          <arg>--early-release</arg>
1850
          <group choice="req">
1851
            <arg>--iallocator <replaceable>name</replaceable></arg>
1852
            <arg>--new-secondary <replaceable>NODE</replaceable></arg>
1853
          </group>
1854

    
1855
          <arg choice="req"><replaceable>instance</replaceable></arg>
1856
        </cmdsynopsis>
1857

    
1858
        <cmdsynopsis>
1859
          <command>replace-disks</command>
1860
          <arg>--submit</arg>
1861
          <arg>--early-release</arg>
1862
          <arg choice="req">--auto</arg>
1863
          <arg choice="req"><replaceable>instance</replaceable></arg>
1864
        </cmdsynopsis>
1865

    
1866
        <para>
1867
          This command is a generalized form for replacing disks. It
1868
          is currently only valid for the mirrored (DRBD) disk
1869
          template.
1870
        </para>
1871

    
1872
        <para>
1873
          The first form (when passing the <option>-p</option> option)
1874
          will replace the disks on the primary, while the second form
1875
          (when passing the <option>-s</option> option will replace
1876
          the disks on the secondary node. For these two cases (as the
1877
          node doesn't change), it is possible to only run the replace
1878
          for a subset of the disks, using the option
1879
          <option>--disks</option> which takes a list of
1880
          comma-delimited disk indices (zero-based),
1881
          e.g. <userinput>0,2</userinput> to replace only the first
1882
          and third disks.
1883
        </para>
1884

    
1885
        <para>
1886
          The third form (when passing either the
1887
          <option>--iallocator</option> or the
1888
          <option>--new-secondary</option> option) is designed to
1889
          change secondary node of the instance.  Specifying
1890
          <option>--iallocator</option> makes the new secondary be
1891
          selected automatically by the specified allocator plugin,
1892
          otherwise the new secondary node will be the one chosen
1893
          manually via the <option>--new-secondary</option> option.
1894
        </para>
1895

    
1896
        <para>
1897
          The fourth form (when using <option>--auto</option>) will
1898
          automatically determine which disks of an instance are faulty and
1899
          replace them within the same node. The <option>--auto</option>
1900
          option works only when an instance has only faulty disks on
1901
          either the primary or secondary node; it doesn't work when
1902
          both sides have faulty disks.
1903
        </para>
1904

    
1905
        <para>
1906
          The <option>--submit</option> option is used to send the job to
1907
          the master daemon but not wait for its completion. The job
1908
          ID will be shown so that it can be examined via
1909
          <command>gnt-job info</command>.
1910
        </para>
1911

    
1912
        <para>
1913
          The <option>--early-release</option> changes the code so
1914
          that the old storage on secondary node(s) is removed early
1915
          (before the resync is completed) and the internal Ganeti
1916
          locks for the current (and new, if any) secondary node are
1917
          also released, thus allowing more parallelism in the cluster
1918
          operation. This should be used only when recovering from a
1919
          disk failure on the current secondary (thus the old storage
1920
          is already broken) or when the storage on the primary node
1921
          is known to be fine (thus we won't need the old storage for
1922
          potential recovery).
1923
        </para>
1924

    
1925
        <para>
1926
          Note that it is not possible to select an offline or drained
1927
          node as a new secondary.
1928
        </para>
1929

    
1930
      </refsect3>
1931

    
1932
      <refsect3>
1933
        <title>ACTIVATE-DISKS</title>
1934

    
1935
        <cmdsynopsis>
1936
          <command>activate-disks</command>
1937
          <arg>--submit</arg>
1938
          <arg>--ignore-size</arg>
1939
          <arg choice="req"><replaceable>instance</replaceable></arg>
1940
        </cmdsynopsis>
1941
        <para>
1942
          Activates the block devices of the given instance. If
1943
          successful, the command will show the location and name of
1944
          the block devices:
1945
          <screen>
1946
node1.example.com:disk/0:/dev/drbd0
1947
node1.example.com:disk/1:/dev/drbd1
1948
          </screen>
1949

    
1950
          In this example, <emphasis>node1.example.com</emphasis> is
1951
          the name of the node on which the devices have been
1952
          activated. The <emphasis>disk/0</emphasis> and
1953
          <emphasis>disk/1</emphasis> are the Ganeti-names of the
1954
          instance disks; how they are visible inside the instance is
1955
          hypervisor-specific. <emphasis>/dev/drbd0</emphasis> and
1956
          <emphasis>/dev/drbd1</emphasis> are the actual block devices
1957
          as visible on the node.
1958
        </para>
1959

    
1960
        <para>
1961
          The <option>--submit</option> option is used to send the job to
1962
          the master daemon but not wait for its completion. The job
1963
          ID will be shown so that it can be examined via
1964
          <command>gnt-job info</command>.
1965
        </para>
1966

    
1967
        <para>
1968
          The <option>--ignore-size</option> option can be used to
1969
          activate disks ignoring the currently configured size in
1970
          Ganeti. This can be used in cases where the configuration
1971
          has gotten out of sync with the real-world (e.g. after a
1972
          partially-failed grow-disk operation or due to rounding in
1973
          LVM devices). This should not be used in normal cases, but
1974
          only when activate-disks fails without it.
1975
        </para>
1976

    
1977
        <para>
1978
          Note that it is safe to run this command while the instance
1979
          is already running.
1980
        </para>
1981
      </refsect3>
1982

    
1983
      <refsect3>
1984
        <title>DEACTIVATE-DISKS</title>
1985

    
1986
        <cmdsynopsis>
1987
          <command>deactivate-disks</command>
1988
          <arg>--submit</arg>
1989
          <arg choice="req"><replaceable>instance</replaceable></arg>
1990
        </cmdsynopsis>
1991
        <para>
1992
          De-activates the block devices of the given instance. Note
1993
          that if you run this command for an instance with a drbd
1994
          disk template, while it is running, it will not be able to
1995
          shutdown the block devices on the primary node, but it will
1996
          shutdown the block devices on the secondary nodes, thus
1997
          breaking the replication.
1998
        </para>
1999

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

    
2007
      </refsect3>
2008

    
2009
      <refsect3>
2010
        <title>GROW-DISK</title>
2011
        <cmdsynopsis>
2012
          <command>grow-disk</command>
2013
          <arg>--no-wait-for-sync</arg>
2014
          <arg>--submit</arg>
2015
          <arg choice="req"><replaceable>instance</replaceable></arg>
2016
          <arg choice="req"><replaceable>disk</replaceable></arg>
2017
          <arg choice="req"><replaceable>amount</replaceable></arg>
2018
        </cmdsynopsis>
2019

    
2020
        <para>
2021
          Grows an instance's disk. This is only possible for
2022
          instances having a <literal>plain</literal> or
2023
          <literal>drbd</literal> disk template.
2024
        </para>
2025

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

    
2053

    
2054
        <para>
2055
          The <replaceable>disk</replaceable> argument is the index of
2056
          the instance disk to grow. The
2057
          <replaceable>amount</replaceable> argument is given either
2058
          as a number (and it represents the amount to increase the
2059
          disk with in mebibytes) or can be given similar to the
2060
          arguments in the create instance operation, with a suffix
2061
          denoting the unit.
2062
        </para>
2063

    
2064
        <para>
2065
          Note that the disk grow operation might complete on one node
2066
          but fail on the other; this will leave the instance with
2067
          different-sized LVs on the two nodes, but this will not
2068
          create problems (except for unused space).
2069
        </para>
2070

    
2071
        <para>
2072
          If you do not want gnt-instance to wait for the new disk
2073
          region to be synced, use the
2074
          <option>--no-wait-for-sync</option> option.
2075
        </para>
2076

    
2077
        <para>
2078
          The <option>--submit</option> option is used to send the job to
2079
          the master daemon but not wait for its completion. The job
2080
          ID will be shown so that it can be examined via
2081
          <command>gnt-job info</command>.
2082
        </para>
2083

    
2084

    
2085
        <para>Example (increase the first disk for instance1 by 16GiB):
2086
          <screen>
2087
# gnt-instance grow-disk instance1.example.com 0 16g
2088
          </screen>
2089
        </para>
2090

    
2091
        <para>
2092
          Also note that disk shrinking is not supported; use
2093
          <command>gnt-backup export</command> and then
2094
          <command>gnt-backup import</command> to reduce the disk size
2095
          of an instance.
2096
        </para>
2097
      </refsect3>
2098

    
2099
      <refsect3>
2100
        <title>RECREATE-DISKS</title>
2101

    
2102
        <cmdsynopsis>
2103
          <command>recreate-disks</command>
2104
          <arg>--submit</arg>
2105
          <arg>--disks=<option>indices</option></arg>
2106
          <arg choice="req"><replaceable>instance</replaceable></arg>
2107
        </cmdsynopsis>
2108
        <para>
2109
          Recreates the disks of the given instance, or only a subset
2110
          of the disks (if the option <option>disks</option> is
2111
          passed, which must be a comma-separated list of disk
2112
          indices, starting from zero).
2113
        </para>
2114

    
2115
        <para>
2116
          Note that this functionality should only be used for missing
2117
          disks; if any of the given disks already exists, the
2118
          operation will fail. While this is suboptimal,
2119
          recreate-disks should hopefully not be needed in normal
2120
          operation and as such the impact of this is low.
2121
        </para>
2122

    
2123
        <para>
2124
          The <option>--submit</option> option is used to send the job to
2125
          the master daemon but not wait for its completion. The job
2126
          ID will be shown so that it can be examined via
2127
          <command>gnt-job info</command>.
2128
        </para>
2129

    
2130
      </refsect3>
2131

    
2132
    </refsect2>
2133

    
2134
    <refsect2>
2135
      <title>Recovery</title>
2136

    
2137
      <refsect3>
2138
        <title>FAILOVER</title>
2139

    
2140
        <cmdsynopsis>
2141
          <command>failover</command>
2142
          <arg>-f</arg>
2143
          <arg>--ignore-consistency</arg>
2144
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2145
          <arg>--submit</arg>
2146
          <arg choice="req"><replaceable>instance</replaceable></arg>
2147
        </cmdsynopsis>
2148

    
2149
        <para>
2150
          Failover will fail the instance over its secondary
2151
          node. This works only for instances having a drbd disk
2152
          template.
2153
        </para>
2154

    
2155
        <para>
2156
          Normally the failover will check the consistency of the
2157
          disks before failing over the instance. If you are trying to
2158
          migrate instances off a dead node, this will fail. Use the
2159
          <option>--ignore-consistency</option> option for this
2160
          purpose. Note that this option can be dangerous as errors in
2161
          shutting down the instance will be ignored, resulting in
2162
          possibly having the instance running on two machines in
2163
          parallel (on disconnected DRBD drives).
2164
        </para>
2165

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

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

    
2180
        <para>
2181
          Example:
2182
          <screen>
2183
# gnt-instance failover instance1.example.com
2184
          </screen>
2185
        </para>
2186
      </refsect3>
2187

    
2188
      <refsect3>
2189
        <title>MIGRATE</title>
2190

    
2191
        <cmdsynopsis>
2192
          <command>migrate</command>
2193
          <arg>-f</arg>
2194
          <arg choice="req">--cleanup</arg>
2195
          <arg choice="req"><replaceable>instance</replaceable></arg>
2196
        </cmdsynopsis>
2197

    
2198
        <cmdsynopsis>
2199
          <command>migrate</command>
2200
          <arg>-f</arg>
2201
          <arg>--non-live</arg>
2202
          <arg choice="req"><replaceable>instance</replaceable></arg>
2203
        </cmdsynopsis>
2204

    
2205
        <para>
2206
          Migrate will move the instance to its secondary node without
2207
          shutdown. It only works for instances having the drbd8 disk
2208
          template type.
2209
        </para>
2210

    
2211
        <para>
2212
          The migration command needs a perfectly healthy instance, as
2213
          we rely on the dual-master capability of drbd8 and the disks
2214
          of the instance are not allowed to be degraded.
2215
        </para>
2216

    
2217
        <para>
2218
          The <option>--non-live</option> option will switch (for the
2219
          hypervisors that support it) between a "fully live"
2220
          (i.e. the interruption is as minimal as possible) migration
2221
          and one in which the instance is frozen, its state saved and
2222
          transported to the remote node, and then resumed there. This
2223
          all depends on the hypervisor support for two different
2224
          methods. In any case, it is not an error to pass this
2225
          parameter (it will just be ignored if the hypervisor doesn't
2226
          support it).
2227
        </para>
2228

    
2229
        <para>
2230
          If the <option>--cleanup</option> option is passed, the
2231
          operation changes from migration to attempting recovery from
2232
          a failed previous migration. In this mode, ganeti checks if
2233
          the instance runs on the correct node (and updates its
2234
          configuration if not) and ensures the instances's disks are
2235
          configured correctly. In this mode, the
2236
          <option>--non-live</option> option is ignored.
2237
        </para>
2238

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

    
2266
      <refsect3>
2267
        <title>MOVE</title>
2268

    
2269
        <cmdsynopsis>
2270
          <command>move</command>
2271
          <arg>-f</arg>
2272
          <arg>-n <replaceable>node</replaceable></arg>
2273
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2274
          <arg>--submit</arg>
2275
          <arg choice="req"><replaceable>instance</replaceable></arg>
2276
        </cmdsynopsis>
2277

    
2278
        <para>
2279
          Move will move the instance to an arbitrary node in the
2280
          cluster. This works only for instances having a plain or
2281
          file disk template.
2282
        </para>
2283

    
2284
        <para>
2285
          Note that since this operation is done via data copy, it
2286
          will take a long time for big disks (similar to
2287
          replace-disks for a drbd instance).
2288
        </para>
2289

    
2290
        <para>
2291
          The <option>--shutdown-timeout</option> is used to specify how
2292
          much time to wait before forcing the shutdown (xm destroy in xen,
2293
          killing the kvm process, for kvm). By default two minutes are
2294
          given to each instance to stop.
2295
        </para>
2296

    
2297
        <para>
2298
          The <option>--submit</option> option is used to send the job to
2299
          the master daemon but not wait for its completion. The job
2300
          ID will be shown so that it can be examined via
2301
          <command>gnt-job info</command>.
2302
        </para>
2303

    
2304
        <para>
2305
          Example:
2306
          <screen>
2307
# gnt-instance move -n node3.example.com instance1.example.com
2308
          </screen>
2309
        </para>
2310
      </refsect3>
2311

    
2312
    </refsect2>
2313

    
2314
    <refsect2>
2315
      <title>TAGS</title>
2316

    
2317
    <refsect3>
2318
        <title>ADD-TAGS</title>
2319

    
2320
        <cmdsynopsis>
2321
          <command>add-tags</command>
2322
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2323
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2324
          <arg choice="req"
2325
            rep="repeat"><replaceable>tag</replaceable></arg>
2326
        </cmdsynopsis>
2327

    
2328
        <para>
2329
          Add tags to the given instance. If any of the tags contains
2330
          invalid characters, the entire operation will abort.
2331
        </para>
2332
        <para>
2333
          If the <option>--from</option> option is given, the list of
2334
          tags will be extended with the contents of that file (each
2335
          line becomes a tag). In this case, there is not need to pass
2336
          tags on the command line (if you do, both sources will be
2337
          used). A file name of - will be interpreted as stdin.
2338
        </para>
2339
      </refsect3>
2340

    
2341
      <refsect3>
2342
        <title>LIST-TAGS</title>
2343

    
2344
        <cmdsynopsis>
2345
          <command>list-tags</command>
2346
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2347
        </cmdsynopsis>
2348

    
2349
        <para>List the tags of the given instance.</para>
2350
      </refsect3>
2351

    
2352
      <refsect3>
2353
        <title>REMOVE-TAGS</title>
2354
        <cmdsynopsis>
2355
          <command>remove-tags</command>
2356
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2357
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2358
          <arg choice="req"
2359
            rep="repeat"><replaceable>tag</replaceable></arg>
2360
        </cmdsynopsis>
2361

    
2362
        <para>
2363
          Remove tags from the given instance. If any of the tags are
2364
          not existing on the node, the entire operation will abort.
2365
        </para>
2366

    
2367
        <para>
2368
          If the <option>--from</option> option is given, the list of
2369
          tags will be extended with the contents of that file (each
2370
          line becomes a tag). In this case, there is not need to pass
2371
          tags on the command line (if you do, both sources will be
2372
          used). A file name of - will be interpreted as stdin.
2373
        </para>
2374
      </refsect3>
2375

    
2376
    </refsect2>
2377

    
2378
  </refsect1>
2379

    
2380
  &footer;
2381

    
2382
</refentry>
2383

    
2384
<!-- Keep this comment at the end of the file
2385
Local variables:
2386
mode: sgml
2387
sgml-omittag:t
2388
sgml-shorttag:t
2389
sgml-minimize-attributes:nil
2390
sgml-always-quote-attributes:t
2391
sgml-indent-step:2
2392
sgml-indent-data:t
2393
sgml-parent-document:nil
2394
sgml-default-dtd-file:nil
2395
sgml-exposed-tags:nil
2396
sgml-local-catalogs:nil
2397
sgml-local-ecat-files:nil
2398
End:
2399
-->