Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ 783a6c0b

History | View | Annotate | Download (95.1 kB)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
628
              </listitem>
629
            </varlistentry>
630

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

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

    
644
              </listitem>
645
            </varlistentry>
646

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

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

    
658
              </listitem>
659
            </varlistentry>
660

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

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

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

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

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

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

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

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

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

    
714
            <varlistentry>
715
              <term>cpu_mask</term>
716
              <listitem>
717
                <simpara>Valid for the LXC hypervisor.</simpara>
718

    
719
                <simpara>The processes belonging to the given instance are
720
                only scheduled on the specified CPUs.
721
                </simpara>
722

    
723
                <simpara>
724
                The parameter format is a comma-separated list of CPU IDs or
725
                CPU ID ranges. The ranges are defined by a lower and higher
726
                boundary, separated by a dash. The boundaries are inclusive.
727
                </simpara>
728

    
729
              </listitem>
730
            </varlistentry>
731

    
732
          </variablelist>
733

    
734
        </para>
735

    
736
        <para>
737
          The <option>--iallocator</option> option specifies the instance
738
          allocator plugin to use. If you pass in this option the allocator
739
          will select nodes for this instance automatically, so you don't need
740
          to pass them with the <option>-n</option> option. For more
741
          information please refer to the instance allocator documentation.
742
        </para>
743

    
744
        <para>
745
          The <option>-t</option> options specifies the disk layout type for
746
          the instance. The available choices are:
747
          <variablelist>
748
            <varlistentry>
749
              <term>diskless</term>
750
              <listitem>
751
                <para>
752
                  This creates an instance with no disks. Its useful for
753
                  testing only (or other special cases).
754
                </para>
755
              </listitem>
756
            </varlistentry>
757
            <varlistentry>
758
              <term>file</term>
759
              <listitem>
760
                <para>Disk devices will be regular files.</para>
761
              </listitem>
762
            </varlistentry>
763
            <varlistentry>
764
              <term>plain</term>
765
              <listitem>
766
                <para>Disk devices will be logical volumes.</para>
767
              </listitem>
768
            </varlistentry>
769
            <varlistentry>
770
              <term>drbd</term>
771
              <listitem>
772
                <para>
773
                  Disk devices will be drbd (version 8.x) on top of
774
                  lvm volumes.
775
                </para>
776
              </listitem>
777
            </varlistentry>
778
          </variablelist>
779
        </para>
780

    
781
        <para>
782
          The optional second value of the <option>--node</option> is used for
783
          the drbd template type and specifies the remote node.
784
        </para>
785

    
786
        <para>
787
          If you do not want gnt-instance to wait for the disk mirror
788
          to be synced, use the <option>--no-wait-for-sync</option>
789
          option.
790
        </para>
791

    
792
        <para>
793
          The <option>--file-storage-dir</option> specifies the relative path
794
          under the cluster-wide file storage directory to store file-based
795
          disks. It is useful for having different subdirectories for
796
          different instances. The full path of the directory where the disk
797
          files are stored will consist of cluster-wide file storage directory
798
          + optional subdirectory + instance name. Example:
799
          /srv/ganeti/file-storage/mysubdir/instance1.example.com. This option
800
          is only relevant for instances using the file storage backend.
801
        </para>
802

    
803
        <para>
804
          The <option>--file-driver</option> specifies the driver to use for
805
          file-based disks. Note that currently these drivers work with the
806
          xen hypervisor only. This option is only relevant for instances using
807
          the file storage backend. The available choices are:
808
          <variablelist>
809
            <varlistentry>
810
              <term>loop</term>
811
              <listitem>
812
                <para>
813
                  Kernel loopback driver. This driver uses loopback
814
                  devices to access the filesystem within the
815
                  file. However, running I/O intensive applications in
816
                  your instance using the loop driver might result in
817
                  slowdowns.  Furthermore, if you use the loopback
818
                  driver consider increasing the maximum amount of
819
                  loopback devices (on most systems it's 8) using the
820
                  max_loop param.
821
                </para>
822
              </listitem>
823
            </varlistentry>
824
            <varlistentry>
825
              <term>blktap</term>
826
              <listitem>
827
                <para>The blktap driver (for Xen hypervisors). In
828
                order to be able to use the blktap driver you should
829
                check if the 'blktapctrl' user space disk agent is
830
                running (usually automatically started via xend). This
831
                user-level disk I/O interface has the advantage of
832
                better performance. Especially if you use a network
833
                file system (e.g. NFS) to store your instances this is
834
                the recommended choice.
835
                </para>
836
              </listitem>
837
            </varlistentry>
838
          </variablelist>
839
        </para>
840

    
841
        <para>
842
          The <option>--submit</option> option is used to send the job to
843
          the master daemon but not wait for its completion. The job
844
          ID will be shown so that it can be examined via
845
          <command>gnt-job info</command>.
846
        </para>
847

    
848
        <para>
849
          Example:
850
          <screen>
851
# gnt-instance add -t file --disk 0:size=30g -B memory=512 -o debian-etch \
852
  -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
853
# gnt-instance add -t plain --disk 0:size=30g -B memory=512 -o debian-etch \
854
  -n node1.example.com instance1.example.com
855
# gnt-instance add -t drbd --disk 0:size=30g -B memory=512 -o debian-etch \
856
  -n node1.example.com:node2.example.com instance2.example.com
857
          </screen>
858
        </para>
859
      </refsect3>
860

    
861
      <refsect3>
862
        <title>BATCH-CREATE</title>
863
        <cmdsynopsis>
864
          <command>batch-create</command>
865
          <arg choice="req">instances_file.json</arg>
866
        </cmdsynopsis>
867

    
868
        <para>
869
          This command (similar to the Ganeti 1.2
870
          <command>batcher</command> tool) submits multiple instance
871
          creation jobs based on a definition file. The instance
872
          configurations do not encompass all the possible options for
873
          the <command>add</command> command, but only a subset.
874
        </para>
875

    
876
        <para>
877
          The instance file should be a valid-formed JSON file,
878
          containing a dictionary with instance name and instance
879
          parameters. The accepted parameters are:
880

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

    
978
        <para>
979
          A simple definition for one instance can be (with most of
980
          the parameters taken from the cluster defaults):
981
          <screen>
982
{
983
  "instance3": {
984
    "template": "drbd",
985
    "os": "debootstrap",
986
    "disk_size": ["25G"],
987
    "iallocator": "dumb"
988
  },
989
  "instance5": {
990
    "template": "drbd",
991
    "os": "debootstrap",
992
    "disk_size": ["25G"],
993
    "iallocator": "dumb",
994
    "hypervisor": "xen-hvm",
995
    "hvparams": {"acpi": true},
996
    "backend": {"memory": 512}
997
  }
998
}
999
</screen>
1000
        </para>
1001

    
1002
        <para>
1003
          The command will display the job id for each submitted instance, as follows:
1004
          <screen>
1005
# gnt-instance batch-create instances.json
1006
instance3: 11224
1007
instance5: 11225
1008
</screen>
1009
        </para>
1010

    
1011
      </refsect3>
1012

    
1013
      <refsect3>
1014
        <title>REMOVE</title>
1015

    
1016
        <cmdsynopsis>
1017
          <command>remove</command>
1018
          <arg>--ignore-failures</arg>
1019
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
1020
          <arg>--submit</arg>
1021
          <arg choice="req"><replaceable>instance</replaceable></arg>
1022
        </cmdsynopsis>
1023

    
1024
        <para>
1025
          Remove an instance. This will remove all data from the
1026
          instance and there is <emphasis>no way back</emphasis>. If
1027
          you are not sure if you use an instance again, use
1028
          <command>shutdown</command> first and leave it in the
1029
          shutdown state for a while.
1030

    
1031
        </para>
1032

    
1033
        <para>
1034
          The <option>--ignore-failures</option> option will cause the
1035
          removal to proceed even in the presence of errors during the
1036
          removal of the instance (e.g. during the shutdown or the
1037
          disk removal). If this option is not given, the command will
1038
          stop at the first error.
1039
        </para>
1040

    
1041
        <para>
1042
          The <option>--shutdown-timeout</option> is used to specify how
1043
          much time to wait before forcing the shutdown (xm destroy in xen,
1044
          killing the kvm process, for kvm). By default two minutes are
1045
          given to each instance to stop.
1046
        </para>
1047

    
1048
        <para>
1049
          The <option>--submit</option> option is used to send the job to
1050
          the master daemon but not wait for its completion. The job
1051
          ID will be shown so that it can be examined via
1052
          <command>gnt-job info</command>.
1053
        </para>
1054

    
1055
        <para>
1056
          Example:
1057
          <screen>
1058
# gnt-instance remove instance1.example.com
1059
          </screen>
1060
        </para>
1061
      </refsect3>
1062

    
1063
      <refsect3>
1064
        <title>LIST</title>
1065

    
1066
        <cmdsynopsis>
1067
          <command>list</command>
1068
          <arg>--no-headers</arg>
1069
          <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
1070
          <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
1071
          <arg>--roman</arg>
1072
          <arg rep="repeat">instance</arg>
1073
        </cmdsynopsis>
1074

    
1075
        <para>
1076
          Shows the currently configured instances with memory usage,
1077
          disk usage, the node they are running on, and their run
1078
          status.
1079
        </para>
1080

    
1081
        <para>
1082
          The <option>--no-headers</option> option will skip the
1083
          initial header line. The <option>--separator</option> option
1084
          takes an argument which denotes what will be used between
1085
          the output fields. Both these options are to help scripting.
1086
        </para>
1087

    
1088
        <para>
1089
          The <option>--roman</option> option allows latin people to better
1090
          understand the cluster instances' status.
1091
        </para>
1092

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

    
1191
            <varlistentry>
1192
              <term>nic_mode</term>
1193
              <listitem>
1194
                <simpara>the mode of the first instance NIC
1195
                (routed or bridged)</simpara>
1196
              </listitem>
1197
            </varlistentry>
1198
            <varlistentry>
1199
              <term>nic_link</term>
1200
              <listitem>
1201
                <simpara>the link of the first instance NIC
1202
                </simpara>
1203
              </listitem>
1204
            </varlistentry>
1205
            <varlistentry>
1206
              <term>sda_size</term>
1207
              <listitem>
1208
                <simpara>the size of the instance's first disk</simpara>
1209
              </listitem>
1210
            </varlistentry>
1211
            <varlistentry>
1212
              <term>sdb_size</term>
1213
              <listitem>
1214
                <simpara>the size of the instance's second disk, if
1215
                any</simpara>
1216
              </listitem>
1217
            </varlistentry>
1218
            <varlistentry>
1219
              <term>vcpus</term>
1220
              <listitem>
1221
                <simpara>the number of VCPUs allocated to the
1222
                instance</simpara>
1223
              </listitem>
1224
            </varlistentry>
1225
            <varlistentry>
1226
              <term>tags</term>
1227
              <listitem>
1228
                <simpara>comma-separated list of the instances's
1229
                tags</simpara>
1230
              </listitem>
1231
            </varlistentry>
1232
            <varlistentry>
1233
              <term>serial_no</term>
1234
              <listitem>
1235
                <simpara>the so called 'serial number' of the
1236
                instance; this is a numeric field that is incremented
1237
                each time the instance is modified, and it can be used
1238
                to track modifications</simpara>
1239
              </listitem>
1240
            </varlistentry>
1241
            <varlistentry>
1242
              <term>ctime</term>
1243
              <listitem>
1244
                <para>
1245
                  the creation time of the instance; note that this
1246
                  field contains spaces and as such it's harder to
1247
                  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
            <varlistentry>
1257
              <term>mtime</term>
1258
              <listitem>
1259
                <para>
1260
                  the last modification time of the instance; note
1261
                  that this field contains spaces and as such it's
1262
                  harder to parse
1263
                </para>
1264
                <para>
1265
                  if this attribute is not present (e.g. when
1266
                  upgrading from older versions), then "N/A" will be
1267
                  shown instead
1268
                </para>
1269
              </listitem>
1270
            </varlistentry>
1271

    
1272
            <varlistentry>
1273
              <term>uuid</term>
1274
              <listitem>
1275
                <simpara>Show the UUID of the instance (generated
1276
                automatically by Ganeti)</simpara>
1277
              </listitem>
1278
            </varlistentry>
1279

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

    
1417
        <para>
1418
          If the value of the option starts with the character
1419
          <constant>+</constant>, the new field(s) will be added to the
1420
          default list. This allows to quickly see the default list
1421
          plus a few other fields, instead of retyping the entire list
1422
          of fields.
1423
        </para>
1424

    
1425
        <para>
1426
          There is a subtle grouping about the available output
1427
          fields: all fields except for <option>oper_state</option>,
1428
          <option>oper_ram</option>, <option>oper_vcpus</option> and
1429
          <option>status</option> are
1430
          configuration value and not run-time values. So if you don't
1431
          select any of the these fields, the query will be satisfied
1432
          instantly from the cluster configuration, without having to
1433
          ask the remote nodes for the data. This can be helpful for
1434
          big clusters when you only want some data and it makes sense
1435
          to specify a reduced set of output fields.
1436
        </para>
1437

    
1438
        <para>The default output field list is:
1439
          <simplelist type="inline">
1440
            <member>name</member>
1441
            <member>os</member>
1442
            <member>pnode</member>
1443
            <member>admin_state</member>
1444
            <member>oper_state</member>
1445
            <member>oper_ram</member>
1446
          </simplelist>.
1447
        </para>
1448
      </refsect3>
1449

    
1450
      <refsect3>
1451
        <title>INFO</title>
1452

    
1453
        <cmdsynopsis>
1454
          <command>info</command>
1455
          <group>
1456
            <arg>-s</arg>
1457
            <arg>--static</arg>
1458
          </group>
1459
          <arg>--roman</arg>
1460
          <group choice="req">
1461
            <arg>--all</arg>
1462
            <arg rep="repeat"><replaceable>instance</replaceable></arg>
1463
          </group>
1464
        </cmdsynopsis>
1465

    
1466
        <para>
1467
          Show detailed information about the given instance(s). This is
1468
          different from <command>list</command> as it shows detailed data
1469
          about the instance's disks (especially useful for the drbd disk
1470
          template).
1471
        </para>
1472

    
1473
        <para>
1474
          If the option <option>-s</option> is used, only information
1475
          available in the configuration file is returned, without
1476
          querying nodes, making the operation faster.
1477
        </para>
1478

    
1479
        <para>
1480
          Use the <option>--all</option> to get info about all instances,
1481
          rather than explicitly passing the ones you're interested in.
1482
        </para>
1483

    
1484
        <para>
1485
          The <option>--roman</option> option can be used to cause envy among
1486
          people who like ancient cultures, but are stuck with non-latin-friendly
1487
          cluster virtualization technologies.
1488
        </para>
1489

    
1490
      </refsect3>
1491

    
1492
      <refsect3>
1493
        <title>MODIFY</title>
1494

    
1495
        <cmdsynopsis>
1496
          <command>modify</command>
1497
          <sbr>
1498
          <arg choice="opt">-H <replaceable>HYPERVISOR_PARAMETERS</replaceable></arg>
1499
          <sbr>
1500
          <arg choice="opt">-B <replaceable>BACKEND_PARAMETERS</replaceable></arg>
1501
          <sbr>
1502
          <group>
1503
            <arg>--net add<replaceable><optional>:options</optional></replaceable></arg>
1504
            <arg>--net remove</arg>
1505
            <arg>--net <replaceable>N:options</replaceable></arg>
1506
          </group>
1507
          <sbr>
1508
          <group>
1509
            <arg>--disk add:size=<replaceable>SIZE</replaceable></arg>
1510
            <arg>--disk remove</arg>
1511
            <arg>--disk <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></arg>
1512
          </group>
1513

    
1514
          <sbr>
1515
          <arg>-t<group choice="req">
1516
              <arg>plain</arg>
1517
              <arg>drbd</arg>
1518
            </group></arg>
1519

    
1520
          <sbr>
1521
            <arg>--os-name=<replaceable>OS</replaceable> <arg>--force-variant</arg></arg>
1522

    
1523
          <sbr>
1524
          <arg>--submit</arg>
1525
          <sbr>
1526
          <arg choice="req"><replaceable>instance</replaceable></arg>
1527
        </cmdsynopsis>
1528

    
1529
        <para>
1530
          Modifies the memory size, number of vcpus, ip address, MAC
1531
          address and/or nic parameters for an instance. It can also
1532
          add and remove disks and NICs to/from the instance. Note
1533
          that you need to give at least one of the arguments, otherwise
1534
          the command complains.
1535
        </para>
1536

    
1537
        <para>
1538
          The <option>-H</option> option specifies hypervisor options
1539
          in the form of <userinput>name=value[,...]</userinput>. For details which options can be specified, see the <command>add</command> command.
1540
        </para>
1541

    
1542
        <para>
1543
          The <option>-t</option> option will change the disk template
1544
          of the instance. Currently only conversions between the
1545
          plain and drbd disk templates are supported, and the
1546
          instance must be stopped before attempting the conversion.
1547
        </para>
1548

    
1549
        <para>
1550
          The <option>--disk
1551
          add:size=<replaceable>SIZE</replaceable></option> option
1552
          adds a disk to the instance. The <option>--disk
1553
          remove</option> will remove the last disk of the
1554
          instance. The <option>--disk
1555
          <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></option>
1556
          option will change the mode of the Nth disk of the instance
1557
          between read-only (<literal>ro</literal>) and read-write
1558
          (<literal>rw</literal>).
1559
        </para>
1560

    
1561
        <para>
1562
          The <option>--net
1563
          add:<replaceable>options</replaceable></option> option will
1564
          add a new NIC to the instance. The available options are the
1565
          same as in the <command>add</command> command (mac, ip, link,
1566
          mode). The <option>--net remove</option> will remove the
1567
          last NIC of the instance, while the <option>--net
1568
          <replaceable>N</replaceable>:<replaceable>options</replaceable></option>
1569
          option will change the parameters of the Nth instance NIC.
1570
        </para>
1571

    
1572
        <para>
1573
          The option <option>--os-name</option> will change the OS
1574
          name for the instance (without reinstallation). In case an
1575
          OS variant is specified that is not found, then by default
1576
          the modification is refused,
1577
          unless <option>--force-variant</option> is passed. An
1578
          invalid OS will also be refused, unless
1579
          the <option>--force</option> option is given.
1580
        </para>
1581

    
1582
        <para>
1583
          The <option>--submit</option> option is used to send the job to
1584
          the master daemon but not wait for its completion. The job
1585
          ID will be shown so that it can be examined via
1586
          <command>gnt-job info</command>.
1587
        </para>
1588

    
1589
        <para>
1590
          All the changes take effect at the next restart. If the
1591
          instance is running, there is no effect on the instance.
1592
        </para>
1593
      </refsect3>
1594

    
1595
      <refsect3>
1596
        <title>REINSTALL</title>
1597

    
1598
        <cmdsynopsis>
1599
          <command>reinstall</command>
1600
          <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
1601
          <arg>--select-os</arg>
1602
          <arg choice="opt">-f <replaceable>force</replaceable></arg>
1603
          <arg>--force-multiple</arg>
1604
          <sbr>
1605
          <group choice="opt">
1606
            <arg>--instance</arg>
1607
            <arg>--node</arg>
1608
            <arg>--primary</arg>
1609
            <arg>--secondary</arg>
1610
            <arg>--all</arg>
1611
          </group>
1612
          <arg>--submit</arg>
1613
          <arg choice="opt" rep="repeat"><replaceable>instance</replaceable></arg>
1614
        </cmdsynopsis>
1615

    
1616
        <para>
1617
          Reinstalls the operating system on the given instance(s). The
1618
          instance(s) must be stopped when running this command. If the
1619
          <option>--os-type</option> is specified, the operating
1620
          system is changed.
1621
        </para>
1622

    
1623
        <para>
1624
          The <option>--select-os</option> option switches to an
1625
          interactive OS reinstall. The user is prompted to select the OS
1626
          template from the list of available OS templates.
1627
        </para>
1628

    
1629
        <para>
1630
          Since this is a potentially dangerous command, the user will
1631
          be required to confirm this action, unless the
1632
          <option>-f</option> flag is passed. When multiple instances
1633
          are selected (either by passing multiple arguments or by
1634
          using the <option>--node</option>,
1635
          <option>--primary</option>, <option>--secondary</option> or
1636
          <option>--all</option> options), the user must pass both the
1637
          <option>--force</option> and
1638
          <option>--force-multiple</option> options to skip the
1639
          interactive confirmation.
1640
        </para>
1641

    
1642
        <para>
1643
          The <option>--submit</option> option is used to send the job to
1644
          the master daemon but not wait for its completion. The job
1645
          ID will be shown so that it can be examined via
1646
          <command>gnt-job info</command>.
1647
        </para>
1648

    
1649

    
1650
      </refsect3>
1651

    
1652
      <refsect3>
1653
        <title>RENAME</title>
1654

    
1655
        <cmdsynopsis>
1656
          <command>rename</command>
1657
          <arg>--no-ip-check</arg>
1658
          <arg>--submit</arg>
1659
          <arg choice="req"><replaceable>instance</replaceable></arg>
1660
          <arg choice="req"><replaceable>new_name</replaceable></arg>
1661
        </cmdsynopsis>
1662

    
1663
        <para>
1664
          Renames the given instance. The instance must be stopped
1665
          when running this command. The requirements for the new name
1666
          are the same as for adding an instance: the new name must be
1667
          resolvable and the IP it resolves to must not be reachable
1668
          (in order to prevent duplicate IPs the next time the
1669
          instance is started). The IP test can be skipped if the
1670
          <option>--no-ip-check</option> option is passed.
1671
        </para>
1672

    
1673
        <para>
1674
          The <option>--submit</option> option is used to send the job to
1675
          the master daemon but not wait for its completion. The job
1676
          ID will be shown so that it can be examined via
1677
          <command>gnt-job info</command>.
1678
        </para>
1679

    
1680
      </refsect3>
1681

    
1682
    </refsect2>
1683

    
1684
    <refsect2>
1685
      <title>Starting/stopping/connecting to console</title>
1686

    
1687
      <refsect3>
1688
        <title>STARTUP</title>
1689

    
1690
        <cmdsynopsis>
1691
          <command>startup</command>
1692
          <sbr>
1693
          <arg>--force</arg>
1694
          <sbr>
1695
          <arg>--force-multiple</arg>
1696
          <sbr>
1697
          <group choice="opt">
1698
            <arg>--instance</arg>
1699
            <arg>--node</arg>
1700
            <arg>--primary</arg>
1701
            <arg>--secondary</arg>
1702
            <arg>--all</arg>
1703
            <arg>--tags</arg>
1704
            <arg>--node-tags</arg>
1705
            <arg>--pri-node-tags</arg>
1706
            <arg>--sec-node-tags</arg>
1707
          </group>
1708
          <sbr>
1709
          <arg>-H <option>key=value...</option></arg>
1710
          <arg>-B <option>key=value...</option></arg>
1711
          <sbr>
1712
          <arg>--submit</arg>
1713
          <sbr>
1714
          <arg choice="opt"
1715
          rep="repeat"><replaceable>name</replaceable></arg>
1716
        </cmdsynopsis>
1717

    
1718
        <para>
1719
          Starts one or more instances, depending on the following
1720
          options. The four available modes are:
1721
          <variablelist>
1722
            <varlistentry>
1723
              <term><option>--instance</option></term>
1724
              <listitem>
1725
                <simpara>will start the instances given as arguments
1726
                (at least one argument required); this is the default
1727
                selection</simpara>
1728
              </listitem>
1729
            </varlistentry>
1730
            <varlistentry>
1731
              <term>--node</term>
1732
              <listitem>
1733
                <simpara>will start the instances who have the given
1734
                node as either primary or secondary</simpara>
1735
              </listitem>
1736
            </varlistentry>
1737
            <varlistentry>
1738
              <term><option>--primary</option></term>
1739
              <listitem>
1740
                <simpara>will start all instances whose primary node
1741
                is in the list of nodes passed as arguments (at least
1742
                one node required)</simpara>
1743
              </listitem>
1744
            </varlistentry>
1745
            <varlistentry>
1746
              <term><option>--secondary</option></term>
1747
              <listitem>
1748
                <simpara>will start all instances whose secondary node
1749
                is in the list of nodes passed as arguments (at least
1750
                one node required)</simpara>
1751
              </listitem>
1752
            </varlistentry>
1753
            <varlistentry>
1754
              <term>--all</term>
1755
              <listitem>
1756
                <simpara>will start all instances in the cluster (no
1757
                arguments accepted)</simpara>
1758
              </listitem>
1759
            </varlistentry>
1760
            <varlistentry>
1761
              <term>--tags</term>
1762
              <listitem>
1763
                <simpara>will start all instances in the cluster with
1764
                the tags given as arguments</simpara>
1765
              </listitem>
1766
            </varlistentry>
1767
            <varlistentry>
1768
              <term>--node-tags</term>
1769
              <listitem>
1770
                <simpara>will start all instances in the cluster on
1771
                nodes with the tags given as arguments</simpara>
1772
              </listitem>
1773
            </varlistentry>
1774
            <varlistentry>
1775
              <term>--pri-node-tags</term>
1776
              <listitem>
1777
                <simpara>will start all instances in the cluster on
1778
                primary nodes with the tags given as
1779
                arguments</simpara>
1780
              </listitem>
1781
            </varlistentry>
1782
            <varlistentry>
1783
              <term>--sec-node-tags</term>
1784
              <listitem>
1785
                <simpara>will start all instances in the cluster on
1786
                secondary nodes with the tags given as
1787
                arguments</simpara>
1788
              </listitem>
1789
            </varlistentry>
1790
          </variablelist>
1791
        </para>
1792

    
1793
        <para>
1794
          Note that although you can pass more than one selection
1795
          option, the last one wins, so in order to guarantee the
1796
          desired result, don't pass more than one such option.
1797
        </para>
1798

    
1799
        <para>
1800
          Use <option>--force</option> to start even if secondary disks are
1801
          failing.
1802
        </para>
1803

    
1804
        <para>
1805
          The <option>--force-multiple</option> will skip the
1806
          interactive confirmation in the case the more than one
1807
          instance will be affected.
1808
        </para>
1809

    
1810
        <para>
1811
          The <option>-H</option> and <option>-B</option> options
1812
          specify temporary hypervisor and backend parameters that can
1813
          be used to start an instance with modified parameters. They
1814
          can be useful for quick testing without having to modify an
1815
          instance back and forth, e.g.:
1816
          <screen>
1817
# gnt-instance start -H root_args="single" instance1
1818
# gnt-instance start -B memory=2048 instance2
1819
          </screen>
1820
          The first form will start the instance
1821
          <userinput>instance1</userinput> in single-user mode, and
1822
          the instance <userinput>instance2</userinput> with 2GB of
1823
          RAM (this time only, unless that is the actual instance
1824
          memory size already). Note that the values override the
1825
          instance parameters (and not extend them): an instance with
1826
          "root_args=ro" when started with <userinput>-H
1827
          root_args=single</userinput> will result in "single", not
1828
          "ro single".
1829
        </para>
1830

    
1831
        <para>
1832
          The <option>--submit</option> option is used to send the job to
1833
          the master daemon but not wait for its completion. The job
1834
          ID will be shown so that it can be examined via
1835
          <command>gnt-job info</command>.
1836
        </para>
1837

    
1838
        <para>
1839
          Example:
1840
          <screen>
1841
# gnt-instance start instance1.example.com
1842
# gnt-instance start --node node1.example.com node2.example.com
1843
# gnt-instance start --all
1844
          </screen>
1845
        </para>
1846
      </refsect3>
1847

    
1848
      <refsect3>
1849
        <title>SHUTDOWN</title>
1850

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

    
1876
        <para>
1877
          Stops one or more instances. If the instance cannot be
1878
          cleanly stopped during a hardcoded interval (currently 2
1879
          minutes), it will forcibly stop the instance (equivalent to
1880
          switching off the power on a physical machine).
1881
        </para>
1882

    
1883
        <para>
1884
          The <option>--timeout</option> is used to specify how much time to
1885
          wait before forcing the shutdown (xm destroy in xen, killing the kvm
1886
          process, for kvm). By default two minutes are given to each instance
1887
          to stop.
1888
        </para>
1889

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

    
1900
        <para>
1901
          The <option>--submit</option> option is used to send the job to
1902
          the master daemon but not wait for its completion. The job
1903
          ID will be shown so that it can be examined via
1904
          <command>gnt-job info</command>.
1905
        </para>
1906

    
1907

    
1908
        <para>
1909
          Example:
1910
          <screen>
1911
# gnt-instance shutdown instance1.example.com
1912
# gnt-instance shutdown --all
1913
          </screen>
1914
        </para>
1915
      </refsect3>
1916

    
1917
      <refsect3>
1918
        <title>REBOOT</title>
1919

    
1920
        <cmdsynopsis>
1921
          <command>reboot</command>
1922
          <sbr>
1923
          <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
1924
          <sbr>
1925
          <arg>--ignore-secondaries</arg>
1926
          <sbr>
1927
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
1928
          <sbr>
1929
          <arg>--force-multiple</arg>
1930
          <sbr>
1931
          <group choice="opt">
1932
            <arg>--instance</arg>
1933
            <arg>--node</arg>
1934
            <arg>--primary</arg>
1935
            <arg>--secondary</arg>
1936
            <arg>--all</arg>
1937
            <arg>--tags</arg>
1938
            <arg>--node-tags</arg>
1939
            <arg>--pri-node-tags</arg>
1940
            <arg>--sec-node-tags</arg>
1941
          </group>
1942
          <sbr>
1943
          <arg>--submit</arg>
1944
          <sbr>
1945
          <arg choice="opt"
1946
          rep="repeat"><replaceable>name</replaceable></arg>
1947
        </cmdsynopsis>
1948

    
1949
        <para>
1950
          Reboots one or more instances. The type of reboot depends on
1951
          the value of <option>--type</option>. A soft reboot does a
1952
          hypervisor reboot, a hard reboot does a instance stop,
1953
          recreates the hypervisor config for the instance and
1954
          starts the instance. A full reboot does the equivalent
1955
          of <command>gnt-instance shutdown &amp;&amp; gnt-instance
1956
          startup</command>. The default is hard reboot.
1957
        </para>
1958

    
1959
        <para>
1960
          For the hard reboot the option
1961
          <option>--ignore-secondaries</option> ignores errors for the
1962
          secondary node while re-assembling the instance disks.
1963
        </para>
1964

    
1965
        <para>
1966
          The <option>--instance</option>, <option>--node</option>,
1967
          <option>--primary</option>, <option>--secondary</option>,
1968
          <option>--all</option>, <option>--tags</option>,
1969
          <option>--node-tags</option>, <option>--pri-node-tags</option> and
1970
          <option>--sec-node-tags</option> options are similar as for the
1971
          <command>startup</command> command and they influence the
1972
          actual instances being rebooted.
1973
        </para>
1974

    
1975
        <para>
1976
          The <option>--shutdown-timeout</option> is used to specify how
1977
          much time to wait before forcing the shutdown (xm destroy in xen,
1978
          killing the kvm process, for kvm). By default two minutes are
1979
          given to each instance to stop.
1980
        </para>
1981

    
1982
        <para>
1983
          The <option>--force-multiple</option> will skip the
1984
          interactive confirmation in the case the more than one
1985
          instance will be affected.
1986
        </para>
1987

    
1988
        <para>
1989
          Example:
1990
          <screen>
1991
# gnt-instance reboot instance1.example.com
1992
# gnt-instance reboot --type=full instance1.example.com
1993
          </screen>
1994
        </para>
1995
      </refsect3>
1996

    
1997
      <refsect3>
1998
        <title>CONSOLE</title>
1999
        <cmdsynopsis>
2000
          <command>console</command>
2001
          <arg choice="opt">--show-cmd</arg>
2002
          <arg choice="req"><replaceable>instance</replaceable></arg>
2003
        </cmdsynopsis>
2004

    
2005
        <para>
2006
          Connects to the console of the given instance. If the
2007
          instance is not up, an error is returned. Use the
2008
          <option>--show-cmd</option> option to display the command
2009
          instead of executing it.
2010
        </para>
2011

    
2012
        <para>
2013
          For HVM instances, this will attempt to connect to the
2014
          serial console of the instance. To connect to the
2015
          virtualized "physical" console of a HVM instance, use a VNC
2016
          client with the connection info from the
2017
          <command>info</command> command.
2018
        </para>
2019

    
2020
        <para>
2021
          Example:
2022
          <screen>
2023
# gnt-instance console instance1.example.com
2024
          </screen>
2025
        </para>
2026
      </refsect3>
2027

    
2028
    </refsect2>
2029

    
2030
    <refsect2>
2031
      <title>Disk management</title>
2032

    
2033
      <refsect3>
2034
        <title>REPLACE-DISKS</title>
2035

    
2036
        <cmdsynopsis>
2037
          <command>replace-disks</command>
2038
          <arg>--submit</arg>
2039
          <arg>--early-release</arg>
2040
          <arg choice="req">-p</arg>
2041
          <arg>--disks <replaceable>idx</replaceable></arg>
2042
          <arg choice="req"><replaceable>instance</replaceable></arg>
2043
        </cmdsynopsis>
2044

    
2045
        <cmdsynopsis>
2046
          <command>replace-disks</command>
2047
          <arg>--submit</arg>
2048
          <arg>--early-release</arg>
2049
          <arg choice="req">-s</arg>
2050
          <arg>--disks <replaceable>idx</replaceable></arg>
2051
          <arg choice="req"><replaceable>instance</replaceable></arg>
2052
        </cmdsynopsis>
2053

    
2054
        <cmdsynopsis>
2055
          <command>replace-disks</command>
2056
          <arg>--submit</arg>
2057
          <arg>--early-release</arg>
2058
          <group choice="req">
2059
            <arg>--iallocator <replaceable>name</replaceable></arg>
2060
            <arg>--new-secondary <replaceable>NODE</replaceable></arg>
2061
          </group>
2062

    
2063
          <arg choice="req"><replaceable>instance</replaceable></arg>
2064
        </cmdsynopsis>
2065

    
2066
        <cmdsynopsis>
2067
          <command>replace-disks</command>
2068
          <arg>--submit</arg>
2069
          <arg>--early-release</arg>
2070
          <arg choice="req">--auto</arg>
2071
          <arg choice="req"><replaceable>instance</replaceable></arg>
2072
        </cmdsynopsis>
2073

    
2074
        <para>
2075
          This command is a generalized form for replacing disks. It
2076
          is currently only valid for the mirrored (DRBD) disk
2077
          template.
2078
        </para>
2079

    
2080
        <para>
2081
          The first form (when passing the <option>-p</option> option)
2082
          will replace the disks on the primary, while the second form
2083
          (when passing the <option>-s</option> option will replace
2084
          the disks on the secondary node. For these two cases (as the
2085
          node doesn't change), it is possible to only run the replace
2086
          for a subset of the disks, using the option
2087
          <option>--disks</option> which takes a list of
2088
          comma-delimited disk indices (zero-based),
2089
          e.g. <userinput>0,2</userinput> to replace only the first
2090
          and third disks.
2091
        </para>
2092

    
2093
        <para>
2094
          The third form (when passing either the
2095
          <option>--iallocator</option> or the
2096
          <option>--new-secondary</option> option) is designed to
2097
          change secondary node of the instance.  Specifying
2098
          <option>--iallocator</option> makes the new secondary be
2099
          selected automatically by the specified allocator plugin,
2100
          otherwise the new secondary node will be the one chosen
2101
          manually via the <option>--new-secondary</option> option.
2102
        </para>
2103

    
2104
        <para>
2105
          The fourth form (when using <option>--auto</option>) will
2106
          automatically determine which disks of an instance are faulty and
2107
          replace them within the same node. The <option>--auto</option>
2108
          option works only when an instance has only faulty disks on
2109
          either the primary or secondary node; it doesn't work when
2110
          both sides have faulty disks.
2111
        </para>
2112

    
2113
        <para>
2114
          The <option>--submit</option> option is used to send the job to
2115
          the master daemon but not wait for its completion. The job
2116
          ID will be shown so that it can be examined via
2117
          <command>gnt-job info</command>.
2118
        </para>
2119

    
2120
        <para>
2121
          The <option>--early-release</option> changes the code so
2122
          that the old storage on secondary node(s) is removed early
2123
          (before the resync is completed) and the internal Ganeti
2124
          locks for the current (and new, if any) secondary node are
2125
          also released, thus allowing more parallelism in the cluster
2126
          operation. This should be used only when recovering from a
2127
          disk failure on the current secondary (thus the old storage
2128
          is already broken) or when the storage on the primary node
2129
          is known to be fine (thus we won't need the old storage for
2130
          potential recovery).
2131
        </para>
2132

    
2133
        <para>
2134
          Note that it is not possible to select an offline or drained
2135
          node as a new secondary.
2136
        </para>
2137

    
2138
      </refsect3>
2139

    
2140
      <refsect3>
2141
        <title>ACTIVATE-DISKS</title>
2142

    
2143
        <cmdsynopsis>
2144
          <command>activate-disks</command>
2145
          <arg>--submit</arg>
2146
          <arg>--ignore-size</arg>
2147
          <arg choice="req"><replaceable>instance</replaceable></arg>
2148
        </cmdsynopsis>
2149
        <para>
2150
          Activates the block devices of the given instance. If
2151
          successful, the command will show the location and name of
2152
          the block devices:
2153
          <screen>
2154
node1.example.com:disk/0:/dev/drbd0
2155
node1.example.com:disk/1:/dev/drbd1
2156
          </screen>
2157

    
2158
          In this example, <emphasis>node1.example.com</emphasis> is
2159
          the name of the node on which the devices have been
2160
          activated. The <emphasis>disk/0</emphasis> and
2161
          <emphasis>disk/1</emphasis> are the Ganeti-names of the
2162
          instance disks; how they are visible inside the instance is
2163
          hypervisor-specific. <emphasis>/dev/drbd0</emphasis> and
2164
          <emphasis>/dev/drbd1</emphasis> are the actual block devices
2165
          as visible on the node.
2166
        </para>
2167

    
2168
        <para>
2169
          The <option>--submit</option> option is used to send the job to
2170
          the master daemon but not wait for its completion. The job
2171
          ID will be shown so that it can be examined via
2172
          <command>gnt-job info</command>.
2173
        </para>
2174

    
2175
        <para>
2176
          The <option>--ignore-size</option> option can be used to
2177
          activate disks ignoring the currently configured size in
2178
          Ganeti. This can be used in cases where the configuration
2179
          has gotten out of sync with the real-world (e.g. after a
2180
          partially-failed grow-disk operation or due to rounding in
2181
          LVM devices). This should not be used in normal cases, but
2182
          only when activate-disks fails without it.
2183
        </para>
2184

    
2185
        <para>
2186
          Note that it is safe to run this command while the instance
2187
          is already running.
2188
        </para>
2189
      </refsect3>
2190

    
2191
      <refsect3>
2192
        <title>DEACTIVATE-DISKS</title>
2193

    
2194
        <cmdsynopsis>
2195
          <command>deactivate-disks</command>
2196
          <arg>--submit</arg>
2197
          <arg choice="req"><replaceable>instance</replaceable></arg>
2198
        </cmdsynopsis>
2199
        <para>
2200
          De-activates the block devices of the given instance. Note
2201
          that if you run this command for an instance with a drbd
2202
          disk template, while it is running, it will not be able to
2203
          shutdown the block devices on the primary node, but it will
2204
          shutdown the block devices on the secondary nodes, thus
2205
          breaking the replication.
2206
        </para>
2207

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

    
2215
      </refsect3>
2216

    
2217
      <refsect3>
2218
        <title>GROW-DISK</title>
2219
        <cmdsynopsis>
2220
          <command>grow-disk</command>
2221
          <arg>--no-wait-for-sync</arg>
2222
          <arg>--submit</arg>
2223
          <arg choice="req"><replaceable>instance</replaceable></arg>
2224
          <arg choice="req"><replaceable>disk</replaceable></arg>
2225
          <arg choice="req"><replaceable>amount</replaceable></arg>
2226
        </cmdsynopsis>
2227

    
2228
        <para>
2229
          Grows an instance's disk. This is only possible for
2230
          instances having a <literal>plain</literal> or
2231
          <literal>drbd</literal> disk template.
2232
        </para>
2233

    
2234
        <para>
2235
          Note that this command only change the block device size; it
2236
          will not grow the actual filesystems, partitions, etc. that
2237
          live on that disk. Usually, you will need to:
2238
          <orderedlist>
2239
            <listitem>
2240
              <simpara>use <command>gnt-instance grow-disk</command></simpara>
2241
            </listitem>
2242
            <listitem>
2243
              <simpara>reboot the instance (later, at a convenient
2244
              time)</simpara>
2245
            </listitem>
2246
            <listitem>
2247
              <simpara>use a filesystem resizer, such as
2248
              <citerefentry> <refentrytitle>ext2online</refentrytitle>
2249
              <manvolnum>8</manvolnum> </citerefentry> or
2250
              <citerefentry> <refentrytitle>xfs_growfs</refentrytitle>
2251
              <manvolnum>8</manvolnum> </citerefentry> to resize the
2252
              filesystem, or use <citerefentry>
2253
              <refentrytitle>fdisk</refentrytitle>
2254
              <manvolnum>8</manvolnum> </citerefentry> to change the
2255
              partition table on the disk
2256
              </simpara>
2257
            </listitem>
2258
          </orderedlist>
2259
        </para>
2260

    
2261

    
2262
        <para>
2263
          The <replaceable>disk</replaceable> argument is the index of
2264
          the instance disk to grow. The
2265
          <replaceable>amount</replaceable> argument is given either
2266
          as a number (and it represents the amount to increase the
2267
          disk with in mebibytes) or can be given similar to the
2268
          arguments in the create instance operation, with a suffix
2269
          denoting the unit.
2270
        </para>
2271

    
2272
        <para>
2273
          Note that the disk grow operation might complete on one node
2274
          but fail on the other; this will leave the instance with
2275
          different-sized LVs on the two nodes, but this will not
2276
          create problems (except for unused space).
2277
        </para>
2278

    
2279
        <para>
2280
          If you do not want gnt-instance to wait for the new disk
2281
          region to be synced, use the
2282
          <option>--no-wait-for-sync</option> option.
2283
        </para>
2284

    
2285
        <para>
2286
          The <option>--submit</option> option is used to send the job to
2287
          the master daemon but not wait for its completion. The job
2288
          ID will be shown so that it can be examined via
2289
          <command>gnt-job info</command>.
2290
        </para>
2291

    
2292

    
2293
        <para>Example (increase the first disk for instance1 by 16GiB):
2294
          <screen>
2295
# gnt-instance grow-disk instance1.example.com 0 16g
2296
          </screen>
2297
        </para>
2298

    
2299
        <para>
2300
          Also note that disk shrinking is not supported; use
2301
          <command>gnt-backup export</command> and then
2302
          <command>gnt-backup import</command> to reduce the disk size
2303
          of an instance.
2304
        </para>
2305
      </refsect3>
2306

    
2307
      <refsect3>
2308
        <title>RECREATE-DISKS</title>
2309

    
2310
        <cmdsynopsis>
2311
          <command>recreate-disks</command>
2312
          <arg>--submit</arg>
2313
          <arg>--disks=<option>indices</option></arg>
2314
          <arg choice="req"><replaceable>instance</replaceable></arg>
2315
        </cmdsynopsis>
2316
        <para>
2317
          Recreates the disks of the given instance, or only a subset
2318
          of the disks (if the option <option>disks</option> is
2319
          passed, which must be a comma-separated list of disk
2320
          indices, starting from zero).
2321
        </para>
2322

    
2323
        <para>
2324
          Note that this functionality should only be used for missing
2325
          disks; if any of the given disks already exists, the
2326
          operation will fail. While this is suboptimal,
2327
          recreate-disks should hopefully not be needed in normal
2328
          operation and as such the impact of this is low.
2329
        </para>
2330

    
2331
        <para>
2332
          The <option>--submit</option> option is used to send the job to
2333
          the master daemon but not wait for its completion. The job
2334
          ID will be shown so that it can be examined via
2335
          <command>gnt-job info</command>.
2336
        </para>
2337

    
2338
      </refsect3>
2339

    
2340
    </refsect2>
2341

    
2342
    <refsect2>
2343
      <title>Recovery</title>
2344

    
2345
      <refsect3>
2346
        <title>FAILOVER</title>
2347

    
2348
        <cmdsynopsis>
2349
          <command>failover</command>
2350
          <arg>-f</arg>
2351
          <arg>--ignore-consistency</arg>
2352
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2353
          <arg>--submit</arg>
2354
          <arg choice="req"><replaceable>instance</replaceable></arg>
2355
        </cmdsynopsis>
2356

    
2357
        <para>
2358
          Failover will fail the instance over its secondary
2359
          node. This works only for instances having a drbd disk
2360
          template.
2361
        </para>
2362

    
2363
        <para>
2364
          Normally the failover will check the consistency of the
2365
          disks before failing over the instance. If you are trying to
2366
          migrate instances off a dead node, this will fail. Use the
2367
          <option>--ignore-consistency</option> option for this
2368
          purpose. Note that this option can be dangerous as errors in
2369
          shutting down the instance will be ignored, resulting in
2370
          possibly having the instance running on two machines in
2371
          parallel (on disconnected DRBD drives).
2372
        </para>
2373

    
2374
        <para>
2375
          The <option>--shutdown-timeout</option> is used to specify how
2376
          much time to wait before forcing the shutdown (xm destroy in xen,
2377
          killing the kvm process, for kvm). By default two minutes are
2378
          given to each instance to stop.
2379
        </para>
2380

    
2381
        <para>
2382
          The <option>--submit</option> option is used to send the job to
2383
          the master daemon but not wait for its completion. The job
2384
          ID will be shown so that it can be examined via
2385
          <command>gnt-job info</command>.
2386
        </para>
2387

    
2388
        <para>
2389
          Example:
2390
          <screen>
2391
# gnt-instance failover instance1.example.com
2392
          </screen>
2393
        </para>
2394
      </refsect3>
2395

    
2396
      <refsect3>
2397
        <title>MIGRATE</title>
2398

    
2399
        <cmdsynopsis>
2400
          <command>migrate</command>
2401
          <arg>-f</arg>
2402
          <arg choice="req">--cleanup</arg>
2403
          <arg choice="req"><replaceable>instance</replaceable></arg>
2404
        </cmdsynopsis>
2405

    
2406
        <cmdsynopsis>
2407
          <command>migrate</command>
2408
          <arg>-f</arg>
2409
          <arg>--non-live</arg>
2410
          <arg>--migration-mode=live|non-live</arg>
2411
          <arg choice="req"><replaceable>instance</replaceable></arg>
2412
        </cmdsynopsis>
2413

    
2414
        <para>
2415
          Migrate will move the instance to its secondary node without
2416
          shutdown. It only works for instances having the drbd8 disk
2417
          template type.
2418
        </para>
2419

    
2420
        <para>
2421
          The migration command needs a perfectly healthy instance, as
2422
          we rely on the dual-master capability of drbd8 and the disks
2423
          of the instance are not allowed to be degraded.
2424
        </para>
2425

    
2426
        <para>
2427
          The <option>--non-live</option>
2428
          and <option>--migration-mode=non-live</option> options will
2429
          switch (for the hypervisors that support it) between a
2430
          "fully live" (i.e. the interruption is as minimal as
2431
          possible) migration and one in which the instance is frozen,
2432
          its state saved and transported to the remote node, and then
2433
          resumed there. This all depends on the hypervisor support
2434
          for two different methods. In any case, it is not an error
2435
          to pass this parameter (it will just be ignored if the
2436
          hypervisor doesn't support it). The
2437
          option <option>--migration-mode=live</option> option will
2438
          request a fully-live migration. The default, when neither
2439
          option is passed, depends on the hypervisor parameters (and
2440
          can be viewed with the <command>gnt-cluster info</command>
2441
          command).
2442
        </para>
2443

    
2444
        <para>
2445
          If the <option>--cleanup</option> option is passed, the
2446
          operation changes from migration to attempting recovery from
2447
          a failed previous migration. In this mode, Ganeti checks if
2448
          the instance runs on the correct node (and updates its
2449
          configuration if not) and ensures the instances's disks are
2450
          configured correctly. In this mode, the
2451
          <option>--non-live</option> option is ignored.
2452
        </para>
2453

    
2454
        <para>
2455
          The option <option>-f</option> will skip the prompting for
2456
          confirmation.
2457
        </para>
2458
        <para>
2459
          Example (and expected output):
2460
          <screen>
2461
# gnt-instance migrate instance1
2462
Migrate will happen to the instance instance1. Note that migration is
2463
**experimental** in this version. This might impact the instance if
2464
anything goes wrong. Continue?
2465
y/[n]/?: y
2466
* checking disk consistency between source and target
2467
* ensuring the target is in secondary mode
2468
* changing disks into dual-master mode
2469
 - INFO: Waiting for instance instance1 to sync disks.
2470
 - INFO: Instance instance1's disks are in sync.
2471
* migrating instance to node2.example.com
2472
* changing the instance's disks on source node to secondary
2473
 - INFO: Waiting for instance instance1 to sync disks.
2474
 - INFO: Instance instance1's disks are in sync.
2475
* changing the instance's disks to single-master
2476
#
2477
          </screen>
2478
        </para>
2479
      </refsect3>
2480

    
2481
      <refsect3>
2482
        <title>MOVE</title>
2483

    
2484
        <cmdsynopsis>
2485
          <command>move</command>
2486
          <arg>-f</arg>
2487
          <arg>-n <replaceable>node</replaceable></arg>
2488
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2489
          <arg>--submit</arg>
2490
          <arg choice="req"><replaceable>instance</replaceable></arg>
2491
        </cmdsynopsis>
2492

    
2493
        <para>
2494
          Move will move the instance to an arbitrary node in the
2495
          cluster. This works only for instances having a plain or
2496
          file disk template.
2497
        </para>
2498

    
2499
        <para>
2500
          Note that since this operation is done via data copy, it
2501
          will take a long time for big disks (similar to
2502
          replace-disks for a drbd instance).
2503
        </para>
2504

    
2505
        <para>
2506
          The <option>--shutdown-timeout</option> is used to specify how
2507
          much time to wait before forcing the shutdown (xm destroy in xen,
2508
          killing the kvm process, for kvm). By default two minutes are
2509
          given to each instance to stop.
2510
        </para>
2511

    
2512
        <para>
2513
          The <option>--submit</option> option is used to send the job to
2514
          the master daemon but not wait for its completion. The job
2515
          ID will be shown so that it can be examined via
2516
          <command>gnt-job info</command>.
2517
        </para>
2518

    
2519
        <para>
2520
          Example:
2521
          <screen>
2522
# gnt-instance move -n node3.example.com instance1.example.com
2523
          </screen>
2524
        </para>
2525
      </refsect3>
2526

    
2527
    </refsect2>
2528

    
2529
    <refsect2>
2530
      <title>TAGS</title>
2531

    
2532
    <refsect3>
2533
        <title>ADD-TAGS</title>
2534

    
2535
        <cmdsynopsis>
2536
          <command>add-tags</command>
2537
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2538
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2539
          <arg choice="req"
2540
            rep="repeat"><replaceable>tag</replaceable></arg>
2541
        </cmdsynopsis>
2542

    
2543
        <para>
2544
          Add tags to the given instance. If any of the tags contains
2545
          invalid characters, the entire operation will abort.
2546
        </para>
2547
        <para>
2548
          If the <option>--from</option> option is given, the list of
2549
          tags will be extended with the contents of that file (each
2550
          line becomes a tag). In this case, there is not need to pass
2551
          tags on the command line (if you do, both sources will be
2552
          used). A file name of - will be interpreted as stdin.
2553
        </para>
2554
      </refsect3>
2555

    
2556
      <refsect3>
2557
        <title>LIST-TAGS</title>
2558

    
2559
        <cmdsynopsis>
2560
          <command>list-tags</command>
2561
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2562
        </cmdsynopsis>
2563

    
2564
        <para>List the tags of the given instance.</para>
2565
      </refsect3>
2566

    
2567
      <refsect3>
2568
        <title>REMOVE-TAGS</title>
2569
        <cmdsynopsis>
2570
          <command>remove-tags</command>
2571
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2572
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2573
          <arg choice="req"
2574
            rep="repeat"><replaceable>tag</replaceable></arg>
2575
        </cmdsynopsis>
2576

    
2577
        <para>
2578
          Remove tags from the given instance. If any of the tags are
2579
          not existing on the node, the entire operation will abort.
2580
        </para>
2581

    
2582
        <para>
2583
          If the <option>--from</option> option is given, the list of
2584
          tags will be extended with the contents of that file (each
2585
          line becomes a tag). In this case, there is not need to pass
2586
          tags on the command line (if you do, both sources will be
2587
          used). A file name of - will be interpreted as stdin.
2588
        </para>
2589
      </refsect3>
2590

    
2591
    </refsect2>
2592

    
2593
  </refsect1>
2594

    
2595
  &footer;
2596

    
2597
</refentry>
2598

    
2599
<!-- Keep this comment at the end of the file
2600
Local variables:
2601
mode: sgml
2602
sgml-omittag:t
2603
sgml-shorttag:t
2604
sgml-minimize-attributes:nil
2605
sgml-always-quote-attributes:t
2606
sgml-indent-step:2
2607
sgml-indent-data:t
2608
sgml-parent-document:nil
2609
sgml-default-dtd-file:nil
2610
sgml-exposed-tags:nil
2611
sgml-local-catalogs:nil
2612
sgml-local-ecat-files:nil
2613
End:
2614
-->