Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ f8409165

History | View | Annotate | Download (94 kB)

1
<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
2

    
3
  <!-- Fill in your name for FIRSTNAME and SURNAME. -->
4
  <!-- Please adjust the date whenever revising the manpage. -->
5
  <!ENTITY dhdate      "<date>January 22, 2010</date>">
6
  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
7
       allowed: see man(7), man(1). -->
8
  <!ENTITY dhsection   "<manvolnum>8</manvolnum>">
9
  <!ENTITY dhucpackage "<refentrytitle>gnt-instance</refentrytitle>">
10
  <!ENTITY dhpackage   "gnt-instance">
11

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
129
        <para>
130
          The <option>disk</option> option specifies the parameters
131
          for the disks of the instance. The numbering of disks starts
132
          at zero, and at least one disk needs to be passed. For each
133
          disk, either the size or the adoption source needs to be
134
          given, and optionally the access mode (read-only or the
135
          default of read-write) can also be specified.  The size is
136
          interpreted (when no unit is given) in mebibytes. You can
137
          also use one of the suffixes
138
          <literal>m</literal>, <literal>g</literal> or
139
          <literal>t</literal> to specify 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 'generate' to generate a
204
                  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
637
                username to run the instance under. It must be a valid
638
                username existing on the host.
639
                </simpara>
640
                <simpara>Cannot be set under security model <quote>none</quote>
641
                or <quote>pool</quote>.
642
                </simpara>
643

    
644
              </listitem>
645
            </varlistentry>
646

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

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

    
658
              </listitem>
659
            </varlistentry>
660

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

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

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

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

    
683
                <simpara>This boolean option determines wether to run the KVM
684
                instance in a chroot directory.
685
                </simpara>
686
                <para>If it is set to <quote>true</quote>, an empty
687
                directory is created before starting the instance and
688
                its path is passed via the -chroot flag to kvm.  The
689
                directory is removed when the instance is stopped.
690
                </para>
691

    
692
                <simpara>It is set to <quote>false</quote> by
693
                default.</simpara>
694

    
695
              </listitem>
696
            </varlistentry>
697

    
698
            <varlistentry>
699
              <term>usb_mouse</term>
700
              <listitem>
701
                <simpara>Valid for the KVM hypervisor.</simpara>
702

    
703
                <simpara>This option specifies the usb mouse type to be used.
704
                It can be <quote>mouse</quote> or <quote>tablet</quote>. When
705
                using VNC it's recommended to set it to <quote>tablet</quote>.
706
                </simpara>
707
              </listitem>
708
            </varlistentry>
709

    
710

    
711
          </variablelist>
712

    
713
        </para>
714

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
991
      </refsect3>
992

    
993
      <refsect3>
994
        <title>REMOVE</title>
995

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

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

    
1011
        </para>
1012

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

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

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

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

    
1043
      <refsect3>
1044
        <title>LIST</title>
1045

    
1046
        <cmdsynopsis>
1047
          <command>list</command>
1048
          <arg>--no-headers</arg>
1049
          <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
1050
        <sbr>
1051
        <arg>--units=<replaceable>UNITS</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 units used to display the numeric values in the output
1072
          varies, depending on the options given. By default, the values
1073
          will be formatted in the most appropriate unit. If the
1074
          <option>--separator</option> option is given, then the values
1075
          are shown in mebibytes to allow parsing by scripts. In both
1076
          cases, the <option>--units</option> option can be used to
1077
          enforce a given output unit.
1078
        </para>
1079

    
1080
        <para>
1081
          The <option>--roman</option> option allows latin people to better
1082
          understand the cluster instances' status.
1083
        </para>
1084

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

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

    
1257
            <varlistentry>
1258
              <term>uuid</term>
1259
              <listitem>
1260
                <simpara>Show the UUID of the instance (generated
1261
                automatically by Ganeti)</simpara>
1262
              </listitem>
1263
            </varlistentry>
1264

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

    
1402
        <para>
1403
          If the value of the option starts with the character
1404
          <constant>+</constant>, the new field(s) will be added to the
1405
          default list. This allows to quickly see the default list
1406
          plus a few other fields, instead of retyping the entire list
1407
          of fields.
1408
        </para>
1409

    
1410
        <para>
1411
          There is a subtle grouping about the available output
1412
          fields: all fields except for <option>oper_state</option>,
1413
          <option>oper_ram</option> and <option>status</option> are
1414
          configuration value and not run-time values. So if you don't
1415
          select any of the these fields, the query will be satisfied
1416
          instantly from the cluster configuration, without having to
1417
          ask the remote nodes for the data. This can be helpful for
1418
          big clusters when you only want some data and it makes sense
1419
          to specify a reduced set of output fields.
1420
        </para>
1421

    
1422
        <para>The default output field list is:
1423
          <simplelist type="inline">
1424
            <member>name</member>
1425
            <member>os</member>
1426
            <member>pnode</member>
1427
            <member>admin_state</member>
1428
            <member>oper_state</member>
1429
            <member>oper_ram</member>
1430
          </simplelist>.
1431
        </para>
1432
      </refsect3>
1433

    
1434
      <refsect3>
1435
        <title>INFO</title>
1436

    
1437
        <cmdsynopsis>
1438
          <command>info</command>
1439
          <group>
1440
            <arg>-s</arg>
1441
            <arg>--static</arg>
1442
          </group>
1443
          <arg>--roman</arg>
1444
          <group choice="req">
1445
            <arg>--all</arg>
1446
            <arg rep="repeat"><replaceable>instance</replaceable></arg>
1447
          </group>
1448
        </cmdsynopsis>
1449

    
1450
        <para>
1451
          Show detailed information about the given instance(s). This is
1452
          different from <command>list</command> as it shows detailed data
1453
          about the instance's disks (especially useful for the drbd disk
1454
          template).
1455
        </para>
1456

    
1457
        <para>
1458
          If the option <option>-s</option> is used, only information
1459
          available in the configuration file is returned, without
1460
          querying nodes, making the operation faster.
1461
        </para>
1462

    
1463
        <para>
1464
          Use the <option>--all</option> to get info about all instances,
1465
          rather than explicitly passing the ones you're interested in.
1466
        </para>
1467

    
1468
        <para>
1469
          The <option>--roman</option> option can be used to cause envy among
1470
          people who like ancient cultures, but are stuck with non-latin-friendly
1471
          cluster virtualization technologies.
1472
        </para>
1473

    
1474
      </refsect3>
1475

    
1476
      <refsect3>
1477
        <title>MODIFY</title>
1478

    
1479
        <cmdsynopsis>
1480
          <command>modify</command>
1481
          <sbr>
1482
          <arg choice="opt">-H <replaceable>HYPERVISOR_PARAMETERS</replaceable></arg>
1483
          <sbr>
1484
          <arg choice="opt">-B <replaceable>BACKEND_PARAMETERS</replaceable></arg>
1485
          <sbr>
1486
          <group>
1487
            <arg>--net add<replaceable><optional>:options</optional></replaceable></arg>
1488
            <arg>--net remove</arg>
1489
            <arg>--net <replaceable>N:options</replaceable></arg>
1490
          </group>
1491
          <sbr>
1492
          <group>
1493
            <arg>--disk add:size=<replaceable>SIZE</replaceable></arg>
1494
            <arg>--disk remove</arg>
1495
            <arg>--disk <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></arg>
1496
          </group>
1497

    
1498
          <sbr>
1499
          <arg>-t<group choice="req">
1500
              <arg>plain</arg>
1501
              <arg>drbd</arg>
1502
            </group></arg>
1503

    
1504
          <sbr>
1505
            <arg>--os-name=<replaceable>OS</replaceable> <arg>--force-variant</arg></arg>
1506

    
1507
          <sbr>
1508
          <arg>--submit</arg>
1509
          <sbr>
1510
          <arg choice="req"><replaceable>instance</replaceable></arg>
1511
        </cmdsynopsis>
1512

    
1513
        <para>
1514
          Modifies the memory size, number of vcpus, ip address, MAC
1515
          address and/or nic parameters for an instance. It can also
1516
          add and remove disks and NICs to/from the instance. Note
1517
          that you need to give at least one of the arguments, otherwise
1518
          the command complains.
1519
        </para>
1520

    
1521
        <para>
1522
          The <option>-H</option> option specifies hypervisor options
1523
          in the form of <userinput>name=value[,...]</userinput>. For details which options can be specified, see the <command>add</command> command.
1524
        </para>
1525

    
1526
        <para>
1527
          The <option>-t</option> option will change the disk template
1528
          of the instance. Currently only conversions between the
1529
          plain and drbd disk templates are supported, and the
1530
          instance must be stopped before attempting the conversion.
1531
        </para>
1532

    
1533
        <para>
1534
          The <option>--disk
1535
          add:size=<replaceable>SIZE</replaceable></option> option
1536
          adds a disk to the instance. The <option>--disk
1537
          remove</option> will remove the last disk of the
1538
          instance. The <option>--disk
1539
          <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></option>
1540
          option will change the mode of the Nth disk of the instance
1541
          between read-only (<literal>ro</literal>) and read-write
1542
          (<literal>rw</literal>).
1543
        </para>
1544

    
1545
        <para>
1546
          The <option>--net
1547
          add:<replaceable>options</replaceable></option> option will
1548
          add a new NIC to the instance. The available options are the
1549
          same as in the <command>add</command> command (mac, ip, link,
1550
          mode). The <option>--net remove</option> will remove the
1551
          last NIC of the instance, while the <option>--net
1552
          <replaceable>N</replaceable>:<replaceable>options</replaceable></option>
1553
          option will change the parameters of the Nth instance NIC.
1554
        </para>
1555

    
1556
        <para>
1557
          The option <option>--os-name</option> will change the OS
1558
          name for the instance (without reinstallation). In case an
1559
          OS variant is specified that is not found, then by default
1560
          the modification is refused,
1561
          unless <option>--force-variant</option> is passed. An
1562
          invalid OS will also be refused, unless
1563
          the <option>--force</option> option is given.
1564
        </para>
1565

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

    
1573
        <para>
1574
          All the changes take effect at the next restart. If the
1575
          instance is running, there is no effect on the instance.
1576
        </para>
1577
      </refsect3>
1578

    
1579
      <refsect3>
1580
        <title>REINSTALL</title>
1581

    
1582
        <cmdsynopsis>
1583
          <command>reinstall</command>
1584
          <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
1585
          <arg>--select-os</arg>
1586
          <arg choice="opt">-f <replaceable>force</replaceable></arg>
1587
          <arg>--force-multiple</arg>
1588
          <sbr>
1589
          <group choice="opt">
1590
            <arg>--instance</arg>
1591
            <arg>--node</arg>
1592
            <arg>--primary</arg>
1593
            <arg>--secondary</arg>
1594
            <arg>--all</arg>
1595
          </group>
1596
          <arg>--submit</arg>
1597
          <arg choice="opt" rep="repeat"><replaceable>instance</replaceable></arg>
1598
        </cmdsynopsis>
1599

    
1600
        <para>
1601
          Reinstalls the operating system on the given instance(s). The
1602
          instance(s) must be stopped when running this command. If the
1603
          <option>--os-type</option> is specified, the operating
1604
          system is changed.
1605
        </para>
1606

    
1607
        <para>
1608
          The <option>--select-os</option> option switches to an
1609
          interactive OS reinstall. The user is prompted to select the OS
1610
          template from the list of available OS templates.
1611
        </para>
1612

    
1613
        <para>
1614
          Since this is a potentially dangerous command, the user will
1615
          be required to confirm this action, unless the
1616
          <option>-f</option> flag is passed. When multiple instances
1617
          are selected (either by passing multiple arguments or by
1618
          using the <option>--node</option>,
1619
          <option>--primary</option>, <option>--secondary</option> or
1620
          <option>--all</option> options), the user must pass both the
1621
          <option>--force</option> and
1622
          <option>--force-multiple</option> options to skip the
1623
          interactive confirmation.
1624
        </para>
1625

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

    
1633

    
1634
      </refsect3>
1635

    
1636
      <refsect3>
1637
        <title>RENAME</title>
1638

    
1639
        <cmdsynopsis>
1640
          <command>rename</command>
1641
          <arg>--no-ip-check</arg>
1642
          <arg>--submit</arg>
1643
          <arg choice="req"><replaceable>instance</replaceable></arg>
1644
          <arg choice="req"><replaceable>new_name</replaceable></arg>
1645
        </cmdsynopsis>
1646

    
1647
        <para>
1648
          Renames the given instance. The instance must be stopped
1649
          when running this command. The requirements for the new name
1650
          are the same as for adding an instance: the new name must be
1651
          resolvable and the IP it resolves to must not be reachable
1652
          (in order to prevent duplicate IPs the next time the
1653
          instance is started). The IP test can be skipped if the
1654
          <option>--no-ip-check</option> option is passed.
1655
        </para>
1656

    
1657
        <para>
1658
          The <option>--submit</option> option is used to send the job to
1659
          the master daemon but not wait for its completion. The job
1660
          ID will be shown so that it can be examined via
1661
          <command>gnt-job info</command>.
1662
        </para>
1663

    
1664
      </refsect3>
1665

    
1666
    </refsect2>
1667

    
1668
    <refsect2>
1669
      <title>Starting/stopping/connecting to console</title>
1670

    
1671
      <refsect3>
1672
        <title>STARTUP</title>
1673

    
1674
        <cmdsynopsis>
1675
          <command>startup</command>
1676
          <sbr>
1677
          <arg>--force</arg>
1678
          <sbr>
1679
          <arg>--force-multiple</arg>
1680
          <sbr>
1681
          <group choice="opt">
1682
            <arg>--instance</arg>
1683
            <arg>--node</arg>
1684
            <arg>--primary</arg>
1685
            <arg>--secondary</arg>
1686
            <arg>--all</arg>
1687
            <arg>--tags</arg>
1688
            <arg>--node-tags</arg>
1689
            <arg>--pri-node-tags</arg>
1690
            <arg>--sec-node-tags</arg>
1691
          </group>
1692
          <sbr>
1693
          <arg>-H <option>key=value...</option></arg>
1694
          <arg>-B <option>key=value...</option></arg>
1695
          <sbr>
1696
          <arg>--submit</arg>
1697
          <sbr>
1698
          <arg choice="opt"
1699
          rep="repeat"><replaceable>name</replaceable></arg>
1700
        </cmdsynopsis>
1701

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

    
1777
        <para>
1778
          Note that although you can pass more than one selection
1779
          option, the last one wins, so in order to guarantee the
1780
          desired result, don't pass more than one such option.
1781
        </para>
1782

    
1783
        <para>
1784
          Use <option>--force</option> to start even if secondary disks are
1785
          failing.
1786
        </para>
1787

    
1788
        <para>
1789
          The <option>--force-multiple</option> will skip the
1790
          interactive confirmation in the case the more than one
1791
          instance will be affected.
1792
        </para>
1793

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

    
1815
        <para>
1816
          The <option>--submit</option> option is used to send the job to
1817
          the master daemon but not wait for its completion. The job
1818
          ID will be shown so that it can be examined via
1819
          <command>gnt-job info</command>.
1820
        </para>
1821

    
1822
        <para>
1823
          Example:
1824
          <screen>
1825
# gnt-instance start instance1.example.com
1826
# gnt-instance start --node node1.example.com node2.example.com
1827
# gnt-instance start --all
1828
          </screen>
1829
        </para>
1830
      </refsect3>
1831

    
1832
      <refsect3>
1833
        <title>SHUTDOWN</title>
1834

    
1835
        <cmdsynopsis>
1836
          <command>shutdown</command>
1837
          <sbr>
1838
          <arg>--timeout=<replaceable>N</replaceable></arg>
1839
          <sbr>
1840
          <arg>--force-multiple</arg>
1841
          <sbr>
1842
          <group choice="opt">
1843
            <arg>--instance</arg>
1844
            <arg>--node</arg>
1845
            <arg>--primary</arg>
1846
            <arg>--secondary</arg>
1847
            <arg>--all</arg>
1848
            <arg>--tags</arg>
1849
            <arg>--node-tags</arg>
1850
            <arg>--pri-node-tags</arg>
1851
            <arg>--sec-node-tags</arg>
1852
          </group>
1853
          <sbr>
1854
          <arg>--submit</arg>
1855
          <sbr>
1856
          <arg choice="opt"
1857
          rep="repeat"><replaceable>name</replaceable></arg>
1858
        </cmdsynopsis>
1859

    
1860
        <para>
1861
          Stops one or more instances. If the instance cannot be
1862
          cleanly stopped during a hardcoded interval (currently 2
1863
          minutes), it will forcibly stop the instance (equivalent to
1864
          switching off the power on a physical machine).
1865
        </para>
1866

    
1867
        <para>
1868
          The <option>--timeout</option> is used to specify how much time to
1869
          wait before forcing the shutdown (xm destroy in xen, killing the kvm
1870
          process, for kvm). By default two minutes are given to each instance
1871
          to stop.
1872
        </para>
1873

    
1874
        <para>
1875
          The <option>--instance</option>, <option>--node</option>,
1876
          <option>--primary</option>, <option>--secondary</option>,
1877
          <option>--all</option>, <option>--tags</option>,
1878
          <option>--node-tags</option>, <option>--pri-node-tags</option> and
1879
          <option>--sec-node-tags</option> options are similar as for the
1880
          <command>startup</command> command and they influence the
1881
          actual instances being shutdown.
1882
        </para>
1883

    
1884
        <para>
1885
          The <option>--submit</option> option is used to send the job to
1886
          the master daemon but not wait for its completion. The job
1887
          ID will be shown so that it can be examined via
1888
          <command>gnt-job info</command>.
1889
        </para>
1890

    
1891

    
1892
        <para>
1893
          Example:
1894
          <screen>
1895
# gnt-instance shutdown instance1.example.com
1896
# gnt-instance shutdown --all
1897
          </screen>
1898
        </para>
1899
      </refsect3>
1900

    
1901
      <refsect3>
1902
        <title>REBOOT</title>
1903

    
1904
        <cmdsynopsis>
1905
          <command>reboot</command>
1906
          <sbr>
1907
          <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
1908
          <sbr>
1909
          <arg>--ignore-secondaries</arg>
1910
          <sbr>
1911
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
1912
          <sbr>
1913
          <arg>--force-multiple</arg>
1914
          <sbr>
1915
          <group choice="opt">
1916
            <arg>--instance</arg>
1917
            <arg>--node</arg>
1918
            <arg>--primary</arg>
1919
            <arg>--secondary</arg>
1920
            <arg>--all</arg>
1921
            <arg>--tags</arg>
1922
            <arg>--node-tags</arg>
1923
            <arg>--pri-node-tags</arg>
1924
            <arg>--sec-node-tags</arg>
1925
          </group>
1926
          <sbr>
1927
          <arg>--submit</arg>
1928
          <sbr>
1929
          <arg choice="opt"
1930
          rep="repeat"><replaceable>name</replaceable></arg>
1931
        </cmdsynopsis>
1932

    
1933
        <para>
1934
          Reboots one or more instances. The type of reboot depends on
1935
          the value of <option>--type</option>. A soft reboot does a
1936
          hypervisor reboot, a hard reboot does a instance stop,
1937
          recreates the hypervisor config for the instance and
1938
          starts the instance. A full reboot does the equivalent
1939
          of <command>gnt-instance shutdown &amp;&amp; gnt-instance
1940
          startup</command>. The default is hard reboot.
1941
        </para>
1942

    
1943
        <para>
1944
          For the hard reboot the option
1945
          <option>--ignore-secondaries</option> ignores errors for the
1946
          secondary node while re-assembling the instance disks.
1947
        </para>
1948

    
1949
        <para>
1950
          The <option>--instance</option>, <option>--node</option>,
1951
          <option>--primary</option>, <option>--secondary</option>,
1952
          <option>--all</option>, <option>--tags</option>,
1953
          <option>--node-tags</option>, <option>--pri-node-tags</option> and
1954
          <option>--sec-node-tags</option> options are similar as for the
1955
          <command>startup</command> command and they influence the
1956
          actual instances being rebooted.
1957
        </para>
1958

    
1959
        <para>
1960
          The <option>--shutdown-timeout</option> is used to specify how
1961
          much time to wait before forcing the shutdown (xm destroy in xen,
1962
          killing the kvm process, for kvm). By default two minutes are
1963
          given to each instance to stop.
1964
        </para>
1965

    
1966
        <para>
1967
          The <option>--force-multiple</option> will skip the
1968
          interactive confirmation in the case the more than one
1969
          instance will be affected.
1970
        </para>
1971

    
1972
        <para>
1973
          Example:
1974
          <screen>
1975
# gnt-instance reboot instance1.example.com
1976
# gnt-instance reboot --type=full instance1.example.com
1977
          </screen>
1978
        </para>
1979
      </refsect3>
1980

    
1981
      <refsect3>
1982
        <title>CONSOLE</title>
1983
        <cmdsynopsis>
1984
          <command>console</command>
1985
          <arg choice="opt">--show-cmd</arg>
1986
          <arg choice="req"><replaceable>instance</replaceable></arg>
1987
        </cmdsynopsis>
1988

    
1989
        <para>
1990
          Connects to the console of the given instance. If the
1991
          instance is not up, an error is returned. Use the
1992
          <option>--show-cmd</option> option to display the command
1993
          instead of executing it.
1994
        </para>
1995

    
1996
        <para>
1997
          For HVM instances, this will attempt to connect to the
1998
          serial console of the instance. To connect to the
1999
          virtualized "physical" console of a HVM instance, use a VNC
2000
          client with the connection info from the
2001
          <command>info</command> command.
2002
        </para>
2003

    
2004
        <para>
2005
          Example:
2006
          <screen>
2007
# gnt-instance console instance1.example.com
2008
          </screen>
2009
        </para>
2010
      </refsect3>
2011

    
2012
    </refsect2>
2013

    
2014
    <refsect2>
2015
      <title>Disk management</title>
2016

    
2017
      <refsect3>
2018
        <title>REPLACE-DISKS</title>
2019

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

    
2029
        <cmdsynopsis>
2030
          <command>replace-disks</command>
2031
          <arg>--submit</arg>
2032
          <arg>--early-release</arg>
2033
          <arg choice="req">-s</arg>
2034
          <arg>--disks <replaceable>idx</replaceable></arg>
2035
          <arg choice="req"><replaceable>instance</replaceable></arg>
2036
        </cmdsynopsis>
2037

    
2038
        <cmdsynopsis>
2039
          <command>replace-disks</command>
2040
          <arg>--submit</arg>
2041
          <arg>--early-release</arg>
2042
          <group choice="req">
2043
            <arg>--iallocator <replaceable>name</replaceable></arg>
2044
            <arg>--new-secondary <replaceable>NODE</replaceable></arg>
2045
          </group>
2046

    
2047
          <arg choice="req"><replaceable>instance</replaceable></arg>
2048
        </cmdsynopsis>
2049

    
2050
        <cmdsynopsis>
2051
          <command>replace-disks</command>
2052
          <arg>--submit</arg>
2053
          <arg>--early-release</arg>
2054
          <arg choice="req">--auto</arg>
2055
          <arg choice="req"><replaceable>instance</replaceable></arg>
2056
        </cmdsynopsis>
2057

    
2058
        <para>
2059
          This command is a generalized form for replacing disks. It
2060
          is currently only valid for the mirrored (DRBD) disk
2061
          template.
2062
        </para>
2063

    
2064
        <para>
2065
          The first form (when passing the <option>-p</option> option)
2066
          will replace the disks on the primary, while the second form
2067
          (when passing the <option>-s</option> option will replace
2068
          the disks on the secondary node. For these two cases (as the
2069
          node doesn't change), it is possible to only run the replace
2070
          for a subset of the disks, using the option
2071
          <option>--disks</option> which takes a list of
2072
          comma-delimited disk indices (zero-based),
2073
          e.g. <userinput>0,2</userinput> to replace only the first
2074
          and third disks.
2075
        </para>
2076

    
2077
        <para>
2078
          The third form (when passing either the
2079
          <option>--iallocator</option> or the
2080
          <option>--new-secondary</option> option) is designed to
2081
          change secondary node of the instance.  Specifying
2082
          <option>--iallocator</option> makes the new secondary be
2083
          selected automatically by the specified allocator plugin,
2084
          otherwise the new secondary node will be the one chosen
2085
          manually via the <option>--new-secondary</option> option.
2086
        </para>
2087

    
2088
        <para>
2089
          The fourth form (when using <option>--auto</option>) will
2090
          automatically determine which disks of an instance are faulty and
2091
          replace them within the same node. The <option>--auto</option>
2092
          option works only when an instance has only faulty disks on
2093
          either the primary or secondary node; it doesn't work when
2094
          both sides have faulty disks.
2095
        </para>
2096

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

    
2104
        <para>
2105
          The <option>--early-release</option> changes the code so
2106
          that the old storage on secondary node(s) is removed early
2107
          (before the resync is completed) and the internal Ganeti
2108
          locks for the current (and new, if any) secondary node are
2109
          also released, thus allowing more parallelism in the cluster
2110
          operation. This should be used only when recovering from a
2111
          disk failure on the current secondary (thus the old storage
2112
          is already broken) or when the storage on the primary node
2113
          is known to be fine (thus we won't need the old storage for
2114
          potential recovery).
2115
        </para>
2116

    
2117
        <para>
2118
          Note that it is not possible to select an offline or drained
2119
          node as a new secondary.
2120
        </para>
2121

    
2122
      </refsect3>
2123

    
2124
      <refsect3>
2125
        <title>ACTIVATE-DISKS</title>
2126

    
2127
        <cmdsynopsis>
2128
          <command>activate-disks</command>
2129
          <arg>--submit</arg>
2130
          <arg>--ignore-size</arg>
2131
          <arg choice="req"><replaceable>instance</replaceable></arg>
2132
        </cmdsynopsis>
2133
        <para>
2134
          Activates the block devices of the given instance. If
2135
          successful, the command will show the location and name of
2136
          the block devices:
2137
          <screen>
2138
node1.example.com:disk/0:/dev/drbd0
2139
node1.example.com:disk/1:/dev/drbd1
2140
          </screen>
2141

    
2142
          In this example, <emphasis>node1.example.com</emphasis> is
2143
          the name of the node on which the devices have been
2144
          activated. The <emphasis>disk/0</emphasis> and
2145
          <emphasis>disk/1</emphasis> are the Ganeti-names of the
2146
          instance disks; how they are visible inside the instance is
2147
          hypervisor-specific. <emphasis>/dev/drbd0</emphasis> and
2148
          <emphasis>/dev/drbd1</emphasis> are the actual block devices
2149
          as visible on the node.
2150
        </para>
2151

    
2152
        <para>
2153
          The <option>--submit</option> option is used to send the job to
2154
          the master daemon but not wait for its completion. The job
2155
          ID will be shown so that it can be examined via
2156
          <command>gnt-job info</command>.
2157
        </para>
2158

    
2159
        <para>
2160
          The <option>--ignore-size</option> option can be used to
2161
          activate disks ignoring the currently configured size in
2162
          Ganeti. This can be used in cases where the configuration
2163
          has gotten out of sync with the real-world (e.g. after a
2164
          partially-failed grow-disk operation or due to rounding in
2165
          LVM devices). This should not be used in normal cases, but
2166
          only when activate-disks fails without it.
2167
        </para>
2168

    
2169
        <para>
2170
          Note that it is safe to run this command while the instance
2171
          is already running.
2172
        </para>
2173
      </refsect3>
2174

    
2175
      <refsect3>
2176
        <title>DEACTIVATE-DISKS</title>
2177

    
2178
        <cmdsynopsis>
2179
          <command>deactivate-disks</command>
2180
          <arg>--submit</arg>
2181
          <arg choice="req"><replaceable>instance</replaceable></arg>
2182
        </cmdsynopsis>
2183
        <para>
2184
          De-activates the block devices of the given instance. Note
2185
          that if you run this command for an instance with a drbd
2186
          disk template, while it is running, it will not be able to
2187
          shutdown the block devices on the primary node, but it will
2188
          shutdown the block devices on the secondary nodes, thus
2189
          breaking the replication.
2190
        </para>
2191

    
2192
        <para>
2193
          The <option>--submit</option> option is used to send the job to
2194
          the master daemon but not wait for its completion. The job
2195
          ID will be shown so that it can be examined via
2196
          <command>gnt-job info</command>.
2197
        </para>
2198

    
2199
      </refsect3>
2200

    
2201
      <refsect3>
2202
        <title>GROW-DISK</title>
2203
        <cmdsynopsis>
2204
          <command>grow-disk</command>
2205
          <arg>--no-wait-for-sync</arg>
2206
          <arg>--submit</arg>
2207
          <arg choice="req"><replaceable>instance</replaceable></arg>
2208
          <arg choice="req"><replaceable>disk</replaceable></arg>
2209
          <arg choice="req"><replaceable>amount</replaceable></arg>
2210
        </cmdsynopsis>
2211

    
2212
        <para>
2213
          Grows an instance's disk. This is only possible for
2214
          instances having a <literal>plain</literal> or
2215
          <literal>drbd</literal> disk template.
2216
        </para>
2217

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

    
2245

    
2246
        <para>
2247
          The <replaceable>disk</replaceable> argument is the index of
2248
          the instance disk to grow. The
2249
          <replaceable>amount</replaceable> argument is given either
2250
          as a number (and it represents the amount to increase the
2251
          disk with in mebibytes) or can be given similar to the
2252
          arguments in the create instance operation, with a suffix
2253
          denoting the unit.
2254
        </para>
2255

    
2256
        <para>
2257
          Note that the disk grow operation might complete on one node
2258
          but fail on the other; this will leave the instance with
2259
          different-sized LVs on the two nodes, but this will not
2260
          create problems (except for unused space).
2261
        </para>
2262

    
2263
        <para>
2264
          If you do not want gnt-instance to wait for the new disk
2265
          region to be synced, use the
2266
          <option>--no-wait-for-sync</option> option.
2267
        </para>
2268

    
2269
        <para>
2270
          The <option>--submit</option> option is used to send the job to
2271
          the master daemon but not wait for its completion. The job
2272
          ID will be shown so that it can be examined via
2273
          <command>gnt-job info</command>.
2274
        </para>
2275

    
2276

    
2277
        <para>Example (increase the first disk for instance1 by 16GiB):
2278
          <screen>
2279
# gnt-instance grow-disk instance1.example.com 0 16g
2280
          </screen>
2281
        </para>
2282

    
2283
        <para>
2284
          Also note that disk shrinking is not supported; use
2285
          <command>gnt-backup export</command> and then
2286
          <command>gnt-backup import</command> to reduce the disk size
2287
          of an instance.
2288
        </para>
2289
      </refsect3>
2290

    
2291
      <refsect3>
2292
        <title>RECREATE-DISKS</title>
2293

    
2294
        <cmdsynopsis>
2295
          <command>recreate-disks</command>
2296
          <arg>--submit</arg>
2297
          <arg>--disks=<option>indices</option></arg>
2298
          <arg choice="req"><replaceable>instance</replaceable></arg>
2299
        </cmdsynopsis>
2300
        <para>
2301
          Recreates the disks of the given instance, or only a subset
2302
          of the disks (if the option <option>disks</option> is
2303
          passed, which must be a comma-separated list of disk
2304
          indices, starting from zero).
2305
        </para>
2306

    
2307
        <para>
2308
          Note that this functionality should only be used for missing
2309
          disks; if any of the given disks already exists, the
2310
          operation will fail. While this is suboptimal,
2311
          recreate-disks should hopefully not be needed in normal
2312
          operation and as such the impact of this is low.
2313
        </para>
2314

    
2315
        <para>
2316
          The <option>--submit</option> option is used to send the job to
2317
          the master daemon but not wait for its completion. The job
2318
          ID will be shown so that it can be examined via
2319
          <command>gnt-job info</command>.
2320
        </para>
2321

    
2322
      </refsect3>
2323

    
2324
    </refsect2>
2325

    
2326
    <refsect2>
2327
      <title>Recovery</title>
2328

    
2329
      <refsect3>
2330
        <title>FAILOVER</title>
2331

    
2332
        <cmdsynopsis>
2333
          <command>failover</command>
2334
          <arg>-f</arg>
2335
          <arg>--ignore-consistency</arg>
2336
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2337
          <arg>--submit</arg>
2338
          <arg choice="req"><replaceable>instance</replaceable></arg>
2339
        </cmdsynopsis>
2340

    
2341
        <para>
2342
          Failover will fail the instance over its secondary
2343
          node. This works only for instances having a drbd disk
2344
          template.
2345
        </para>
2346

    
2347
        <para>
2348
          Normally the failover will check the consistency of the
2349
          disks before failing over the instance. If you are trying to
2350
          migrate instances off a dead node, this will fail. Use the
2351
          <option>--ignore-consistency</option> option for this
2352
          purpose. Note that this option can be dangerous as errors in
2353
          shutting down the instance will be ignored, resulting in
2354
          possibly having the instance running on two machines in
2355
          parallel (on disconnected DRBD drives).
2356
        </para>
2357

    
2358
        <para>
2359
          The <option>--shutdown-timeout</option> is used to specify how
2360
          much time to wait before forcing the shutdown (xm destroy in xen,
2361
          killing the kvm process, for kvm). By default two minutes are
2362
          given to each instance to stop.
2363
        </para>
2364

    
2365
        <para>
2366
          The <option>--submit</option> option is used to send the job to
2367
          the master daemon but not wait for its completion. The job
2368
          ID will be shown so that it can be examined via
2369
          <command>gnt-job info</command>.
2370
        </para>
2371

    
2372
        <para>
2373
          Example:
2374
          <screen>
2375
# gnt-instance failover instance1.example.com
2376
          </screen>
2377
        </para>
2378
      </refsect3>
2379

    
2380
      <refsect3>
2381
        <title>MIGRATE</title>
2382

    
2383
        <cmdsynopsis>
2384
          <command>migrate</command>
2385
          <arg>-f</arg>
2386
          <arg choice="req">--cleanup</arg>
2387
          <arg choice="req"><replaceable>instance</replaceable></arg>
2388
        </cmdsynopsis>
2389

    
2390
        <cmdsynopsis>
2391
          <command>migrate</command>
2392
          <arg>-f</arg>
2393
          <arg>--non-live</arg>
2394
          <arg choice="req"><replaceable>instance</replaceable></arg>
2395
        </cmdsynopsis>
2396

    
2397
        <para>
2398
          Migrate will move the instance to its secondary node without
2399
          shutdown. It only works for instances having the drbd8 disk
2400
          template type.
2401
        </para>
2402

    
2403
        <para>
2404
          The migration command needs a perfectly healthy instance, as
2405
          we rely on the dual-master capability of drbd8 and the disks
2406
          of the instance are not allowed to be degraded.
2407
        </para>
2408

    
2409
        <para>
2410
          The <option>--non-live</option> option will switch (for the
2411
          hypervisors that support it) between a "fully live"
2412
          (i.e. the interruption is as minimal as possible) migration
2413
          and one in which the instance is frozen, its state saved and
2414
          transported to the remote node, and then resumed there. This
2415
          all depends on the hypervisor support for two different
2416
          methods. In any case, it is not an error to pass this
2417
          parameter (it will just be ignored if the hypervisor doesn't
2418
          support it).
2419
        </para>
2420

    
2421
        <para>
2422
          If the <option>--cleanup</option> option is passed, the
2423
          operation changes from migration to attempting recovery from
2424
          a failed previous migration. In this mode, ganeti checks if
2425
          the instance runs on the correct node (and updates its
2426
          configuration if not) and ensures the instances's disks are
2427
          configured correctly. In this mode, the
2428
          <option>--non-live</option> option is ignored.
2429
        </para>
2430

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

    
2458
      <refsect3>
2459
        <title>MOVE</title>
2460

    
2461
        <cmdsynopsis>
2462
          <command>move</command>
2463
          <arg>-f</arg>
2464
          <arg>-n <replaceable>node</replaceable></arg>
2465
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2466
          <arg>--submit</arg>
2467
          <arg choice="req"><replaceable>instance</replaceable></arg>
2468
        </cmdsynopsis>
2469

    
2470
        <para>
2471
          Move will move the instance to an arbitrary node in the
2472
          cluster. This works only for instances having a plain or
2473
          file disk template.
2474
        </para>
2475

    
2476
        <para>
2477
          Note that since this operation is done via data copy, it
2478
          will take a long time for big disks (similar to
2479
          replace-disks for a drbd instance).
2480
        </para>
2481

    
2482
        <para>
2483
          The <option>--shutdown-timeout</option> is used to specify how
2484
          much time to wait before forcing the shutdown (xm destroy in xen,
2485
          killing the kvm process, for kvm). By default two minutes are
2486
          given to each instance to stop.
2487
        </para>
2488

    
2489
        <para>
2490
          The <option>--submit</option> option is used to send the job to
2491
          the master daemon but not wait for its completion. The job
2492
          ID will be shown so that it can be examined via
2493
          <command>gnt-job info</command>.
2494
        </para>
2495

    
2496
        <para>
2497
          Example:
2498
          <screen>
2499
# gnt-instance move -n node3.example.com instance1.example.com
2500
          </screen>
2501
        </para>
2502
      </refsect3>
2503

    
2504
    </refsect2>
2505

    
2506
    <refsect2>
2507
      <title>TAGS</title>
2508

    
2509
    <refsect3>
2510
        <title>ADD-TAGS</title>
2511

    
2512
        <cmdsynopsis>
2513
          <command>add-tags</command>
2514
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2515
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2516
          <arg choice="req"
2517
            rep="repeat"><replaceable>tag</replaceable></arg>
2518
        </cmdsynopsis>
2519

    
2520
        <para>
2521
          Add tags to the given instance. If any of the tags contains
2522
          invalid characters, the entire operation will abort.
2523
        </para>
2524
        <para>
2525
          If the <option>--from</option> option is given, the list of
2526
          tags will be extended with the contents of that file (each
2527
          line becomes a tag). In this case, there is not need to pass
2528
          tags on the command line (if you do, both sources will be
2529
          used). A file name of - will be interpreted as stdin.
2530
        </para>
2531
      </refsect3>
2532

    
2533
      <refsect3>
2534
        <title>LIST-TAGS</title>
2535

    
2536
        <cmdsynopsis>
2537
          <command>list-tags</command>
2538
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2539
        </cmdsynopsis>
2540

    
2541
        <para>List the tags of the given instance.</para>
2542
      </refsect3>
2543

    
2544
      <refsect3>
2545
        <title>REMOVE-TAGS</title>
2546
        <cmdsynopsis>
2547
          <command>remove-tags</command>
2548
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2549
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2550
          <arg choice="req"
2551
            rep="repeat"><replaceable>tag</replaceable></arg>
2552
        </cmdsynopsis>
2553

    
2554
        <para>
2555
          Remove tags from the given instance. If any of the tags are
2556
          not existing on the node, the entire operation will abort.
2557
        </para>
2558

    
2559
        <para>
2560
          If the <option>--from</option> option is given, the list of
2561
          tags will be extended with the contents of that file (each
2562
          line becomes a tag). In this case, there is not need to pass
2563
          tags on the command line (if you do, both sources will be
2564
          used). A file name of - will be interpreted as stdin.
2565
        </para>
2566
      </refsect3>
2567

    
2568
    </refsect2>
2569

    
2570
  </refsect1>
2571

    
2572
  &footer;
2573

    
2574
</refentry>
2575

    
2576
<!-- Keep this comment at the end of the file
2577
Local variables:
2578
mode: sgml
2579
sgml-omittag:t
2580
sgml-shorttag:t
2581
sgml-minimize-attributes:nil
2582
sgml-always-quote-attributes:t
2583
sgml-indent-step:2
2584
sgml-indent-data:t
2585
sgml-parent-document:nil
2586
sgml-default-dtd-file:nil
2587
sgml-exposed-tags:nil
2588
sgml-local-catalogs:nil
2589
sgml-local-ecat-files:nil
2590
End:
2591
-->