Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ e43d4f9f

History | View | Annotate | Download (91.8 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>migration_downtime</term>
663
              <listitem>
664
                <simpara>Valid for the KVM hypervisor.</simpara>
665

    
666
                <simpara>The maximum amount of time (in ms) a KVM instance is
667
                allowed to be frozen during a live migration, in order to copy
668
                dirty memory pages. Default value is 30ms, but you may need to
669
                increase this value for busy instances.
670
                </simpara>
671

    
672
                <simpara>This option is only effective with kvm versions >= 87
673
                and qemu-kvm versions >= 0.11.0.
674
                </simpara>
675

    
676
              </listitem>
677
            </varlistentry>
678

    
679
          </variablelist>
680

    
681
        </para>
682

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
958
      </refsect3>
959

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

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

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

    
978
        </para>
979

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
1574

    
1575
      </refsect3>
1576

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

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

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

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

    
1605
      </refsect3>
1606

    
1607
    </refsect2>
1608

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
1832

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

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

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

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

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

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

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

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

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

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

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

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

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

    
1953
    </refsect2>
1954

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
2063
      </refsect3>
2064

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

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

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

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

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

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

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

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

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

    
2140
      </refsect3>
2141

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

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

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

    
2186

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

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

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

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

    
2217

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

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

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

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

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

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

    
2263
      </refsect3>
2264

    
2265
    </refsect2>
2266

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
2445
    </refsect2>
2446

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

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

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

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

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

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

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

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

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

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

    
2509
    </refsect2>
2510

    
2511
  </refsect1>
2512

    
2513
  &footer;
2514

    
2515
</refentry>
2516

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