Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ e0897adf

History | View | Annotate | Download (93.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>June 08, 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.2</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
637
                to run the instance under. It must be a valid username
638
                existing on the host.
639
                </simpara>
640
                <simpara>Cannot be set under security model <quote>none</quote>
641
                or <quote>pool</quote>.
642
                </simpara>
643

    
644
              </listitem>
645
            </varlistentry>
646

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

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

    
658
              </listitem>
659
            </varlistentry>
660

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

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

    
675
                <simpara>It is set to <quote>false</quote> by default.</simpara>
676
              </listitem>
677
            </varlistentry>
678

    
679
            <varlistentry>
680
              <term>migration_downtime</term>
681
              <listitem>
682
                <simpara>Valid for the KVM hypervisor.</simpara>
683

    
684
                <simpara>The maximum amount of time (in ms) a KVM instance is
685
                allowed to be frozen during a live migration, in order to copy
686
                dirty memory pages. Default value is 30ms, but you may need to
687
                increase this value for busy instances.
688
                </simpara>
689

    
690
                <simpara>This option is only effective with kvm versions >= 87
691
                and qemu-kvm versions >= 0.11.0.
692
                </simpara>
693
              </listitem>
694
            </varlistentry>
695

    
696
            <varlistentry>
697
              <term>use_chroot</term>
698
              <listitem>
699
                <simpara>Valid for the KVM hypervisor.</simpara>
700

    
701
                <simpara>This boolean option determines wether to run the KVM
702
                instance in a chroot directory.
703
                </simpara>
704
                <para>If it is set to <quote>true</quote>, an empty directory
705
                is created before starting the instance and its path is passed
706
                via the <option>-chroot</option> flag to kvm.
707
                The directory is removed when the instance is stopped.
708
                </para>
709

    
710
                <simpara>It is set to <quote>false</quote> by default.</simpara>
711
              </listitem>
712
            </varlistentry>
713

    
714
          </variablelist>
715

    
716
        </para>
717

    
718
        <para>
719
          The <option>--iallocator</option> option specifies the instance
720
          allocator plugin to use. If you pass in this option the allocator
721
          will select nodes for this instance automatically, so you don't need
722
          to pass them with the <option>-n</option> option. For more
723
          information please refer to the instance allocator documentation.
724
        </para>
725

    
726
        <para>
727
          The <option>-t</option> options specifies the disk layout type for
728
          the instance. The available choices are:
729
          <variablelist>
730
            <varlistentry>
731
              <term>diskless</term>
732
              <listitem>
733
                <para>
734
                  This creates an instance with no disks. Its useful for
735
                  testing only (or other special cases).
736
                </para>
737
              </listitem>
738
            </varlistentry>
739
            <varlistentry>
740
              <term>file</term>
741
              <listitem>
742
                <para>Disk devices will be regular files.</para>
743
              </listitem>
744
            </varlistentry>
745
            <varlistentry>
746
              <term>plain</term>
747
              <listitem>
748
                <para>Disk devices will be logical volumes.</para>
749
              </listitem>
750
            </varlistentry>
751
            <varlistentry>
752
              <term>drbd</term>
753
              <listitem>
754
                <para>
755
                  Disk devices will be drbd (version 8.x) on top of
756
                  lvm volumes.
757
                </para>
758
              </listitem>
759
            </varlistentry>
760
          </variablelist>
761
        </para>
762

    
763
        <para>
764
          The optional second value of the <option>--node</option> is used for
765
          the drbd template type and specifies the remote node.
766
        </para>
767

    
768
        <para>
769
          If you do not want gnt-instance to wait for the disk mirror
770
          to be synced, use the <option>--no-wait-for-sync</option>
771
          option.
772
        </para>
773

    
774
        <para>
775
          The <option>--file-storage-dir</option> specifies the relative path
776
          under the cluster-wide file storage directory to store file-based
777
          disks. It is useful for having different subdirectories for
778
          different instances. The full path of the directory where the disk
779
          files are stored will consist of cluster-wide file storage directory
780
          + optional subdirectory + instance name. Example:
781
          /srv/ganeti/file-storage/mysubdir/instance1.example.com. This option
782
          is only relevant for instances using the file storage backend.
783
        </para>
784

    
785
        <para>
786
          The <option>--file-driver</option> specifies the driver to use for
787
          file-based disks. Note that currently these drivers work with the
788
          xen hypervisor only. This option is only relevant for instances using
789
          the file storage backend. The available choices are:
790
          <variablelist>
791
            <varlistentry>
792
              <term>loop</term>
793
              <listitem>
794
                <para>
795
                  Kernel loopback driver. This driver uses loopback
796
                  devices to access the filesystem within the
797
                  file. However, running I/O intensive applications in
798
                  your instance using the loop driver might result in
799
                  slowdowns.  Furthermore, if you use the loopback
800
                  driver consider increasing the maximum amount of
801
                  loopback devices (on most systems it's 8) using the
802
                  max_loop param.
803
                </para>
804
              </listitem>
805
            </varlistentry>
806
            <varlistentry>
807
              <term>blktap</term>
808
              <listitem>
809
                <para>The blktap driver (for Xen hypervisors). In
810
                order to be able to use the blktap driver you should
811
                check if the 'blktapctrl' user space disk agent is
812
                running (usually automatically started via xend). This
813
                user-level disk I/O interface has the advantage of
814
                better performance. Especially if you use a network
815
                file system (e.g. NFS) to store your instances this is
816
                the recommended choice.
817
                </para>
818
              </listitem>
819
            </varlistentry>
820
          </variablelist>
821
        </para>
822

    
823
        <para>
824
          The <option>--submit</option> option is used to send the job to
825
          the master daemon but not wait for its completion. The job
826
          ID will be shown so that it can be examined via
827
          <command>gnt-job info</command>.
828
        </para>
829

    
830
        <para>
831
          Example:
832
          <screen>
833
# gnt-instance add -t file --disk 0:size=30g -B memory=512 -o debian-etch \
834
  -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
835
# gnt-instance add -t plain --disk 0:size=30g -B memory=512 -o debian-etch \
836
  -n node1.example.com instance1.example.com
837
# gnt-instance add -t drbd --disk 0:size=30g -B memory=512 -o debian-etch \
838
  -n node1.example.com:node2.example.com instance2.example.com
839
          </screen>
840
        </para>
841
      </refsect3>
842

    
843
      <refsect3>
844
        <title>BATCH-CREATE</title>
845
        <cmdsynopsis>
846
          <command>batch-create</command>
847
          <arg choice="req">instances_file.json</arg>
848
        </cmdsynopsis>
849

    
850
        <para>
851
          This command (similar to the Ganeti 1.2
852
          <command>batcher</command> tool) submits multiple instance
853
          creation jobs based on a definition file. The instance
854
          configurations do not encompass all the possible options for
855
          the <command>add</command> command, but only a subset.
856
        </para>
857

    
858
        <para>
859
          The instance file should be a valid-formed JSON file,
860
          containing a dictionary with instance name and instance
861
          parameters. The accepted parameters are:
862

    
863
          <variablelist>
864
            <varlistentry>
865
              <term>disk_size</term>
866
              <listitem>
867
                <simpara>The size of the disks of the instance.</simpara>
868
              </listitem>
869
            </varlistentry>
870
            <varlistentry>
871
              <term>disk_templace</term>
872
              <listitem>
873
                <simpara>The disk template to use for the instance,
874
                the same as in the <command>add</command>
875
                command.</simpara>
876
              </listitem>
877
            </varlistentry>
878
            <varlistentry>
879
              <term>backend</term>
880
              <listitem>
881
                <simpara>A dictionary of backend parameters.</simpara>
882
              </listitem>
883
            </varlistentry>
884
            <varlistentry>
885
              <term>hypervisor</term>
886
              <listitem>
887
                <simpara>A dictionary with a single key (the
888
                hypervisor name), and as value the hypervisor
889
                options. If not passed, the default hypervisor and
890
                hypervisor options will be inherited.</simpara>
891
              </listitem>
892
            </varlistentry>
893
            <varlistentry>
894
              <term>mac, ip, mode, link</term>
895
              <listitem>
896
                <simpara>Specifications for the one NIC that will be
897
                created for the instance. 'bridge' is also accepted
898
                as a backwards compatibile key.</simpara>
899
              </listitem>
900
            </varlistentry>
901
            <varlistentry>
902
              <term>nics</term>
903
              <listitem>
904
                <simpara>List of nics that will be created for the
905
                instance. Each entry should be a dict, with mac, ip, mode
906
                and link as possible keys. Please don't provide the "mac,
907
                ip, mode, link" parent keys if you use this method for
908
                specifying nics.</simpara>
909
              </listitem>
910
            </varlistentry>
911
            <varlistentry>
912
              <term>primary_node, secondary_node</term>
913
              <listitem>
914
                <simpara>The primary and optionally the secondary node
915
                to use for the instance (in case an iallocator script
916
                is not used).</simpara>
917
              </listitem>
918
            </varlistentry>
919
            <varlistentry>
920
              <term>iallocator</term>
921
              <listitem>
922
                <simpara>Instead of specifying the nodes, an
923
                iallocator script can be used to automatically compute
924
                them.</simpara>
925
              </listitem>
926
            </varlistentry>
927
            <varlistentry>
928
              <term>start</term>
929
              <listitem>
930
                <simpara>whether to start the instance</simpara>
931
              </listitem>
932
            </varlistentry>
933
            <varlistentry>
934
              <term>ip_check</term>
935
              <listitem>
936
                <simpara>Skip the check for already-in-use instance;
937
                see the description in the <command>add</command>
938
                command for details.</simpara>
939
              </listitem>
940
            </varlistentry>
941
            <varlistentry>
942
              <term>name_check</term>
943
              <listitem>
944
                <simpara>Skip the name check for instances;
945
                see the description in the <command>add</command>
946
                command for details.</simpara>
947
              </listitem>
948
            </varlistentry>
949
            <varlistentry>
950
              <term>file_storage_dir, file_driver</term>
951
              <listitem>
952
                <simpara>Configuration for the <literal>file</literal>
953
                disk type, see the <command>add</command> command for
954
                details.</simpara>
955
              </listitem>
956
            </varlistentry>
957
          </variablelist>
958
        </para>
959

    
960
        <para>
961
          A simple definition for one instance can be (with most of
962
          the parameters taken from the cluster defaults):
963
          <screen>
964
{
965
  "instance3": {
966
    "template": "drbd",
967
    "os": "debootstrap",
968
    "disk_size": ["25G"],
969
    "iallocator": "dumb"
970
  },
971
  "instance5": {
972
    "template": "drbd",
973
    "os": "debootstrap",
974
    "disk_size": ["25G"],
975
    "iallocator": "dumb",
976
    "hypervisor": "xen-hvm",
977
    "hvparams": {"acpi": true},
978
    "backend": {"memory": 512}
979
  }
980
}
981
</screen>
982
        </para>
983

    
984
        <para>
985
          The command will display the job id for each submitted instance, as follows:
986
          <screen>
987
# gnt-instance batch-create instances.json
988
instance3: 11224
989
instance5: 11225
990
</screen>
991
        </para>
992

    
993
      </refsect3>
994

    
995
      <refsect3>
996
        <title>REMOVE</title>
997

    
998
        <cmdsynopsis>
999
          <command>remove</command>
1000
          <arg>--ignore-failures</arg>
1001
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
1002
          <arg>--submit</arg>
1003
          <arg choice="req"><replaceable>instance</replaceable></arg>
1004
        </cmdsynopsis>
1005

    
1006
        <para>
1007
          Remove an instance. This will remove all data from the
1008
          instance and there is <emphasis>no way back</emphasis>. If
1009
          you are not sure if you use an instance again, use
1010
          <command>shutdown</command> first and leave it in the
1011
          shutdown state for a while.
1012

    
1013
        </para>
1014

    
1015
        <para>
1016
          The <option>--ignore-failures</option> option will cause the
1017
          removal to proceed even in the presence of errors during the
1018
          removal of the instance (e.g. during the shutdown or the
1019
          disk removal). If this option is not given, the command will
1020
          stop at the first error.
1021
        </para>
1022

    
1023
        <para>
1024
          The <option>--shutdown-timeout</option> is used to specify how
1025
          much time to wait before forcing the shutdown (xm destroy in xen,
1026
          killing the kvm process, for kvm). By default two minutes are
1027
          given to each instance to stop.
1028
        </para>
1029

    
1030
        <para>
1031
          The <option>--submit</option> option is used to send the job to
1032
          the master daemon but not wait for its completion. The job
1033
          ID will be shown so that it can be examined via
1034
          <command>gnt-job info</command>.
1035
        </para>
1036

    
1037
        <para>
1038
          Example:
1039
          <screen>
1040
# gnt-instance remove instance1.example.com
1041
          </screen>
1042
        </para>
1043
      </refsect3>
1044

    
1045
      <refsect3>
1046
        <title>LIST</title>
1047

    
1048
        <cmdsynopsis>
1049
          <command>list</command>
1050
          <arg>--no-headers</arg>
1051
          <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
1052
          <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
1053
          <arg>--roman</arg>
1054
          <arg rep="repeat">instance</arg>
1055
        </cmdsynopsis>
1056

    
1057
        <para>
1058
          Shows the currently configured instances with memory usage,
1059
          disk usage, the node they are running on, and their run
1060
          status.
1061
        </para>
1062

    
1063
        <para>
1064
          The <option>--no-headers</option> option will skip the
1065
          initial header line. The <option>--separator</option> option
1066
          takes an argument which denotes what will be used between
1067
          the output fields. Both these options are to help scripting.
1068
        </para>
1069

    
1070
        <para>
1071
          The <option>--roman</option> option allows latin people to better
1072
          understand the cluster instances' status.
1073
        </para>
1074

    
1075
        <para>
1076
          The <option>-o</option> option takes a comma-separated list
1077
          of output fields. The available fields and their meaning
1078
          are:
1079
          <variablelist>
1080
            <varlistentry>
1081
              <term>name</term>
1082
              <listitem>
1083
                <simpara>the instance name</simpara>
1084
              </listitem>
1085
            </varlistentry>
1086
            <varlistentry>
1087
              <term>os</term>
1088
              <listitem>
1089
                <simpara>the OS of the instance</simpara>
1090
              </listitem>
1091
            </varlistentry>
1092
            <varlistentry>
1093
              <term>pnode</term>
1094
              <listitem>
1095
                <simpara>the primary node of the instance</simpara>
1096
              </listitem>
1097
            </varlistentry>
1098
            <varlistentry>
1099
              <term>snodes</term>
1100
              <listitem>
1101
                <simpara>comma-separated list of secondary nodes for the
1102
                  instance; usually this will be just one node</simpara>
1103
              </listitem>
1104
            </varlistentry>
1105
            <varlistentry>
1106
              <term>admin_state</term>
1107
              <listitem>
1108
                <simpara>the desired state of the instance (either "yes"
1109
                  or "no" denoting the instance should run or
1110
                  not)</simpara>
1111
              </listitem>
1112
            </varlistentry>
1113
            <varlistentry>
1114
              <term>disk_template</term>
1115
              <listitem>
1116
                <simpara>the disk template of the instance</simpara>
1117
              </listitem>
1118
            </varlistentry>
1119
            <varlistentry>
1120
              <term>oper_state</term>
1121
              <listitem>
1122
                <simpara>the actual state of the instance; can be
1123
                one of the values "running", "stopped", "(node
1124
                down)"</simpara>
1125
              </listitem>
1126
            </varlistentry>
1127
            <varlistentry>
1128
              <term>status</term>
1129
              <listitem>
1130
                <simpara>combined form of admin_state and oper_stat;
1131
                this can be one of:
1132
                <computeroutput>ERROR_nodedown</computeroutput> if the
1133
                node of the instance is down,
1134
                <computeroutput>ERROR_down</computeroutput> if the
1135
                instance should run but is down,
1136
                <computeroutput>ERROR_up</computeroutput> if the
1137
                instance should be stopped but is actually running,
1138
                <computeroutput>ADMIN_down</computeroutput> if the
1139
                instance has been stopped (and is stopped) and
1140
                <computeroutput>running</computeroutput> if the
1141
                instance is set to be running (and is
1142
                running)</simpara>
1143
              </listitem>
1144
            </varlistentry>
1145
            <varlistentry>
1146
              <term>oper_ram</term>
1147
              <listitem>
1148
                <simpara>the actual memory usage of the instance as seen
1149
                  by the hypervisor</simpara>
1150
              </listitem>
1151
            </varlistentry>
1152
            <varlistentry>
1153
              <term>ip</term>
1154
              <listitem>
1155
                <simpara>the ip address Ganeti recognizes as associated with
1156
                the first instance interface</simpara>
1157
              </listitem>
1158
            </varlistentry>
1159
            <varlistentry>
1160
              <term>mac</term>
1161
              <listitem>
1162
                <simpara>the first instance interface MAC address</simpara>
1163
              </listitem>
1164
            </varlistentry>
1165

    
1166
            <varlistentry>
1167
              <term>nic_mode</term>
1168
              <listitem>
1169
                <simpara>the mode of the first instance NIC
1170
                (routed or bridged)</simpara>
1171
              </listitem>
1172
            </varlistentry>
1173
            <varlistentry>
1174
              <term>nic_link</term>
1175
              <listitem>
1176
                <simpara>the link of the first instance NIC
1177
                </simpara>
1178
              </listitem>
1179
            </varlistentry>
1180
            <varlistentry>
1181
              <term>sda_size</term>
1182
              <listitem>
1183
                <simpara>the size of the instance's first disk</simpara>
1184
              </listitem>
1185
            </varlistentry>
1186
            <varlistentry>
1187
              <term>sdb_size</term>
1188
              <listitem>
1189
                <simpara>the size of the instance's second disk, if
1190
                any</simpara>
1191
              </listitem>
1192
            </varlistentry>
1193
            <varlistentry>
1194
              <term>vcpus</term>
1195
              <listitem>
1196
                <simpara>the number of VCPUs allocated to the
1197
                instance</simpara>
1198
              </listitem>
1199
            </varlistentry>
1200
            <varlistentry>
1201
              <term>tags</term>
1202
              <listitem>
1203
                <simpara>comma-separated list of the instances's
1204
                tags</simpara>
1205
              </listitem>
1206
            </varlistentry>
1207
            <varlistentry>
1208
              <term>serial_no</term>
1209
              <listitem>
1210
                <simpara>the so called 'serial number' of the
1211
                instance; this is a numeric field that is incremented
1212
                each time the instance is modified, and it can be used
1213
                to track modifications</simpara>
1214
              </listitem>
1215
            </varlistentry>
1216
            <varlistentry>
1217
              <term>ctime</term>
1218
              <listitem>
1219
                <para>
1220
                  the creation time of the instance; note that this
1221
                  field contains spaces and as such it's harder to
1222
                  parse
1223
                </para>
1224
                <para>
1225
                  if this attribute is not present (e.g. when
1226
                  upgrading from older versions), then "N/A" will be
1227
                  shown instead
1228
                </para>
1229
              </listitem>
1230
            </varlistentry>
1231
            <varlistentry>
1232
              <term>mtime</term>
1233
              <listitem>
1234
                <para>
1235
                  the last modification time of the instance; note
1236
                  that this field contains spaces and as such it's
1237
                  harder to parse
1238
                </para>
1239
                <para>
1240
                  if this attribute is not present (e.g. when
1241
                  upgrading from older versions), then "N/A" will be
1242
                  shown instead
1243
                </para>
1244
              </listitem>
1245
            </varlistentry>
1246

    
1247
            <varlistentry>
1248
              <term>uuid</term>
1249
              <listitem>
1250
                <simpara>Show the UUID of the instance (generated
1251
                automatically by Ganeti)</simpara>
1252
              </listitem>
1253
            </varlistentry>
1254

    
1255
            <varlistentry>
1256
              <term>network_port</term>
1257
              <listitem>
1258
                <simpara>If the instance has a network port assigned
1259
                to it (e.g. for VNC connections), this will be shown,
1260
                otherwise <literal>-</literal> will be
1261
                displayed.</simpara>
1262
              </listitem>
1263
            </varlistentry>
1264
            <varlistentry>
1265
              <term>beparams</term>
1266
              <listitem>
1267
                <simpara>A text format of the entire beparams for the
1268
                instance. It's more useful to select individual fields
1269
                from this dictionary, see below.</simpara>
1270
              </listitem>
1271
            </varlistentry>
1272
            <varlistentry>
1273
              <term>disk.count</term>
1274
              <listitem>
1275
                <simpara>The number of instance disks.</simpara>
1276
              </listitem>
1277
            </varlistentry>
1278
            <varlistentry>
1279
              <term>disk.size/N</term>
1280
              <listitem>
1281
                <simpara>The size of the instance's Nth disk. This is
1282
                a more generic form of the <literal>sda_size</literal>
1283
                and <literal>sdb_size</literal> fields.</simpara>
1284
              </listitem>
1285
            </varlistentry>
1286
            <varlistentry>
1287
              <term>disk.sizes</term>
1288
              <listitem>
1289
                <simpara>A comma-separated list of the disk sizes for
1290
                this instance.</simpara>
1291
              </listitem>
1292
            </varlistentry>
1293
            <varlistentry>
1294
              <term>disk_usage</term>
1295
              <listitem>
1296
                <simpara>The total disk space used by this instance on
1297
                each of its nodes. This is not the instance-visible
1298
                disk size, but the actual disk "cost" of the
1299
                instance.</simpara>
1300
              </listitem>
1301
            </varlistentry>
1302
            <varlistentry>
1303
              <term>nic.mac/N</term>
1304
              <listitem>
1305
                <simpara>The MAC of the Nth instance NIC.</simpara>
1306
              </listitem>
1307
            </varlistentry>
1308
            <varlistentry>
1309
              <term>nic.ip/N</term>
1310
              <listitem>
1311
                <simpara>The IP address of the Nth instance NIC.</simpara>
1312
              </listitem>
1313
            </varlistentry>
1314
            <varlistentry>
1315
              <term>nic.mode/N</term>
1316
              <listitem>
1317
                <simpara>The mode of the Nth instance NIC</simpara>
1318
              </listitem>
1319
            </varlistentry>
1320
            <varlistentry>
1321
              <term>nic.link/N</term>
1322
              <listitem>
1323
                <simpara>The link of the Nth instance NIC</simpara>
1324
              </listitem>
1325
            </varlistentry>
1326
            <varlistentry>
1327
              <term>nic.macs</term>
1328
              <listitem>
1329
                <simpara>A comma-separated list of all the MACs of the
1330
                instance's NICs.</simpara>
1331
              </listitem>
1332
            </varlistentry>
1333
            <varlistentry>
1334
              <term>nic.ips</term>
1335
              <listitem>
1336
                <simpara>A comma-separated list of all the IP
1337
                addresses of the instance's NICs.</simpara>
1338
              </listitem>
1339
            </varlistentry>
1340
            <varlistentry>
1341
              <term>nic.modes</term>
1342
              <listitem>
1343
                <simpara>A comma-separated list of all the modes of the
1344
                instance's NICs.</simpara>
1345
              </listitem>
1346
            </varlistentry>
1347
            <varlistentry>
1348
              <term>nic.links</term>
1349
              <listitem>
1350
                <simpara>A comma-separated list of all the link parameters
1351
                of the instance's NICs.</simpara>
1352
              </listitem>
1353
            </varlistentry>
1354
            <varlistentry>
1355
              <term>nic.count</term>
1356
              <listitem>
1357
                <simpara>The number of instance nics.</simpara>
1358
              </listitem>
1359
            </varlistentry>
1360
            <varlistentry>
1361
              <term>hv/<replaceable>NAME</replaceable></term>
1362
              <listitem>
1363
                <simpara>The value of the hypervisor parameter called
1364
                <replaceable>NAME</replaceable>. For details of what
1365
                hypervisor parameters exist and their meaning, see the
1366
                <command>add</command> command.</simpara>
1367
              </listitem>
1368
            </varlistentry>
1369
            <varlistentry>
1370
              <term>be/memory</term>
1371
              <listitem>
1372
                <simpara>The configured memory for the instance.</simpara>
1373
              </listitem>
1374
            </varlistentry>
1375
            <varlistentry>
1376
              <term>be/vcpus</term>
1377
              <listitem>
1378
                <simpara>The configured number of VCPUs for the
1379
                instance.</simpara>
1380
              </listitem>
1381
            </varlistentry>
1382
            <varlistentry>
1383
              <term>be/auto_balance</term>
1384
              <listitem>
1385
                <simpara>Whether the instance is considered in N+1
1386
                checks.</simpara>
1387
              </listitem>
1388
            </varlistentry>
1389
          </variablelist>
1390
        </para>
1391

    
1392
        <para>
1393
          If the value of the option starts with the character
1394
          <constant>+</constant>, the new field(s) will be added to the
1395
          default list. This allows to quickly see the default list
1396
          plus a few other fields, instead of retyping the entire list
1397
          of fields.
1398
        </para>
1399

    
1400
        <para>
1401
          There is a subtle grouping about the available output
1402
          fields: all fields except for <option>oper_state</option>,
1403
          <option>oper_ram</option> and <option>status</option> are
1404
          configuration value and not run-time values. So if you don't
1405
          select any of the these fields, the query will be satisfied
1406
          instantly from the cluster configuration, without having to
1407
          ask the remote nodes for the data. This can be helpful for
1408
          big clusters when you only want some data and it makes sense
1409
          to specify a reduced set of output fields.
1410
        </para>
1411

    
1412
        <para>The default output field list is:
1413
          <simplelist type="inline">
1414
            <member>name</member>
1415
            <member>os</member>
1416
            <member>pnode</member>
1417
            <member>admin_state</member>
1418
            <member>oper_state</member>
1419
            <member>oper_ram</member>
1420
          </simplelist>.
1421
        </para>
1422
      </refsect3>
1423

    
1424
      <refsect3>
1425
        <title>INFO</title>
1426

    
1427
        <cmdsynopsis>
1428
          <command>info</command>
1429
          <group>
1430
            <arg>-s</arg>
1431
            <arg>--static</arg>
1432
          </group>
1433
          <arg>--roman</arg>
1434
          <group choice="req">
1435
            <arg>--all</arg>
1436
            <arg rep="repeat"><replaceable>instance</replaceable></arg>
1437
          </group>
1438
        </cmdsynopsis>
1439

    
1440
        <para>
1441
          Show detailed information about the given instance(s). This is
1442
          different from <command>list</command> as it shows detailed data
1443
          about the instance's disks (especially useful for the drbd disk
1444
          template).
1445
        </para>
1446

    
1447
        <para>
1448
          If the option <option>-s</option> is used, only information
1449
          available in the configuration file is returned, without
1450
          querying nodes, making the operation faster.
1451
        </para>
1452

    
1453
        <para>
1454
          Use the <option>--all</option> to get info about all instances,
1455
          rather than explicitly passing the ones you're interested in.
1456
        </para>
1457

    
1458
        <para>
1459
          The <option>--roman</option> option can be used to cause envy among
1460
          people who like ancient cultures, but are stuck with non-latin-friendly
1461
          cluster virtualization technologies.
1462
        </para>
1463

    
1464
      </refsect3>
1465

    
1466
      <refsect3>
1467
        <title>MODIFY</title>
1468

    
1469
        <cmdsynopsis>
1470
          <command>modify</command>
1471
          <sbr>
1472
          <arg choice="opt">-H <replaceable>HYPERVISOR_PARAMETERS</replaceable></arg>
1473
          <sbr>
1474
          <arg choice="opt">-B <replaceable>BACKEND_PARAMETERS</replaceable></arg>
1475
          <sbr>
1476
          <group>
1477
            <arg>--net add<replaceable><optional>:options</optional></replaceable></arg>
1478
            <arg>--net remove</arg>
1479
            <arg>--net <replaceable>N:options</replaceable></arg>
1480
          </group>
1481
          <sbr>
1482
          <group>
1483
            <arg>--disk add:size=<replaceable>SIZE</replaceable></arg>
1484
            <arg>--disk remove</arg>
1485
            <arg>--disk <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></arg>
1486
          </group>
1487

    
1488
          <sbr>
1489
          <arg>-t<group choice="req">
1490
              <arg>plain</arg>
1491
              <arg>drbd</arg>
1492
            </group></arg>
1493

    
1494
          <sbr>
1495
            <arg>--os-name=<replaceable>OS</replaceable> <arg>--force-variant</arg></arg>
1496

    
1497
          <sbr>
1498
          <arg>--submit</arg>
1499
          <sbr>
1500
          <arg choice="req"><replaceable>instance</replaceable></arg>
1501
        </cmdsynopsis>
1502

    
1503
        <para>
1504
          Modifies the memory size, number of vcpus, ip address, MAC
1505
          address and/or nic parameters for an instance. It can also
1506
          add and remove disks and NICs to/from the instance. Note
1507
          that you need to give at least one of the arguments, otherwise
1508
          the command complains.
1509
        </para>
1510

    
1511
        <para>
1512
          The <option>-H</option> option specifies hypervisor options
1513
          in the form of <userinput>name=value[,...]</userinput>. For details which options can be specified, see the <command>add</command> command.
1514
        </para>
1515

    
1516
        <para>
1517
          The <option>-t</option> option will change the disk template
1518
          of the instance. Currently only conversions between the
1519
          plain and drbd disk templates are supported, and the
1520
          instance must be stopped before attempting the conversion.
1521
        </para>
1522

    
1523
        <para>
1524
          The <option>--disk
1525
          add:size=<replaceable>SIZE</replaceable></option> option
1526
          adds a disk to the instance. The <option>--disk
1527
          remove</option> will remove the last disk of the
1528
          instance. The <option>--disk
1529
          <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></option>
1530
          option will change the mode of the Nth disk of the instance
1531
          between read-only (<literal>ro</literal>) and read-write
1532
          (<literal>rw</literal>).
1533
        </para>
1534

    
1535
        <para>
1536
          The <option>--net
1537
          add:<replaceable>options</replaceable></option> option will
1538
          add a new NIC to the instance. The available options are the
1539
          same as in the <command>add</command> command (mac, ip, link,
1540
          mode). The <option>--net remove</option> will remove the
1541
          last NIC of the instance, while the <option>--net
1542
          <replaceable>N</replaceable>:<replaceable>options</replaceable></option>
1543
          option will change the parameters of the Nth instance NIC.
1544
        </para>
1545

    
1546
        <para>
1547
          The option <option>--os-name</option> will change the OS
1548
          name for the instance (without reinstallation). In case an
1549
          OS variant is specified that is not found, then by default
1550
          the modification is refused,
1551
          unless <option>--force-variant</option> is passed. An
1552
          invalid OS will also be refused, unless
1553
          the <option>--force</option> option is given.
1554
        </para>
1555

    
1556
        <para>
1557
          The <option>--submit</option> option is used to send the job to
1558
          the master daemon but not wait for its completion. The job
1559
          ID will be shown so that it can be examined via
1560
          <command>gnt-job info</command>.
1561
        </para>
1562

    
1563
        <para>
1564
          All the changes take effect at the next restart. If the
1565
          instance is running, there is no effect on the instance.
1566
        </para>
1567
      </refsect3>
1568

    
1569
      <refsect3>
1570
        <title>REINSTALL</title>
1571

    
1572
        <cmdsynopsis>
1573
          <command>reinstall</command>
1574
          <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
1575
          <arg>--select-os</arg>
1576
          <arg choice="opt">-f <replaceable>force</replaceable></arg>
1577
          <arg>--force-multiple</arg>
1578
          <sbr>
1579
          <group choice="opt">
1580
            <arg>--instance</arg>
1581
            <arg>--node</arg>
1582
            <arg>--primary</arg>
1583
            <arg>--secondary</arg>
1584
            <arg>--all</arg>
1585
          </group>
1586
          <arg>--submit</arg>
1587
          <arg choice="opt" rep="repeat"><replaceable>instance</replaceable></arg>
1588
        </cmdsynopsis>
1589

    
1590
        <para>
1591
          Reinstalls the operating system on the given instance(s). The
1592
          instance(s) must be stopped when running this command. If the
1593
          <option>--os-type</option> is specified, the operating
1594
          system is changed.
1595
        </para>
1596

    
1597
        <para>
1598
          The <option>--select-os</option> option switches to an
1599
          interactive OS reinstall. The user is prompted to select the OS
1600
          template from the list of available OS templates.
1601
        </para>
1602

    
1603
        <para>
1604
          Since this is a potentially dangerous command, the user will
1605
          be required to confirm this action, unless the
1606
          <option>-f</option> flag is passed. When multiple instances
1607
          are selected (either by passing multiple arguments or by
1608
          using the <option>--node</option>,
1609
          <option>--primary</option>, <option>--secondary</option> or
1610
          <option>--all</option> options), the user must pass both the
1611
          <option>--force</option> and
1612
          <option>--force-multiple</option> options to skip the
1613
          interactive confirmation.
1614
        </para>
1615

    
1616
        <para>
1617
          The <option>--submit</option> option is used to send the job to
1618
          the master daemon but not wait for its completion. The job
1619
          ID will be shown so that it can be examined via
1620
          <command>gnt-job info</command>.
1621
        </para>
1622

    
1623

    
1624
      </refsect3>
1625

    
1626
      <refsect3>
1627
        <title>RENAME</title>
1628

    
1629
        <cmdsynopsis>
1630
          <command>rename</command>
1631
          <arg>--no-ip-check</arg>
1632
          <arg>--submit</arg>
1633
          <arg choice="req"><replaceable>instance</replaceable></arg>
1634
          <arg choice="req"><replaceable>new_name</replaceable></arg>
1635
        </cmdsynopsis>
1636

    
1637
        <para>
1638
          Renames the given instance. The instance must be stopped
1639
          when running this command. The requirements for the new name
1640
          are the same as for adding an instance: the new name must be
1641
          resolvable and the IP it resolves to must not be reachable
1642
          (in order to prevent duplicate IPs the next time the
1643
          instance is started). The IP test can be skipped if the
1644
          <option>--no-ip-check</option> option is passed.
1645
        </para>
1646

    
1647
        <para>
1648
          The <option>--submit</option> option is used to send the job to
1649
          the master daemon but not wait for its completion. The job
1650
          ID will be shown so that it can be examined via
1651
          <command>gnt-job info</command>.
1652
        </para>
1653

    
1654
      </refsect3>
1655

    
1656
    </refsect2>
1657

    
1658
    <refsect2>
1659
      <title>Starting/stopping/connecting to console</title>
1660

    
1661
      <refsect3>
1662
        <title>STARTUP</title>
1663

    
1664
        <cmdsynopsis>
1665
          <command>startup</command>
1666
          <sbr>
1667
          <arg>--force</arg>
1668
          <sbr>
1669
          <arg>--force-multiple</arg>
1670
          <sbr>
1671
          <group choice="opt">
1672
            <arg>--instance</arg>
1673
            <arg>--node</arg>
1674
            <arg>--primary</arg>
1675
            <arg>--secondary</arg>
1676
            <arg>--all</arg>
1677
            <arg>--tags</arg>
1678
            <arg>--node-tags</arg>
1679
            <arg>--pri-node-tags</arg>
1680
            <arg>--sec-node-tags</arg>
1681
          </group>
1682
          <sbr>
1683
          <arg>-H <option>key=value...</option></arg>
1684
          <arg>-B <option>key=value...</option></arg>
1685
          <sbr>
1686
          <arg>--submit</arg>
1687
          <sbr>
1688
          <arg choice="opt"
1689
          rep="repeat"><replaceable>name</replaceable></arg>
1690
        </cmdsynopsis>
1691

    
1692
        <para>
1693
          Starts one or more instances, depending on the following
1694
          options. The four available modes are:
1695
          <variablelist>
1696
            <varlistentry>
1697
              <term><option>--instance</option></term>
1698
              <listitem>
1699
                <simpara>will start the instances given as arguments
1700
                (at least one argument required); this is the default
1701
                selection</simpara>
1702
              </listitem>
1703
            </varlistentry>
1704
            <varlistentry>
1705
              <term>--node</term>
1706
              <listitem>
1707
                <simpara>will start the instances who have the given
1708
                node as either primary or secondary</simpara>
1709
              </listitem>
1710
            </varlistentry>
1711
            <varlistentry>
1712
              <term><option>--primary</option></term>
1713
              <listitem>
1714
                <simpara>will start all instances whose primary node
1715
                is in the list of nodes passed as arguments (at least
1716
                one node required)</simpara>
1717
              </listitem>
1718
            </varlistentry>
1719
            <varlistentry>
1720
              <term><option>--secondary</option></term>
1721
              <listitem>
1722
                <simpara>will start all instances whose secondary node
1723
                is in the list of nodes passed as arguments (at least
1724
                one node required)</simpara>
1725
              </listitem>
1726
            </varlistentry>
1727
            <varlistentry>
1728
              <term>--all</term>
1729
              <listitem>
1730
                <simpara>will start all instances in the cluster (no
1731
                arguments accepted)</simpara>
1732
              </listitem>
1733
            </varlistentry>
1734
            <varlistentry>
1735
              <term>--tags</term>
1736
              <listitem>
1737
                <simpara>will start all instances in the cluster with
1738
                the tags given as arguments</simpara>
1739
              </listitem>
1740
            </varlistentry>
1741
            <varlistentry>
1742
              <term>--node-tags</term>
1743
              <listitem>
1744
                <simpara>will start all instances in the cluster on
1745
                nodes with the tags given as arguments</simpara>
1746
              </listitem>
1747
            </varlistentry>
1748
            <varlistentry>
1749
              <term>--pri-node-tags</term>
1750
              <listitem>
1751
                <simpara>will start all instances in the cluster on
1752
                primary nodes with the tags given as
1753
                arguments</simpara>
1754
              </listitem>
1755
            </varlistentry>
1756
            <varlistentry>
1757
              <term>--sec-node-tags</term>
1758
              <listitem>
1759
                <simpara>will start all instances in the cluster on
1760
                secondary nodes with the tags given as
1761
                arguments</simpara>
1762
              </listitem>
1763
            </varlistentry>
1764
          </variablelist>
1765
        </para>
1766

    
1767
        <para>
1768
          Note that although you can pass more than one selection
1769
          option, the last one wins, so in order to guarantee the
1770
          desired result, don't pass more than one such option.
1771
        </para>
1772

    
1773
        <para>
1774
          Use <option>--force</option> to start even if secondary disks are
1775
          failing.
1776
        </para>
1777

    
1778
        <para>
1779
          The <option>--force-multiple</option> will skip the
1780
          interactive confirmation in the case the more than one
1781
          instance will be affected.
1782
        </para>
1783

    
1784
        <para>
1785
          The <option>-H</option> and <option>-B</option> options
1786
          specify temporary hypervisor and backend parameters that can
1787
          be used to start an instance with modified parameters. They
1788
          can be useful for quick testing without having to modify an
1789
          instance back and forth, e.g.:
1790
          <screen>
1791
# gnt-instance start -H root_args="single" instance1
1792
# gnt-instance start -B memory=2048 instance2
1793
          </screen>
1794
          The first form will start the instance
1795
          <userinput>instance1</userinput> in single-user mode, and
1796
          the instance <userinput>instance2</userinput> with 2GB of
1797
          RAM (this time only, unless that is the actual instance
1798
          memory size already). Note that the values override the
1799
          instance parameters (and not extend them): an instance with
1800
          "root_args=ro" when started with <userinput>-H
1801
          root_args=single</userinput> will result in "single", not
1802
          "ro single".
1803
        </para>
1804

    
1805
        <para>
1806
          The <option>--submit</option> option is used to send the job to
1807
          the master daemon but not wait for its completion. The job
1808
          ID will be shown so that it can be examined via
1809
          <command>gnt-job info</command>.
1810
        </para>
1811

    
1812
        <para>
1813
          Example:
1814
          <screen>
1815
# gnt-instance start instance1.example.com
1816
# gnt-instance start --node node1.example.com node2.example.com
1817
# gnt-instance start --all
1818
          </screen>
1819
        </para>
1820
      </refsect3>
1821

    
1822
      <refsect3>
1823
        <title>SHUTDOWN</title>
1824

    
1825
        <cmdsynopsis>
1826
          <command>shutdown</command>
1827
          <sbr>
1828
          <arg>--timeout=<replaceable>N</replaceable></arg>
1829
          <sbr>
1830
          <arg>--force-multiple</arg>
1831
          <sbr>
1832
          <group choice="opt">
1833
            <arg>--instance</arg>
1834
            <arg>--node</arg>
1835
            <arg>--primary</arg>
1836
            <arg>--secondary</arg>
1837
            <arg>--all</arg>
1838
            <arg>--tags</arg>
1839
            <arg>--node-tags</arg>
1840
            <arg>--pri-node-tags</arg>
1841
            <arg>--sec-node-tags</arg>
1842
          </group>
1843
          <sbr>
1844
          <arg>--submit</arg>
1845
          <sbr>
1846
          <arg choice="opt"
1847
          rep="repeat"><replaceable>name</replaceable></arg>
1848
        </cmdsynopsis>
1849

    
1850
        <para>
1851
          Stops one or more instances. If the instance cannot be
1852
          cleanly stopped during a hardcoded interval (currently 2
1853
          minutes), it will forcibly stop the instance (equivalent to
1854
          switching off the power on a physical machine).
1855
        </para>
1856

    
1857
        <para>
1858
          The <option>--timeout</option> is used to specify how much time to
1859
          wait before forcing the shutdown (xm destroy in xen, killing the kvm
1860
          process, for kvm). By default two minutes are given to each instance
1861
          to stop.
1862
        </para>
1863

    
1864
        <para>
1865
          The <option>--instance</option>, <option>--node</option>,
1866
          <option>--primary</option>, <option>--secondary</option>,
1867
          <option>--all</option>, <option>--tags</option>,
1868
          <option>--node-tags</option>, <option>--pri-node-tags</option> and
1869
          <option>--sec-node-tags</option> options are similar as for the
1870
          <command>startup</command> command and they influence the
1871
          actual instances being shutdown.
1872
        </para>
1873

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

    
1881

    
1882
        <para>
1883
          Example:
1884
          <screen>
1885
# gnt-instance shutdown instance1.example.com
1886
# gnt-instance shutdown --all
1887
          </screen>
1888
        </para>
1889
      </refsect3>
1890

    
1891
      <refsect3>
1892
        <title>REBOOT</title>
1893

    
1894
        <cmdsynopsis>
1895
          <command>reboot</command>
1896
          <sbr>
1897
          <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
1898
          <sbr>
1899
          <arg>--ignore-secondaries</arg>
1900
          <sbr>
1901
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
1902
          <sbr>
1903
          <arg>--force-multiple</arg>
1904
          <sbr>
1905
          <group choice="opt">
1906
            <arg>--instance</arg>
1907
            <arg>--node</arg>
1908
            <arg>--primary</arg>
1909
            <arg>--secondary</arg>
1910
            <arg>--all</arg>
1911
            <arg>--tags</arg>
1912
            <arg>--node-tags</arg>
1913
            <arg>--pri-node-tags</arg>
1914
            <arg>--sec-node-tags</arg>
1915
          </group>
1916
          <sbr>
1917
          <arg>--submit</arg>
1918
          <sbr>
1919
          <arg choice="opt"
1920
          rep="repeat"><replaceable>name</replaceable></arg>
1921
        </cmdsynopsis>
1922

    
1923
        <para>
1924
          Reboots one or more instances. The type of reboot depends on
1925
          the value of <option>--type</option>. A soft reboot does a
1926
          hypervisor reboot, a hard reboot does a instance stop,
1927
          recreates the hypervisor config for the instance and
1928
          starts the instance. A full reboot does the equivalent
1929
          of <command>gnt-instance shutdown &amp;&amp; gnt-instance
1930
          startup</command>. The default is hard reboot.
1931
        </para>
1932

    
1933
        <para>
1934
          For the hard reboot the option
1935
          <option>--ignore-secondaries</option> ignores errors for the
1936
          secondary node while re-assembling the instance disks.
1937
        </para>
1938

    
1939
        <para>
1940
          The <option>--instance</option>, <option>--node</option>,
1941
          <option>--primary</option>, <option>--secondary</option>,
1942
          <option>--all</option>, <option>--tags</option>,
1943
          <option>--node-tags</option>, <option>--pri-node-tags</option> and
1944
          <option>--sec-node-tags</option> options are similar as for the
1945
          <command>startup</command> command and they influence the
1946
          actual instances being rebooted.
1947
        </para>
1948

    
1949
        <para>
1950
          The <option>--shutdown-timeout</option> is used to specify how
1951
          much time to wait before forcing the shutdown (xm destroy in xen,
1952
          killing the kvm process, for kvm). By default two minutes are
1953
          given to each instance to stop.
1954
        </para>
1955

    
1956
        <para>
1957
          The <option>--force-multiple</option> will skip the
1958
          interactive confirmation in the case the more than one
1959
          instance will be affected.
1960
        </para>
1961

    
1962
        <para>
1963
          Example:
1964
          <screen>
1965
# gnt-instance reboot instance1.example.com
1966
# gnt-instance reboot --type=full instance1.example.com
1967
          </screen>
1968
        </para>
1969
      </refsect3>
1970

    
1971
      <refsect3>
1972
        <title>CONSOLE</title>
1973
        <cmdsynopsis>
1974
          <command>console</command>
1975
          <arg choice="opt">--show-cmd</arg>
1976
          <arg choice="req"><replaceable>instance</replaceable></arg>
1977
        </cmdsynopsis>
1978

    
1979
        <para>
1980
          Connects to the console of the given instance. If the
1981
          instance is not up, an error is returned. Use the
1982
          <option>--show-cmd</option> option to display the command
1983
          instead of executing it.
1984
        </para>
1985

    
1986
        <para>
1987
          For HVM instances, this will attempt to connect to the
1988
          serial console of the instance. To connect to the
1989
          virtualized "physical" console of a HVM instance, use a VNC
1990
          client with the connection info from the
1991
          <command>info</command> command.
1992
        </para>
1993

    
1994
        <para>
1995
          Example:
1996
          <screen>
1997
# gnt-instance console instance1.example.com
1998
          </screen>
1999
        </para>
2000
      </refsect3>
2001

    
2002
    </refsect2>
2003

    
2004
    <refsect2>
2005
      <title>Disk management</title>
2006

    
2007
      <refsect3>
2008
        <title>REPLACE-DISKS</title>
2009

    
2010
        <cmdsynopsis>
2011
          <command>replace-disks</command>
2012
          <arg>--submit</arg>
2013
          <arg>--early-release</arg>
2014
          <arg choice="req">-p</arg>
2015
          <arg>--disks <replaceable>idx</replaceable></arg>
2016
          <arg choice="req"><replaceable>instance</replaceable></arg>
2017
        </cmdsynopsis>
2018

    
2019
        <cmdsynopsis>
2020
          <command>replace-disks</command>
2021
          <arg>--submit</arg>
2022
          <arg>--early-release</arg>
2023
          <arg choice="req">-s</arg>
2024
          <arg>--disks <replaceable>idx</replaceable></arg>
2025
          <arg choice="req"><replaceable>instance</replaceable></arg>
2026
        </cmdsynopsis>
2027

    
2028
        <cmdsynopsis>
2029
          <command>replace-disks</command>
2030
          <arg>--submit</arg>
2031
          <arg>--early-release</arg>
2032
          <group choice="req">
2033
            <arg>--iallocator <replaceable>name</replaceable></arg>
2034
            <arg>--new-secondary <replaceable>NODE</replaceable></arg>
2035
          </group>
2036

    
2037
          <arg choice="req"><replaceable>instance</replaceable></arg>
2038
        </cmdsynopsis>
2039

    
2040
        <cmdsynopsis>
2041
          <command>replace-disks</command>
2042
          <arg>--submit</arg>
2043
          <arg>--early-release</arg>
2044
          <arg choice="req">--auto</arg>
2045
          <arg choice="req"><replaceable>instance</replaceable></arg>
2046
        </cmdsynopsis>
2047

    
2048
        <para>
2049
          This command is a generalized form for replacing disks. It
2050
          is currently only valid for the mirrored (DRBD) disk
2051
          template.
2052
        </para>
2053

    
2054
        <para>
2055
          The first form (when passing the <option>-p</option> option)
2056
          will replace the disks on the primary, while the second form
2057
          (when passing the <option>-s</option> option will replace
2058
          the disks on the secondary node. For these two cases (as the
2059
          node doesn't change), it is possible to only run the replace
2060
          for a subset of the disks, using the option
2061
          <option>--disks</option> which takes a list of
2062
          comma-delimited disk indices (zero-based),
2063
          e.g. <userinput>0,2</userinput> to replace only the first
2064
          and third disks.
2065
        </para>
2066

    
2067
        <para>
2068
          The third form (when passing either the
2069
          <option>--iallocator</option> or the
2070
          <option>--new-secondary</option> option) is designed to
2071
          change secondary node of the instance.  Specifying
2072
          <option>--iallocator</option> makes the new secondary be
2073
          selected automatically by the specified allocator plugin,
2074
          otherwise the new secondary node will be the one chosen
2075
          manually via the <option>--new-secondary</option> option.
2076
        </para>
2077

    
2078
        <para>
2079
          The fourth form (when using <option>--auto</option>) will
2080
          automatically determine which disks of an instance are faulty and
2081
          replace them within the same node. The <option>--auto</option>
2082
          option works only when an instance has only faulty disks on
2083
          either the primary or secondary node; it doesn't work when
2084
          both sides have faulty disks.
2085
        </para>
2086

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

    
2094
        <para>
2095
          The <option>--early-release</option> changes the code so
2096
          that the old storage on secondary node(s) is removed early
2097
          (before the resync is completed) and the internal Ganeti
2098
          locks for the current (and new, if any) secondary node are
2099
          also released, thus allowing more parallelism in the cluster
2100
          operation. This should be used only when recovering from a
2101
          disk failure on the current secondary (thus the old storage
2102
          is already broken) or when the storage on the primary node
2103
          is known to be fine (thus we won't need the old storage for
2104
          potential recovery).
2105
        </para>
2106

    
2107
        <para>
2108
          Note that it is not possible to select an offline or drained
2109
          node as a new secondary.
2110
        </para>
2111

    
2112
      </refsect3>
2113

    
2114
      <refsect3>
2115
        <title>ACTIVATE-DISKS</title>
2116

    
2117
        <cmdsynopsis>
2118
          <command>activate-disks</command>
2119
          <arg>--submit</arg>
2120
          <arg>--ignore-size</arg>
2121
          <arg choice="req"><replaceable>instance</replaceable></arg>
2122
        </cmdsynopsis>
2123
        <para>
2124
          Activates the block devices of the given instance. If
2125
          successful, the command will show the location and name of
2126
          the block devices:
2127
          <screen>
2128
node1.example.com:disk/0:/dev/drbd0
2129
node1.example.com:disk/1:/dev/drbd1
2130
          </screen>
2131

    
2132
          In this example, <emphasis>node1.example.com</emphasis> is
2133
          the name of the node on which the devices have been
2134
          activated. The <emphasis>disk/0</emphasis> and
2135
          <emphasis>disk/1</emphasis> are the Ganeti-names of the
2136
          instance disks; how they are visible inside the instance is
2137
          hypervisor-specific. <emphasis>/dev/drbd0</emphasis> and
2138
          <emphasis>/dev/drbd1</emphasis> are the actual block devices
2139
          as visible on the node.
2140
        </para>
2141

    
2142
        <para>
2143
          The <option>--submit</option> option is used to send the job to
2144
          the master daemon but not wait for its completion. The job
2145
          ID will be shown so that it can be examined via
2146
          <command>gnt-job info</command>.
2147
        </para>
2148

    
2149
        <para>
2150
          The <option>--ignore-size</option> option can be used to
2151
          activate disks ignoring the currently configured size in
2152
          Ganeti. This can be used in cases where the configuration
2153
          has gotten out of sync with the real-world (e.g. after a
2154
          partially-failed grow-disk operation or due to rounding in
2155
          LVM devices). This should not be used in normal cases, but
2156
          only when activate-disks fails without it.
2157
        </para>
2158

    
2159
        <para>
2160
          Note that it is safe to run this command while the instance
2161
          is already running.
2162
        </para>
2163
      </refsect3>
2164

    
2165
      <refsect3>
2166
        <title>DEACTIVATE-DISKS</title>
2167

    
2168
        <cmdsynopsis>
2169
          <command>deactivate-disks</command>
2170
          <arg>--submit</arg>
2171
          <arg choice="req"><replaceable>instance</replaceable></arg>
2172
        </cmdsynopsis>
2173
        <para>
2174
          De-activates the block devices of the given instance. Note
2175
          that if you run this command for an instance with a drbd
2176
          disk template, while it is running, it will not be able to
2177
          shutdown the block devices on the primary node, but it will
2178
          shutdown the block devices on the secondary nodes, thus
2179
          breaking the replication.
2180
        </para>
2181

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

    
2189
      </refsect3>
2190

    
2191
      <refsect3>
2192
        <title>GROW-DISK</title>
2193
        <cmdsynopsis>
2194
          <command>grow-disk</command>
2195
          <arg>--no-wait-for-sync</arg>
2196
          <arg>--submit</arg>
2197
          <arg choice="req"><replaceable>instance</replaceable></arg>
2198
          <arg choice="req"><replaceable>disk</replaceable></arg>
2199
          <arg choice="req"><replaceable>amount</replaceable></arg>
2200
        </cmdsynopsis>
2201

    
2202
        <para>
2203
          Grows an instance's disk. This is only possible for
2204
          instances having a <literal>plain</literal> or
2205
          <literal>drbd</literal> disk template.
2206
        </para>
2207

    
2208
        <para>
2209
          Note that this command only change the block device size; it
2210
          will not grow the actual filesystems, partitions, etc. that
2211
          live on that disk. Usually, you will need to:
2212
          <orderedlist>
2213
            <listitem>
2214
              <simpara>use <command>gnt-instance grow-disk</command></simpara>
2215
            </listitem>
2216
            <listitem>
2217
              <simpara>reboot the instance (later, at a convenient
2218
              time)</simpara>
2219
            </listitem>
2220
            <listitem>
2221
              <simpara>use a filesystem resizer, such as
2222
              <citerefentry> <refentrytitle>ext2online</refentrytitle>
2223
              <manvolnum>8</manvolnum> </citerefentry> or
2224
              <citerefentry> <refentrytitle>xfs_growfs</refentrytitle>
2225
              <manvolnum>8</manvolnum> </citerefentry> to resize the
2226
              filesystem, or use <citerefentry>
2227
              <refentrytitle>fdisk</refentrytitle>
2228
              <manvolnum>8</manvolnum> </citerefentry> to change the
2229
              partition table on the disk
2230
              </simpara>
2231
            </listitem>
2232
          </orderedlist>
2233
        </para>
2234

    
2235

    
2236
        <para>
2237
          The <replaceable>disk</replaceable> argument is the index of
2238
          the instance disk to grow. The
2239
          <replaceable>amount</replaceable> argument is given either
2240
          as a number (and it represents the amount to increase the
2241
          disk with in mebibytes) or can be given similar to the
2242
          arguments in the create instance operation, with a suffix
2243
          denoting the unit.
2244
        </para>
2245

    
2246
        <para>
2247
          Note that the disk grow operation might complete on one node
2248
          but fail on the other; this will leave the instance with
2249
          different-sized LVs on the two nodes, but this will not
2250
          create problems (except for unused space).
2251
        </para>
2252

    
2253
        <para>
2254
          If you do not want gnt-instance to wait for the new disk
2255
          region to be synced, use the
2256
          <option>--no-wait-for-sync</option> option.
2257
        </para>
2258

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

    
2266

    
2267
        <para>Example (increase the first disk for instance1 by 16GiB):
2268
          <screen>
2269
# gnt-instance grow-disk instance1.example.com 0 16g
2270
          </screen>
2271
        </para>
2272

    
2273
        <para>
2274
          Also note that disk shrinking is not supported; use
2275
          <command>gnt-backup export</command> and then
2276
          <command>gnt-backup import</command> to reduce the disk size
2277
          of an instance.
2278
        </para>
2279
      </refsect3>
2280

    
2281
      <refsect3>
2282
        <title>RECREATE-DISKS</title>
2283

    
2284
        <cmdsynopsis>
2285
          <command>recreate-disks</command>
2286
          <arg>--submit</arg>
2287
          <arg>--disks=<option>indices</option></arg>
2288
          <arg choice="req"><replaceable>instance</replaceable></arg>
2289
        </cmdsynopsis>
2290
        <para>
2291
          Recreates the disks of the given instance, or only a subset
2292
          of the disks (if the option <option>disks</option> is
2293
          passed, which must be a comma-separated list of disk
2294
          indices, starting from zero).
2295
        </para>
2296

    
2297
        <para>
2298
          Note that this functionality should only be used for missing
2299
          disks; if any of the given disks already exists, the
2300
          operation will fail. While this is suboptimal,
2301
          recreate-disks should hopefully not be needed in normal
2302
          operation and as such the impact of this is low.
2303
        </para>
2304

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

    
2312
      </refsect3>
2313

    
2314
    </refsect2>
2315

    
2316
    <refsect2>
2317
      <title>Recovery</title>
2318

    
2319
      <refsect3>
2320
        <title>FAILOVER</title>
2321

    
2322
        <cmdsynopsis>
2323
          <command>failover</command>
2324
          <arg>-f</arg>
2325
          <arg>--ignore-consistency</arg>
2326
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2327
          <arg>--submit</arg>
2328
          <arg choice="req"><replaceable>instance</replaceable></arg>
2329
        </cmdsynopsis>
2330

    
2331
        <para>
2332
          Failover will fail the instance over its secondary
2333
          node. This works only for instances having a drbd disk
2334
          template.
2335
        </para>
2336

    
2337
        <para>
2338
          Normally the failover will check the consistency of the
2339
          disks before failing over the instance. If you are trying to
2340
          migrate instances off a dead node, this will fail. Use the
2341
          <option>--ignore-consistency</option> option for this
2342
          purpose. Note that this option can be dangerous as errors in
2343
          shutting down the instance will be ignored, resulting in
2344
          possibly having the instance running on two machines in
2345
          parallel (on disconnected DRBD drives).
2346
        </para>
2347

    
2348
        <para>
2349
          The <option>--shutdown-timeout</option> is used to specify how
2350
          much time to wait before forcing the shutdown (xm destroy in xen,
2351
          killing the kvm process, for kvm). By default two minutes are
2352
          given to each instance to stop.
2353
        </para>
2354

    
2355
        <para>
2356
          The <option>--submit</option> option is used to send the job to
2357
          the master daemon but not wait for its completion. The job
2358
          ID will be shown so that it can be examined via
2359
          <command>gnt-job info</command>.
2360
        </para>
2361

    
2362
        <para>
2363
          Example:
2364
          <screen>
2365
# gnt-instance failover instance1.example.com
2366
          </screen>
2367
        </para>
2368
      </refsect3>
2369

    
2370
      <refsect3>
2371
        <title>MIGRATE</title>
2372

    
2373
        <cmdsynopsis>
2374
          <command>migrate</command>
2375
          <arg>-f</arg>
2376
          <arg choice="req">--cleanup</arg>
2377
          <arg choice="req"><replaceable>instance</replaceable></arg>
2378
        </cmdsynopsis>
2379

    
2380
        <cmdsynopsis>
2381
          <command>migrate</command>
2382
          <arg>-f</arg>
2383
          <arg>--non-live</arg>
2384
          <arg choice="req"><replaceable>instance</replaceable></arg>
2385
        </cmdsynopsis>
2386

    
2387
        <para>
2388
          Migrate will move the instance to its secondary node without
2389
          shutdown. It only works for instances having the drbd8 disk
2390
          template type.
2391
        </para>
2392

    
2393
        <para>
2394
          The migration command needs a perfectly healthy instance, as
2395
          we rely on the dual-master capability of drbd8 and the disks
2396
          of the instance are not allowed to be degraded.
2397
        </para>
2398

    
2399
        <para>
2400
          The <option>--non-live</option> option will switch (for the
2401
          hypervisors that support it) between a "fully live"
2402
          (i.e. the interruption is as minimal as possible) migration
2403
          and one in which the instance is frozen, its state saved and
2404
          transported to the remote node, and then resumed there. This
2405
          all depends on the hypervisor support for two different
2406
          methods. In any case, it is not an error to pass this
2407
          parameter (it will just be ignored if the hypervisor doesn't
2408
          support it).
2409
        </para>
2410

    
2411
        <para>
2412
          If the <option>--cleanup</option> option is passed, the
2413
          operation changes from migration to attempting recovery from
2414
          a failed previous migration. In this mode, Ganeti checks if
2415
          the instance runs on the correct node (and updates its
2416
          configuration if not) and ensures the instances's disks are
2417
          configured correctly. In this mode, the
2418
          <option>--non-live</option> option is ignored.
2419
        </para>
2420

    
2421
        <para>
2422
          The option <option>-f</option> will skip the prompting for
2423
          confirmation.
2424
        </para>
2425
        <para>
2426
          Example (and expected output):
2427
          <screen>
2428
# gnt-instance migrate instance1
2429
Migrate will happen to the instance instance1. Note that migration is
2430
**experimental** in this version. This might impact the instance if
2431
anything goes wrong. Continue?
2432
y/[n]/?: y
2433
* checking disk consistency between source and target
2434
* ensuring the target is in secondary mode
2435
* changing disks into dual-master mode
2436
 - INFO: Waiting for instance instance1 to sync disks.
2437
 - INFO: Instance instance1's disks are in sync.
2438
* migrating instance to node2.example.com
2439
* changing the instance's disks on source node to secondary
2440
 - INFO: Waiting for instance instance1 to sync disks.
2441
 - INFO: Instance instance1's disks are in sync.
2442
* changing the instance's disks to single-master
2443
#
2444
          </screen>
2445
        </para>
2446
      </refsect3>
2447

    
2448
      <refsect3>
2449
        <title>MOVE</title>
2450

    
2451
        <cmdsynopsis>
2452
          <command>move</command>
2453
          <arg>-f</arg>
2454
          <arg>-n <replaceable>node</replaceable></arg>
2455
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2456
          <arg>--submit</arg>
2457
          <arg choice="req"><replaceable>instance</replaceable></arg>
2458
        </cmdsynopsis>
2459

    
2460
        <para>
2461
          Move will move the instance to an arbitrary node in the
2462
          cluster. This works only for instances having a plain or
2463
          file disk template.
2464
        </para>
2465

    
2466
        <para>
2467
          Note that since this operation is done via data copy, it
2468
          will take a long time for big disks (similar to
2469
          replace-disks for a drbd instance).
2470
        </para>
2471

    
2472
        <para>
2473
          The <option>--shutdown-timeout</option> is used to specify how
2474
          much time to wait before forcing the shutdown (xm destroy in xen,
2475
          killing the kvm process, for kvm). By default two minutes are
2476
          given to each instance to stop.
2477
        </para>
2478

    
2479
        <para>
2480
          The <option>--submit</option> option is used to send the job to
2481
          the master daemon but not wait for its completion. The job
2482
          ID will be shown so that it can be examined via
2483
          <command>gnt-job info</command>.
2484
        </para>
2485

    
2486
        <para>
2487
          Example:
2488
          <screen>
2489
# gnt-instance move -n node3.example.com instance1.example.com
2490
          </screen>
2491
        </para>
2492
      </refsect3>
2493

    
2494
    </refsect2>
2495

    
2496
    <refsect2>
2497
      <title>TAGS</title>
2498

    
2499
    <refsect3>
2500
        <title>ADD-TAGS</title>
2501

    
2502
        <cmdsynopsis>
2503
          <command>add-tags</command>
2504
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2505
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2506
          <arg choice="req"
2507
            rep="repeat"><replaceable>tag</replaceable></arg>
2508
        </cmdsynopsis>
2509

    
2510
        <para>
2511
          Add tags to the given instance. If any of the tags contains
2512
          invalid characters, the entire operation will abort.
2513
        </para>
2514
        <para>
2515
          If the <option>--from</option> option is given, the list of
2516
          tags will be extended with the contents of that file (each
2517
          line becomes a tag). In this case, there is not need to pass
2518
          tags on the command line (if you do, both sources will be
2519
          used). A file name of - will be interpreted as stdin.
2520
        </para>
2521
      </refsect3>
2522

    
2523
      <refsect3>
2524
        <title>LIST-TAGS</title>
2525

    
2526
        <cmdsynopsis>
2527
          <command>list-tags</command>
2528
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2529
        </cmdsynopsis>
2530

    
2531
        <para>List the tags of the given instance.</para>
2532
      </refsect3>
2533

    
2534
      <refsect3>
2535
        <title>REMOVE-TAGS</title>
2536
        <cmdsynopsis>
2537
          <command>remove-tags</command>
2538
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2539
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2540
          <arg choice="req"
2541
            rep="repeat"><replaceable>tag</replaceable></arg>
2542
        </cmdsynopsis>
2543

    
2544
        <para>
2545
          Remove tags from the given instance. If any of the tags are
2546
          not existing on the node, the entire operation will abort.
2547
        </para>
2548

    
2549
        <para>
2550
          If the <option>--from</option> option is given, the list of
2551
          tags will be extended with the contents of that file (each
2552
          line becomes a tag). In this case, there is not need to pass
2553
          tags on the command line (if you do, both sources will be
2554
          used). A file name of - will be interpreted as stdin.
2555
        </para>
2556
      </refsect3>
2557

    
2558
    </refsect2>
2559

    
2560
  </refsect1>
2561

    
2562
  &footer;
2563

    
2564
</refentry>
2565

    
2566
<!-- Keep this comment at the end of the file
2567
Local variables:
2568
mode: sgml
2569
sgml-omittag:t
2570
sgml-shorttag:t
2571
sgml-minimize-attributes:nil
2572
sgml-always-quote-attributes:t
2573
sgml-indent-step:2
2574
sgml-indent-data:t
2575
sgml-parent-document:nil
2576
sgml-default-dtd-file:nil
2577
sgml-exposed-tags:nil
2578
sgml-local-catalogs:nil
2579
sgml-local-ecat-files:nil
2580
End:
2581
-->