Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ 77a2f6f4

History | View | Annotate | Download (93.5 kB)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
628
              </listitem>
629
            </varlistentry>
630

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

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

    
644
              </listitem>
645
            </varlistentry>
646

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

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

    
658
              </listitem>
659
            </varlistentry>
660

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

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

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

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

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

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

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

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

    
708

    
709
          </variablelist>
710

    
711
        </para>
712

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
988
      </refsect3>
989

    
990
      <refsect3>
991
        <title>REMOVE</title>
992

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

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

    
1008
        </para>
1009

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

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

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

    
1032
        <para>
1033
          Example:
1034
          <screen>
1035
# gnt-instance remove instance1.example.com
1036
          </screen>
1037
        </para>
1038
      </refsect3>
1039

    
1040
      <refsect3>
1041
        <title>LIST</title>
1042

    
1043
        <cmdsynopsis>
1044
          <command>list</command>
1045
          <arg>--no-headers</arg>
1046
          <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
1047
          <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
1048
          <arg>--roman</arg>
1049
          <arg rep="repeat">instance</arg>
1050
        </cmdsynopsis>
1051

    
1052
        <para>
1053
          Shows the currently configured instances with memory usage,
1054
          disk usage, the node they are running on, and their run
1055
          status.
1056
        </para>
1057

    
1058
        <para>
1059
          The <option>--no-headers</option> option will skip the
1060
          initial header line. The <option>--separator</option> option
1061
          takes an argument which denotes what will be used between
1062
          the output fields. Both these options are to help scripting.
1063
        </para>
1064

    
1065
        <para>
1066
          The <option>--roman</option> option allows latin people to better
1067
          understand the cluster instances' status.
1068
        </para>
1069

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

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

    
1242
            <varlistentry>
1243
              <term>uuid</term>
1244
              <listitem>
1245
                <simpara>Show the UUID of the instance (generated
1246
                automatically by Ganeti)</simpara>
1247
              </listitem>
1248
            </varlistentry>
1249

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

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

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

    
1407
        <para>The default output field list is:
1408
          <simplelist type="inline">
1409
            <member>name</member>
1410
            <member>os</member>
1411
            <member>pnode</member>
1412
            <member>admin_state</member>
1413
            <member>oper_state</member>
1414
            <member>oper_ram</member>
1415
          </simplelist>.
1416
        </para>
1417
      </refsect3>
1418

    
1419
      <refsect3>
1420
        <title>INFO</title>
1421

    
1422
        <cmdsynopsis>
1423
          <command>info</command>
1424
          <group>
1425
            <arg>-s</arg>
1426
            <arg>--static</arg>
1427
          </group>
1428
          <arg>--roman</arg>
1429
          <group choice="req">
1430
            <arg>--all</arg>
1431
            <arg rep="repeat"><replaceable>instance</replaceable></arg>
1432
          </group>
1433
        </cmdsynopsis>
1434

    
1435
        <para>
1436
          Show detailed information about the given instance(s). This is
1437
          different from <command>list</command> as it shows detailed data
1438
          about the instance's disks (especially useful for the drbd disk
1439
          template).
1440
        </para>
1441

    
1442
        <para>
1443
          If the option <option>-s</option> is used, only information
1444
          available in the configuration file is returned, without
1445
          querying nodes, making the operation faster.
1446
        </para>
1447

    
1448
        <para>
1449
          Use the <option>--all</option> to get info about all instances,
1450
          rather than explicitly passing the ones you're interested in.
1451
        </para>
1452

    
1453
        <para>
1454
          The <option>--roman</option> option can be used to cause envy among
1455
          people who like ancient cultures, but are stuck with non-latin-friendly
1456
          cluster virtualization technologies.
1457
        </para>
1458

    
1459
      </refsect3>
1460

    
1461
      <refsect3>
1462
        <title>MODIFY</title>
1463

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

    
1483
          <sbr>
1484
          <arg>-t<group choice="req">
1485
              <arg>plain</arg>
1486
              <arg>drbd</arg>
1487
            </group></arg>
1488

    
1489
          <sbr>
1490
            <arg>--os-name=<replaceable>OS</replaceable> <arg>--force-variant</arg></arg>
1491

    
1492
          <sbr>
1493
          <arg>--submit</arg>
1494
          <sbr>
1495
          <arg choice="req"><replaceable>instance</replaceable></arg>
1496
        </cmdsynopsis>
1497

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

    
1506
        <para>
1507
          The <option>-H</option> option specifies hypervisor options
1508
          in the form of <userinput>name=value[,...]</userinput>. For details which options can be specified, see the <command>add</command> command.
1509
        </para>
1510

    
1511
        <para>
1512
          The <option>-t</option> option will change the disk template
1513
          of the instance. Currently only conversions between the
1514
          plain and drbd disk templates are supported, and the
1515
          instance must be stopped before attempting the conversion.
1516
        </para>
1517

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

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

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

    
1551
        <para>
1552
          The <option>--submit</option> option is used to send the job to
1553
          the master daemon but not wait for its completion. The job
1554
          ID will be shown so that it can be examined via
1555
          <command>gnt-job info</command>.
1556
        </para>
1557

    
1558
        <para>
1559
          All the changes take effect at the next restart. If the
1560
          instance is running, there is no effect on the instance.
1561
        </para>
1562
      </refsect3>
1563

    
1564
      <refsect3>
1565
        <title>REINSTALL</title>
1566

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

    
1585
        <para>
1586
          Reinstalls the operating system on the given instance(s). The
1587
          instance(s) must be stopped when running this command. If the
1588
          <option>--os-type</option> is specified, the operating
1589
          system is changed.
1590
        </para>
1591

    
1592
        <para>
1593
          The <option>--select-os</option> option switches to an
1594
          interactive OS reinstall. The user is prompted to select the OS
1595
          template from the list of available OS templates.
1596
        </para>
1597

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

    
1611
        <para>
1612
          The <option>--submit</option> option is used to send the job to
1613
          the master daemon but not wait for its completion. The job
1614
          ID will be shown so that it can be examined via
1615
          <command>gnt-job info</command>.
1616
        </para>
1617

    
1618

    
1619
      </refsect3>
1620

    
1621
      <refsect3>
1622
        <title>RENAME</title>
1623

    
1624
        <cmdsynopsis>
1625
          <command>rename</command>
1626
          <arg>--no-ip-check</arg>
1627
          <arg>--submit</arg>
1628
          <arg choice="req"><replaceable>instance</replaceable></arg>
1629
          <arg choice="req"><replaceable>new_name</replaceable></arg>
1630
        </cmdsynopsis>
1631

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

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

    
1649
      </refsect3>
1650

    
1651
    </refsect2>
1652

    
1653
    <refsect2>
1654
      <title>Starting/stopping/connecting to console</title>
1655

    
1656
      <refsect3>
1657
        <title>STARTUP</title>
1658

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

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

    
1762
        <para>
1763
          Note that although you can pass more than one selection
1764
          option, the last one wins, so in order to guarantee the
1765
          desired result, don't pass more than one such option.
1766
        </para>
1767

    
1768
        <para>
1769
          Use <option>--force</option> to start even if secondary disks are
1770
          failing.
1771
        </para>
1772

    
1773
        <para>
1774
          The <option>--force-multiple</option> will skip the
1775
          interactive confirmation in the case the more than one
1776
          instance will be affected.
1777
        </para>
1778

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

    
1800
        <para>
1801
          The <option>--submit</option> option is used to send the job to
1802
          the master daemon but not wait for its completion. The job
1803
          ID will be shown so that it can be examined via
1804
          <command>gnt-job info</command>.
1805
        </para>
1806

    
1807
        <para>
1808
          Example:
1809
          <screen>
1810
# gnt-instance start instance1.example.com
1811
# gnt-instance start --node node1.example.com node2.example.com
1812
# gnt-instance start --all
1813
          </screen>
1814
        </para>
1815
      </refsect3>
1816

    
1817
      <refsect3>
1818
        <title>SHUTDOWN</title>
1819

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

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

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

    
1859
        <para>
1860
          The <option>--instance</option>, <option>--node</option>,
1861
          <option>--primary</option>, <option>--secondary</option>,
1862
          <option>--all</option>, <option>--tags</option>,
1863
          <option>--node-tags</option>, <option>--pri-node-tags</option> and
1864
          <option>--sec-node-tags</option> options are similar as for the
1865
          <command>startup</command> command and they influence the
1866
          actual instances being shutdown.
1867
        </para>
1868

    
1869
        <para>
1870
          The <option>--submit</option> option is used to send the job to
1871
          the master daemon but not wait for its completion. The job
1872
          ID will be shown so that it can be examined via
1873
          <command>gnt-job info</command>.
1874
        </para>
1875

    
1876

    
1877
        <para>
1878
          Example:
1879
          <screen>
1880
# gnt-instance shutdown instance1.example.com
1881
# gnt-instance shutdown --all
1882
          </screen>
1883
        </para>
1884
      </refsect3>
1885

    
1886
      <refsect3>
1887
        <title>REBOOT</title>
1888

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

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

    
1928
        <para>
1929
          For the hard reboot the option
1930
          <option>--ignore-secondaries</option> ignores errors for the
1931
          secondary node while re-assembling the instance disks.
1932
        </para>
1933

    
1934
        <para>
1935
          The <option>--instance</option>, <option>--node</option>,
1936
          <option>--primary</option>, <option>--secondary</option>,
1937
          <option>--all</option>, <option>--tags</option>,
1938
          <option>--node-tags</option>, <option>--pri-node-tags</option> and
1939
          <option>--sec-node-tags</option> options are similar as for the
1940
          <command>startup</command> command and they influence the
1941
          actual instances being rebooted.
1942
        </para>
1943

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

    
1951
        <para>
1952
          The <option>--force-multiple</option> will skip the
1953
          interactive confirmation in the case the more than one
1954
          instance will be affected.
1955
        </para>
1956

    
1957
        <para>
1958
          Example:
1959
          <screen>
1960
# gnt-instance reboot instance1.example.com
1961
# gnt-instance reboot --type=full instance1.example.com
1962
          </screen>
1963
        </para>
1964
      </refsect3>
1965

    
1966
      <refsect3>
1967
        <title>CONSOLE</title>
1968
        <cmdsynopsis>
1969
          <command>console</command>
1970
          <arg choice="opt">--show-cmd</arg>
1971
          <arg choice="req"><replaceable>instance</replaceable></arg>
1972
        </cmdsynopsis>
1973

    
1974
        <para>
1975
          Connects to the console of the given instance. If the
1976
          instance is not up, an error is returned. Use the
1977
          <option>--show-cmd</option> option to display the command
1978
          instead of executing it.
1979
        </para>
1980

    
1981
        <para>
1982
          For HVM instances, this will attempt to connect to the
1983
          serial console of the instance. To connect to the
1984
          virtualized "physical" console of a HVM instance, use a VNC
1985
          client with the connection info from the
1986
          <command>info</command> command.
1987
        </para>
1988

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

    
1997
    </refsect2>
1998

    
1999
    <refsect2>
2000
      <title>Disk management</title>
2001

    
2002
      <refsect3>
2003
        <title>REPLACE-DISKS</title>
2004

    
2005
        <cmdsynopsis>
2006
          <command>replace-disks</command>
2007
          <arg>--submit</arg>
2008
          <arg>--early-release</arg>
2009
          <arg choice="req">-p</arg>
2010
          <arg>--disks <replaceable>idx</replaceable></arg>
2011
          <arg choice="req"><replaceable>instance</replaceable></arg>
2012
        </cmdsynopsis>
2013

    
2014
        <cmdsynopsis>
2015
          <command>replace-disks</command>
2016
          <arg>--submit</arg>
2017
          <arg>--early-release</arg>
2018
          <arg choice="req">-s</arg>
2019
          <arg>--disks <replaceable>idx</replaceable></arg>
2020
          <arg choice="req"><replaceable>instance</replaceable></arg>
2021
        </cmdsynopsis>
2022

    
2023
        <cmdsynopsis>
2024
          <command>replace-disks</command>
2025
          <arg>--submit</arg>
2026
          <arg>--early-release</arg>
2027
          <group choice="req">
2028
            <arg>--iallocator <replaceable>name</replaceable></arg>
2029
            <arg>--new-secondary <replaceable>NODE</replaceable></arg>
2030
          </group>
2031

    
2032
          <arg choice="req"><replaceable>instance</replaceable></arg>
2033
        </cmdsynopsis>
2034

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

    
2043
        <para>
2044
          This command is a generalized form for replacing disks. It
2045
          is currently only valid for the mirrored (DRBD) disk
2046
          template.
2047
        </para>
2048

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

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

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

    
2082
        <para>
2083
          The <option>--submit</option> option is used to send the job to
2084
          the master daemon but not wait for its completion. The job
2085
          ID will be shown so that it can be examined via
2086
          <command>gnt-job info</command>.
2087
        </para>
2088

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

    
2102
        <para>
2103
          Note that it is not possible to select an offline or drained
2104
          node as a new secondary.
2105
        </para>
2106

    
2107
      </refsect3>
2108

    
2109
      <refsect3>
2110
        <title>ACTIVATE-DISKS</title>
2111

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

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

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

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

    
2154
        <para>
2155
          Note that it is safe to run this command while the instance
2156
          is already running.
2157
        </para>
2158
      </refsect3>
2159

    
2160
      <refsect3>
2161
        <title>DEACTIVATE-DISKS</title>
2162

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

    
2177
        <para>
2178
          The <option>--submit</option> option is used to send the job to
2179
          the master daemon but not wait for its completion. The job
2180
          ID will be shown so that it can be examined via
2181
          <command>gnt-job info</command>.
2182
        </para>
2183

    
2184
      </refsect3>
2185

    
2186
      <refsect3>
2187
        <title>GROW-DISK</title>
2188
        <cmdsynopsis>
2189
          <command>grow-disk</command>
2190
          <arg>--no-wait-for-sync</arg>
2191
          <arg>--submit</arg>
2192
          <arg choice="req"><replaceable>instance</replaceable></arg>
2193
          <arg choice="req"><replaceable>disk</replaceable></arg>
2194
          <arg choice="req"><replaceable>amount</replaceable></arg>
2195
        </cmdsynopsis>
2196

    
2197
        <para>
2198
          Grows an instance's disk. This is only possible for
2199
          instances having a <literal>plain</literal> or
2200
          <literal>drbd</literal> disk template.
2201
        </para>
2202

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

    
2230

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

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

    
2248
        <para>
2249
          If you do not want gnt-instance to wait for the new disk
2250
          region to be synced, use the
2251
          <option>--no-wait-for-sync</option> option.
2252
        </para>
2253

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

    
2261

    
2262
        <para>Example (increase the first disk for instance1 by 16GiB):
2263
          <screen>
2264
# gnt-instance grow-disk instance1.example.com 0 16g
2265
          </screen>
2266
        </para>
2267

    
2268
        <para>
2269
          Also note that disk shrinking is not supported; use
2270
          <command>gnt-backup export</command> and then
2271
          <command>gnt-backup import</command> to reduce the disk size
2272
          of an instance.
2273
        </para>
2274
      </refsect3>
2275

    
2276
      <refsect3>
2277
        <title>RECREATE-DISKS</title>
2278

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

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

    
2300
        <para>
2301
          The <option>--submit</option> option is used to send the job to
2302
          the master daemon but not wait for its completion. The job
2303
          ID will be shown so that it can be examined via
2304
          <command>gnt-job info</command>.
2305
        </para>
2306

    
2307
      </refsect3>
2308

    
2309
    </refsect2>
2310

    
2311
    <refsect2>
2312
      <title>Recovery</title>
2313

    
2314
      <refsect3>
2315
        <title>FAILOVER</title>
2316

    
2317
        <cmdsynopsis>
2318
          <command>failover</command>
2319
          <arg>-f</arg>
2320
          <arg>--ignore-consistency</arg>
2321
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2322
          <arg>--submit</arg>
2323
          <arg choice="req"><replaceable>instance</replaceable></arg>
2324
        </cmdsynopsis>
2325

    
2326
        <para>
2327
          Failover will fail the instance over its secondary
2328
          node. This works only for instances having a drbd disk
2329
          template.
2330
        </para>
2331

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

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

    
2350
        <para>
2351
          The <option>--submit</option> option is used to send the job to
2352
          the master daemon but not wait for its completion. The job
2353
          ID will be shown so that it can be examined via
2354
          <command>gnt-job info</command>.
2355
        </para>
2356

    
2357
        <para>
2358
          Example:
2359
          <screen>
2360
# gnt-instance failover instance1.example.com
2361
          </screen>
2362
        </para>
2363
      </refsect3>
2364

    
2365
      <refsect3>
2366
        <title>MIGRATE</title>
2367

    
2368
        <cmdsynopsis>
2369
          <command>migrate</command>
2370
          <arg>-f</arg>
2371
          <arg choice="req">--cleanup</arg>
2372
          <arg choice="req"><replaceable>instance</replaceable></arg>
2373
        </cmdsynopsis>
2374

    
2375
        <cmdsynopsis>
2376
          <command>migrate</command>
2377
          <arg>-f</arg>
2378
          <arg>--non-live</arg>
2379
          <arg choice="req"><replaceable>instance</replaceable></arg>
2380
        </cmdsynopsis>
2381

    
2382
        <para>
2383
          Migrate will move the instance to its secondary node without
2384
          shutdown. It only works for instances having the drbd8 disk
2385
          template type.
2386
        </para>
2387

    
2388
        <para>
2389
          The migration command needs a perfectly healthy instance, as
2390
          we rely on the dual-master capability of drbd8 and the disks
2391
          of the instance are not allowed to be degraded.
2392
        </para>
2393

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

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

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

    
2443
      <refsect3>
2444
        <title>MOVE</title>
2445

    
2446
        <cmdsynopsis>
2447
          <command>move</command>
2448
          <arg>-f</arg>
2449
          <arg>-n <replaceable>node</replaceable></arg>
2450
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2451
          <arg>--submit</arg>
2452
          <arg choice="req"><replaceable>instance</replaceable></arg>
2453
        </cmdsynopsis>
2454

    
2455
        <para>
2456
          Move will move the instance to an arbitrary node in the
2457
          cluster. This works only for instances having a plain or
2458
          file disk template.
2459
        </para>
2460

    
2461
        <para>
2462
          Note that since this operation is done via data copy, it
2463
          will take a long time for big disks (similar to
2464
          replace-disks for a drbd instance).
2465
        </para>
2466

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

    
2474
        <para>
2475
          The <option>--submit</option> option is used to send the job to
2476
          the master daemon but not wait for its completion. The job
2477
          ID will be shown so that it can be examined via
2478
          <command>gnt-job info</command>.
2479
        </para>
2480

    
2481
        <para>
2482
          Example:
2483
          <screen>
2484
# gnt-instance move -n node3.example.com instance1.example.com
2485
          </screen>
2486
        </para>
2487
      </refsect3>
2488

    
2489
    </refsect2>
2490

    
2491
    <refsect2>
2492
      <title>TAGS</title>
2493

    
2494
    <refsect3>
2495
        <title>ADD-TAGS</title>
2496

    
2497
        <cmdsynopsis>
2498
          <command>add-tags</command>
2499
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2500
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2501
          <arg choice="req"
2502
            rep="repeat"><replaceable>tag</replaceable></arg>
2503
        </cmdsynopsis>
2504

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

    
2518
      <refsect3>
2519
        <title>LIST-TAGS</title>
2520

    
2521
        <cmdsynopsis>
2522
          <command>list-tags</command>
2523
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2524
        </cmdsynopsis>
2525

    
2526
        <para>List the tags of the given instance.</para>
2527
      </refsect3>
2528

    
2529
      <refsect3>
2530
        <title>REMOVE-TAGS</title>
2531
        <cmdsynopsis>
2532
          <command>remove-tags</command>
2533
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2534
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2535
          <arg choice="req"
2536
            rep="repeat"><replaceable>tag</replaceable></arg>
2537
        </cmdsynopsis>
2538

    
2539
        <para>
2540
          Remove tags from the given instance. If any of the tags are
2541
          not existing on the node, the entire operation will abort.
2542
        </para>
2543

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

    
2553
    </refsect2>
2554

    
2555
  </refsect1>
2556

    
2557
  &footer;
2558

    
2559
</refentry>
2560

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