Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ 84c08e4e

History | View | Annotate | Download (91.9 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>:<group choice="req">
79
                <arg>size=<replaceable>VAL</replaceable></arg>
80
                <arg>adopt=<replaceable>LV</replaceable></arg>
81
              </group>,mode=<replaceable>ro|rw</replaceable></arg>
82
            <arg>-s <replaceable>SIZE</replaceable></arg>
83
          </group>
84
          <sbr>
85
          <arg>--no-ip-check</arg>
86
          <arg>--no-name-check</arg>
87
          <arg>--no-start</arg>
88
          <arg>--no-install</arg>
89
          <sbr>
90
          <group>
91
            <arg rep="repeat">--net=<replaceable>N</replaceable><arg rep="repeat">:options</arg></arg>
92
            <arg>--no-nics</arg>
93
          </group>
94
          <sbr>
95
          <arg>-B <replaceable>BEPARAMS</replaceable></arg>
96
          <sbr>
97

    
98
          <arg>-H <replaceable>HYPERVISOR</replaceable><arg>:<arg choice="plain" rep="repeat">option=<replaceable>value</replaceable></arg></arg></arg>
99
          <sbr>
100

    
101
          <arg>--file-storage-dir <replaceable>dir_path</replaceable></arg>
102
          <arg>--file-driver<group choice="req">
103
              <arg>loop</arg>
104
              <arg>blktap</arg>
105
            </group></arg>
106
          <sbr>
107

    
108
          <group choice="req">
109
            <arg>-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg>
110
            <arg>--iallocator <replaceable>name</replaceable></arg>
111
          </group>
112
          <sbr>
113

    
114
          <arg choice="req">-o <replaceable>os-type</replaceable></arg>
115
          <sbr>
116
          <arg>--submit</arg>
117
          <sbr>
118

    
119
          <arg choice="req"><replaceable>instance</replaceable></arg>
120
        </cmdsynopsis>
121

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

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

    
143
        <para>
144
          When using the <option>adopt</option> key in the disk
145
          definition, Ganeti will reuse those volumes (instead of
146
          creating new ones) as the instance's disks. Ganeti will
147
          rename these volumes to the standard format, and (without
148
          installing the OS) will use them as-is for the
149
          instance. This allows migrating instances from non-managed
150
          mode (e.q. plain KVM with LVM) to being managed via
151
          Ganeti. Note that this works only for the `plain' disk
152
          template (see below for template details).
153
        </para>
154

    
155
        <para>
156
          Alternatively, a single-disk instance can be created via the
157
          <option>-s</option> option which takes a single argument,
158
          the size of the disk. This is similar to the Ganeti 1.2
159
          version (but will only create one disk).
160
        </para>
161

    
162
        <para>
163
          The minimum disk specification is therefore
164
          <userinput>--disk 0:size=20G</userinput> (or <userinput>-s
165
          20G</userinput> when using the <option>-s</option> option),
166
          and a three-disk instance can be specified as
167
          <userinput>--disk 0:size=20G --disk 1:size=4G --disk
168
          2:size=100G</userinput>.
169
        </para>
170

    
171
        <para>
172
          The <option>--no-ip-check</option> skips the checks that are
173
          done to see if the instance's IP is not already alive
174
          (i.e. reachable from the master node).
175
        </para>
176

    
177
        <para>
178
          The <option>--no-name-check</option> skips the check for the
179
          instance name via the resolver (e.g. in DNS or /etc/hosts,
180
          depending on your setup). Since the name check is used to
181
          compute the IP address, if you pass this option you must
182
          also pass the <option>--no-ip-check</option> option.
183
        </para>
184

    
185
        <para>
186
          If you don't wat the instance to automatically start after
187
          creation, this is possible via the
188
          <option>--no-start</option> option. This will leave the
189
          instance down until a subsequent <command>gnt-instance
190
          start</command> command.
191
        </para>
192

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

    
238
        <para>
239
          Alternatively, if no network is desired for the instance, you
240
          can prevent the default of one NIC with the
241
          <option>--no-nics</option> option.
242
        </para>
243

    
244
        <para>
245
          The <option>-o</option> options specifies the operating
246
          system to be installed. The available operating systems can
247
          be listed with <command>gnt-os
248
          list</command>. Passing <option>--no-install</option> will
249
          however skip the OS installation, allowing a manual import
250
          if so desired. Note that the no-installation mode will
251
          automatically disable the start-up of the instance (without
252
          an OS, it most likely won't be able to start-up
253
          successfully).
254
        </para>
255

    
256
        <para>
257
          The <option>-B</option> option specifies the backend
258
          parameters for the instance. If no such parameters are
259
          specified, the values are inherited from the cluster. Possible
260
          parameters are:
261
          <variablelist>
262
            <varlistentry>
263
              <term>memory</term>
264
              <listitem>
265
                <simpara>the memory size of the instance; as usual,
266
                  suffixes can be used to denote the unit, otherwise the
267
                  value is taken in mebibites</simpara>
268
              </listitem>
269
            </varlistentry>
270
            <varlistentry>
271
              <term>vcpus</term>
272
              <listitem>
273
                <simpara>the number of VCPUs to assign to the instance
274
                  (if this value makes sense for the hypervisor)</simpara>
275
              </listitem>
276
            </varlistentry>
277
            <varlistentry>
278
              <term>auto_balance</term>
279
              <listitem>
280
                <simpara>whether the instance is considered in the N+1
281
                  cluster checks (enough redundancy in the cluster to
282
                  survive a node failure)</simpara>
283
              </listitem>
284
            </varlistentry>
285
          </variablelist>
286
        </para>
287

    
288
        <para>
289
          The <option>-H</option> option specified the hypervisor to
290
          use for the instance (must be one of the enabled hypervisors
291
          on the cluster) and optionally custom parameters for this
292
          instance. If not other options are used (i.e. the invocation
293
          is just <userinput>-H
294
          <replaceable>NAME</replaceable></userinput>) the instance
295
          will inherit the cluster options. The defaults below show
296
          the cluster defaults at cluster creation time.
297
        </para>
298

    
299
        <para>
300
          The possible hypervisor options are as follows:
301
          <variablelist>
302
            <varlistentry>
303
              <term>boot_order</term>
304
              <listitem>
305
                <simpara>Valid for the Xen HVM and KVM
306
                hypervisors.</simpara>
307

    
308
                <simpara>A string value denoting the boot order. This
309
                has different meaning for the Xen HVM hypervisor and
310
                for the KVM one.</simpara>
311

    
312
                <simpara>
313
                  For Xen HVM, The boot order is a string of letters
314
                  listing the boot devices, with valid device letters
315
                  being:
316
                </simpara>
317
                  <variablelist>
318
                    <varlistentry>
319
                      <term>a</term>
320
                      <listitem>
321
                        <para>
322
                          floppy drive
323
                        </para>
324
                      </listitem>
325
                    </varlistentry>
326
                    <varlistentry>
327
                      <term>c</term>
328
                      <listitem>
329
                        <para>
330
                          hard disk
331
                        </para>
332
                      </listitem>
333
                    </varlistentry>
334
                    <varlistentry>
335
                      <term>d</term>
336
                      <listitem>
337
                        <para>
338
                          CDROM drive
339
                        </para>
340
                      </listitem>
341
                    </varlistentry>
342
                    <varlistentry>
343
                      <term>n</term>
344
                      <listitem>
345
                        <para>
346
                          network boot (PXE)
347
                        </para>
348
                      </listitem>
349
                    </varlistentry>
350
                  </variablelist>
351
                <simpara>
352
                  The default is not to set an HVM boot order which is
353
                  interpreted as 'dc'.
354
                </simpara>
355

    
356
                <simpara>
357
                  For KVM the boot order is either
358
                  <quote>cdrom</quote>, <quote>disk</quote> or
359
                  <quote>network</quote>. Please note that older
360
                  versions of KVM couldn't netboot from virtio
361
                  interfaces. This has been fixed in more recent
362
                  versions and is confirmed to work at least with
363
                  qemu-kvm 0.11.1.
364
                </simpara>
365

    
366
              </listitem>
367
            </varlistentry>
368
            <varlistentry>
369
              <term>cdrom_image_path</term>
370
              <listitem>
371
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
372

    
373
                <simpara>The path to a CDROM image to attach to the
374
                instance.</simpara>
375

    
376
              </listitem>
377
            </varlistentry>
378
            <varlistentry>
379
              <term>nic_type</term>
380
              <listitem>
381
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
382

    
383
                <para>
384
                  This parameter determines the way the network cards
385
                  are presented to the instance. The possible options are:
386
                  <simplelist>
387
                    <member>rtl8139 (default for Xen HVM) (HVM & KVM)</member>
388
                    <member>ne2k_isa (HVM & KVM)</member>
389
                    <member>ne2k_pci (HVM & KVM)</member>
390
                    <member>i82551 (KVM)</member>
391
                    <member>i82557b (KVM)</member>
392
                    <member>i82559er (KVM)</member>
393
                    <member>pcnet (KVM)</member>
394
                    <member>e1000 (KVM)</member>
395
                    <member>paravirtual (default for KVM) (HVM & KVM)</member>
396
                  </simplelist>
397
                </para>
398
              </listitem>
399
            </varlistentry>
400
            <varlistentry>
401
              <term>disk_type</term>
402
              <listitem>
403
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
404

    
405
                <para>
406
                  This parameter determines the way the disks are
407
                  presented to the instance. The possible options are:
408
                  <simplelist>
409
                    <member>ioemu (default for HVM & KVM) (HVM & KVM)</member>
410
                    <member>ide (HVM & KVM)</member>
411
                    <member>scsi (KVM)</member>
412
                    <member>sd (KVM)</member>
413
                    <member>mtd (KVM)</member>
414
                    <member>pflash (KVM)</member>
415
                  </simplelist>
416
                </para>
417
              </listitem>
418
            </varlistentry>
419
            <varlistentry>
420
              <term>vnc_bind_address</term>
421
              <listitem>
422
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
423

    
424
                <para>Specifies the address that the VNC listener for
425
                this instance should bind to. Valid values are IPv4
426
                addresses. Use the address 0.0.0.0 to bind to all
427
                available interfaces (this is the default) or specify
428
                the address of one of the interfaces on the node to
429
                restrict listening to that interface.</para>
430
              </listitem>
431
            </varlistentry>
432

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

    
438
                <simpara>A boolean option that controls whether the
439
                VNC connection is secured with TLS.</simpara>
440
              </listitem>
441
            </varlistentry>
442

    
443
            <varlistentry>
444
              <term>vnc_x509_path</term>
445
              <listitem>
446
                <simpara>Valid for the KVM hypervisor.</simpara>
447

    
448
                <para>If <option>vnc_tls</option> is enabled, this
449
                options specifies the path to the x509 certificate to
450
                use.</para>
451
              </listitem>
452
            </varlistentry>
453

    
454
            <varlistentry>
455
              <term>vnc_x509_verify</term>
456
              <listitem>
457
                <simpara>Valid for the KVM hypervisor.</simpara>
458
              </listitem>
459
            </varlistentry>
460

    
461
            <varlistentry>
462
              <term>acpi</term>
463
              <listitem>
464
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
465

    
466
                <para>
467
                  A boolean option that specifies if the hypervisor
468
                  should enable ACPI support for this instance. By
469
                  default, ACPI is disabled.
470
                </para>
471
              </listitem>
472
            </varlistentry>
473

    
474
            <varlistentry>
475
              <term>pae</term>
476
              <listitem>
477
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
478

    
479
                <para>
480
                  A boolean option that specifies if the hypervisor
481
                  should enabled PAE support for this instance. The
482
                  default is false, disabling PAE support.
483
                </para>
484
              </listitem>
485
            </varlistentry>
486

    
487
            <varlistentry>
488
              <term>use_localtime</term>
489
              <listitem>
490
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
491

    
492
                <para>
493
                  A boolean option that specifies if the instance
494
                  should be started with its clock set to the
495
                  localtime of the machine (when true) or to the UTC
496
                  (When false). The default is false, which is useful
497
                  for Linux/Unix machines; for Windows OSes, it is
498
                  recommended to enable this parameter.
499
                </para>
500
              </listitem>
501
            </varlistentry>
502

    
503
            <varlistentry>
504
              <term>kernel_path</term>
505
              <listitem>
506
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
507

    
508
                <para>
509
                  This option specifies the path (on the node) to the
510
                  kernel to boot the instance with. Xen PVM instances
511
                  always require this, while for KVM if this option is
512
                  empty, it will cause the machine to load the kernel
513
                  from its disks.
514
                </para>
515
              </listitem>
516
            </varlistentry>
517

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

    
523
                <para>
524
                  This options specifies extra arguments to the kernel
525
                  that will be loaded.  device. This is always used
526
                  for Xen PVM, while for KVM it is only used if the
527
                  <option>kernel_path</option> option is also
528
                  specified.
529
                </para>
530

    
531
                <para>
532
                  The default setting for this value is simply
533
                  <constant>"ro"</constant>, which mounts the root
534
                  disk (initially) in read-only one. For example,
535
                  setting this to <userinput>single</userinput> will
536
                  cause the instance to start in single-user mode.
537
                </para>
538
              </listitem>
539
            </varlistentry>
540

    
541
            <varlistentry>
542
              <term>initrd_path</term>
543
              <listitem>
544
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
545

    
546
                <para>
547
                  This option specifies the path (on the node) to the
548
                  initrd to boot the instance with. Xen PVM instances
549
                  can use this always, while for KVM if this option is
550
                  only used if the <option>kernel_path</option> option
551
                  is also specified. You can pass here either an
552
                  absolute filename (the path to the initrd) if you
553
                  want to use an initrd, or use the format
554
                  <userinput>no_initrd_path</userinput> for no initrd.
555
                </para>
556
              </listitem>
557
            </varlistentry>
558

    
559
            <varlistentry>
560
              <term>root_path</term>
561
              <listitem>
562
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
563

    
564
                <para>
565
                  This options specifies the name of the root
566
                  device. This is always needed for Xen PVM, while for
567
                  KVM it is only used if the
568
                  <option>kernel_path</option> option is also
569
                  specified.
570
                </para>
571
              </listitem>
572
            </varlistentry>
573

    
574
            <varlistentry>
575
              <term>serial_console</term>
576
              <listitem>
577
                <simpara>Valid for the KVM hypervisor.</simpara>
578

    
579
                <simpara>This boolean option specifies whether to
580
                emulate a serial console for the instance.</simpara>
581
              </listitem>
582
            </varlistentry>
583

    
584
            <varlistentry>
585
              <term>disk_cache</term>
586
              <listitem>
587
                <simpara>Valid for the KVM hypervisor.</simpara>
588

    
589
                <simpara>The disk cache mode. It can be either
590
                <userinput>default</userinput> to not pass any cache
591
                option to KVM, or one of the KVM cache modes: none
592
                (for direct I/O), writethrough (to use the host cache
593
                but report completion to the guest only when the host
594
                has committed the changes to disk) or writeback (to
595
                use the host cache and report completion as soon as
596
                the data is in the host cache). Note that there are
597
                special considerations for the cache mode depending on
598
                version of KVM used and disk type (always raw file
599
                under Ganeti), please refer to the KVM documentation
600
                for more details.
601
                </simpara>
602
              </listitem>
603
            </varlistentry>
604

    
605
            <varlistentry>
606
              <term>security_model</term>
607
              <listitem>
608
                <simpara>Valid for the KVM hypervisor.</simpara>
609

    
610
                <simpara>The security model for kvm. Currently one of
611
                <quote>none</quote>, <quote>user</quote> or
612
                <quote>pool</quote>. Under <quote>none</quote>, the
613
                default, nothing is done and instances are run as
614
                the ganeti daemon user (normally root).
615
                </simpara>
616

    
617
                <simpara>Under <quote>user</quote> kvm will drop
618
                privileges and become the user specified by the
619
                security_domain parameter.
620
                </simpara>
621

    
622
                <simpara>Under <quote>pool</quote> a global cluster
623
                pool of users will be used, making sure no two
624
                instances share the same user on the same node.
625
                (this mode is not implemented yet)
626
                </simpara>
627

    
628
              </listitem>
629
            </varlistentry>
630

    
631
            <varlistentry>
632
              <term>security_domain</term>
633
              <listitem>
634
                <simpara>Valid for the KVM hypervisor.</simpara>
635

    
636
                <simpara>Under security model <quote>user</quote> the username to
637
                run the instance under. It must be a valid username
638
                existing on the host.
639
                </simpara>
640
                <simpara>Cannot be set under security model <quote>none</quote>
641
                or <quote>pool</quote>.
642
                </simpara>
643

    
644
              </listitem>
645
            </varlistentry>
646

    
647
            <varlistentry>
648
              <term>kvm_flag</term>
649
              <listitem>
650
                <simpara>Valid for the KVM hypervisor.</simpara>
651

    
652
                <simpara>If <quote>enabled</quote> the -enable-kvm flag is
653
                passed to kvm. If <quote>disabled</quote> -disable-kvm is
654
                passed. If unset no flag is passed, and the default running
655
                mode for your kvm binary will be used.
656
                </simpara>
657

    
658
              </listitem>
659
            </varlistentry>
660

    
661
            <varlistentry>
662
              <term>use_chroot</term>
663
              <listitem>
664
                <simpara>Valid for the KVM hypervisor.</simpara>
665

    
666
                <simpara>This boolean option determines wether to run the KVM
667
                instance in a chroot directory.
668
                </simpara>
669
                <para>If it is set to <quote>true</quote>, an empty directory
670
                is created before starting the instance and its path is passed via
671
                the -chroot flag to kvm.
672
                The directory is removed when the instance is stopped.
673
                </para>
674

    
675
                <simpara>It is set to <quote>false</quote> by default.</simpara>
676

    
677
              </listitem>
678
            </varlistentry>
679

    
680
          </variablelist>
681

    
682
        </para>
683

    
684
        <para>
685
          The <option>--iallocator</option> option specifies the instance
686
          allocator plugin to use. If you pass in this option the allocator
687
          will select nodes for this instance automatically, so you don't need
688
          to pass them with the <option>-n</option> option. For more
689
          information please refer to the instance allocator documentation.
690
        </para>
691

    
692
        <para>
693
          The <option>-t</option> options specifies the disk layout type for
694
          the instance. The available choices are:
695
          <variablelist>
696
            <varlistentry>
697
              <term>diskless</term>
698
              <listitem>
699
                <para>
700
                  This creates an instance with no disks. Its useful for
701
                  testing only (or other special cases).
702
                </para>
703
              </listitem>
704
            </varlistentry>
705
            <varlistentry>
706
              <term>file</term>
707
              <listitem>
708
                <para>Disk devices will be regular files.</para>
709
              </listitem>
710
            </varlistentry>
711
            <varlistentry>
712
              <term>plain</term>
713
              <listitem>
714
                <para>Disk devices will be logical volumes.</para>
715
              </listitem>
716
            </varlistentry>
717
            <varlistentry>
718
              <term>drbd</term>
719
              <listitem>
720
                <para>
721
                  Disk devices will be drbd (version 8.x) on top of
722
                  lvm volumes.
723
                </para>
724
              </listitem>
725
            </varlistentry>
726
          </variablelist>
727
        </para>
728

    
729
        <para>
730
          The optional second value of the <option>--node</option> is used for
731
          the drbd template type and specifies the remote node.
732
        </para>
733

    
734
        <para>
735
          If you do not want gnt-instance to wait for the disk mirror
736
          to be synced, use the <option>--no-wait-for-sync</option>
737
          option.
738
        </para>
739

    
740
        <para>
741
          The <option>--file-storage-dir</option> specifies the relative path
742
          under the cluster-wide file storage directory to store file-based
743
          disks. It is useful for having different subdirectories for
744
          different instances. The full path of the directory where the disk
745
          files are stored will consist of cluster-wide file storage directory
746
          + optional subdirectory + instance name. Example:
747
          /srv/ganeti/file-storage/mysubdir/instance1.example.com. This option
748
          is only relevant for instances using the file storage backend.
749
        </para>
750

    
751
        <para>
752
          The <option>--file-driver</option> specifies the driver to use for
753
          file-based disks. Note that currently these drivers work with the
754
          xen hypervisor only. This option is only relevant for instances using
755
          the file storage backend. The available choices are:
756
          <variablelist>
757
            <varlistentry>
758
              <term>loop</term>
759
              <listitem>
760
                <para>
761
                  Kernel loopback driver. This driver uses loopback
762
                  devices to access the filesystem within the
763
                  file. However, running I/O intensive applications in
764
                  your instance using the loop driver might result in
765
                  slowdowns.  Furthermore, if you use the loopback
766
                  driver consider increasing the maximum amount of
767
                  loopback devices (on most systems it's 8) using the
768
                  max_loop param.
769
                </para>
770
              </listitem>
771
            </varlistentry>
772
            <varlistentry>
773
              <term>blktap</term>
774
              <listitem>
775
                <para>The blktap driver (for Xen hypervisors). In
776
                order to be able to use the blktap driver you should
777
                check if the 'blktapctrl' user space disk agent is
778
                running (usually automatically started via xend). This
779
                user-level disk I/O interface has the advantage of
780
                better performance. Especially if you use a network
781
                file system (e.g. NFS) to store your instances this is
782
                the recommended choice.
783
                </para>
784
              </listitem>
785
            </varlistentry>
786
          </variablelist>
787
        </para>
788

    
789
        <para>
790
          The <option>--submit</option> option is used to send the job to
791
          the master daemon but not wait for its completion. The job
792
          ID will be shown so that it can be examined via
793
          <command>gnt-job info</command>.
794
        </para>
795

    
796
        <para>
797
          Example:
798
          <screen>
799
# gnt-instance add -t file --disk 0:size=30g -B memory=512 -o debian-etch \
800
  -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
801
# gnt-instance add -t plain --disk 0:size=30g -B memory=512 -o debian-etch \
802
  -n node1.example.com instance1.example.com
803
# gnt-instance add -t drbd --disk 0:size=30g -B memory=512 -o debian-etch \
804
  -n node1.example.com:node2.example.com instance2.example.com
805
          </screen>
806
        </para>
807
      </refsect3>
808

    
809
      <refsect3>
810
        <title>BATCH-CREATE</title>
811
        <cmdsynopsis>
812
          <command>batch-create</command>
813
          <arg choice="req">instances_file.json</arg>
814
        </cmdsynopsis>
815

    
816
        <para>
817
          This command (similar to the Ganeti 1.2
818
          <command>batcher</command> tool) submits multiple instance
819
          creation jobs based on a definition file. The instance
820
          configurations do not encompass all the possible options for
821
          the <command>add</command> command, but only a subset.
822
        </para>
823

    
824
        <para>
825
          The instance file should be a valid-formed JSON file,
826
          containing a dictionary with instance name and instance
827
          parameters. The accepted parameters are:
828

    
829
          <variablelist>
830
            <varlistentry>
831
              <term>disk_size</term>
832
              <listitem>
833
                <simpara>The size of the disks of the instance.</simpara>
834
              </listitem>
835
            </varlistentry>
836
            <varlistentry>
837
              <term>disk_templace</term>
838
              <listitem>
839
                <simpara>The disk template to use for the instance,
840
                the same as in the <command>add</command>
841
                command.</simpara>
842
              </listitem>
843
            </varlistentry>
844
            <varlistentry>
845
              <term>backend</term>
846
              <listitem>
847
                <simpara>A dictionary of backend parameters.</simpara>
848
              </listitem>
849
            </varlistentry>
850
            <varlistentry>
851
              <term>hypervisor</term>
852
              <listitem>
853
                <simpara>A dictionary with a single key (the
854
                hypervisor name), and as value the hypervisor
855
                options. If not passed, the default hypervisor and
856
                hypervisor options will be inherited.</simpara>
857
              </listitem>
858
            </varlistentry>
859
            <varlistentry>
860
              <term>mac, ip, mode, link</term>
861
              <listitem>
862
                <simpara>Specifications for the one NIC that will be
863
                created for the instance. 'bridge' is also accepted
864
                as a backwards compatibile key.</simpara>
865
              </listitem>
866
            </varlistentry>
867
            <varlistentry>
868
              <term>nics</term>
869
              <listitem>
870
                <simpara>List of nics that will be created for the
871
                instance. Each entry should be a dict, with mac, ip, mode
872
                and link as possible keys. Please don't provide the "mac,
873
                ip, mode, link" parent keys if you use this method for
874
                specifying nics.</simpara>
875
              </listitem>
876
            </varlistentry>
877
            <varlistentry>
878
              <term>primary_node, secondary_node</term>
879
              <listitem>
880
                <simpara>The primary and optionally the secondary node
881
                to use for the instance (in case an iallocator script
882
                is not used).</simpara>
883
              </listitem>
884
            </varlistentry>
885
            <varlistentry>
886
              <term>iallocator</term>
887
              <listitem>
888
                <simpara>Instead of specifying the nodes, an
889
                iallocator script can be used to automatically compute
890
                them.</simpara>
891
              </listitem>
892
            </varlistentry>
893
            <varlistentry>
894
              <term>start</term>
895
              <listitem>
896
                <simpara>whether to start the instance</simpara>
897
              </listitem>
898
            </varlistentry>
899
            <varlistentry>
900
              <term>ip_check</term>
901
              <listitem>
902
                <simpara>Skip the check for already-in-use instance;
903
                see the description in the <command>add</command>
904
                command for details.</simpara>
905
              </listitem>
906
            </varlistentry>
907
            <varlistentry>
908
              <term>name_check</term>
909
              <listitem>
910
                <simpara>Skip the name check for instances;
911
                see the description in the <command>add</command>
912
                command for details.</simpara>
913
              </listitem>
914
            </varlistentry>
915
            <varlistentry>
916
              <term>file_storage_dir, file_driver</term>
917
              <listitem>
918
                <simpara>Configuration for the <literal>file</literal>
919
                disk type, see the <command>add</command> command for
920
                details.</simpara>
921
              </listitem>
922
            </varlistentry>
923
          </variablelist>
924
        </para>
925

    
926
        <para>
927
          A simple definition for one instance can be (with most of
928
          the parameters taken from the cluster defaults):
929
          <screen>
930
{
931
  "instance3": {
932
    "template": "drbd",
933
    "os": "debootstrap",
934
    "disk_size": ["25G"],
935
    "iallocator": "dumb"
936
  },
937
  "instance5": {
938
    "template": "drbd",
939
    "os": "debootstrap",
940
    "disk_size": ["25G"],
941
    "iallocator": "dumb",
942
    "hypervisor": "xen-hvm",
943
    "hvparams": {"acpi": true},
944
    "backend": {"memory": 512}
945
  }
946
}
947
</screen>
948
        </para>
949

    
950
        <para>
951
          The command will display the job id for each submitted instance, as follows:
952
          <screen>
953
# gnt-instance batch-create instances.json
954
instance3: 11224
955
instance5: 11225
956
</screen>
957
        </para>
958

    
959
      </refsect3>
960

    
961
      <refsect3>
962
        <title>REMOVE</title>
963

    
964
        <cmdsynopsis>
965
          <command>remove</command>
966
          <arg>--ignore-failures</arg>
967
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
968
          <arg>--submit</arg>
969
          <arg choice="req"><replaceable>instance</replaceable></arg>
970
        </cmdsynopsis>
971

    
972
        <para>
973
          Remove an instance. This will remove all data from the
974
          instance and there is <emphasis>no way back</emphasis>. If
975
          you are not sure if you use an instance again, use
976
          <command>shutdown</command> first and leave it in the
977
          shutdown state for a while.
978

    
979
        </para>
980

    
981
        <para>
982
          The <option>--ignore-failures</option> option will cause the
983
          removal to proceed even in the presence of errors during the
984
          removal of the instance (e.g. during the shutdown or the
985
          disk removal). If this option is not given, the command will
986
          stop at the first error.
987
        </para>
988

    
989
        <para>
990
          The <option>--shutdown-timeout</option> is used to specify how
991
          much time to wait before forcing the shutdown (xm destroy in xen,
992
          killing the kvm process, for kvm). By default two minutes are
993
          given to each instance to stop.
994
        </para>
995

    
996
        <para>
997
          The <option>--submit</option> option is used to send the job to
998
          the master daemon but not wait for its completion. The job
999
          ID will be shown so that it can be examined via
1000
          <command>gnt-job info</command>.
1001
        </para>
1002

    
1003
        <para>
1004
          Example:
1005
          <screen>
1006
# gnt-instance remove instance1.example.com
1007
          </screen>
1008
        </para>
1009
      </refsect3>
1010

    
1011
      <refsect3>
1012
        <title>LIST</title>
1013

    
1014
        <cmdsynopsis>
1015
          <command>list</command>
1016
          <arg>--no-headers</arg>
1017
          <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
1018
          <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
1019
          <arg rep="repeat">instance</arg>
1020
        </cmdsynopsis>
1021

    
1022
        <para>
1023
          Shows the currently configured instances with memory usage,
1024
          disk usage, the node they are running on, and their run
1025
          status.
1026
        </para>
1027

    
1028
        <para>
1029
          The <option>--no-headers</option> option will skip the
1030
          initial header line. The <option>--separator</option> option
1031
          takes an argument which denotes what will be used between
1032
          the output fields. Both these options are to help scripting.
1033
        </para>
1034

    
1035
        <para>
1036
          The <option>-o</option> option takes a comma-separated list
1037
          of output fields. The available fields and their meaning
1038
          are:
1039
          <variablelist>
1040
            <varlistentry>
1041
              <term>name</term>
1042
              <listitem>
1043
                <simpara>the instance name</simpara>
1044
              </listitem>
1045
            </varlistentry>
1046
            <varlistentry>
1047
              <term>os</term>
1048
              <listitem>
1049
                <simpara>the OS of the instance</simpara>
1050
              </listitem>
1051
            </varlistentry>
1052
            <varlistentry>
1053
              <term>pnode</term>
1054
              <listitem>
1055
                <simpara>the primary node of the instance</simpara>
1056
              </listitem>
1057
            </varlistentry>
1058
            <varlistentry>
1059
              <term>snodes</term>
1060
              <listitem>
1061
                <simpara>comma-separated list of secondary nodes for the
1062
                  instance; usually this will be just one node</simpara>
1063
              </listitem>
1064
            </varlistentry>
1065
            <varlistentry>
1066
              <term>admin_state</term>
1067
              <listitem>
1068
                <simpara>the desired state of the instance (either "yes"
1069
                  or "no" denoting the instance should run or
1070
                  not)</simpara>
1071
              </listitem>
1072
            </varlistentry>
1073
            <varlistentry>
1074
              <term>disk_template</term>
1075
              <listitem>
1076
                <simpara>the disk template of the instance</simpara>
1077
              </listitem>
1078
            </varlistentry>
1079
            <varlistentry>
1080
              <term>oper_state</term>
1081
              <listitem>
1082
                <simpara>the actual state of the instance; can be
1083
                one of the values "running", "stopped", "(node
1084
                down)"</simpara>
1085
              </listitem>
1086
            </varlistentry>
1087
            <varlistentry>
1088
              <term>status</term>
1089
              <listitem>
1090
                <simpara>combined form of admin_state and oper_stat;
1091
                this can be one of:
1092
                <computeroutput>ERROR_nodedown</computeroutput> if the
1093
                node of the instance is down,
1094
                <computeroutput>ERROR_down</computeroutput> if the
1095
                instance should run but is down,
1096
                <computeroutput>ERROR_up</computeroutput> if the
1097
                instance should be stopped but is actually running,
1098
                <computeroutput>ADMIN_down</computeroutput> if the
1099
                instance has been stopped (and is stopped) and
1100
                <computeroutput>running</computeroutput> if the
1101
                instance is set to be running (and is
1102
                running)</simpara>
1103
              </listitem>
1104
            </varlistentry>
1105
            <varlistentry>
1106
              <term>oper_ram</term>
1107
              <listitem>
1108
                <simpara>the actual memory usage of the instance as seen
1109
                  by the hypervisor</simpara>
1110
              </listitem>
1111
            </varlistentry>
1112
            <varlistentry>
1113
              <term>ip</term>
1114
              <listitem>
1115
                <simpara>the ip address ganeti recognizes as associated with
1116
                the first instance interface</simpara>
1117
              </listitem>
1118
            </varlistentry>
1119
            <varlistentry>
1120
              <term>mac</term>
1121
              <listitem>
1122
                <simpara>the first instance interface MAC address</simpara>
1123
              </listitem>
1124
            </varlistentry>
1125

    
1126
            <varlistentry>
1127
              <term>nic_mode</term>
1128
              <listitem>
1129
                <simpara>the mode of the first instance NIC
1130
                (routed or bridged)</simpara>
1131
              </listitem>
1132
            </varlistentry>
1133
            <varlistentry>
1134
              <term>nic_link</term>
1135
              <listitem>
1136
                <simpara>the link of the first instance NIC
1137
                </simpara>
1138
              </listitem>
1139
            </varlistentry>
1140
            <varlistentry>
1141
              <term>sda_size</term>
1142
              <listitem>
1143
                <simpara>the size of the instance's first disk</simpara>
1144
              </listitem>
1145
            </varlistentry>
1146
            <varlistentry>
1147
              <term>sdb_size</term>
1148
              <listitem>
1149
                <simpara>the size of the instance's second disk, if
1150
                any</simpara>
1151
              </listitem>
1152
            </varlistentry>
1153
            <varlistentry>
1154
              <term>vcpus</term>
1155
              <listitem>
1156
                <simpara>the number of VCPUs allocated to the
1157
                instance</simpara>
1158
              </listitem>
1159
            </varlistentry>
1160
            <varlistentry>
1161
              <term>tags</term>
1162
              <listitem>
1163
                <simpara>comma-separated list of the instances's
1164
                tags</simpara>
1165
              </listitem>
1166
            </varlistentry>
1167
            <varlistentry>
1168
              <term>serial_no</term>
1169
              <listitem>
1170
                <simpara>the so called 'serial number' of the
1171
                instance; this is a numeric field that is incremented
1172
                each time the instance is modified, and it can be used
1173
                to track modifications</simpara>
1174
              </listitem>
1175
            </varlistentry>
1176
            <varlistentry>
1177
              <term>ctime</term>
1178
              <listitem>
1179
                <para>
1180
                  the creation time of the instance; note that this
1181
                  field contains spaces and as such it's harder to
1182
                  parse
1183
                </para>
1184
                <para>
1185
                  if this attribute is not present (e.g. when
1186
                  upgrading from older versions), then "N/A" will be
1187
                  shown instead
1188
                </para>
1189
              </listitem>
1190
            </varlistentry>
1191
            <varlistentry>
1192
              <term>mtime</term>
1193
              <listitem>
1194
                <para>
1195
                  the last modification time of the instance; note
1196
                  that this field contains spaces and as such it's
1197
                  harder to parse
1198
                </para>
1199
                <para>
1200
                  if this attribute is not present (e.g. when
1201
                  upgrading from older versions), then "N/A" will be
1202
                  shown instead
1203
                </para>
1204
              </listitem>
1205
            </varlistentry>
1206

    
1207
            <varlistentry>
1208
              <term>uuid</term>
1209
              <listitem>
1210
                <simpara>Show the UUID of the instance (generated
1211
                automatically by Ganeti)</simpara>
1212
              </listitem>
1213
            </varlistentry>
1214

    
1215
            <varlistentry>
1216
              <term>network_port</term>
1217
              <listitem>
1218
                <simpara>If the instance has a network port assigned
1219
                to it (e.g. for VNC connections), this will be shown,
1220
                otherwise <literal>-</literal> will be
1221
                displayed.</simpara>
1222
              </listitem>
1223
            </varlistentry>
1224
            <varlistentry>
1225
              <term>beparams</term>
1226
              <listitem>
1227
                <simpara>A text format of the entire beparams for the
1228
                instance. It's more useful to select individual fields
1229
                from this dictionary, see below.</simpara>
1230
              </listitem>
1231
            </varlistentry>
1232
            <varlistentry>
1233
              <term>disk.count</term>
1234
              <listitem>
1235
                <simpara>The number of instance disks.</simpara>
1236
              </listitem>
1237
            </varlistentry>
1238
            <varlistentry>
1239
              <term>disk.size/N</term>
1240
              <listitem>
1241
                <simpara>The size of the instance's Nth disk. This is
1242
                a more generic form of the <literal>sda_size</literal>
1243
                and <literal>sdb_size</literal> fields.</simpara>
1244
              </listitem>
1245
            </varlistentry>
1246
            <varlistentry>
1247
              <term>disk.sizes</term>
1248
              <listitem>
1249
                <simpara>A comma-separated list of the disk sizes for
1250
                this instance.</simpara>
1251
              </listitem>
1252
            </varlistentry>
1253
            <varlistentry>
1254
              <term>disk_usage</term>
1255
              <listitem>
1256
                <simpara>The total disk space used by this instance on
1257
                each of its nodes. This is not the instance-visible
1258
                disk size, but the actual disk "cost" of the
1259
                instance.</simpara>
1260
              </listitem>
1261
            </varlistentry>
1262
            <varlistentry>
1263
              <term>nic.mac/N</term>
1264
              <listitem>
1265
                <simpara>The MAC of the Nth instance NIC.</simpara>
1266
              </listitem>
1267
            </varlistentry>
1268
            <varlistentry>
1269
              <term>nic.ip/N</term>
1270
              <listitem>
1271
                <simpara>The IP address of the Nth instance NIC.</simpara>
1272
              </listitem>
1273
            </varlistentry>
1274
            <varlistentry>
1275
              <term>nic.mode/N</term>
1276
              <listitem>
1277
                <simpara>The mode of the Nth instance NIC</simpara>
1278
              </listitem>
1279
            </varlistentry>
1280
            <varlistentry>
1281
              <term>nic.link/N</term>
1282
              <listitem>
1283
                <simpara>The link of the Nth instance NIC</simpara>
1284
              </listitem>
1285
            </varlistentry>
1286
            <varlistentry>
1287
              <term>nic.macs</term>
1288
              <listitem>
1289
                <simpara>A comma-separated list of all the MACs of the
1290
                instance's NICs.</simpara>
1291
              </listitem>
1292
            </varlistentry>
1293
            <varlistentry>
1294
              <term>nic.ips</term>
1295
              <listitem>
1296
                <simpara>A comma-separated list of all the IP
1297
                addresses of the instance's NICs.</simpara>
1298
              </listitem>
1299
            </varlistentry>
1300
            <varlistentry>
1301
              <term>nic.modes</term>
1302
              <listitem>
1303
                <simpara>A comma-separated list of all the modes of the
1304
                instance's NICs.</simpara>
1305
              </listitem>
1306
            </varlistentry>
1307
            <varlistentry>
1308
              <term>nic.links</term>
1309
              <listitem>
1310
                <simpara>A comma-separated list of all the link parameters
1311
                of the instance's NICs.</simpara>
1312
              </listitem>
1313
            </varlistentry>
1314
            <varlistentry>
1315
              <term>nic.count</term>
1316
              <listitem>
1317
                <simpara>The number of instance nics.</simpara>
1318
              </listitem>
1319
            </varlistentry>
1320
            <varlistentry>
1321
              <term>hv/<replaceable>NAME</replaceable></term>
1322
              <listitem>
1323
                <simpara>The value of the hypervisor parameter called
1324
                <replaceable>NAME</replaceable>. For details of what
1325
                hypervisor parameters exist and their meaning, see the
1326
                <command>add</command> command.</simpara>
1327
              </listitem>
1328
            </varlistentry>
1329
            <varlistentry>
1330
              <term>be/memory</term>
1331
              <listitem>
1332
                <simpara>The configured memory for the instance.</simpara>
1333
              </listitem>
1334
            </varlistentry>
1335
            <varlistentry>
1336
              <term>be/vcpus</term>
1337
              <listitem>
1338
                <simpara>The configured number of VCPUs for the
1339
                instance.</simpara>
1340
              </listitem>
1341
            </varlistentry>
1342
            <varlistentry>
1343
              <term>be/auto_balance</term>
1344
              <listitem>
1345
                <simpara>Whether the instance is considered in N+1
1346
                checks.</simpara>
1347
              </listitem>
1348
            </varlistentry>
1349
          </variablelist>
1350
        </para>
1351

    
1352
        <para>
1353
          If the value of the option starts with the character
1354
          <constant>+</constant>, the new field(s) will be added to the
1355
          default list. This allows to quickly see the default list
1356
          plus a few other fields, instead of retyping the entire list
1357
          of fields.
1358
        </para>
1359

    
1360
        <para>
1361
          There is a subtle grouping about the available output
1362
          fields: all fields except for <option>oper_state</option>,
1363
          <option>oper_ram</option> and <option>status</option> are
1364
          configuration value and not run-time values. So if you don't
1365
          select any of the these fields, the query will be satisfied
1366
          instantly from the cluster configuration, without having to
1367
          ask the remote nodes for the data. This can be helpful for
1368
          big clusters when you only want some data and it makes sense
1369
          to specify a reduced set of output fields.
1370
        </para>
1371

    
1372
        <para>The default output field list is:
1373
          <simplelist type="inline">
1374
            <member>name</member>
1375
            <member>os</member>
1376
            <member>pnode</member>
1377
            <member>admin_state</member>
1378
            <member>oper_state</member>
1379
            <member>oper_ram</member>
1380
          </simplelist>.
1381
        </para>
1382
      </refsect3>
1383

    
1384
      <refsect3>
1385
        <title>INFO</title>
1386

    
1387
        <cmdsynopsis>
1388
          <command>info</command>
1389
          <group>
1390
            <arg>-s</arg>
1391
            <arg>--static</arg>
1392
          </group>
1393
          <group choice="req">
1394
            <arg>--all</arg>
1395
            <arg rep="repeat"><replaceable>instance</replaceable></arg>
1396
          </group>
1397
        </cmdsynopsis>
1398

    
1399
        <para>
1400
          Show detailed information about the given instance(s). This is
1401
          different from <command>list</command> as it shows detailed data
1402
          about the instance's disks (especially useful for the drbd disk
1403
          template).
1404
        </para>
1405

    
1406
        <para>
1407
          If the option <option>-s</option> is used, only information
1408
          available in the configuration file is returned, without
1409
          querying nodes, making the operation faster.
1410
        </para>
1411

    
1412
        <para>
1413
          Use the <option>--all</option> to get info about all instances,
1414
          rather than explicitly passing the ones you're interested in.
1415
        </para>
1416
      </refsect3>
1417

    
1418
      <refsect3>
1419
        <title>MODIFY</title>
1420

    
1421
        <cmdsynopsis>
1422
          <command>modify</command>
1423
          <sbr>
1424
          <arg choice="opt">-H <replaceable>HYPERVISOR_PARAMETERS</replaceable></arg>
1425
          <sbr>
1426
          <arg choice="opt">-B <replaceable>BACKEND_PARAMETERS</replaceable></arg>
1427
          <sbr>
1428
          <group>
1429
            <arg>--net add<replaceable><optional>:options</optional></replaceable></arg>
1430
            <arg>--net remove</arg>
1431
            <arg>--net <replaceable>N:options</replaceable></arg>
1432
          </group>
1433
          <sbr>
1434
          <group>
1435
            <arg>--disk add:size=<replaceable>SIZE</replaceable></arg>
1436
            <arg>--disk remove</arg>
1437
            <arg>--disk <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></arg>
1438
          </group>
1439

    
1440
          <sbr>
1441
          <arg>-t<group choice="req">
1442
              <arg>plain</arg>
1443
              <arg>drbd</arg>
1444
            </group></arg>
1445

    
1446
          <sbr>
1447
            <arg>--os-name=<replaceable>OS</replaceable> <arg>--force-variant</arg></arg>
1448

    
1449
          <sbr>
1450
          <arg>--submit</arg>
1451
          <sbr>
1452
          <arg choice="req"><replaceable>instance</replaceable></arg>
1453
        </cmdsynopsis>
1454

    
1455
        <para>
1456
          Modifies the memory size, number of vcpus, ip address, MAC
1457
          address and/or nic parameters for an instance. It can also
1458
          add and remove disks and NICs to/from the instance. Note
1459
          that you need to give at least one of the arguments, otherwise
1460
          the command complains.
1461
        </para>
1462

    
1463
        <para>
1464
          The <option>-H</option> option specifies hypervisor options
1465
          in the form of <userinput>name=value[,...]</userinput>. For details which options can be specified, see the <command>add</command> command.
1466
        </para>
1467

    
1468
        <para>
1469
          The <option>-t</option> option will change the disk template
1470
          of the instance. Currently only conversions between the
1471
          plain and drbd disk templates are supported, and the
1472
          instance must be stopped before attempting the conversion.
1473
        </para>
1474

    
1475
        <para>
1476
          The <option>--disk
1477
          add:size=<replaceable>SIZE</replaceable></option> option
1478
          adds a disk to the instance. The <option>--disk
1479
          remove</option> will remove the last disk of the
1480
          instance. The <option>--disk
1481
          <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></option>
1482
          option will change the mode of the Nth disk of the instance
1483
          between read-only (<literal>ro</literal>) and read-write
1484
          (<literal>rw</literal>).
1485
        </para>
1486

    
1487
        <para>
1488
          The <option>--net
1489
          add:<replaceable>options</replaceable></option> option will
1490
          add a new NIC to the instance. The available options are the
1491
          same as in the <command>add</command> command (mac, ip, link,
1492
          mode). The <option>--net remove</option> will remove the
1493
          last NIC of the instance, while the <option>--net
1494
          <replaceable>N</replaceable>:<replaceable>options</replaceable></option>
1495
          option will change the parameters of the Nth instance NIC.
1496
        </para>
1497

    
1498
        <para>
1499
          The option <option>--os-name</option> will change the OS
1500
          name for the instance (without reinstallation). In case an
1501
          OS variant is specified that is not found, then by default
1502
          the modification is refused,
1503
          unless <option>--force-variant</option> is passed. An
1504
          invalid OS will also be refused, unless
1505
          the <option>--force</option> option is given.
1506
        </para>
1507

    
1508
        <para>
1509
          The <option>--submit</option> option is used to send the job to
1510
          the master daemon but not wait for its completion. The job
1511
          ID will be shown so that it can be examined via
1512
          <command>gnt-job info</command>.
1513
        </para>
1514

    
1515
        <para>
1516
          All the changes take effect at the next restart. If the
1517
          instance is running, there is no effect on the instance.
1518
        </para>
1519
      </refsect3>
1520

    
1521
      <refsect3>
1522
        <title>REINSTALL</title>
1523

    
1524
        <cmdsynopsis>
1525
          <command>reinstall</command>
1526
          <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
1527
          <arg>--select-os</arg>
1528
          <arg choice="opt">-f <replaceable>force</replaceable></arg>
1529
          <arg>--force-multiple</arg>
1530
          <sbr>
1531
          <group choice="opt">
1532
            <arg>--instance</arg>
1533
            <arg>--node</arg>
1534
            <arg>--primary</arg>
1535
            <arg>--secondary</arg>
1536
            <arg>--all</arg>
1537
          </group>
1538
          <arg>--submit</arg>
1539
          <arg choice="opt" rep="repeat"><replaceable>instance</replaceable></arg>
1540
        </cmdsynopsis>
1541

    
1542
        <para>
1543
          Reinstalls the operating system on the given instance(s). The
1544
          instance(s) must be stopped when running this command. If the
1545
          <option>--os-type</option> is specified, the operating
1546
          system is changed.
1547
        </para>
1548

    
1549
        <para>
1550
          The <option>--select-os</option> option switches to an
1551
          interactive OS reinstall. The user is prompted to select the OS
1552
          template from the list of available OS templates.
1553
        </para>
1554

    
1555
        <para>
1556
          Since this is a potentially dangerous command, the user will
1557
          be required to confirm this action, unless the
1558
          <option>-f</option> flag is passed. When multiple instances
1559
          are selected (either by passing multiple arguments or by
1560
          using the <option>--node</option>,
1561
          <option>--primary</option>, <option>--secondary</option> or
1562
          <option>--all</option> options), the user must pass both the
1563
          <option>--force</option> and
1564
          <option>--force-multiple</option> options to skip the
1565
          interactive confirmation.
1566
        </para>
1567

    
1568
        <para>
1569
          The <option>--submit</option> option is used to send the job to
1570
          the master daemon but not wait for its completion. The job
1571
          ID will be shown so that it can be examined via
1572
          <command>gnt-job info</command>.
1573
        </para>
1574

    
1575

    
1576
      </refsect3>
1577

    
1578
      <refsect3>
1579
        <title>RENAME</title>
1580

    
1581
        <cmdsynopsis>
1582
          <command>rename</command>
1583
          <arg>--no-ip-check</arg>
1584
          <arg>--submit</arg>
1585
          <arg choice="req"><replaceable>instance</replaceable></arg>
1586
          <arg choice="req"><replaceable>new_name</replaceable></arg>
1587
        </cmdsynopsis>
1588

    
1589
        <para>
1590
          Renames the given instance. The instance must be stopped
1591
          when running this command. The requirements for the new name
1592
          are the same as for adding an instance: the new name must be
1593
          resolvable and the IP it resolves to must not be reachable
1594
          (in order to prevent duplicate IPs the next time the
1595
          instance is started). The IP test can be skipped if the
1596
          <option>--no-ip-check</option> option is passed.
1597
        </para>
1598

    
1599
        <para>
1600
          The <option>--submit</option> option is used to send the job to
1601
          the master daemon but not wait for its completion. The job
1602
          ID will be shown so that it can be examined via
1603
          <command>gnt-job info</command>.
1604
        </para>
1605

    
1606
      </refsect3>
1607

    
1608
    </refsect2>
1609

    
1610
    <refsect2>
1611
      <title>Starting/stopping/connecting to console</title>
1612

    
1613
      <refsect3>
1614
        <title>STARTUP</title>
1615

    
1616
        <cmdsynopsis>
1617
          <command>startup</command>
1618
          <sbr>
1619
          <arg>--force</arg>
1620
          <sbr>
1621
          <arg>--force-multiple</arg>
1622
          <sbr>
1623
          <group choice="opt">
1624
            <arg>--instance</arg>
1625
            <arg>--node</arg>
1626
            <arg>--primary</arg>
1627
            <arg>--secondary</arg>
1628
            <arg>--all</arg>
1629
            <arg>--tags</arg>
1630
            <arg>--node-tags</arg>
1631
            <arg>--pri-node-tags</arg>
1632
            <arg>--sec-node-tags</arg>
1633
          </group>
1634
          <sbr>
1635
          <arg>-H <option>key=value...</option></arg>
1636
          <arg>-B <option>key=value...</option></arg>
1637
          <sbr>
1638
          <arg>--submit</arg>
1639
          <sbr>
1640
          <arg choice="opt"
1641
          rep="repeat"><replaceable>name</replaceable></arg>
1642
        </cmdsynopsis>
1643

    
1644
        <para>
1645
          Starts one or more instances, depending on the following
1646
          options. The four available modes are:
1647
          <variablelist>
1648
            <varlistentry>
1649
              <term><option>--instance</option></term>
1650
              <listitem>
1651
                <simpara>will start the instances given as arguments
1652
                (at least one argument required); this is the default
1653
                selection</simpara>
1654
              </listitem>
1655
            </varlistentry>
1656
            <varlistentry>
1657
              <term>--node</term>
1658
              <listitem>
1659
                <simpara>will start the instances who have the given
1660
                node as either primary or secondary</simpara>
1661
              </listitem>
1662
            </varlistentry>
1663
            <varlistentry>
1664
              <term><option>--primary</option></term>
1665
              <listitem>
1666
                <simpara>will start all instances whose primary node
1667
                is in the list of nodes passed as arguments (at least
1668
                one node required)</simpara>
1669
              </listitem>
1670
            </varlistentry>
1671
            <varlistentry>
1672
              <term><option>--secondary</option></term>
1673
              <listitem>
1674
                <simpara>will start all instances whose secondary node
1675
                is in the list of nodes passed as arguments (at least
1676
                one node required)</simpara>
1677
              </listitem>
1678
            </varlistentry>
1679
            <varlistentry>
1680
              <term>--all</term>
1681
              <listitem>
1682
                <simpara>will start all instances in the cluster (no
1683
                arguments accepted)</simpara>
1684
              </listitem>
1685
            </varlistentry>
1686
            <varlistentry>
1687
              <term>--tags</term>
1688
              <listitem>
1689
                <simpara>will start all instances in the cluster with
1690
                the tags given as arguments</simpara>
1691
              </listitem>
1692
            </varlistentry>
1693
            <varlistentry>
1694
              <term>--node-tags</term>
1695
              <listitem>
1696
                <simpara>will start all instances in the cluster on
1697
                nodes with the tags given as arguments</simpara>
1698
              </listitem>
1699
            </varlistentry>
1700
            <varlistentry>
1701
              <term>--pri-node-tags</term>
1702
              <listitem>
1703
                <simpara>will start all instances in the cluster on
1704
                primary nodes with the tags given as
1705
                arguments</simpara>
1706
              </listitem>
1707
            </varlistentry>
1708
            <varlistentry>
1709
              <term>--sec-node-tags</term>
1710
              <listitem>
1711
                <simpara>will start all instances in the cluster on
1712
                secondary nodes with the tags given as
1713
                arguments</simpara>
1714
              </listitem>
1715
            </varlistentry>
1716
          </variablelist>
1717
        </para>
1718

    
1719
        <para>
1720
          Note that although you can pass more than one selection
1721
          option, the last one wins, so in order to guarantee the
1722
          desired result, don't pass more than one such option.
1723
        </para>
1724

    
1725
        <para>
1726
          Use <option>--force</option> to start even if secondary disks are
1727
          failing.
1728
        </para>
1729

    
1730
        <para>
1731
          The <option>--force-multiple</option> will skip the
1732
          interactive confirmation in the case the more than one
1733
          instance will be affected.
1734
        </para>
1735

    
1736
        <para>
1737
          The <option>-H</option> and <option>-B</option> options
1738
          specify temporary hypervisor and backend parameters that can
1739
          be used to start an instance with modified parameters. They
1740
          can be useful for quick testing without having to modify an
1741
          instance back and forth, e.g.:
1742
          <screen>
1743
# gnt-instance start -H root_args="single" instance1
1744
# gnt-instance start -B memory=2048 instance2
1745
          </screen>
1746
          The first form will start the instance
1747
          <userinput>instance1</userinput> in single-user mode, and
1748
          the instance <userinput>instance2</userinput> with 2GB of
1749
          RAM (this time only, unless that is the actual instance
1750
          memory size already). Note that the values override the
1751
          instance parameters (and not extend them): an instance with
1752
          "root_args=ro" when started with <userinput>-H
1753
          root_args=single</userinput> will result in "single", not
1754
          "ro single".
1755
        </para>
1756

    
1757
        <para>
1758
          The <option>--submit</option> option is used to send the job to
1759
          the master daemon but not wait for its completion. The job
1760
          ID will be shown so that it can be examined via
1761
          <command>gnt-job info</command>.
1762
        </para>
1763

    
1764
        <para>
1765
          Example:
1766
          <screen>
1767
# gnt-instance start instance1.example.com
1768
# gnt-instance start --node node1.example.com node2.example.com
1769
# gnt-instance start --all
1770
          </screen>
1771
        </para>
1772
      </refsect3>
1773

    
1774
      <refsect3>
1775
        <title>SHUTDOWN</title>
1776

    
1777
        <cmdsynopsis>
1778
          <command>shutdown</command>
1779
          <sbr>
1780
          <arg>--timeout=<replaceable>N</replaceable></arg>
1781
          <sbr>
1782
          <arg>--force-multiple</arg>
1783
          <sbr>
1784
          <group choice="opt">
1785
            <arg>--instance</arg>
1786
            <arg>--node</arg>
1787
            <arg>--primary</arg>
1788
            <arg>--secondary</arg>
1789
            <arg>--all</arg>
1790
            <arg>--tags</arg>
1791
            <arg>--node-tags</arg>
1792
            <arg>--pri-node-tags</arg>
1793
            <arg>--sec-node-tags</arg>
1794
          </group>
1795
          <sbr>
1796
          <arg>--submit</arg>
1797
          <sbr>
1798
          <arg choice="opt"
1799
          rep="repeat"><replaceable>name</replaceable></arg>
1800
        </cmdsynopsis>
1801

    
1802
        <para>
1803
          Stops one or more instances. If the instance cannot be
1804
          cleanly stopped during a hardcoded interval (currently 2
1805
          minutes), it will forcibly stop the instance (equivalent to
1806
          switching off the power on a physical machine).
1807
        </para>
1808

    
1809
        <para>
1810
          The <option>--timeout</option> is used to specify how much time to
1811
          wait before forcing the shutdown (xm destroy in xen, killing the kvm
1812
          process, for kvm). By default two minutes are given to each instance
1813
          to stop.
1814
        </para>
1815

    
1816
        <para>
1817
          The <option>--instance</option>, <option>--node</option>,
1818
          <option>--primary</option>, <option>--secondary</option>,
1819
          <option>--all</option>, <option>--tags</option>,
1820
          <option>--node-tags</option>, <option>--pri-node-tags</option> and
1821
          <option>--sec-node-tags</option> options are similar as for the
1822
          <command>startup</command> command and they influence the
1823
          actual instances being shutdown.
1824
        </para>
1825

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

    
1833

    
1834
        <para>
1835
          Example:
1836
          <screen>
1837
# gnt-instance shutdown instance1.example.com
1838
# gnt-instance shutdown --all
1839
          </screen>
1840
        </para>
1841
      </refsect3>
1842

    
1843
      <refsect3>
1844
        <title>REBOOT</title>
1845

    
1846
        <cmdsynopsis>
1847
          <command>reboot</command>
1848
          <sbr>
1849
          <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
1850
          <sbr>
1851
          <arg>--ignore-secondaries</arg>
1852
          <sbr>
1853
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
1854
          <sbr>
1855
          <arg>--force-multiple</arg>
1856
          <sbr>
1857
          <group choice="opt">
1858
            <arg>--instance</arg>
1859
            <arg>--node</arg>
1860
            <arg>--primary</arg>
1861
            <arg>--secondary</arg>
1862
            <arg>--all</arg>
1863
            <arg>--tags</arg>
1864
            <arg>--node-tags</arg>
1865
            <arg>--pri-node-tags</arg>
1866
            <arg>--sec-node-tags</arg>
1867
          </group>
1868
          <sbr>
1869
          <arg>--submit</arg>
1870
          <sbr>
1871
          <arg choice="opt"
1872
          rep="repeat"><replaceable>name</replaceable></arg>
1873
        </cmdsynopsis>
1874

    
1875
        <para>
1876
          Reboots one or more instances. The type of reboot depends on
1877
          the value of <option>--type</option>. A soft reboot does a
1878
          hypervisor reboot, a hard reboot does a instance stop,
1879
          recreates the hypervisor config for the instance and
1880
          starts the instance. A full reboot does the equivalent
1881
          of <command>gnt-instance shutdown &amp;&amp; gnt-instance
1882
          startup</command>. The default is hard reboot.
1883
        </para>
1884

    
1885
        <para>
1886
          For the hard reboot the option
1887
          <option>--ignore-secondaries</option> ignores errors for the
1888
          secondary node while re-assembling the instance disks.
1889
        </para>
1890

    
1891
        <para>
1892
          The <option>--instance</option>, <option>--node</option>,
1893
          <option>--primary</option>, <option>--secondary</option>,
1894
          <option>--all</option>, <option>--tags</option>,
1895
          <option>--node-tags</option>, <option>--pri-node-tags</option> and
1896
          <option>--sec-node-tags</option> options are similar as for the
1897
          <command>startup</command> command and they influence the
1898
          actual instances being rebooted.
1899
        </para>
1900

    
1901
        <para>
1902
          The <option>--shutdown-timeout</option> is used to specify how
1903
          much time to wait before forcing the shutdown (xm destroy in xen,
1904
          killing the kvm process, for kvm). By default two minutes are
1905
          given to each instance to stop.
1906
        </para>
1907

    
1908
        <para>
1909
          The <option>--force-multiple</option> will skip the
1910
          interactive confirmation in the case the more than one
1911
          instance will be affected.
1912
        </para>
1913

    
1914
        <para>
1915
          Example:
1916
          <screen>
1917
# gnt-instance reboot instance1.example.com
1918
# gnt-instance reboot --type=full instance1.example.com
1919
          </screen>
1920
        </para>
1921
      </refsect3>
1922

    
1923
      <refsect3>
1924
        <title>CONSOLE</title>
1925
        <cmdsynopsis>
1926
          <command>console</command>
1927
          <arg choice="opt">--show-cmd</arg>
1928
          <arg choice="req"><replaceable>instance</replaceable></arg>
1929
        </cmdsynopsis>
1930

    
1931
        <para>
1932
          Connects to the console of the given instance. If the
1933
          instance is not up, an error is returned. Use the
1934
          <option>--show-cmd</option> option to display the command
1935
          instead of executing it.
1936
        </para>
1937

    
1938
        <para>
1939
          For HVM instances, this will attempt to connect to the
1940
          serial console of the instance. To connect to the
1941
          virtualized "physical" console of a HVM instance, use a VNC
1942
          client with the connection info from the
1943
          <command>info</command> command.
1944
        </para>
1945

    
1946
        <para>
1947
          Example:
1948
          <screen>
1949
# gnt-instance console instance1.example.com
1950
          </screen>
1951
        </para>
1952
      </refsect3>
1953

    
1954
    </refsect2>
1955

    
1956
    <refsect2>
1957
      <title>Disk management</title>
1958

    
1959
      <refsect3>
1960
        <title>REPLACE-DISKS</title>
1961

    
1962
        <cmdsynopsis>
1963
          <command>replace-disks</command>
1964
          <arg>--submit</arg>
1965
          <arg>--early-release</arg>
1966
          <arg choice="req">-p</arg>
1967
          <arg>--disks <replaceable>idx</replaceable></arg>
1968
          <arg choice="req"><replaceable>instance</replaceable></arg>
1969
        </cmdsynopsis>
1970

    
1971
        <cmdsynopsis>
1972
          <command>replace-disks</command>
1973
          <arg>--submit</arg>
1974
          <arg>--early-release</arg>
1975
          <arg choice="req">-s</arg>
1976
          <arg>--disks <replaceable>idx</replaceable></arg>
1977
          <arg choice="req"><replaceable>instance</replaceable></arg>
1978
        </cmdsynopsis>
1979

    
1980
        <cmdsynopsis>
1981
          <command>replace-disks</command>
1982
          <arg>--submit</arg>
1983
          <arg>--early-release</arg>
1984
          <group choice="req">
1985
            <arg>--iallocator <replaceable>name</replaceable></arg>
1986
            <arg>--new-secondary <replaceable>NODE</replaceable></arg>
1987
          </group>
1988

    
1989
          <arg choice="req"><replaceable>instance</replaceable></arg>
1990
        </cmdsynopsis>
1991

    
1992
        <cmdsynopsis>
1993
          <command>replace-disks</command>
1994
          <arg>--submit</arg>
1995
          <arg>--early-release</arg>
1996
          <arg choice="req">--auto</arg>
1997
          <arg choice="req"><replaceable>instance</replaceable></arg>
1998
        </cmdsynopsis>
1999

    
2000
        <para>
2001
          This command is a generalized form for replacing disks. It
2002
          is currently only valid for the mirrored (DRBD) disk
2003
          template.
2004
        </para>
2005

    
2006
        <para>
2007
          The first form (when passing the <option>-p</option> option)
2008
          will replace the disks on the primary, while the second form
2009
          (when passing the <option>-s</option> option will replace
2010
          the disks on the secondary node. For these two cases (as the
2011
          node doesn't change), it is possible to only run the replace
2012
          for a subset of the disks, using the option
2013
          <option>--disks</option> which takes a list of
2014
          comma-delimited disk indices (zero-based),
2015
          e.g. <userinput>0,2</userinput> to replace only the first
2016
          and third disks.
2017
        </para>
2018

    
2019
        <para>
2020
          The third form (when passing either the
2021
          <option>--iallocator</option> or the
2022
          <option>--new-secondary</option> option) is designed to
2023
          change secondary node of the instance.  Specifying
2024
          <option>--iallocator</option> makes the new secondary be
2025
          selected automatically by the specified allocator plugin,
2026
          otherwise the new secondary node will be the one chosen
2027
          manually via the <option>--new-secondary</option> option.
2028
        </para>
2029

    
2030
        <para>
2031
          The fourth form (when using <option>--auto</option>) will
2032
          automatically determine which disks of an instance are faulty and
2033
          replace them within the same node. The <option>--auto</option>
2034
          option works only when an instance has only faulty disks on
2035
          either the primary or secondary node; it doesn't work when
2036
          both sides have faulty disks.
2037
        </para>
2038

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

    
2046
        <para>
2047
          The <option>--early-release</option> changes the code so
2048
          that the old storage on secondary node(s) is removed early
2049
          (before the resync is completed) and the internal Ganeti
2050
          locks for the current (and new, if any) secondary node are
2051
          also released, thus allowing more parallelism in the cluster
2052
          operation. This should be used only when recovering from a
2053
          disk failure on the current secondary (thus the old storage
2054
          is already broken) or when the storage on the primary node
2055
          is known to be fine (thus we won't need the old storage for
2056
          potential recovery).
2057
        </para>
2058

    
2059
        <para>
2060
          Note that it is not possible to select an offline or drained
2061
          node as a new secondary.
2062
        </para>
2063

    
2064
      </refsect3>
2065

    
2066
      <refsect3>
2067
        <title>ACTIVATE-DISKS</title>
2068

    
2069
        <cmdsynopsis>
2070
          <command>activate-disks</command>
2071
          <arg>--submit</arg>
2072
          <arg>--ignore-size</arg>
2073
          <arg choice="req"><replaceable>instance</replaceable></arg>
2074
        </cmdsynopsis>
2075
        <para>
2076
          Activates the block devices of the given instance. If
2077
          successful, the command will show the location and name of
2078
          the block devices:
2079
          <screen>
2080
node1.example.com:disk/0:/dev/drbd0
2081
node1.example.com:disk/1:/dev/drbd1
2082
          </screen>
2083

    
2084
          In this example, <emphasis>node1.example.com</emphasis> is
2085
          the name of the node on which the devices have been
2086
          activated. The <emphasis>disk/0</emphasis> and
2087
          <emphasis>disk/1</emphasis> are the Ganeti-names of the
2088
          instance disks; how they are visible inside the instance is
2089
          hypervisor-specific. <emphasis>/dev/drbd0</emphasis> and
2090
          <emphasis>/dev/drbd1</emphasis> are the actual block devices
2091
          as visible on the node.
2092
        </para>
2093

    
2094
        <para>
2095
          The <option>--submit</option> option is used to send the job to
2096
          the master daemon but not wait for its completion. The job
2097
          ID will be shown so that it can be examined via
2098
          <command>gnt-job info</command>.
2099
        </para>
2100

    
2101
        <para>
2102
          The <option>--ignore-size</option> option can be used to
2103
          activate disks ignoring the currently configured size in
2104
          Ganeti. This can be used in cases where the configuration
2105
          has gotten out of sync with the real-world (e.g. after a
2106
          partially-failed grow-disk operation or due to rounding in
2107
          LVM devices). This should not be used in normal cases, but
2108
          only when activate-disks fails without it.
2109
        </para>
2110

    
2111
        <para>
2112
          Note that it is safe to run this command while the instance
2113
          is already running.
2114
        </para>
2115
      </refsect3>
2116

    
2117
      <refsect3>
2118
        <title>DEACTIVATE-DISKS</title>
2119

    
2120
        <cmdsynopsis>
2121
          <command>deactivate-disks</command>
2122
          <arg>--submit</arg>
2123
          <arg choice="req"><replaceable>instance</replaceable></arg>
2124
        </cmdsynopsis>
2125
        <para>
2126
          De-activates the block devices of the given instance. Note
2127
          that if you run this command for an instance with a drbd
2128
          disk template, while it is running, it will not be able to
2129
          shutdown the block devices on the primary node, but it will
2130
          shutdown the block devices on the secondary nodes, thus
2131
          breaking the replication.
2132
        </para>
2133

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

    
2141
      </refsect3>
2142

    
2143
      <refsect3>
2144
        <title>GROW-DISK</title>
2145
        <cmdsynopsis>
2146
          <command>grow-disk</command>
2147
          <arg>--no-wait-for-sync</arg>
2148
          <arg>--submit</arg>
2149
          <arg choice="req"><replaceable>instance</replaceable></arg>
2150
          <arg choice="req"><replaceable>disk</replaceable></arg>
2151
          <arg choice="req"><replaceable>amount</replaceable></arg>
2152
        </cmdsynopsis>
2153

    
2154
        <para>
2155
          Grows an instance's disk. This is only possible for
2156
          instances having a <literal>plain</literal> or
2157
          <literal>drbd</literal> disk template.
2158
        </para>
2159

    
2160
        <para>
2161
          Note that this command only change the block device size; it
2162
          will not grow the actual filesystems, partitions, etc. that
2163
          live on that disk. Usually, you will need to:
2164
          <orderedlist>
2165
            <listitem>
2166
              <simpara>use <command>gnt-instance grow-disk</command></simpara>
2167
            </listitem>
2168
            <listitem>
2169
              <simpara>reboot the instance (later, at a convenient
2170
              time)</simpara>
2171
            </listitem>
2172
            <listitem>
2173
              <simpara>use a filesystem resizer, such as
2174
              <citerefentry> <refentrytitle>ext2online</refentrytitle>
2175
              <manvolnum>8</manvolnum> </citerefentry> or
2176
              <citerefentry> <refentrytitle>xfs_growfs</refentrytitle>
2177
              <manvolnum>8</manvolnum> </citerefentry> to resize the
2178
              filesystem, or use <citerefentry>
2179
              <refentrytitle>fdisk</refentrytitle>
2180
              <manvolnum>8</manvolnum> </citerefentry> to change the
2181
              partition table on the disk
2182
              </simpara>
2183
            </listitem>
2184
          </orderedlist>
2185
        </para>
2186

    
2187

    
2188
        <para>
2189
          The <replaceable>disk</replaceable> argument is the index of
2190
          the instance disk to grow. The
2191
          <replaceable>amount</replaceable> argument is given either
2192
          as a number (and it represents the amount to increase the
2193
          disk with in mebibytes) or can be given similar to the
2194
          arguments in the create instance operation, with a suffix
2195
          denoting the unit.
2196
        </para>
2197

    
2198
        <para>
2199
          Note that the disk grow operation might complete on one node
2200
          but fail on the other; this will leave the instance with
2201
          different-sized LVs on the two nodes, but this will not
2202
          create problems (except for unused space).
2203
        </para>
2204

    
2205
        <para>
2206
          If you do not want gnt-instance to wait for the new disk
2207
          region to be synced, use the
2208
          <option>--no-wait-for-sync</option> option.
2209
        </para>
2210

    
2211
        <para>
2212
          The <option>--submit</option> option is used to send the job to
2213
          the master daemon but not wait for its completion. The job
2214
          ID will be shown so that it can be examined via
2215
          <command>gnt-job info</command>.
2216
        </para>
2217

    
2218

    
2219
        <para>Example (increase the first disk for instance1 by 16GiB):
2220
          <screen>
2221
# gnt-instance grow-disk instance1.example.com 0 16g
2222
          </screen>
2223
        </para>
2224

    
2225
        <para>
2226
          Also note that disk shrinking is not supported; use
2227
          <command>gnt-backup export</command> and then
2228
          <command>gnt-backup import</command> to reduce the disk size
2229
          of an instance.
2230
        </para>
2231
      </refsect3>
2232

    
2233
      <refsect3>
2234
        <title>RECREATE-DISKS</title>
2235

    
2236
        <cmdsynopsis>
2237
          <command>recreate-disks</command>
2238
          <arg>--submit</arg>
2239
          <arg>--disks=<option>indices</option></arg>
2240
          <arg choice="req"><replaceable>instance</replaceable></arg>
2241
        </cmdsynopsis>
2242
        <para>
2243
          Recreates the disks of the given instance, or only a subset
2244
          of the disks (if the option <option>disks</option> is
2245
          passed, which must be a comma-separated list of disk
2246
          indices, starting from zero).
2247
        </para>
2248

    
2249
        <para>
2250
          Note that this functionality should only be used for missing
2251
          disks; if any of the given disks already exists, the
2252
          operation will fail. While this is suboptimal,
2253
          recreate-disks should hopefully not be needed in normal
2254
          operation and as such the impact of this is low.
2255
        </para>
2256

    
2257
        <para>
2258
          The <option>--submit</option> option is used to send the job to
2259
          the master daemon but not wait for its completion. The job
2260
          ID will be shown so that it can be examined via
2261
          <command>gnt-job info</command>.
2262
        </para>
2263

    
2264
      </refsect3>
2265

    
2266
    </refsect2>
2267

    
2268
    <refsect2>
2269
      <title>Recovery</title>
2270

    
2271
      <refsect3>
2272
        <title>FAILOVER</title>
2273

    
2274
        <cmdsynopsis>
2275
          <command>failover</command>
2276
          <arg>-f</arg>
2277
          <arg>--ignore-consistency</arg>
2278
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2279
          <arg>--submit</arg>
2280
          <arg choice="req"><replaceable>instance</replaceable></arg>
2281
        </cmdsynopsis>
2282

    
2283
        <para>
2284
          Failover will fail the instance over its secondary
2285
          node. This works only for instances having a drbd disk
2286
          template.
2287
        </para>
2288

    
2289
        <para>
2290
          Normally the failover will check the consistency of the
2291
          disks before failing over the instance. If you are trying to
2292
          migrate instances off a dead node, this will fail. Use the
2293
          <option>--ignore-consistency</option> option for this
2294
          purpose. Note that this option can be dangerous as errors in
2295
          shutting down the instance will be ignored, resulting in
2296
          possibly having the instance running on two machines in
2297
          parallel (on disconnected DRBD drives).
2298
        </para>
2299

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

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

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

    
2322
      <refsect3>
2323
        <title>MIGRATE</title>
2324

    
2325
        <cmdsynopsis>
2326
          <command>migrate</command>
2327
          <arg>-f</arg>
2328
          <arg choice="req">--cleanup</arg>
2329
          <arg choice="req"><replaceable>instance</replaceable></arg>
2330
        </cmdsynopsis>
2331

    
2332
        <cmdsynopsis>
2333
          <command>migrate</command>
2334
          <arg>-f</arg>
2335
          <arg>--non-live</arg>
2336
          <arg choice="req"><replaceable>instance</replaceable></arg>
2337
        </cmdsynopsis>
2338

    
2339
        <para>
2340
          Migrate will move the instance to its secondary node without
2341
          shutdown. It only works for instances having the drbd8 disk
2342
          template type.
2343
        </para>
2344

    
2345
        <para>
2346
          The migration command needs a perfectly healthy instance, as
2347
          we rely on the dual-master capability of drbd8 and the disks
2348
          of the instance are not allowed to be degraded.
2349
        </para>
2350

    
2351
        <para>
2352
          The <option>--non-live</option> option will switch (for the
2353
          hypervisors that support it) between a "fully live"
2354
          (i.e. the interruption is as minimal as possible) migration
2355
          and one in which the instance is frozen, its state saved and
2356
          transported to the remote node, and then resumed there. This
2357
          all depends on the hypervisor support for two different
2358
          methods. In any case, it is not an error to pass this
2359
          parameter (it will just be ignored if the hypervisor doesn't
2360
          support it).
2361
        </para>
2362

    
2363
        <para>
2364
          If the <option>--cleanup</option> option is passed, the
2365
          operation changes from migration to attempting recovery from
2366
          a failed previous migration. In this mode, ganeti checks if
2367
          the instance runs on the correct node (and updates its
2368
          configuration if not) and ensures the instances's disks are
2369
          configured correctly. In this mode, the
2370
          <option>--non-live</option> option is ignored.
2371
        </para>
2372

    
2373
        <para>
2374
          The option <option>-f</option> will skip the prompting for
2375
          confirmation.
2376
        </para>
2377
        <para>
2378
          Example (and expected output):
2379
          <screen>
2380
# gnt-instance migrate instance1
2381
Migrate will happen to the instance instance1. Note that migration is
2382
**experimental** in this version. This might impact the instance if
2383
anything goes wrong. Continue?
2384
y/[n]/?: y
2385
* checking disk consistency between source and target
2386
* ensuring the target is in secondary mode
2387
* changing disks into dual-master mode
2388
 - INFO: Waiting for instance instance1 to sync disks.
2389
 - INFO: Instance instance1's disks are in sync.
2390
* migrating instance to node2.example.com
2391
* changing the instance's disks on source node to secondary
2392
 - INFO: Waiting for instance instance1 to sync disks.
2393
 - INFO: Instance instance1's disks are in sync.
2394
* changing the instance's disks to single-master
2395
#
2396
          </screen>
2397
        </para>
2398
      </refsect3>
2399

    
2400
      <refsect3>
2401
        <title>MOVE</title>
2402

    
2403
        <cmdsynopsis>
2404
          <command>move</command>
2405
          <arg>-f</arg>
2406
          <arg>-n <replaceable>node</replaceable></arg>
2407
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2408
          <arg>--submit</arg>
2409
          <arg choice="req"><replaceable>instance</replaceable></arg>
2410
        </cmdsynopsis>
2411

    
2412
        <para>
2413
          Move will move the instance to an arbitrary node in the
2414
          cluster. This works only for instances having a plain or
2415
          file disk template.
2416
        </para>
2417

    
2418
        <para>
2419
          Note that since this operation is done via data copy, it
2420
          will take a long time for big disks (similar to
2421
          replace-disks for a drbd instance).
2422
        </para>
2423

    
2424
        <para>
2425
          The <option>--shutdown-timeout</option> is used to specify how
2426
          much time to wait before forcing the shutdown (xm destroy in xen,
2427
          killing the kvm process, for kvm). By default two minutes are
2428
          given to each instance to stop.
2429
        </para>
2430

    
2431
        <para>
2432
          The <option>--submit</option> option is used to send the job to
2433
          the master daemon but not wait for its completion. The job
2434
          ID will be shown so that it can be examined via
2435
          <command>gnt-job info</command>.
2436
        </para>
2437

    
2438
        <para>
2439
          Example:
2440
          <screen>
2441
# gnt-instance move -n node3.example.com instance1.example.com
2442
          </screen>
2443
        </para>
2444
      </refsect3>
2445

    
2446
    </refsect2>
2447

    
2448
    <refsect2>
2449
      <title>TAGS</title>
2450

    
2451
    <refsect3>
2452
        <title>ADD-TAGS</title>
2453

    
2454
        <cmdsynopsis>
2455
          <command>add-tags</command>
2456
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2457
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2458
          <arg choice="req"
2459
            rep="repeat"><replaceable>tag</replaceable></arg>
2460
        </cmdsynopsis>
2461

    
2462
        <para>
2463
          Add tags to the given instance. If any of the tags contains
2464
          invalid characters, the entire operation will abort.
2465
        </para>
2466
        <para>
2467
          If the <option>--from</option> option is given, the list of
2468
          tags will be extended with the contents of that file (each
2469
          line becomes a tag). In this case, there is not need to pass
2470
          tags on the command line (if you do, both sources will be
2471
          used). A file name of - will be interpreted as stdin.
2472
        </para>
2473
      </refsect3>
2474

    
2475
      <refsect3>
2476
        <title>LIST-TAGS</title>
2477

    
2478
        <cmdsynopsis>
2479
          <command>list-tags</command>
2480
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2481
        </cmdsynopsis>
2482

    
2483
        <para>List the tags of the given instance.</para>
2484
      </refsect3>
2485

    
2486
      <refsect3>
2487
        <title>REMOVE-TAGS</title>
2488
        <cmdsynopsis>
2489
          <command>remove-tags</command>
2490
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2491
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2492
          <arg choice="req"
2493
            rep="repeat"><replaceable>tag</replaceable></arg>
2494
        </cmdsynopsis>
2495

    
2496
        <para>
2497
          Remove tags from the given instance. If any of the tags are
2498
          not existing on the node, the entire operation will abort.
2499
        </para>
2500

    
2501
        <para>
2502
          If the <option>--from</option> option is given, the list of
2503
          tags will be extended with the contents of that file (each
2504
          line becomes a tag). In this case, there is not need to pass
2505
          tags on the command line (if you do, both sources will be
2506
          used). A file name of - will be interpreted as stdin.
2507
        </para>
2508
      </refsect3>
2509

    
2510
    </refsect2>
2511

    
2512
  </refsect1>
2513

    
2514
  &footer;
2515

    
2516
</refentry>
2517

    
2518
<!-- Keep this comment at the end of the file
2519
Local variables:
2520
mode: sgml
2521
sgml-omittag:t
2522
sgml-shorttag:t
2523
sgml-minimize-attributes:nil
2524
sgml-always-quote-attributes:t
2525
sgml-indent-step:2
2526
sgml-indent-data:t
2527
sgml-parent-document:nil
2528
sgml-default-dtd-file:nil
2529
sgml-exposed-tags:nil
2530
sgml-local-catalogs:nil
2531
sgml-local-ecat-files:nil
2532
End:
2533
-->