Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ 3d95cd0d

History | View | Annotate | Download (96.9 kB)

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

    
3
  <!-- Fill in your name for FIRSTNAME and SURNAME. -->
4
  <!-- Please adjust the date whenever revising the manpage. -->
5
  <!ENTITY dhdate      "<date>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 specify the exact the units used;
140
          these suffixes map to mebibytes, gibibytes and tebibytes.
141
        </para>
142

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
628
              </listitem>
629
            </varlistentry>
630

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

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

    
644
              </listitem>
645
            </varlistentry>
646

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

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

    
658
              </listitem>
659
            </varlistentry>
660

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

    
666
                <simpara>This option passes the -mem-path argument to kvm with
667
                the path (on the node) to the mount point of the hugetlbfs
668
                file system, along with the -mem-prealloc argument too.
669
                </simpara>
670

    
671
              </listitem>
672
            </varlistentry>
673

    
674
            <varlistentry>
675
              <term>use_chroot</term>
676
              <listitem>
677
                <simpara>Valid for the KVM hypervisor.</simpara>
678

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

    
688
                <simpara>It is set to <quote>false</quote> by default.</simpara>
689
              </listitem>
690
            </varlistentry>
691

    
692
            <varlistentry>
693
              <term>migration_downtime</term>
694
              <listitem>
695
                <simpara>Valid for the KVM hypervisor.</simpara>
696

    
697
                <simpara>The maximum amount of time (in ms) a KVM instance is
698
                allowed to be frozen during a live migration, in order to copy
699
                dirty memory pages. Default value is 30ms, but you may need to
700
                increase this value for busy instances.
701
                </simpara>
702

    
703
                <simpara>This option is only effective with kvm versions >= 87
704
                and qemu-kvm versions >= 0.11.0.
705
                </simpara>
706
              </listitem>
707
            </varlistentry>
708

    
709
            <varlistentry>
710
              <term>use_chroot</term>
711
              <listitem>
712
                <simpara>Valid for the KVM hypervisor.</simpara>
713

    
714
                <simpara>This boolean option determines wether to run the KVM
715
                instance in a chroot directory.
716
                </simpara>
717

    
718
                <para>If it is set to <quote>true</quote>, an empty
719
                directory is created before starting the instance and
720
                its path is passed via the <option>-chroot</option>
721
                flag to kvm.  The directory is removed when the
722
                instance is stopped.
723
                </para>
724

    
725
                <simpara>It is set to <quote>false</quote> by
726
                default.</simpara>
727

    
728
              </listitem>
729
            </varlistentry>
730

    
731
            <varlistentry>
732
              <term>cpu_mask</term>
733
              <listitem>
734
                <simpara>Valid for the LXC hypervisor.</simpara>
735

    
736
                <simpara>The processes belonging to the given instance are
737
                only scheduled on the specified CPUs.
738
                </simpara>
739

    
740
                <simpara>
741
                The parameter format is a comma-separated list of CPU IDs or
742
                CPU ID ranges. The ranges are defined by a lower and higher
743
                boundary, separated by a dash. The boundaries are inclusive.
744
                </simpara>
745

    
746
              </listitem>
747
            </varlistentry>
748

    
749
            <varlistentry>
750
              <term>usb_mouse</term>
751
              <listitem>
752
                <simpara>Valid for the KVM hypervisor.</simpara>
753

    
754
                <simpara>This option specifies the usb mouse type to be used.
755
                It can be <quote>mouse</quote> or <quote>tablet</quote>. When
756
                using VNC it's recommended to set it to <quote>tablet</quote>.
757
                </simpara>
758
              </listitem>
759
            </varlistentry>
760

    
761
          </variablelist>
762

    
763
        </para>
764

    
765
        <para>
766
          The <option>--iallocator</option> option specifies the instance
767
          allocator plugin to use. If you pass in this option the allocator
768
          will select nodes for this instance automatically, so you don't need
769
          to pass them with the <option>-n</option> option. For more
770
          information please refer to the instance allocator documentation.
771
        </para>
772

    
773
        <para>
774
          The <option>-t</option> options specifies the disk layout type for
775
          the instance. The available choices are:
776
          <variablelist>
777
            <varlistentry>
778
              <term>diskless</term>
779
              <listitem>
780
                <para>
781
                  This creates an instance with no disks. Its useful for
782
                  testing only (or other special cases).
783
                </para>
784
              </listitem>
785
            </varlistentry>
786
            <varlistentry>
787
              <term>file</term>
788
              <listitem>
789
                <para>Disk devices will be regular files.</para>
790
              </listitem>
791
            </varlistentry>
792
            <varlistentry>
793
              <term>plain</term>
794
              <listitem>
795
                <para>Disk devices will be logical volumes.</para>
796
              </listitem>
797
            </varlistentry>
798
            <varlistentry>
799
              <term>drbd</term>
800
              <listitem>
801
                <para>
802
                  Disk devices will be drbd (version 8.x) on top of
803
                  lvm volumes.
804
                </para>
805
              </listitem>
806
            </varlistentry>
807
          </variablelist>
808
        </para>
809

    
810
        <para>
811
          The optional second value of the <option>--node</option> is used for
812
          the drbd template type and specifies the remote node.
813
        </para>
814

    
815
        <para>
816
          If you do not want gnt-instance to wait for the disk mirror
817
          to be synced, use the <option>--no-wait-for-sync</option>
818
          option.
819
        </para>
820

    
821
        <para>
822
          The <option>--file-storage-dir</option> specifies the relative path
823
          under the cluster-wide file storage directory to store file-based
824
          disks. It is useful for having different subdirectories for
825
          different instances. The full path of the directory where the disk
826
          files are stored will consist of cluster-wide file storage directory
827
          + optional subdirectory + instance name. Example:
828
          /srv/ganeti/file-storage/mysubdir/instance1.example.com. This option
829
          is only relevant for instances using the file storage backend.
830
        </para>
831

    
832
        <para>
833
          The <option>--file-driver</option> specifies the driver to use for
834
          file-based disks. Note that currently these drivers work with the
835
          xen hypervisor only. This option is only relevant for instances using
836
          the file storage backend. The available choices are:
837
          <variablelist>
838
            <varlistentry>
839
              <term>loop</term>
840
              <listitem>
841
                <para>
842
                  Kernel loopback driver. This driver uses loopback
843
                  devices to access the filesystem within the
844
                  file. However, running I/O intensive applications in
845
                  your instance using the loop driver might result in
846
                  slowdowns.  Furthermore, if you use the loopback
847
                  driver consider increasing the maximum amount of
848
                  loopback devices (on most systems it's 8) using the
849
                  max_loop param.
850
                </para>
851
              </listitem>
852
            </varlistentry>
853
            <varlistentry>
854
              <term>blktap</term>
855
              <listitem>
856
                <para>The blktap driver (for Xen hypervisors). In
857
                order to be able to use the blktap driver you should
858
                check if the 'blktapctrl' user space disk agent is
859
                running (usually automatically started via xend). This
860
                user-level disk I/O interface has the advantage of
861
                better performance. Especially if you use a network
862
                file system (e.g. NFS) to store your instances this is
863
                the recommended choice.
864
                </para>
865
              </listitem>
866
            </varlistentry>
867
          </variablelist>
868
        </para>
869

    
870
        <para>
871
          The <option>--submit</option> option is used to send the job to
872
          the master daemon but not wait for its completion. The job
873
          ID will be shown so that it can be examined via
874
          <command>gnt-job info</command>.
875
        </para>
876

    
877
        <para>
878
          Example:
879
          <screen>
880
# gnt-instance add -t file --disk 0:size=30g -B memory=512 -o debian-etch \
881
  -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
882
# gnt-instance add -t plain --disk 0:size=30g -B memory=512 -o debian-etch \
883
  -n node1.example.com instance1.example.com
884
# gnt-instance add -t drbd --disk 0:size=30g -B memory=512 -o debian-etch \
885
  -n node1.example.com:node2.example.com instance2.example.com
886
          </screen>
887
        </para>
888
      </refsect3>
889

    
890
      <refsect3>
891
        <title>BATCH-CREATE</title>
892
        <cmdsynopsis>
893
          <command>batch-create</command>
894
          <arg choice="req">instances_file.json</arg>
895
        </cmdsynopsis>
896

    
897
        <para>
898
          This command (similar to the Ganeti 1.2
899
          <command>batcher</command> tool) submits multiple instance
900
          creation jobs based on a definition file. The instance
901
          configurations do not encompass all the possible options for
902
          the <command>add</command> command, but only a subset.
903
        </para>
904

    
905
        <para>
906
          The instance file should be a valid-formed JSON file,
907
          containing a dictionary with instance name and instance
908
          parameters. The accepted parameters are:
909

    
910
          <variablelist>
911
            <varlistentry>
912
              <term>disk_size</term>
913
              <listitem>
914
                <simpara>The size of the disks of the instance.</simpara>
915
              </listitem>
916
            </varlistentry>
917
            <varlistentry>
918
              <term>disk_template</term>
919
              <listitem>
920
                <simpara>The disk template to use for the instance,
921
                the same as in the <command>add</command>
922
                command.</simpara>
923
              </listitem>
924
            </varlistentry>
925
            <varlistentry>
926
              <term>backend</term>
927
              <listitem>
928
                <simpara>A dictionary of backend parameters.</simpara>
929
              </listitem>
930
            </varlistentry>
931
            <varlistentry>
932
              <term>hypervisor</term>
933
              <listitem>
934
                <simpara>A dictionary with a single key (the
935
                hypervisor name), and as value the hypervisor
936
                options. If not passed, the default hypervisor and
937
                hypervisor options will be inherited.</simpara>
938
              </listitem>
939
            </varlistentry>
940
            <varlistentry>
941
              <term>mac, ip, mode, link</term>
942
              <listitem>
943
                <simpara>Specifications for the one NIC that will be
944
                created for the instance. 'bridge' is also accepted
945
                as a backwards compatibile key.</simpara>
946
              </listitem>
947
            </varlistentry>
948
            <varlistentry>
949
              <term>nics</term>
950
              <listitem>
951
                <simpara>List of nics that will be created for the
952
                instance. Each entry should be a dict, with mac, ip, mode
953
                and link as possible keys. Please don't provide the "mac,
954
                ip, mode, link" parent keys if you use this method for
955
                specifying nics.</simpara>
956
              </listitem>
957
            </varlistentry>
958
            <varlistentry>
959
              <term>primary_node, secondary_node</term>
960
              <listitem>
961
                <simpara>The primary and optionally the secondary node
962
                to use for the instance (in case an iallocator script
963
                is not used).</simpara>
964
              </listitem>
965
            </varlistentry>
966
            <varlistentry>
967
              <term>iallocator</term>
968
              <listitem>
969
                <simpara>Instead of specifying the nodes, an
970
                iallocator script can be used to automatically compute
971
                them.</simpara>
972
              </listitem>
973
            </varlistentry>
974
            <varlistentry>
975
              <term>start</term>
976
              <listitem>
977
                <simpara>whether to start the instance</simpara>
978
              </listitem>
979
            </varlistentry>
980
            <varlistentry>
981
              <term>ip_check</term>
982
              <listitem>
983
                <simpara>Skip the check for already-in-use instance;
984
                see the description in the <command>add</command>
985
                command for details.</simpara>
986
              </listitem>
987
            </varlistentry>
988
            <varlistentry>
989
              <term>name_check</term>
990
              <listitem>
991
                <simpara>Skip the name check for instances;
992
                see the description in the <command>add</command>
993
                command for details.</simpara>
994
              </listitem>
995
            </varlistentry>
996
            <varlistentry>
997
              <term>file_storage_dir, file_driver</term>
998
              <listitem>
999
                <simpara>Configuration for the <literal>file</literal>
1000
                disk type, see the <command>add</command> command for
1001
                details.</simpara>
1002
              </listitem>
1003
            </varlistentry>
1004
          </variablelist>
1005
        </para>
1006

    
1007
        <para>
1008
          A simple definition for one instance can be (with most of
1009
          the parameters taken from the cluster defaults):
1010
          <screen>
1011
{
1012
  "instance3": {
1013
    "template": "drbd",
1014
    "os": "debootstrap",
1015
    "disk_size": ["25G"],
1016
    "iallocator": "dumb"
1017
  },
1018
  "instance5": {
1019
    "template": "drbd",
1020
    "os": "debootstrap",
1021
    "disk_size": ["25G"],
1022
    "iallocator": "dumb",
1023
    "hypervisor": "xen-hvm",
1024
    "hvparams": {"acpi": true},
1025
    "backend": {"memory": 512}
1026
  }
1027
}
1028
</screen>
1029
        </para>
1030

    
1031
        <para>
1032
          The command will display the job id for each submitted
1033
          instance, as follows:
1034
          <screen>
1035
# gnt-instance batch-create instances.json
1036
instance3: 11224
1037
instance5: 11225
1038
</screen>
1039
        </para>
1040

    
1041
      </refsect3>
1042

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

    
1046
        <cmdsynopsis>
1047
          <command>remove</command>
1048
          <arg>--ignore-failures</arg>
1049
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
1050
          <arg>--submit</arg>
1051
          <arg choice="req"><replaceable>instance</replaceable></arg>
1052
        </cmdsynopsis>
1053

    
1054
        <para>
1055
          Remove an instance. This will remove all data from the
1056
          instance and there is <emphasis>no way back</emphasis>. If
1057
          you are not sure if you use an instance again, use
1058
          <command>shutdown</command> first and leave it in the
1059
          shutdown state for a while.
1060

    
1061
        </para>
1062

    
1063
        <para>
1064
          The <option>--ignore-failures</option> option will cause the
1065
          removal to proceed even in the presence of errors during the
1066
          removal of the instance (e.g. during the shutdown or the
1067
          disk removal). If this option is not given, the command will
1068
          stop at the first error.
1069
        </para>
1070

    
1071
        <para>
1072
          The <option>--shutdown-timeout</option> is used to specify how
1073
          much time to wait before forcing the shutdown (xm destroy in xen,
1074
          killing the kvm process, for kvm). By default two minutes are
1075
          given to each instance to stop.
1076
        </para>
1077

    
1078
        <para>
1079
          The <option>--submit</option> option is used to send the job to
1080
          the master daemon but not wait for its completion. The job
1081
          ID will be shown so that it can be examined via
1082
          <command>gnt-job info</command>.
1083
        </para>
1084

    
1085
        <para>
1086
          Example:
1087
          <screen>
1088
# gnt-instance remove instance1.example.com
1089
          </screen>
1090
        </para>
1091
      </refsect3>
1092

    
1093
      <refsect3>
1094
        <title>LIST</title>
1095

    
1096
        <cmdsynopsis>
1097
          <command>list</command>
1098
          <arg>--no-headers</arg>
1099
          <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
1100
        <sbr>
1101
        <arg>--units=<replaceable>UNITS</replaceable></arg>
1102
          <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
1103
          <arg>--roman</arg>
1104
          <arg rep="repeat">instance</arg>
1105
        </cmdsynopsis>
1106

    
1107
        <para>
1108
          Shows the currently configured instances with memory usage,
1109
          disk usage, the node they are running on, and their run
1110
          status.
1111
        </para>
1112

    
1113
        <para>
1114
          The <option>--no-headers</option> option will skip the
1115
          initial header line. The <option>--separator</option> option
1116
          takes an argument which denotes what will be used between
1117
          the output fields. Both these options are to help scripting.
1118
        </para>
1119

    
1120
        <para>
1121
          The units used to display the numeric values in the output
1122
          varies, depending on the options given. By default, the values
1123
          will be formatted in the most appropriate unit. If the
1124
          <option>--separator</option> option is given, then the values
1125
          are shown in mebibytes to allow parsing by scripts. In both
1126
          cases, the <option>--units</option> option can be used to
1127
          enforce a given output unit.
1128
        </para>
1129

    
1130
        <para>
1131
          The <option>--roman</option> option allows latin people to better
1132
          understand the cluster instances' status.
1133
        </para>
1134

    
1135
        <para>
1136
          The <option>-o</option> option takes a comma-separated list
1137
          of output fields. The available fields and their meaning
1138
          are:
1139
          <variablelist>
1140
            <varlistentry>
1141
              <term>name</term>
1142
              <listitem>
1143
                <simpara>the instance name</simpara>
1144
              </listitem>
1145
            </varlistentry>
1146
            <varlistentry>
1147
              <term>os</term>
1148
              <listitem>
1149
                <simpara>the OS of the instance</simpara>
1150
              </listitem>
1151
            </varlistentry>
1152
            <varlistentry>
1153
              <term>pnode</term>
1154
              <listitem>
1155
                <simpara>the primary node of the instance</simpara>
1156
              </listitem>
1157
            </varlistentry>
1158
            <varlistentry>
1159
              <term>snodes</term>
1160
              <listitem>
1161
                <simpara>comma-separated list of secondary nodes for the
1162
                  instance; usually this will be just one node</simpara>
1163
              </listitem>
1164
            </varlistentry>
1165
            <varlistentry>
1166
              <term>admin_state</term>
1167
              <listitem>
1168
                <simpara>the desired state of the instance (either "yes"
1169
                  or "no" denoting the instance should run or
1170
                  not)</simpara>
1171
              </listitem>
1172
            </varlistentry>
1173
            <varlistentry>
1174
              <term>disk_template</term>
1175
              <listitem>
1176
                <simpara>the disk template of the instance</simpara>
1177
              </listitem>
1178
            </varlistentry>
1179
            <varlistentry>
1180
              <term>oper_state</term>
1181
              <listitem>
1182
                <simpara>the actual state of the instance; can be
1183
                one of the values "running", "stopped", "(node
1184
                down)"</simpara>
1185
              </listitem>
1186
            </varlistentry>
1187
            <varlistentry>
1188
              <term>status</term>
1189
              <listitem>
1190
                <simpara>combined form of admin_state and oper_stat;
1191
                this can be one of:
1192
                <computeroutput>ERROR_nodedown</computeroutput> if the
1193
                node of the instance is down,
1194
                <computeroutput>ERROR_down</computeroutput> if the
1195
                instance should run but is down,
1196
                <computeroutput>ERROR_up</computeroutput> if the
1197
                instance should be stopped but is actually running,
1198
                <computeroutput>ADMIN_down</computeroutput> if the
1199
                instance has been stopped (and is stopped) and
1200
                <computeroutput>running</computeroutput> if the
1201
                instance is set to be running (and is
1202
                running)</simpara>
1203
              </listitem>
1204
            </varlistentry>
1205
            <varlistentry>
1206
              <term>oper_ram</term>
1207
              <listitem>
1208
                <simpara>the actual memory usage of the instance as seen
1209
                  by the hypervisor</simpara>
1210
              </listitem>
1211
            </varlistentry>
1212
            <varlistentry>
1213
              <term>oper_vcpus</term>
1214
              <listitem>
1215
                <simpara>the actual number of VCPUs the instance is using
1216
                  as seen by the hypervisor</simpara>
1217
              </listitem>
1218
            </varlistentry>
1219
            <varlistentry>
1220
              <term>ip</term>
1221
              <listitem>
1222
                <simpara>the ip address Ganeti recognizes as associated with
1223
                the first instance interface</simpara>
1224
              </listitem>
1225
            </varlistentry>
1226
            <varlistentry>
1227
              <term>mac</term>
1228
              <listitem>
1229
                <simpara>the first instance interface MAC address</simpara>
1230
              </listitem>
1231
            </varlistentry>
1232

    
1233
            <varlistentry>
1234
              <term>nic_mode</term>
1235
              <listitem>
1236
                <simpara>the mode of the first instance NIC
1237
                (routed or bridged)</simpara>
1238
              </listitem>
1239
            </varlistentry>
1240
            <varlistentry>
1241
              <term>nic_link</term>
1242
              <listitem>
1243
                <simpara>the link of the first instance NIC
1244
                </simpara>
1245
              </listitem>
1246
            </varlistentry>
1247
            <varlistentry>
1248
              <term>sda_size</term>
1249
              <listitem>
1250
                <simpara>the size of the instance's first disk</simpara>
1251
              </listitem>
1252
            </varlistentry>
1253
            <varlistentry>
1254
              <term>sdb_size</term>
1255
              <listitem>
1256
                <simpara>the size of the instance's second disk, if
1257
                any</simpara>
1258
              </listitem>
1259
            </varlistentry>
1260
            <varlistentry>
1261
              <term>vcpus</term>
1262
              <listitem>
1263
                <simpara>the number of VCPUs allocated to the
1264
                instance</simpara>
1265
              </listitem>
1266
            </varlistentry>
1267
            <varlistentry>
1268
              <term>tags</term>
1269
              <listitem>
1270
                <simpara>comma-separated list of the instances's
1271
                tags</simpara>
1272
              </listitem>
1273
            </varlistentry>
1274
            <varlistentry>
1275
              <term>serial_no</term>
1276
              <listitem>
1277
                <simpara>the so called 'serial number' of the
1278
                instance; this is a numeric field that is incremented
1279
                each time the instance is modified, and it can be used
1280
                to track modifications</simpara>
1281
              </listitem>
1282
            </varlistentry>
1283
            <varlistentry>
1284
              <term>ctime</term>
1285
              <listitem>
1286
                <para>
1287
                  the creation time of the instance; note that this
1288
                  field contains spaces and as such it's harder to
1289
                  parse
1290
                </para>
1291
                <para>
1292
                  if this attribute is not present (e.g. when
1293
                  upgrading from older versions), then "N/A" will be
1294
                  shown instead
1295
                </para>
1296
              </listitem>
1297
            </varlistentry>
1298
            <varlistentry>
1299
              <term>mtime</term>
1300
              <listitem>
1301
                <para>
1302
                  the last modification time of the instance; note
1303
                  that this field contains spaces and as such it's
1304
                  harder to parse
1305
                </para>
1306
                <para>
1307
                  if this attribute is not present (e.g. when
1308
                  upgrading from older versions), then "N/A" will be
1309
                  shown instead
1310
                </para>
1311
              </listitem>
1312
            </varlistentry>
1313

    
1314
            <varlistentry>
1315
              <term>uuid</term>
1316
              <listitem>
1317
                <simpara>Show the UUID of the instance (generated
1318
                automatically by Ganeti)</simpara>
1319
              </listitem>
1320
            </varlistentry>
1321

    
1322
            <varlistentry>
1323
              <term>network_port</term>
1324
              <listitem>
1325
                <simpara>If the instance has a network port assigned
1326
                to it (e.g. for VNC connections), this will be shown,
1327
                otherwise <literal>-</literal> will be
1328
                displayed.</simpara>
1329
              </listitem>
1330
            </varlistentry>
1331
            <varlistentry>
1332
              <term>beparams</term>
1333
              <listitem>
1334
                <simpara>A text format of the entire beparams for the
1335
                instance. It's more useful to select individual fields
1336
                from this dictionary, see below.</simpara>
1337
              </listitem>
1338
            </varlistentry>
1339
            <varlistentry>
1340
              <term>disk.count</term>
1341
              <listitem>
1342
                <simpara>The number of instance disks.</simpara>
1343
              </listitem>
1344
            </varlistentry>
1345
            <varlistentry>
1346
              <term>disk.size/N</term>
1347
              <listitem>
1348
                <simpara>The size of the instance's Nth disk. This is
1349
                a more generic form of the <literal>sda_size</literal>
1350
                and <literal>sdb_size</literal> fields.</simpara>
1351
              </listitem>
1352
            </varlistentry>
1353
            <varlistentry>
1354
              <term>disk.sizes</term>
1355
              <listitem>
1356
                <simpara>A comma-separated list of the disk sizes for
1357
                this instance.</simpara>
1358
              </listitem>
1359
            </varlistentry>
1360
            <varlistentry>
1361
              <term>disk_usage</term>
1362
              <listitem>
1363
                <simpara>The total disk space used by this instance on
1364
                each of its nodes. This is not the instance-visible
1365
                disk size, but the actual disk "cost" of the
1366
                instance.</simpara>
1367
              </listitem>
1368
            </varlistentry>
1369
            <varlistentry>
1370
              <term>nic.mac/N</term>
1371
              <listitem>
1372
                <simpara>The MAC of the Nth instance NIC.</simpara>
1373
              </listitem>
1374
            </varlistentry>
1375
            <varlistentry>
1376
              <term>nic.ip/N</term>
1377
              <listitem>
1378
                <simpara>The IP address of the Nth instance NIC.</simpara>
1379
              </listitem>
1380
            </varlistentry>
1381
            <varlistentry>
1382
              <term>nic.mode/N</term>
1383
              <listitem>
1384
                <simpara>The mode of the Nth instance NIC</simpara>
1385
              </listitem>
1386
            </varlistentry>
1387
            <varlistentry>
1388
              <term>nic.link/N</term>
1389
              <listitem>
1390
                <simpara>The link of the Nth instance NIC</simpara>
1391
              </listitem>
1392
            </varlistentry>
1393
            <varlistentry>
1394
              <term>nic.macs</term>
1395
              <listitem>
1396
                <simpara>A comma-separated list of all the MACs of the
1397
                instance's NICs.</simpara>
1398
              </listitem>
1399
            </varlistentry>
1400
            <varlistentry>
1401
              <term>nic.ips</term>
1402
              <listitem>
1403
                <simpara>A comma-separated list of all the IP
1404
                addresses of the instance's NICs.</simpara>
1405
              </listitem>
1406
            </varlistentry>
1407
            <varlistentry>
1408
              <term>nic.modes</term>
1409
              <listitem>
1410
                <simpara>A comma-separated list of all the modes of the
1411
                instance's NICs.</simpara>
1412
              </listitem>
1413
            </varlistentry>
1414
            <varlistentry>
1415
              <term>nic.links</term>
1416
              <listitem>
1417
                <simpara>A comma-separated list of all the link parameters
1418
                of the instance's NICs.</simpara>
1419
              </listitem>
1420
            </varlistentry>
1421
            <varlistentry>
1422
              <term>nic.count</term>
1423
              <listitem>
1424
                <simpara>The number of instance nics.</simpara>
1425
              </listitem>
1426
            </varlistentry>
1427
            <varlistentry>
1428
              <term>hv/<replaceable>NAME</replaceable></term>
1429
              <listitem>
1430
                <simpara>The value of the hypervisor parameter called
1431
                <replaceable>NAME</replaceable>. For details of what
1432
                hypervisor parameters exist and their meaning, see the
1433
                <command>add</command> command.</simpara>
1434
              </listitem>
1435
            </varlistentry>
1436
            <varlistentry>
1437
              <term>be/memory</term>
1438
              <listitem>
1439
                <simpara>The configured memory for the instance.</simpara>
1440
              </listitem>
1441
            </varlistentry>
1442
            <varlistentry>
1443
              <term>be/vcpus</term>
1444
              <listitem>
1445
                <simpara>The configured number of VCPUs for the
1446
                instance.</simpara>
1447
              </listitem>
1448
            </varlistentry>
1449
            <varlistentry>
1450
              <term>be/auto_balance</term>
1451
              <listitem>
1452
                <simpara>Whether the instance is considered in N+1
1453
                checks.</simpara>
1454
              </listitem>
1455
            </varlistentry>
1456
          </variablelist>
1457
        </para>
1458

    
1459
        <para>
1460
          If the value of the option starts with the character
1461
          <constant>+</constant>, the new field(s) will be added to the
1462
          default list. This allows to quickly see the default list
1463
          plus a few other fields, instead of retyping the entire list
1464
          of fields.
1465
        </para>
1466

    
1467
        <para>
1468
          There is a subtle grouping about the available output
1469
          fields: all fields except for <option>oper_state</option>,
1470
          <option>oper_ram</option>, <option>oper_vcpus</option> and
1471
          <option>status</option> are
1472
          configuration value and not run-time values. So if you don't
1473
          select any of the these fields, the query will be satisfied
1474
          instantly from the cluster configuration, without having to
1475
          ask the remote nodes for the data. This can be helpful for
1476
          big clusters when you only want some data and it makes sense
1477
          to specify a reduced set of output fields.
1478
        </para>
1479

    
1480
        <para>The default output field list is:
1481
          <simplelist type="inline">
1482
            <member>name</member>
1483
            <member>os</member>
1484
            <member>pnode</member>
1485
            <member>admin_state</member>
1486
            <member>oper_state</member>
1487
            <member>oper_ram</member>
1488
          </simplelist>.
1489
        </para>
1490
      </refsect3>
1491

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

    
1495
        <cmdsynopsis>
1496
          <command>info</command>
1497
          <group>
1498
            <arg>-s</arg>
1499
            <arg>--static</arg>
1500
          </group>
1501
          <arg>--roman</arg>
1502
          <group choice="req">
1503
            <arg>--all</arg>
1504
            <arg rep="repeat"><replaceable>instance</replaceable></arg>
1505
          </group>
1506
        </cmdsynopsis>
1507

    
1508
        <para>
1509
          Show detailed information about the given instance(s). This is
1510
          different from <command>list</command> as it shows detailed data
1511
          about the instance's disks (especially useful for the drbd disk
1512
          template).
1513
        </para>
1514

    
1515
        <para>
1516
          If the option <option>-s</option> is used, only information
1517
          available in the configuration file is returned, without
1518
          querying nodes, making the operation faster.
1519
        </para>
1520

    
1521
        <para>
1522
          Use the <option>--all</option> to get info about all instances,
1523
          rather than explicitly passing the ones you're interested in.
1524
        </para>
1525

    
1526
        <para>
1527
          The <option>--roman</option> option can be used to cause envy among
1528
          people who like ancient cultures, but are stuck with non-latin-friendly
1529
          cluster virtualization technologies.
1530
        </para>
1531

    
1532
      </refsect3>
1533

    
1534
      <refsect3>
1535
        <title>MODIFY</title>
1536

    
1537
        <cmdsynopsis>
1538
          <command>modify</command>
1539
          <sbr>
1540
          <arg choice="opt">-H <replaceable>HYPERVISOR_PARAMETERS</replaceable></arg>
1541
          <sbr>
1542
          <arg choice="opt">-B <replaceable>BACKEND_PARAMETERS</replaceable></arg>
1543
          <sbr>
1544
          <group>
1545
            <arg>--net add<replaceable><optional>:options</optional></replaceable></arg>
1546
            <arg>--net remove</arg>
1547
            <arg>--net <replaceable>N:options</replaceable></arg>
1548
          </group>
1549
          <sbr>
1550
          <group>
1551
            <arg>--disk add:size=<replaceable>SIZE</replaceable></arg>
1552
            <arg>--disk remove</arg>
1553
            <arg>--disk <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></arg>
1554
          </group>
1555

    
1556
          <sbr>
1557
          <arg>-t<group choice="req">
1558
              <arg>plain</arg>
1559
              <arg>drbd</arg>
1560
            </group></arg>
1561

    
1562
          <sbr>
1563
            <arg>--os-name=<replaceable>OS</replaceable> <arg>--force-variant</arg></arg>
1564

    
1565
          <sbr>
1566
          <arg>--submit</arg>
1567
          <sbr>
1568
          <arg choice="req"><replaceable>instance</replaceable></arg>
1569
        </cmdsynopsis>
1570

    
1571
        <para>
1572
          Modifies the memory size, number of vcpus, ip address, MAC
1573
          address and/or nic parameters for an instance. It can also
1574
          add and remove disks and NICs to/from the instance. Note
1575
          that you need to give at least one of the arguments, otherwise
1576
          the command complains.
1577
        </para>
1578

    
1579
        <para>
1580
          The <option>-H</option> option specifies hypervisor options
1581
          in the form of <userinput>name=value[,...]</userinput>. For details which options can be specified, see the <command>add</command> command.
1582
        </para>
1583

    
1584
        <para>
1585
          The <option>-t</option> option will change the disk template
1586
          of the instance. Currently only conversions between the
1587
          plain and drbd disk templates are supported, and the
1588
          instance must be stopped before attempting the conversion.
1589
        </para>
1590

    
1591
        <para>
1592
          The <option>--disk
1593
          add:size=<replaceable>SIZE</replaceable></option> option
1594
          adds a disk to the instance. The <option>--disk
1595
          remove</option> will remove the last disk of the
1596
          instance. The <option>--disk
1597
          <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></option>
1598
          option will change the mode of the Nth disk of the instance
1599
          between read-only (<literal>ro</literal>) and read-write
1600
          (<literal>rw</literal>).
1601
        </para>
1602

    
1603
        <para>
1604
          The <option>--net
1605
          add:<replaceable>options</replaceable></option> option will
1606
          add a new NIC to the instance. The available options are the
1607
          same as in the <command>add</command> command (mac, ip, link,
1608
          mode). The <option>--net remove</option> will remove the
1609
          last NIC of the instance, while the <option>--net
1610
          <replaceable>N</replaceable>:<replaceable>options</replaceable></option>
1611
          option will change the parameters of the Nth instance NIC.
1612
        </para>
1613

    
1614
        <para>
1615
          The option <option>--os-name</option> will change the OS
1616
          name for the instance (without reinstallation). In case an
1617
          OS variant is specified that is not found, then by default
1618
          the modification is refused,
1619
          unless <option>--force-variant</option> is passed. An
1620
          invalid OS will also be refused, unless
1621
          the <option>--force</option> option is given.
1622
        </para>
1623

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

    
1631
        <para>
1632
          All the changes take effect at the next restart. If the
1633
          instance is running, there is no effect on the instance.
1634
        </para>
1635
      </refsect3>
1636

    
1637
      <refsect3>
1638
        <title>REINSTALL</title>
1639

    
1640
        <cmdsynopsis>
1641
          <command>reinstall</command>
1642
          <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
1643
          <arg>--select-os</arg>
1644
          <arg choice="opt">-f <replaceable>force</replaceable></arg>
1645
          <arg>--force-multiple</arg>
1646
          <sbr>
1647
          <group choice="opt">
1648
            <arg>--instance</arg>
1649
            <arg>--node</arg>
1650
            <arg>--primary</arg>
1651
            <arg>--secondary</arg>
1652
            <arg>--all</arg>
1653
          </group>
1654
          <arg>--submit</arg>
1655
          <arg choice="opt" rep="repeat"><replaceable>instance</replaceable></arg>
1656
        </cmdsynopsis>
1657

    
1658
        <para>
1659
          Reinstalls the operating system on the given instance(s). The
1660
          instance(s) must be stopped when running this command. If the
1661
          <option>--os-type</option> is specified, the operating
1662
          system is changed.
1663
        </para>
1664

    
1665
        <para>
1666
          The <option>--select-os</option> option switches to an
1667
          interactive OS reinstall. The user is prompted to select the OS
1668
          template from the list of available OS templates.
1669
        </para>
1670

    
1671
        <para>
1672
          Since this is a potentially dangerous command, the user will
1673
          be required to confirm this action, unless the
1674
          <option>-f</option> flag is passed. When multiple instances
1675
          are selected (either by passing multiple arguments or by
1676
          using the <option>--node</option>,
1677
          <option>--primary</option>, <option>--secondary</option> or
1678
          <option>--all</option> options), the user must pass the
1679
          <option>--force-multiple</option> options to skip the
1680
          interactive confirmation.
1681
        </para>
1682

    
1683
        <para>
1684
          The <option>--submit</option> option is used to send the job to
1685
          the master daemon but not wait for its completion. The job
1686
          ID will be shown so that it can be examined via
1687
          <command>gnt-job info</command>.
1688
        </para>
1689

    
1690

    
1691
      </refsect3>
1692

    
1693
      <refsect3>
1694
        <title>RENAME</title>
1695

    
1696
        <cmdsynopsis>
1697
          <command>rename</command>
1698
          <arg>--no-ip-check</arg>
1699
          <arg>--no-name-check</arg>
1700
          <arg>--submit</arg>
1701
          <arg choice="req"><replaceable>instance</replaceable></arg>
1702
          <arg choice="req"><replaceable>new_name</replaceable></arg>
1703
        </cmdsynopsis>
1704

    
1705
        <para>
1706
          Renames the given instance. The instance must be stopped
1707
          when running this command. The requirements for the new name
1708
          are the same as for adding an instance: the new name must be
1709
          resolvable and the IP it resolves to must not be reachable
1710
          (in order to prevent duplicate IPs the next time the
1711
          instance is started). The IP test can be skipped if the
1712
          <option>--no-ip-check</option> option is passed.
1713
        </para>
1714

    
1715
        <para>
1716
          The <option>--no-name-check</option> skips the check for the
1717
          new instance name via the resolver (e.g. in DNS or /etc/hosts,
1718
          depending on your setup). Since the name check is used to
1719
          compute the IP address, if you pass this option you must
1720
          also pass the <option>--no-ip-check</option> option.
1721
        </para>
1722

    
1723
        <para>
1724
          The <option>--submit</option> option is used to send the job to
1725
          the master daemon but not wait for its completion. The job
1726
          ID will be shown so that it can be examined via
1727
          <command>gnt-job info</command>.
1728
        </para>
1729

    
1730
      </refsect3>
1731

    
1732
    </refsect2>
1733

    
1734
    <refsect2>
1735
      <title>Starting/stopping/connecting to console</title>
1736

    
1737
      <refsect3>
1738
        <title>STARTUP</title>
1739

    
1740
        <cmdsynopsis>
1741
          <command>startup</command>
1742
          <sbr>
1743
          <arg>--force</arg>
1744
          <sbr>
1745
          <arg>--force-multiple</arg>
1746
          <sbr>
1747
          <group choice="opt">
1748
            <arg>--instance</arg>
1749
            <arg>--node</arg>
1750
            <arg>--primary</arg>
1751
            <arg>--secondary</arg>
1752
            <arg>--all</arg>
1753
            <arg>--tags</arg>
1754
            <arg>--node-tags</arg>
1755
            <arg>--pri-node-tags</arg>
1756
            <arg>--sec-node-tags</arg>
1757
          </group>
1758
          <sbr>
1759
          <arg>-H <option>key=value...</option></arg>
1760
          <arg>-B <option>key=value...</option></arg>
1761
          <sbr>
1762
          <arg>--submit</arg>
1763
          <sbr>
1764
          <arg choice="opt"
1765
          rep="repeat"><replaceable>name</replaceable></arg>
1766
        </cmdsynopsis>
1767

    
1768
        <para>
1769
          Starts one or more instances, depending on the following
1770
          options. The four available modes are:
1771
          <variablelist>
1772
            <varlistentry>
1773
              <term><option>--instance</option></term>
1774
              <listitem>
1775
                <simpara>will start the instances given as arguments
1776
                (at least one argument required); this is the default
1777
                selection</simpara>
1778
              </listitem>
1779
            </varlistentry>
1780
            <varlistentry>
1781
              <term>--node</term>
1782
              <listitem>
1783
                <simpara>will start the instances who have the given
1784
                node as either primary or secondary</simpara>
1785
              </listitem>
1786
            </varlistentry>
1787
            <varlistentry>
1788
              <term><option>--primary</option></term>
1789
              <listitem>
1790
                <simpara>will start all instances whose primary node
1791
                is in the list of nodes passed as arguments (at least
1792
                one node required)</simpara>
1793
              </listitem>
1794
            </varlistentry>
1795
            <varlistentry>
1796
              <term><option>--secondary</option></term>
1797
              <listitem>
1798
                <simpara>will start all instances whose secondary node
1799
                is in the list of nodes passed as arguments (at least
1800
                one node required)</simpara>
1801
              </listitem>
1802
            </varlistentry>
1803
            <varlistentry>
1804
              <term>--all</term>
1805
              <listitem>
1806
                <simpara>will start all instances in the cluster (no
1807
                arguments accepted)</simpara>
1808
              </listitem>
1809
            </varlistentry>
1810
            <varlistentry>
1811
              <term>--tags</term>
1812
              <listitem>
1813
                <simpara>will start all instances in the cluster with
1814
                the tags given as arguments</simpara>
1815
              </listitem>
1816
            </varlistentry>
1817
            <varlistentry>
1818
              <term>--node-tags</term>
1819
              <listitem>
1820
                <simpara>will start all instances in the cluster on
1821
                nodes with the tags given as arguments</simpara>
1822
              </listitem>
1823
            </varlistentry>
1824
            <varlistentry>
1825
              <term>--pri-node-tags</term>
1826
              <listitem>
1827
                <simpara>will start all instances in the cluster on
1828
                primary nodes with the tags given as
1829
                arguments</simpara>
1830
              </listitem>
1831
            </varlistentry>
1832
            <varlistentry>
1833
              <term>--sec-node-tags</term>
1834
              <listitem>
1835
                <simpara>will start all instances in the cluster on
1836
                secondary nodes with the tags given as
1837
                arguments</simpara>
1838
              </listitem>
1839
            </varlistentry>
1840
          </variablelist>
1841
        </para>
1842

    
1843
        <para>
1844
          Note that although you can pass more than one selection
1845
          option, the last one wins, so in order to guarantee the
1846
          desired result, don't pass more than one such option.
1847
        </para>
1848

    
1849
        <para>
1850
          Use <option>--force</option> to start even if secondary disks are
1851
          failing.
1852
        </para>
1853

    
1854
        <para>
1855
          The <option>--force-multiple</option> will skip the
1856
          interactive confirmation in the case the more than one
1857
          instance will be affected.
1858
        </para>
1859

    
1860
        <para>
1861
          The <option>-H</option> and <option>-B</option> options
1862
          specify temporary hypervisor and backend parameters that can
1863
          be used to start an instance with modified parameters. They
1864
          can be useful for quick testing without having to modify an
1865
          instance back and forth, e.g.:
1866
          <screen>
1867
# gnt-instance start -H root_args="single" instance1
1868
# gnt-instance start -B memory=2048 instance2
1869
          </screen>
1870
          The first form will start the instance
1871
          <userinput>instance1</userinput> in single-user mode, and
1872
          the instance <userinput>instance2</userinput> with 2GB of
1873
          RAM (this time only, unless that is the actual instance
1874
          memory size already). Note that the values override the
1875
          instance parameters (and not extend them): an instance with
1876
          "root_args=ro" when started with <userinput>-H
1877
          root_args=single</userinput> will result in "single", not
1878
          "ro single".
1879
        </para>
1880

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

    
1888
        <para>
1889
          Example:
1890
          <screen>
1891
# gnt-instance start instance1.example.com
1892
# gnt-instance start --node node1.example.com node2.example.com
1893
# gnt-instance start --all
1894
          </screen>
1895
        </para>
1896
      </refsect3>
1897

    
1898
      <refsect3>
1899
        <title>SHUTDOWN</title>
1900

    
1901
        <cmdsynopsis>
1902
          <command>shutdown</command>
1903
          <sbr>
1904
          <arg>--timeout=<replaceable>N</replaceable></arg>
1905
          <sbr>
1906
          <arg>--force-multiple</arg>
1907
          <sbr>
1908
          <group choice="opt">
1909
            <arg>--instance</arg>
1910
            <arg>--node</arg>
1911
            <arg>--primary</arg>
1912
            <arg>--secondary</arg>
1913
            <arg>--all</arg>
1914
            <arg>--tags</arg>
1915
            <arg>--node-tags</arg>
1916
            <arg>--pri-node-tags</arg>
1917
            <arg>--sec-node-tags</arg>
1918
          </group>
1919
          <sbr>
1920
          <arg>--submit</arg>
1921
          <sbr>
1922
          <arg choice="opt"
1923
          rep="repeat"><replaceable>name</replaceable></arg>
1924
        </cmdsynopsis>
1925

    
1926
        <para>
1927
          Stops one or more instances. If the instance cannot be
1928
          cleanly stopped during a hardcoded interval (currently 2
1929
          minutes), it will forcibly stop the instance (equivalent to
1930
          switching off the power on a physical machine).
1931
        </para>
1932

    
1933
        <para>
1934
          The <option>--timeout</option> is used to specify how much time to
1935
          wait before forcing the shutdown (xm destroy in xen, killing the kvm
1936
          process, for kvm). By default two minutes are given to each instance
1937
          to stop.
1938
        </para>
1939

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

    
1950
        <para>
1951
          The <option>--submit</option> option is used to send the job to
1952
          the master daemon but not wait for its completion. The job
1953
          ID will be shown so that it can be examined via
1954
          <command>gnt-job info</command>.
1955
        </para>
1956

    
1957

    
1958
        <para>
1959
          Example:
1960
          <screen>
1961
# gnt-instance shutdown instance1.example.com
1962
# gnt-instance shutdown --all
1963
          </screen>
1964
        </para>
1965
      </refsect3>
1966

    
1967
      <refsect3>
1968
        <title>REBOOT</title>
1969

    
1970
        <cmdsynopsis>
1971
          <command>reboot</command>
1972
          <sbr>
1973
          <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
1974
          <sbr>
1975
          <arg>--ignore-secondaries</arg>
1976
          <sbr>
1977
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
1978
          <sbr>
1979
          <arg>--force-multiple</arg>
1980
          <sbr>
1981
          <group choice="opt">
1982
            <arg>--instance</arg>
1983
            <arg>--node</arg>
1984
            <arg>--primary</arg>
1985
            <arg>--secondary</arg>
1986
            <arg>--all</arg>
1987
            <arg>--tags</arg>
1988
            <arg>--node-tags</arg>
1989
            <arg>--pri-node-tags</arg>
1990
            <arg>--sec-node-tags</arg>
1991
          </group>
1992
          <sbr>
1993
          <arg>--submit</arg>
1994
          <sbr>
1995
          <arg choice="opt"
1996
          rep="repeat"><replaceable>name</replaceable></arg>
1997
        </cmdsynopsis>
1998

    
1999
        <para>
2000
          Reboots one or more instances. The type of reboot depends on
2001
          the value of <option>--type</option>. A soft reboot does a
2002
          hypervisor reboot, a hard reboot does a instance stop,
2003
          recreates the hypervisor config for the instance and
2004
          starts the instance. A full reboot does the equivalent
2005
          of <command>gnt-instance shutdown &amp;&amp; gnt-instance
2006
          startup</command>. The default is hard reboot.
2007
        </para>
2008

    
2009
        <para>
2010
          For the hard reboot the option
2011
          <option>--ignore-secondaries</option> ignores errors for the
2012
          secondary node while re-assembling the instance disks.
2013
        </para>
2014

    
2015
        <para>
2016
          The <option>--instance</option>, <option>--node</option>,
2017
          <option>--primary</option>, <option>--secondary</option>,
2018
          <option>--all</option>, <option>--tags</option>,
2019
          <option>--node-tags</option>, <option>--pri-node-tags</option> and
2020
          <option>--sec-node-tags</option> options are similar as for the
2021
          <command>startup</command> command and they influence the
2022
          actual instances being rebooted.
2023
        </para>
2024

    
2025
        <para>
2026
          The <option>--shutdown-timeout</option> is used to specify how
2027
          much time to wait before forcing the shutdown (xm destroy in xen,
2028
          killing the kvm process, for kvm). By default two minutes are
2029
          given to each instance to stop.
2030
        </para>
2031

    
2032
        <para>
2033
          The <option>--force-multiple</option> will skip the
2034
          interactive confirmation in the case the more than one
2035
          instance will be affected.
2036
        </para>
2037

    
2038
        <para>
2039
          Example:
2040
          <screen>
2041
# gnt-instance reboot instance1.example.com
2042
# gnt-instance reboot --type=full instance1.example.com
2043
          </screen>
2044
        </para>
2045
      </refsect3>
2046

    
2047
      <refsect3>
2048
        <title>CONSOLE</title>
2049
        <cmdsynopsis>
2050
          <command>console</command>
2051
          <arg choice="opt">--show-cmd</arg>
2052
          <arg choice="req"><replaceable>instance</replaceable></arg>
2053
        </cmdsynopsis>
2054

    
2055
        <para>
2056
          Connects to the console of the given instance. If the
2057
          instance is not up, an error is returned. Use the
2058
          <option>--show-cmd</option> option to display the command
2059
          instead of executing it.
2060
        </para>
2061

    
2062
        <para>
2063
          For HVM instances, this will attempt to connect to the
2064
          serial console of the instance. To connect to the
2065
          virtualized "physical" console of a HVM instance, use a VNC
2066
          client with the connection info from the
2067
          <command>info</command> command.
2068
        </para>
2069

    
2070
        <para>
2071
          Example:
2072
          <screen>
2073
# gnt-instance console instance1.example.com
2074
          </screen>
2075
        </para>
2076
      </refsect3>
2077

    
2078
    </refsect2>
2079

    
2080
    <refsect2>
2081
      <title>Disk management</title>
2082

    
2083
      <refsect3>
2084
        <title>REPLACE-DISKS</title>
2085

    
2086
        <cmdsynopsis>
2087
          <command>replace-disks</command>
2088
          <arg>--submit</arg>
2089
          <arg>--early-release</arg>
2090
          <arg choice="req">-p</arg>
2091
          <arg>--disks <replaceable>idx</replaceable></arg>
2092
          <arg choice="req"><replaceable>instance</replaceable></arg>
2093
        </cmdsynopsis>
2094

    
2095
        <cmdsynopsis>
2096
          <command>replace-disks</command>
2097
          <arg>--submit</arg>
2098
          <arg>--early-release</arg>
2099
          <arg choice="req">-s</arg>
2100
          <arg>--disks <replaceable>idx</replaceable></arg>
2101
          <arg choice="req"><replaceable>instance</replaceable></arg>
2102
        </cmdsynopsis>
2103

    
2104
        <cmdsynopsis>
2105
          <command>replace-disks</command>
2106
          <arg>--submit</arg>
2107
          <arg>--early-release</arg>
2108
          <group choice="req">
2109
            <arg>--iallocator <replaceable>name</replaceable></arg>
2110
            <arg>--new-secondary <replaceable>NODE</replaceable></arg>
2111
          </group>
2112

    
2113
          <arg choice="req"><replaceable>instance</replaceable></arg>
2114
        </cmdsynopsis>
2115

    
2116
        <cmdsynopsis>
2117
          <command>replace-disks</command>
2118
          <arg>--submit</arg>
2119
          <arg>--early-release</arg>
2120
          <arg choice="req">--auto</arg>
2121
          <arg choice="req"><replaceable>instance</replaceable></arg>
2122
        </cmdsynopsis>
2123

    
2124
        <para>
2125
          This command is a generalized form for replacing disks. It
2126
          is currently only valid for the mirrored (DRBD) disk
2127
          template.
2128
        </para>
2129

    
2130
        <para>
2131
          The first form (when passing the <option>-p</option> option)
2132
          will replace the disks on the primary, while the second form
2133
          (when passing the <option>-s</option> option will replace
2134
          the disks on the secondary node. For these two cases (as the
2135
          node doesn't change), it is possible to only run the replace
2136
          for a subset of the disks, using the option
2137
          <option>--disks</option> which takes a list of
2138
          comma-delimited disk indices (zero-based),
2139
          e.g. <userinput>0,2</userinput> to replace only the first
2140
          and third disks.
2141
        </para>
2142

    
2143
        <para>
2144
          The third form (when passing either the
2145
          <option>--iallocator</option> or the
2146
          <option>--new-secondary</option> option) is designed to
2147
          change secondary node of the instance.  Specifying
2148
          <option>--iallocator</option> makes the new secondary be
2149
          selected automatically by the specified allocator plugin,
2150
          otherwise the new secondary node will be the one chosen
2151
          manually via the <option>--new-secondary</option> option.
2152
        </para>
2153

    
2154
        <para>
2155
          The fourth form (when using <option>--auto</option>) will
2156
          automatically determine which disks of an instance are faulty and
2157
          replace them within the same node. The <option>--auto</option>
2158
          option works only when an instance has only faulty disks on
2159
          either the primary or secondary node; it doesn't work when
2160
          both sides have faulty disks.
2161
        </para>
2162

    
2163
        <para>
2164
          The <option>--submit</option> option is used to send the job to
2165
          the master daemon but not wait for its completion. The job
2166
          ID will be shown so that it can be examined via
2167
          <command>gnt-job info</command>.
2168
        </para>
2169

    
2170
        <para>
2171
          The <option>--early-release</option> changes the code so
2172
          that the old storage on secondary node(s) is removed early
2173
          (before the resync is completed) and the internal Ganeti
2174
          locks for the current (and new, if any) secondary node are
2175
          also released, thus allowing more parallelism in the cluster
2176
          operation. This should be used only when recovering from a
2177
          disk failure on the current secondary (thus the old storage
2178
          is already broken) or when the storage on the primary node
2179
          is known to be fine (thus we won't need the old storage for
2180
          potential recovery).
2181
        </para>
2182

    
2183
        <para>
2184
          Note that it is not possible to select an offline or drained
2185
          node as a new secondary.
2186
        </para>
2187

    
2188
      </refsect3>
2189

    
2190
      <refsect3>
2191
        <title>ACTIVATE-DISKS</title>
2192

    
2193
        <cmdsynopsis>
2194
          <command>activate-disks</command>
2195
          <arg>--submit</arg>
2196
          <arg>--ignore-size</arg>
2197
          <arg choice="req"><replaceable>instance</replaceable></arg>
2198
        </cmdsynopsis>
2199
        <para>
2200
          Activates the block devices of the given instance. If
2201
          successful, the command will show the location and name of
2202
          the block devices:
2203
          <screen>
2204
node1.example.com:disk/0:/dev/drbd0
2205
node1.example.com:disk/1:/dev/drbd1
2206
          </screen>
2207

    
2208
          In this example, <emphasis>node1.example.com</emphasis> is
2209
          the name of the node on which the devices have been
2210
          activated. The <emphasis>disk/0</emphasis> and
2211
          <emphasis>disk/1</emphasis> are the Ganeti-names of the
2212
          instance disks; how they are visible inside the instance is
2213
          hypervisor-specific. <emphasis>/dev/drbd0</emphasis> and
2214
          <emphasis>/dev/drbd1</emphasis> are the actual block devices
2215
          as visible on the node.
2216
        </para>
2217

    
2218
        <para>
2219
          The <option>--submit</option> option is used to send the job to
2220
          the master daemon but not wait for its completion. The job
2221
          ID will be shown so that it can be examined via
2222
          <command>gnt-job info</command>.
2223
        </para>
2224

    
2225
        <para>
2226
          The <option>--ignore-size</option> option can be used to
2227
          activate disks ignoring the currently configured size in
2228
          Ganeti. This can be used in cases where the configuration
2229
          has gotten out of sync with the real-world (e.g. after a
2230
          partially-failed grow-disk operation or due to rounding in
2231
          LVM devices). This should not be used in normal cases, but
2232
          only when activate-disks fails without it.
2233
        </para>
2234

    
2235
        <para>
2236
          Note that it is safe to run this command while the instance
2237
          is already running.
2238
        </para>
2239
      </refsect3>
2240

    
2241
      <refsect3>
2242
        <title>DEACTIVATE-DISKS</title>
2243

    
2244
        <cmdsynopsis>
2245
          <command>deactivate-disks</command>
2246
          <arg>--submit</arg>
2247
          <arg choice="req"><replaceable>instance</replaceable></arg>
2248
        </cmdsynopsis>
2249
        <para>
2250
          De-activates the block devices of the given instance. Note
2251
          that if you run this command for an instance with a drbd
2252
          disk template, while it is running, it will not be able to
2253
          shutdown the block devices on the primary node, but it will
2254
          shutdown the block devices on the secondary nodes, thus
2255
          breaking the replication.
2256
        </para>
2257

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

    
2265
      </refsect3>
2266

    
2267
      <refsect3>
2268
        <title>GROW-DISK</title>
2269
        <cmdsynopsis>
2270
          <command>grow-disk</command>
2271
          <arg>--no-wait-for-sync</arg>
2272
          <arg>--submit</arg>
2273
          <arg choice="req"><replaceable>instance</replaceable></arg>
2274
          <arg choice="req"><replaceable>disk</replaceable></arg>
2275
          <arg choice="req"><replaceable>amount</replaceable></arg>
2276
        </cmdsynopsis>
2277

    
2278
        <para>
2279
          Grows an instance's disk. This is only possible for
2280
          instances having a <literal>plain</literal> or
2281
          <literal>drbd</literal> disk template.
2282
        </para>
2283

    
2284
        <para>
2285
          Note that this command only change the block device size; it
2286
          will not grow the actual filesystems, partitions, etc. that
2287
          live on that disk. Usually, you will need to:
2288
          <orderedlist>
2289
            <listitem>
2290
              <simpara>use <command>gnt-instance grow-disk</command></simpara>
2291
            </listitem>
2292
            <listitem>
2293
              <simpara>reboot the instance (later, at a convenient
2294
              time)</simpara>
2295
            </listitem>
2296
            <listitem>
2297
              <simpara>use a filesystem resizer, such as
2298
              <citerefentry> <refentrytitle>ext2online</refentrytitle>
2299
              <manvolnum>8</manvolnum> </citerefentry> or
2300
              <citerefentry> <refentrytitle>xfs_growfs</refentrytitle>
2301
              <manvolnum>8</manvolnum> </citerefentry> to resize the
2302
              filesystem, or use <citerefentry>
2303
              <refentrytitle>fdisk</refentrytitle>
2304
              <manvolnum>8</manvolnum> </citerefentry> to change the
2305
              partition table on the disk
2306
              </simpara>
2307
            </listitem>
2308
          </orderedlist>
2309
        </para>
2310

    
2311

    
2312
        <para>
2313
          The <replaceable>disk</replaceable> argument is the index of
2314
          the instance disk to grow. The
2315
          <replaceable>amount</replaceable> argument is given either
2316
          as a number (and it represents the amount to increase the
2317
          disk with in mebibytes) or can be given similar to the
2318
          arguments in the create instance operation, with a suffix
2319
          denoting the unit.
2320
        </para>
2321

    
2322
        <para>
2323
          Note that the disk grow operation might complete on one node
2324
          but fail on the other; this will leave the instance with
2325
          different-sized LVs on the two nodes, but this will not
2326
          create problems (except for unused space).
2327
        </para>
2328

    
2329
        <para>
2330
          If you do not want gnt-instance to wait for the new disk
2331
          region to be synced, use the
2332
          <option>--no-wait-for-sync</option> option.
2333
        </para>
2334

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

    
2342

    
2343
        <para>Example (increase the first disk for instance1 by 16GiB):
2344
          <screen>
2345
# gnt-instance grow-disk instance1.example.com 0 16g
2346
          </screen>
2347
        </para>
2348

    
2349
        <para>
2350
          Also note that disk shrinking is not supported; use
2351
          <command>gnt-backup export</command> and then
2352
          <command>gnt-backup import</command> to reduce the disk size
2353
          of an instance.
2354
        </para>
2355
      </refsect3>
2356

    
2357
      <refsect3>
2358
        <title>RECREATE-DISKS</title>
2359

    
2360
        <cmdsynopsis>
2361
          <command>recreate-disks</command>
2362
          <arg>--submit</arg>
2363
          <arg>--disks=<option>indices</option></arg>
2364
          <arg choice="req"><replaceable>instance</replaceable></arg>
2365
        </cmdsynopsis>
2366
        <para>
2367
          Recreates the disks of the given instance, or only a subset
2368
          of the disks (if the option <option>disks</option> is
2369
          passed, which must be a comma-separated list of disk
2370
          indices, starting from zero).
2371
        </para>
2372

    
2373
        <para>
2374
          Note that this functionality should only be used for missing
2375
          disks; if any of the given disks already exists, the
2376
          operation will fail. While this is suboptimal,
2377
          recreate-disks should hopefully not be needed in normal
2378
          operation and as such the impact of this is low.
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
      </refsect3>
2389

    
2390
    </refsect2>
2391

    
2392
    <refsect2>
2393
      <title>Recovery</title>
2394

    
2395
      <refsect3>
2396
        <title>FAILOVER</title>
2397

    
2398
        <cmdsynopsis>
2399
          <command>failover</command>
2400
          <arg>-f</arg>
2401
          <arg>--ignore-consistency</arg>
2402
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2403
          <arg>--submit</arg>
2404
          <arg choice="req"><replaceable>instance</replaceable></arg>
2405
        </cmdsynopsis>
2406

    
2407
        <para>
2408
          Failover will fail the instance over its secondary
2409
          node. This works only for instances having a drbd disk
2410
          template.
2411
        </para>
2412

    
2413
        <para>
2414
          Normally the failover will check the consistency of the
2415
          disks before failing over the instance. If you are trying to
2416
          migrate instances off a dead node, this will fail. Use the
2417
          <option>--ignore-consistency</option> option for this
2418
          purpose. Note that this option can be dangerous as errors in
2419
          shutting down the instance will be ignored, resulting in
2420
          possibly having the instance running on two machines in
2421
          parallel (on disconnected DRBD drives).
2422
        </para>
2423

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

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

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

    
2446
      <refsect3>
2447
        <title>MIGRATE</title>
2448

    
2449
        <cmdsynopsis>
2450
          <command>migrate</command>
2451
          <arg>-f</arg>
2452
          <arg choice="req">--cleanup</arg>
2453
          <arg choice="req"><replaceable>instance</replaceable></arg>
2454
        </cmdsynopsis>
2455

    
2456
        <cmdsynopsis>
2457
          <command>migrate</command>
2458
          <arg>-f</arg>
2459
          <arg>--non-live</arg>
2460
          <arg>--migration-mode=live|non-live</arg>
2461
          <arg choice="req"><replaceable>instance</replaceable></arg>
2462
        </cmdsynopsis>
2463

    
2464
        <para>
2465
          Migrate will move the instance to its secondary node without
2466
          shutdown. It only works for instances having the drbd8 disk
2467
          template type.
2468
        </para>
2469

    
2470
        <para>
2471
          The migration command needs a perfectly healthy instance, as
2472
          we rely on the dual-master capability of drbd8 and the disks
2473
          of the instance are not allowed to be degraded.
2474
        </para>
2475

    
2476
        <para>
2477
          The <option>--non-live</option>
2478
          and <option>--migration-mode=non-live</option> options will
2479
          switch (for the hypervisors that support it) between a
2480
          "fully live" (i.e. the interruption is as minimal as
2481
          possible) migration and one in which the instance is frozen,
2482
          its state saved and transported to the remote node, and then
2483
          resumed there. This all depends on the hypervisor support
2484
          for two different methods. In any case, it is not an error
2485
          to pass this parameter (it will just be ignored if the
2486
          hypervisor doesn't support it). The
2487
          option <option>--migration-mode=live</option> option will
2488
          request a fully-live migration. The default, when neither
2489
          option is passed, depends on the hypervisor parameters (and
2490
          can be viewed with the <command>gnt-cluster info</command>
2491
          command).
2492
        </para>
2493

    
2494
        <para>
2495
          If the <option>--cleanup</option> option is passed, the
2496
          operation changes from migration to attempting recovery from
2497
          a failed previous migration. In this mode, Ganeti checks if
2498
          the instance runs on the correct node (and updates its
2499
          configuration if not) and ensures the instances's disks are
2500
          configured correctly. In this mode, the
2501
          <option>--non-live</option> option is ignored.
2502
        </para>
2503

    
2504
        <para>
2505
          The option <option>-f</option> will skip the prompting for
2506
          confirmation.
2507
        </para>
2508
        <para>
2509
          Example (and expected output):
2510
          <screen>
2511
# gnt-instance migrate instance1
2512
Migrate will happen to the instance instance1. Note that migration is
2513
**experimental** in this version. This might impact the instance if
2514
anything goes wrong. Continue?
2515
y/[n]/?: y
2516
* checking disk consistency between source and target
2517
* ensuring the target is in secondary mode
2518
* changing disks into dual-master mode
2519
 - INFO: Waiting for instance instance1 to sync disks.
2520
 - INFO: Instance instance1's disks are in sync.
2521
* migrating instance to node2.example.com
2522
* changing the instance's disks on source node to secondary
2523
 - INFO: Waiting for instance instance1 to sync disks.
2524
 - INFO: Instance instance1's disks are in sync.
2525
* changing the instance's disks to single-master
2526
#
2527
          </screen>
2528
        </para>
2529
      </refsect3>
2530

    
2531
      <refsect3>
2532
        <title>MOVE</title>
2533

    
2534
        <cmdsynopsis>
2535
          <command>move</command>
2536
          <arg>-f</arg>
2537
          <arg>-n <replaceable>node</replaceable></arg>
2538
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2539
          <arg>--submit</arg>
2540
          <arg choice="req"><replaceable>instance</replaceable></arg>
2541
        </cmdsynopsis>
2542

    
2543
        <para>
2544
          Move will move the instance to an arbitrary node in the
2545
          cluster. This works only for instances having a plain or
2546
          file disk template.
2547
        </para>
2548

    
2549
        <para>
2550
          Note that since this operation is done via data copy, it
2551
          will take a long time for big disks (similar to
2552
          replace-disks for a drbd instance).
2553
        </para>
2554

    
2555
        <para>
2556
          The <option>--shutdown-timeout</option> is used to specify how
2557
          much time to wait before forcing the shutdown (xm destroy in xen,
2558
          killing the kvm process, for kvm). By default two minutes are
2559
          given to each instance to stop.
2560
        </para>
2561

    
2562
        <para>
2563
          The <option>--submit</option> option is used to send the job to
2564
          the master daemon but not wait for its completion. The job
2565
          ID will be shown so that it can be examined via
2566
          <command>gnt-job info</command>.
2567
        </para>
2568

    
2569
        <para>
2570
          Example:
2571
          <screen>
2572
# gnt-instance move -n node3.example.com instance1.example.com
2573
          </screen>
2574
        </para>
2575
      </refsect3>
2576

    
2577
    </refsect2>
2578

    
2579
    <refsect2>
2580
      <title>TAGS</title>
2581

    
2582
    <refsect3>
2583
        <title>ADD-TAGS</title>
2584

    
2585
        <cmdsynopsis>
2586
          <command>add-tags</command>
2587
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2588
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2589
          <arg choice="req"
2590
            rep="repeat"><replaceable>tag</replaceable></arg>
2591
        </cmdsynopsis>
2592

    
2593
        <para>
2594
          Add tags to the given instance. If any of the tags contains
2595
          invalid characters, the entire operation will abort.
2596
        </para>
2597
        <para>
2598
          If the <option>--from</option> option is given, the list of
2599
          tags will be extended with the contents of that file (each
2600
          line becomes a tag). In this case, there is not need to pass
2601
          tags on the command line (if you do, both sources will be
2602
          used). A file name of - will be interpreted as stdin.
2603
        </para>
2604
      </refsect3>
2605

    
2606
      <refsect3>
2607
        <title>LIST-TAGS</title>
2608

    
2609
        <cmdsynopsis>
2610
          <command>list-tags</command>
2611
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2612
        </cmdsynopsis>
2613

    
2614
        <para>List the tags of the given instance.</para>
2615
      </refsect3>
2616

    
2617
      <refsect3>
2618
        <title>REMOVE-TAGS</title>
2619
        <cmdsynopsis>
2620
          <command>remove-tags</command>
2621
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2622
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2623
          <arg choice="req"
2624
            rep="repeat"><replaceable>tag</replaceable></arg>
2625
        </cmdsynopsis>
2626

    
2627
        <para>
2628
          Remove tags from the given instance. If any of the tags are
2629
          not existing on the node, the entire operation will abort.
2630
        </para>
2631

    
2632
        <para>
2633
          If the <option>--from</option> option is given, the list of
2634
          tags will be extended with the contents of that file (each
2635
          line becomes a tag). In this case, there is not need to pass
2636
          tags on the command line (if you do, both sources will be
2637
          used). A file name of - will be interpreted as stdin.
2638
        </para>
2639
      </refsect3>
2640

    
2641
    </refsect2>
2642

    
2643
  </refsect1>
2644

    
2645
  &footer;
2646

    
2647
</refentry>
2648

    
2649
<!-- Keep this comment at the end of the file
2650
Local variables:
2651
mode: sgml
2652
sgml-omittag:t
2653
sgml-shorttag:t
2654
sgml-minimize-attributes:nil
2655
sgml-always-quote-attributes:t
2656
sgml-indent-step:2
2657
sgml-indent-data:t
2658
sgml-parent-document:nil
2659
sgml-default-dtd-file:nil
2660
sgml-exposed-tags:nil
2661
sgml-local-catalogs:nil
2662
sgml-local-ecat-files:nil
2663
End:
2664
-->