Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ 547a63b7

History | View | Annotate | Download (93 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
          </variablelist>
697

    
698
        </para>
699

    
700
        <para>
701
          The <option>--iallocator</option> option specifies the instance
702
          allocator plugin to use. If you pass in this option the allocator
703
          will select nodes for this instance automatically, so you don't need
704
          to pass them with the <option>-n</option> option. For more
705
          information please refer to the instance allocator documentation.
706
        </para>
707

    
708
        <para>
709
          The <option>-t</option> options specifies the disk layout type for
710
          the instance. The available choices are:
711
          <variablelist>
712
            <varlistentry>
713
              <term>diskless</term>
714
              <listitem>
715
                <para>
716
                  This creates an instance with no disks. Its useful for
717
                  testing only (or other special cases).
718
                </para>
719
              </listitem>
720
            </varlistentry>
721
            <varlistentry>
722
              <term>file</term>
723
              <listitem>
724
                <para>Disk devices will be regular files.</para>
725
              </listitem>
726
            </varlistentry>
727
            <varlistentry>
728
              <term>plain</term>
729
              <listitem>
730
                <para>Disk devices will be logical volumes.</para>
731
              </listitem>
732
            </varlistentry>
733
            <varlistentry>
734
              <term>drbd</term>
735
              <listitem>
736
                <para>
737
                  Disk devices will be drbd (version 8.x) on top of
738
                  lvm volumes.
739
                </para>
740
              </listitem>
741
            </varlistentry>
742
          </variablelist>
743
        </para>
744

    
745
        <para>
746
          The optional second value of the <option>--node</option> is used for
747
          the drbd template type and specifies the remote node.
748
        </para>
749

    
750
        <para>
751
          If you do not want gnt-instance to wait for the disk mirror
752
          to be synced, use the <option>--no-wait-for-sync</option>
753
          option.
754
        </para>
755

    
756
        <para>
757
          The <option>--file-storage-dir</option> specifies the relative path
758
          under the cluster-wide file storage directory to store file-based
759
          disks. It is useful for having different subdirectories for
760
          different instances. The full path of the directory where the disk
761
          files are stored will consist of cluster-wide file storage directory
762
          + optional subdirectory + instance name. Example:
763
          /srv/ganeti/file-storage/mysubdir/instance1.example.com. This option
764
          is only relevant for instances using the file storage backend.
765
        </para>
766

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

    
805
        <para>
806
          The <option>--submit</option> option is used to send the job to
807
          the master daemon but not wait for its completion. The job
808
          ID will be shown so that it can be examined via
809
          <command>gnt-job info</command>.
810
        </para>
811

    
812
        <para>
813
          Example:
814
          <screen>
815
# gnt-instance add -t file --disk 0:size=30g -B memory=512 -o debian-etch \
816
  -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
817
# gnt-instance add -t plain --disk 0:size=30g -B memory=512 -o debian-etch \
818
  -n node1.example.com instance1.example.com
819
# gnt-instance add -t drbd --disk 0:size=30g -B memory=512 -o debian-etch \
820
  -n node1.example.com:node2.example.com instance2.example.com
821
          </screen>
822
        </para>
823
      </refsect3>
824

    
825
      <refsect3>
826
        <title>BATCH-CREATE</title>
827
        <cmdsynopsis>
828
          <command>batch-create</command>
829
          <arg choice="req">instances_file.json</arg>
830
        </cmdsynopsis>
831

    
832
        <para>
833
          This command (similar to the Ganeti 1.2
834
          <command>batcher</command> tool) submits multiple instance
835
          creation jobs based on a definition file. The instance
836
          configurations do not encompass all the possible options for
837
          the <command>add</command> command, but only a subset.
838
        </para>
839

    
840
        <para>
841
          The instance file should be a valid-formed JSON file,
842
          containing a dictionary with instance name and instance
843
          parameters. The accepted parameters are:
844

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

    
942
        <para>
943
          A simple definition for one instance can be (with most of
944
          the parameters taken from the cluster defaults):
945
          <screen>
946
{
947
  "instance3": {
948
    "template": "drbd",
949
    "os": "debootstrap",
950
    "disk_size": ["25G"],
951
    "iallocator": "dumb"
952
  },
953
  "instance5": {
954
    "template": "drbd",
955
    "os": "debootstrap",
956
    "disk_size": ["25G"],
957
    "iallocator": "dumb",
958
    "hypervisor": "xen-hvm",
959
    "hvparams": {"acpi": true},
960
    "backend": {"memory": 512}
961
  }
962
}
963
</screen>
964
        </para>
965

    
966
        <para>
967
          The command will display the job id for each submitted instance, as follows:
968
          <screen>
969
# gnt-instance batch-create instances.json
970
instance3: 11224
971
instance5: 11225
972
</screen>
973
        </para>
974

    
975
      </refsect3>
976

    
977
      <refsect3>
978
        <title>REMOVE</title>
979

    
980
        <cmdsynopsis>
981
          <command>remove</command>
982
          <arg>--ignore-failures</arg>
983
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
984
          <arg>--submit</arg>
985
          <arg choice="req"><replaceable>instance</replaceable></arg>
986
        </cmdsynopsis>
987

    
988
        <para>
989
          Remove an instance. This will remove all data from the
990
          instance and there is <emphasis>no way back</emphasis>. If
991
          you are not sure if you use an instance again, use
992
          <command>shutdown</command> first and leave it in the
993
          shutdown state for a while.
994

    
995
        </para>
996

    
997
        <para>
998
          The <option>--ignore-failures</option> option will cause the
999
          removal to proceed even in the presence of errors during the
1000
          removal of the instance (e.g. during the shutdown or the
1001
          disk removal). If this option is not given, the command will
1002
          stop at the first error.
1003
        </para>
1004

    
1005
        <para>
1006
          The <option>--shutdown-timeout</option> is used to specify how
1007
          much time to wait before forcing the shutdown (xm destroy in xen,
1008
          killing the kvm process, for kvm). By default two minutes are
1009
          given to each instance to stop.
1010
        </para>
1011

    
1012
        <para>
1013
          The <option>--submit</option> option is used to send the job to
1014
          the master daemon but not wait for its completion. The job
1015
          ID will be shown so that it can be examined via
1016
          <command>gnt-job info</command>.
1017
        </para>
1018

    
1019
        <para>
1020
          Example:
1021
          <screen>
1022
# gnt-instance remove instance1.example.com
1023
          </screen>
1024
        </para>
1025
      </refsect3>
1026

    
1027
      <refsect3>
1028
        <title>LIST</title>
1029

    
1030
        <cmdsynopsis>
1031
          <command>list</command>
1032
          <arg>--no-headers</arg>
1033
          <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
1034
          <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
1035
          <arg>--roman</arg>
1036
          <arg rep="repeat">instance</arg>
1037
        </cmdsynopsis>
1038

    
1039
        <para>
1040
          Shows the currently configured instances with memory usage,
1041
          disk usage, the node they are running on, and their run
1042
          status.
1043
        </para>
1044

    
1045
        <para>
1046
          The <option>--no-headers</option> option will skip the
1047
          initial header line. The <option>--separator</option> option
1048
          takes an argument which denotes what will be used between
1049
          the output fields. Both these options are to help scripting.
1050
        </para>
1051

    
1052
        <para>
1053
          The <option>--roman</option> option allows latin people to better
1054
          understand the cluster instances' status.
1055
        </para>
1056

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

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

    
1229
            <varlistentry>
1230
              <term>uuid</term>
1231
              <listitem>
1232
                <simpara>Show the UUID of the instance (generated
1233
                automatically by Ganeti)</simpara>
1234
              </listitem>
1235
            </varlistentry>
1236

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

    
1374
        <para>
1375
          If the value of the option starts with the character
1376
          <constant>+</constant>, the new field(s) will be added to the
1377
          default list. This allows to quickly see the default list
1378
          plus a few other fields, instead of retyping the entire list
1379
          of fields.
1380
        </para>
1381

    
1382
        <para>
1383
          There is a subtle grouping about the available output
1384
          fields: all fields except for <option>oper_state</option>,
1385
          <option>oper_ram</option> and <option>status</option> are
1386
          configuration value and not run-time values. So if you don't
1387
          select any of the these fields, the query will be satisfied
1388
          instantly from the cluster configuration, without having to
1389
          ask the remote nodes for the data. This can be helpful for
1390
          big clusters when you only want some data and it makes sense
1391
          to specify a reduced set of output fields.
1392
        </para>
1393

    
1394
        <para>The default output field list is:
1395
          <simplelist type="inline">
1396
            <member>name</member>
1397
            <member>os</member>
1398
            <member>pnode</member>
1399
            <member>admin_state</member>
1400
            <member>oper_state</member>
1401
            <member>oper_ram</member>
1402
          </simplelist>.
1403
        </para>
1404
      </refsect3>
1405

    
1406
      <refsect3>
1407
        <title>INFO</title>
1408

    
1409
        <cmdsynopsis>
1410
          <command>info</command>
1411
          <group>
1412
            <arg>-s</arg>
1413
            <arg>--static</arg>
1414
          </group>
1415
          <arg>--roman</arg>
1416
          <group choice="req">
1417
            <arg>--all</arg>
1418
            <arg rep="repeat"><replaceable>instance</replaceable></arg>
1419
          </group>
1420
        </cmdsynopsis>
1421

    
1422
        <para>
1423
          Show detailed information about the given instance(s). This is
1424
          different from <command>list</command> as it shows detailed data
1425
          about the instance's disks (especially useful for the drbd disk
1426
          template).
1427
        </para>
1428

    
1429
        <para>
1430
          If the option <option>-s</option> is used, only information
1431
          available in the configuration file is returned, without
1432
          querying nodes, making the operation faster.
1433
        </para>
1434

    
1435
        <para>
1436
          Use the <option>--all</option> to get info about all instances,
1437
          rather than explicitly passing the ones you're interested in.
1438
        </para>
1439

    
1440
        <para>
1441
          The <option>--roman</option> option can be used to cause envy among
1442
          people who like ancient cultures, but are stuck with non-latin-friendly
1443
          cluster virtualization technologies.
1444
        </para>
1445

    
1446
      </refsect3>
1447

    
1448
      <refsect3>
1449
        <title>MODIFY</title>
1450

    
1451
        <cmdsynopsis>
1452
          <command>modify</command>
1453
          <sbr>
1454
          <arg choice="opt">-H <replaceable>HYPERVISOR_PARAMETERS</replaceable></arg>
1455
          <sbr>
1456
          <arg choice="opt">-B <replaceable>BACKEND_PARAMETERS</replaceable></arg>
1457
          <sbr>
1458
          <group>
1459
            <arg>--net add<replaceable><optional>:options</optional></replaceable></arg>
1460
            <arg>--net remove</arg>
1461
            <arg>--net <replaceable>N:options</replaceable></arg>
1462
          </group>
1463
          <sbr>
1464
          <group>
1465
            <arg>--disk add:size=<replaceable>SIZE</replaceable></arg>
1466
            <arg>--disk remove</arg>
1467
            <arg>--disk <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></arg>
1468
          </group>
1469

    
1470
          <sbr>
1471
          <arg>-t<group choice="req">
1472
              <arg>plain</arg>
1473
              <arg>drbd</arg>
1474
            </group></arg>
1475

    
1476
          <sbr>
1477
            <arg>--os-name=<replaceable>OS</replaceable> <arg>--force-variant</arg></arg>
1478

    
1479
          <sbr>
1480
          <arg>--submit</arg>
1481
          <sbr>
1482
          <arg choice="req"><replaceable>instance</replaceable></arg>
1483
        </cmdsynopsis>
1484

    
1485
        <para>
1486
          Modifies the memory size, number of vcpus, ip address, MAC
1487
          address and/or nic parameters for an instance. It can also
1488
          add and remove disks and NICs to/from the instance. Note
1489
          that you need to give at least one of the arguments, otherwise
1490
          the command complains.
1491
        </para>
1492

    
1493
        <para>
1494
          The <option>-H</option> option specifies hypervisor options
1495
          in the form of <userinput>name=value[,...]</userinput>. For details which options can be specified, see the <command>add</command> command.
1496
        </para>
1497

    
1498
        <para>
1499
          The <option>-t</option> option will change the disk template
1500
          of the instance. Currently only conversions between the
1501
          plain and drbd disk templates are supported, and the
1502
          instance must be stopped before attempting the conversion.
1503
        </para>
1504

    
1505
        <para>
1506
          The <option>--disk
1507
          add:size=<replaceable>SIZE</replaceable></option> option
1508
          adds a disk to the instance. The <option>--disk
1509
          remove</option> will remove the last disk of the
1510
          instance. The <option>--disk
1511
          <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></option>
1512
          option will change the mode of the Nth disk of the instance
1513
          between read-only (<literal>ro</literal>) and read-write
1514
          (<literal>rw</literal>).
1515
        </para>
1516

    
1517
        <para>
1518
          The <option>--net
1519
          add:<replaceable>options</replaceable></option> option will
1520
          add a new NIC to the instance. The available options are the
1521
          same as in the <command>add</command> command (mac, ip, link,
1522
          mode). The <option>--net remove</option> will remove the
1523
          last NIC of the instance, while the <option>--net
1524
          <replaceable>N</replaceable>:<replaceable>options</replaceable></option>
1525
          option will change the parameters of the Nth instance NIC.
1526
        </para>
1527

    
1528
        <para>
1529
          The option <option>--os-name</option> will change the OS
1530
          name for the instance (without reinstallation). In case an
1531
          OS variant is specified that is not found, then by default
1532
          the modification is refused,
1533
          unless <option>--force-variant</option> is passed. An
1534
          invalid OS will also be refused, unless
1535
          the <option>--force</option> option is given.
1536
        </para>
1537

    
1538
        <para>
1539
          The <option>--submit</option> option is used to send the job to
1540
          the master daemon but not wait for its completion. The job
1541
          ID will be shown so that it can be examined via
1542
          <command>gnt-job info</command>.
1543
        </para>
1544

    
1545
        <para>
1546
          All the changes take effect at the next restart. If the
1547
          instance is running, there is no effect on the instance.
1548
        </para>
1549
      </refsect3>
1550

    
1551
      <refsect3>
1552
        <title>REINSTALL</title>
1553

    
1554
        <cmdsynopsis>
1555
          <command>reinstall</command>
1556
          <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
1557
          <arg>--select-os</arg>
1558
          <arg choice="opt">-f <replaceable>force</replaceable></arg>
1559
          <arg>--force-multiple</arg>
1560
          <sbr>
1561
          <group choice="opt">
1562
            <arg>--instance</arg>
1563
            <arg>--node</arg>
1564
            <arg>--primary</arg>
1565
            <arg>--secondary</arg>
1566
            <arg>--all</arg>
1567
          </group>
1568
          <arg>--submit</arg>
1569
          <arg choice="opt" rep="repeat"><replaceable>instance</replaceable></arg>
1570
        </cmdsynopsis>
1571

    
1572
        <para>
1573
          Reinstalls the operating system on the given instance(s). The
1574
          instance(s) must be stopped when running this command. If the
1575
          <option>--os-type</option> is specified, the operating
1576
          system is changed.
1577
        </para>
1578

    
1579
        <para>
1580
          The <option>--select-os</option> option switches to an
1581
          interactive OS reinstall. The user is prompted to select the OS
1582
          template from the list of available OS templates.
1583
        </para>
1584

    
1585
        <para>
1586
          Since this is a potentially dangerous command, the user will
1587
          be required to confirm this action, unless the
1588
          <option>-f</option> flag is passed. When multiple instances
1589
          are selected (either by passing multiple arguments or by
1590
          using the <option>--node</option>,
1591
          <option>--primary</option>, <option>--secondary</option> or
1592
          <option>--all</option> options), the user must pass both the
1593
          <option>--force</option> and
1594
          <option>--force-multiple</option> options to skip the
1595
          interactive confirmation.
1596
        </para>
1597

    
1598
        <para>
1599
          The <option>--submit</option> option is used to send the job to
1600
          the master daemon but not wait for its completion. The job
1601
          ID will be shown so that it can be examined via
1602
          <command>gnt-job info</command>.
1603
        </para>
1604

    
1605

    
1606
      </refsect3>
1607

    
1608
      <refsect3>
1609
        <title>RENAME</title>
1610

    
1611
        <cmdsynopsis>
1612
          <command>rename</command>
1613
          <arg>--no-ip-check</arg>
1614
          <arg>--submit</arg>
1615
          <arg choice="req"><replaceable>instance</replaceable></arg>
1616
          <arg choice="req"><replaceable>new_name</replaceable></arg>
1617
        </cmdsynopsis>
1618

    
1619
        <para>
1620
          Renames the given instance. The instance must be stopped
1621
          when running this command. The requirements for the new name
1622
          are the same as for adding an instance: the new name must be
1623
          resolvable and the IP it resolves to must not be reachable
1624
          (in order to prevent duplicate IPs the next time the
1625
          instance is started). The IP test can be skipped if the
1626
          <option>--no-ip-check</option> option is passed.
1627
        </para>
1628

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

    
1636
      </refsect3>
1637

    
1638
    </refsect2>
1639

    
1640
    <refsect2>
1641
      <title>Starting/stopping/connecting to console</title>
1642

    
1643
      <refsect3>
1644
        <title>STARTUP</title>
1645

    
1646
        <cmdsynopsis>
1647
          <command>startup</command>
1648
          <sbr>
1649
          <arg>--force</arg>
1650
          <sbr>
1651
          <arg>--force-multiple</arg>
1652
          <sbr>
1653
          <group choice="opt">
1654
            <arg>--instance</arg>
1655
            <arg>--node</arg>
1656
            <arg>--primary</arg>
1657
            <arg>--secondary</arg>
1658
            <arg>--all</arg>
1659
            <arg>--tags</arg>
1660
            <arg>--node-tags</arg>
1661
            <arg>--pri-node-tags</arg>
1662
            <arg>--sec-node-tags</arg>
1663
          </group>
1664
          <sbr>
1665
          <arg>-H <option>key=value...</option></arg>
1666
          <arg>-B <option>key=value...</option></arg>
1667
          <sbr>
1668
          <arg>--submit</arg>
1669
          <sbr>
1670
          <arg choice="opt"
1671
          rep="repeat"><replaceable>name</replaceable></arg>
1672
        </cmdsynopsis>
1673

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

    
1749
        <para>
1750
          Note that although you can pass more than one selection
1751
          option, the last one wins, so in order to guarantee the
1752
          desired result, don't pass more than one such option.
1753
        </para>
1754

    
1755
        <para>
1756
          Use <option>--force</option> to start even if secondary disks are
1757
          failing.
1758
        </para>
1759

    
1760
        <para>
1761
          The <option>--force-multiple</option> will skip the
1762
          interactive confirmation in the case the more than one
1763
          instance will be affected.
1764
        </para>
1765

    
1766
        <para>
1767
          The <option>-H</option> and <option>-B</option> options
1768
          specify temporary hypervisor and backend parameters that can
1769
          be used to start an instance with modified parameters. They
1770
          can be useful for quick testing without having to modify an
1771
          instance back and forth, e.g.:
1772
          <screen>
1773
# gnt-instance start -H root_args="single" instance1
1774
# gnt-instance start -B memory=2048 instance2
1775
          </screen>
1776
          The first form will start the instance
1777
          <userinput>instance1</userinput> in single-user mode, and
1778
          the instance <userinput>instance2</userinput> with 2GB of
1779
          RAM (this time only, unless that is the actual instance
1780
          memory size already). Note that the values override the
1781
          instance parameters (and not extend them): an instance with
1782
          "root_args=ro" when started with <userinput>-H
1783
          root_args=single</userinput> will result in "single", not
1784
          "ro single".
1785
        </para>
1786

    
1787
        <para>
1788
          The <option>--submit</option> option is used to send the job to
1789
          the master daemon but not wait for its completion. The job
1790
          ID will be shown so that it can be examined via
1791
          <command>gnt-job info</command>.
1792
        </para>
1793

    
1794
        <para>
1795
          Example:
1796
          <screen>
1797
# gnt-instance start instance1.example.com
1798
# gnt-instance start --node node1.example.com node2.example.com
1799
# gnt-instance start --all
1800
          </screen>
1801
        </para>
1802
      </refsect3>
1803

    
1804
      <refsect3>
1805
        <title>SHUTDOWN</title>
1806

    
1807
        <cmdsynopsis>
1808
          <command>shutdown</command>
1809
          <sbr>
1810
          <arg>--timeout=<replaceable>N</replaceable></arg>
1811
          <sbr>
1812
          <arg>--force-multiple</arg>
1813
          <sbr>
1814
          <group choice="opt">
1815
            <arg>--instance</arg>
1816
            <arg>--node</arg>
1817
            <arg>--primary</arg>
1818
            <arg>--secondary</arg>
1819
            <arg>--all</arg>
1820
            <arg>--tags</arg>
1821
            <arg>--node-tags</arg>
1822
            <arg>--pri-node-tags</arg>
1823
            <arg>--sec-node-tags</arg>
1824
          </group>
1825
          <sbr>
1826
          <arg>--submit</arg>
1827
          <sbr>
1828
          <arg choice="opt"
1829
          rep="repeat"><replaceable>name</replaceable></arg>
1830
        </cmdsynopsis>
1831

    
1832
        <para>
1833
          Stops one or more instances. If the instance cannot be
1834
          cleanly stopped during a hardcoded interval (currently 2
1835
          minutes), it will forcibly stop the instance (equivalent to
1836
          switching off the power on a physical machine).
1837
        </para>
1838

    
1839
        <para>
1840
          The <option>--timeout</option> is used to specify how much time to
1841
          wait before forcing the shutdown (xm destroy in xen, killing the kvm
1842
          process, for kvm). By default two minutes are given to each instance
1843
          to stop.
1844
        </para>
1845

    
1846
        <para>
1847
          The <option>--instance</option>, <option>--node</option>,
1848
          <option>--primary</option>, <option>--secondary</option>,
1849
          <option>--all</option>, <option>--tags</option>,
1850
          <option>--node-tags</option>, <option>--pri-node-tags</option> and
1851
          <option>--sec-node-tags</option> options are similar as for the
1852
          <command>startup</command> command and they influence the
1853
          actual instances being shutdown.
1854
        </para>
1855

    
1856
        <para>
1857
          The <option>--submit</option> option is used to send the job to
1858
          the master daemon but not wait for its completion. The job
1859
          ID will be shown so that it can be examined via
1860
          <command>gnt-job info</command>.
1861
        </para>
1862

    
1863

    
1864
        <para>
1865
          Example:
1866
          <screen>
1867
# gnt-instance shutdown instance1.example.com
1868
# gnt-instance shutdown --all
1869
          </screen>
1870
        </para>
1871
      </refsect3>
1872

    
1873
      <refsect3>
1874
        <title>REBOOT</title>
1875

    
1876
        <cmdsynopsis>
1877
          <command>reboot</command>
1878
          <sbr>
1879
          <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
1880
          <sbr>
1881
          <arg>--ignore-secondaries</arg>
1882
          <sbr>
1883
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
1884
          <sbr>
1885
          <arg>--force-multiple</arg>
1886
          <sbr>
1887
          <group choice="opt">
1888
            <arg>--instance</arg>
1889
            <arg>--node</arg>
1890
            <arg>--primary</arg>
1891
            <arg>--secondary</arg>
1892
            <arg>--all</arg>
1893
            <arg>--tags</arg>
1894
            <arg>--node-tags</arg>
1895
            <arg>--pri-node-tags</arg>
1896
            <arg>--sec-node-tags</arg>
1897
          </group>
1898
          <sbr>
1899
          <arg>--submit</arg>
1900
          <sbr>
1901
          <arg choice="opt"
1902
          rep="repeat"><replaceable>name</replaceable></arg>
1903
        </cmdsynopsis>
1904

    
1905
        <para>
1906
          Reboots one or more instances. The type of reboot depends on
1907
          the value of <option>--type</option>. A soft reboot does a
1908
          hypervisor reboot, a hard reboot does a instance stop,
1909
          recreates the hypervisor config for the instance and
1910
          starts the instance. A full reboot does the equivalent
1911
          of <command>gnt-instance shutdown &amp;&amp; gnt-instance
1912
          startup</command>. The default is hard reboot.
1913
        </para>
1914

    
1915
        <para>
1916
          For the hard reboot the option
1917
          <option>--ignore-secondaries</option> ignores errors for the
1918
          secondary node while re-assembling the instance disks.
1919
        </para>
1920

    
1921
        <para>
1922
          The <option>--instance</option>, <option>--node</option>,
1923
          <option>--primary</option>, <option>--secondary</option>,
1924
          <option>--all</option>, <option>--tags</option>,
1925
          <option>--node-tags</option>, <option>--pri-node-tags</option> and
1926
          <option>--sec-node-tags</option> options are similar as for the
1927
          <command>startup</command> command and they influence the
1928
          actual instances being rebooted.
1929
        </para>
1930

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

    
1938
        <para>
1939
          The <option>--force-multiple</option> will skip the
1940
          interactive confirmation in the case the more than one
1941
          instance will be affected.
1942
        </para>
1943

    
1944
        <para>
1945
          Example:
1946
          <screen>
1947
# gnt-instance reboot instance1.example.com
1948
# gnt-instance reboot --type=full instance1.example.com
1949
          </screen>
1950
        </para>
1951
      </refsect3>
1952

    
1953
      <refsect3>
1954
        <title>CONSOLE</title>
1955
        <cmdsynopsis>
1956
          <command>console</command>
1957
          <arg choice="opt">--show-cmd</arg>
1958
          <arg choice="req"><replaceable>instance</replaceable></arg>
1959
        </cmdsynopsis>
1960

    
1961
        <para>
1962
          Connects to the console of the given instance. If the
1963
          instance is not up, an error is returned. Use the
1964
          <option>--show-cmd</option> option to display the command
1965
          instead of executing it.
1966
        </para>
1967

    
1968
        <para>
1969
          For HVM instances, this will attempt to connect to the
1970
          serial console of the instance. To connect to the
1971
          virtualized "physical" console of a HVM instance, use a VNC
1972
          client with the connection info from the
1973
          <command>info</command> command.
1974
        </para>
1975

    
1976
        <para>
1977
          Example:
1978
          <screen>
1979
# gnt-instance console instance1.example.com
1980
          </screen>
1981
        </para>
1982
      </refsect3>
1983

    
1984
    </refsect2>
1985

    
1986
    <refsect2>
1987
      <title>Disk management</title>
1988

    
1989
      <refsect3>
1990
        <title>REPLACE-DISKS</title>
1991

    
1992
        <cmdsynopsis>
1993
          <command>replace-disks</command>
1994
          <arg>--submit</arg>
1995
          <arg>--early-release</arg>
1996
          <arg choice="req">-p</arg>
1997
          <arg>--disks <replaceable>idx</replaceable></arg>
1998
          <arg choice="req"><replaceable>instance</replaceable></arg>
1999
        </cmdsynopsis>
2000

    
2001
        <cmdsynopsis>
2002
          <command>replace-disks</command>
2003
          <arg>--submit</arg>
2004
          <arg>--early-release</arg>
2005
          <arg choice="req">-s</arg>
2006
          <arg>--disks <replaceable>idx</replaceable></arg>
2007
          <arg choice="req"><replaceable>instance</replaceable></arg>
2008
        </cmdsynopsis>
2009

    
2010
        <cmdsynopsis>
2011
          <command>replace-disks</command>
2012
          <arg>--submit</arg>
2013
          <arg>--early-release</arg>
2014
          <group choice="req">
2015
            <arg>--iallocator <replaceable>name</replaceable></arg>
2016
            <arg>--new-secondary <replaceable>NODE</replaceable></arg>
2017
          </group>
2018

    
2019
          <arg choice="req"><replaceable>instance</replaceable></arg>
2020
        </cmdsynopsis>
2021

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

    
2030
        <para>
2031
          This command is a generalized form for replacing disks. It
2032
          is currently only valid for the mirrored (DRBD) disk
2033
          template.
2034
        </para>
2035

    
2036
        <para>
2037
          The first form (when passing the <option>-p</option> option)
2038
          will replace the disks on the primary, while the second form
2039
          (when passing the <option>-s</option> option will replace
2040
          the disks on the secondary node. For these two cases (as the
2041
          node doesn't change), it is possible to only run the replace
2042
          for a subset of the disks, using the option
2043
          <option>--disks</option> which takes a list of
2044
          comma-delimited disk indices (zero-based),
2045
          e.g. <userinput>0,2</userinput> to replace only the first
2046
          and third disks.
2047
        </para>
2048

    
2049
        <para>
2050
          The third form (when passing either the
2051
          <option>--iallocator</option> or the
2052
          <option>--new-secondary</option> option) is designed to
2053
          change secondary node of the instance.  Specifying
2054
          <option>--iallocator</option> makes the new secondary be
2055
          selected automatically by the specified allocator plugin,
2056
          otherwise the new secondary node will be the one chosen
2057
          manually via the <option>--new-secondary</option> option.
2058
        </para>
2059

    
2060
        <para>
2061
          The fourth form (when using <option>--auto</option>) will
2062
          automatically determine which disks of an instance are faulty and
2063
          replace them within the same node. The <option>--auto</option>
2064
          option works only when an instance has only faulty disks on
2065
          either the primary or secondary node; it doesn't work when
2066
          both sides have faulty disks.
2067
        </para>
2068

    
2069
        <para>
2070
          The <option>--submit</option> option is used to send the job to
2071
          the master daemon but not wait for its completion. The job
2072
          ID will be shown so that it can be examined via
2073
          <command>gnt-job info</command>.
2074
        </para>
2075

    
2076
        <para>
2077
          The <option>--early-release</option> changes the code so
2078
          that the old storage on secondary node(s) is removed early
2079
          (before the resync is completed) and the internal Ganeti
2080
          locks for the current (and new, if any) secondary node are
2081
          also released, thus allowing more parallelism in the cluster
2082
          operation. This should be used only when recovering from a
2083
          disk failure on the current secondary (thus the old storage
2084
          is already broken) or when the storage on the primary node
2085
          is known to be fine (thus we won't need the old storage for
2086
          potential recovery).
2087
        </para>
2088

    
2089
        <para>
2090
          Note that it is not possible to select an offline or drained
2091
          node as a new secondary.
2092
        </para>
2093

    
2094
      </refsect3>
2095

    
2096
      <refsect3>
2097
        <title>ACTIVATE-DISKS</title>
2098

    
2099
        <cmdsynopsis>
2100
          <command>activate-disks</command>
2101
          <arg>--submit</arg>
2102
          <arg>--ignore-size</arg>
2103
          <arg choice="req"><replaceable>instance</replaceable></arg>
2104
        </cmdsynopsis>
2105
        <para>
2106
          Activates the block devices of the given instance. If
2107
          successful, the command will show the location and name of
2108
          the block devices:
2109
          <screen>
2110
node1.example.com:disk/0:/dev/drbd0
2111
node1.example.com:disk/1:/dev/drbd1
2112
          </screen>
2113

    
2114
          In this example, <emphasis>node1.example.com</emphasis> is
2115
          the name of the node on which the devices have been
2116
          activated. The <emphasis>disk/0</emphasis> and
2117
          <emphasis>disk/1</emphasis> are the Ganeti-names of the
2118
          instance disks; how they are visible inside the instance is
2119
          hypervisor-specific. <emphasis>/dev/drbd0</emphasis> and
2120
          <emphasis>/dev/drbd1</emphasis> are the actual block devices
2121
          as visible on the node.
2122
        </para>
2123

    
2124
        <para>
2125
          The <option>--submit</option> option is used to send the job to
2126
          the master daemon but not wait for its completion. The job
2127
          ID will be shown so that it can be examined via
2128
          <command>gnt-job info</command>.
2129
        </para>
2130

    
2131
        <para>
2132
          The <option>--ignore-size</option> option can be used to
2133
          activate disks ignoring the currently configured size in
2134
          Ganeti. This can be used in cases where the configuration
2135
          has gotten out of sync with the real-world (e.g. after a
2136
          partially-failed grow-disk operation or due to rounding in
2137
          LVM devices). This should not be used in normal cases, but
2138
          only when activate-disks fails without it.
2139
        </para>
2140

    
2141
        <para>
2142
          Note that it is safe to run this command while the instance
2143
          is already running.
2144
        </para>
2145
      </refsect3>
2146

    
2147
      <refsect3>
2148
        <title>DEACTIVATE-DISKS</title>
2149

    
2150
        <cmdsynopsis>
2151
          <command>deactivate-disks</command>
2152
          <arg>--submit</arg>
2153
          <arg choice="req"><replaceable>instance</replaceable></arg>
2154
        </cmdsynopsis>
2155
        <para>
2156
          De-activates the block devices of the given instance. Note
2157
          that if you run this command for an instance with a drbd
2158
          disk template, while it is running, it will not be able to
2159
          shutdown the block devices on the primary node, but it will
2160
          shutdown the block devices on the secondary nodes, thus
2161
          breaking the replication.
2162
        </para>
2163

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

    
2171
      </refsect3>
2172

    
2173
      <refsect3>
2174
        <title>GROW-DISK</title>
2175
        <cmdsynopsis>
2176
          <command>grow-disk</command>
2177
          <arg>--no-wait-for-sync</arg>
2178
          <arg>--submit</arg>
2179
          <arg choice="req"><replaceable>instance</replaceable></arg>
2180
          <arg choice="req"><replaceable>disk</replaceable></arg>
2181
          <arg choice="req"><replaceable>amount</replaceable></arg>
2182
        </cmdsynopsis>
2183

    
2184
        <para>
2185
          Grows an instance's disk. This is only possible for
2186
          instances having a <literal>plain</literal> or
2187
          <literal>drbd</literal> disk template.
2188
        </para>
2189

    
2190
        <para>
2191
          Note that this command only change the block device size; it
2192
          will not grow the actual filesystems, partitions, etc. that
2193
          live on that disk. Usually, you will need to:
2194
          <orderedlist>
2195
            <listitem>
2196
              <simpara>use <command>gnt-instance grow-disk</command></simpara>
2197
            </listitem>
2198
            <listitem>
2199
              <simpara>reboot the instance (later, at a convenient
2200
              time)</simpara>
2201
            </listitem>
2202
            <listitem>
2203
              <simpara>use a filesystem resizer, such as
2204
              <citerefentry> <refentrytitle>ext2online</refentrytitle>
2205
              <manvolnum>8</manvolnum> </citerefentry> or
2206
              <citerefentry> <refentrytitle>xfs_growfs</refentrytitle>
2207
              <manvolnum>8</manvolnum> </citerefentry> to resize the
2208
              filesystem, or use <citerefentry>
2209
              <refentrytitle>fdisk</refentrytitle>
2210
              <manvolnum>8</manvolnum> </citerefentry> to change the
2211
              partition table on the disk
2212
              </simpara>
2213
            </listitem>
2214
          </orderedlist>
2215
        </para>
2216

    
2217

    
2218
        <para>
2219
          The <replaceable>disk</replaceable> argument is the index of
2220
          the instance disk to grow. The
2221
          <replaceable>amount</replaceable> argument is given either
2222
          as a number (and it represents the amount to increase the
2223
          disk with in mebibytes) or can be given similar to the
2224
          arguments in the create instance operation, with a suffix
2225
          denoting the unit.
2226
        </para>
2227

    
2228
        <para>
2229
          Note that the disk grow operation might complete on one node
2230
          but fail on the other; this will leave the instance with
2231
          different-sized LVs on the two nodes, but this will not
2232
          create problems (except for unused space).
2233
        </para>
2234

    
2235
        <para>
2236
          If you do not want gnt-instance to wait for the new disk
2237
          region to be synced, use the
2238
          <option>--no-wait-for-sync</option> option.
2239
        </para>
2240

    
2241
        <para>
2242
          The <option>--submit</option> option is used to send the job to
2243
          the master daemon but not wait for its completion. The job
2244
          ID will be shown so that it can be examined via
2245
          <command>gnt-job info</command>.
2246
        </para>
2247

    
2248

    
2249
        <para>Example (increase the first disk for instance1 by 16GiB):
2250
          <screen>
2251
# gnt-instance grow-disk instance1.example.com 0 16g
2252
          </screen>
2253
        </para>
2254

    
2255
        <para>
2256
          Also note that disk shrinking is not supported; use
2257
          <command>gnt-backup export</command> and then
2258
          <command>gnt-backup import</command> to reduce the disk size
2259
          of an instance.
2260
        </para>
2261
      </refsect3>
2262

    
2263
      <refsect3>
2264
        <title>RECREATE-DISKS</title>
2265

    
2266
        <cmdsynopsis>
2267
          <command>recreate-disks</command>
2268
          <arg>--submit</arg>
2269
          <arg>--disks=<option>indices</option></arg>
2270
          <arg choice="req"><replaceable>instance</replaceable></arg>
2271
        </cmdsynopsis>
2272
        <para>
2273
          Recreates the disks of the given instance, or only a subset
2274
          of the disks (if the option <option>disks</option> is
2275
          passed, which must be a comma-separated list of disk
2276
          indices, starting from zero).
2277
        </para>
2278

    
2279
        <para>
2280
          Note that this functionality should only be used for missing
2281
          disks; if any of the given disks already exists, the
2282
          operation will fail. While this is suboptimal,
2283
          recreate-disks should hopefully not be needed in normal
2284
          operation and as such the impact of this is low.
2285
        </para>
2286

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

    
2294
      </refsect3>
2295

    
2296
    </refsect2>
2297

    
2298
    <refsect2>
2299
      <title>Recovery</title>
2300

    
2301
      <refsect3>
2302
        <title>FAILOVER</title>
2303

    
2304
        <cmdsynopsis>
2305
          <command>failover</command>
2306
          <arg>-f</arg>
2307
          <arg>--ignore-consistency</arg>
2308
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2309
          <arg>--submit</arg>
2310
          <arg choice="req"><replaceable>instance</replaceable></arg>
2311
        </cmdsynopsis>
2312

    
2313
        <para>
2314
          Failover will fail the instance over its secondary
2315
          node. This works only for instances having a drbd disk
2316
          template.
2317
        </para>
2318

    
2319
        <para>
2320
          Normally the failover will check the consistency of the
2321
          disks before failing over the instance. If you are trying to
2322
          migrate instances off a dead node, this will fail. Use the
2323
          <option>--ignore-consistency</option> option for this
2324
          purpose. Note that this option can be dangerous as errors in
2325
          shutting down the instance will be ignored, resulting in
2326
          possibly having the instance running on two machines in
2327
          parallel (on disconnected DRBD drives).
2328
        </para>
2329

    
2330
        <para>
2331
          The <option>--shutdown-timeout</option> is used to specify how
2332
          much time to wait before forcing the shutdown (xm destroy in xen,
2333
          killing the kvm process, for kvm). By default two minutes are
2334
          given to each instance to stop.
2335
        </para>
2336

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

    
2344
        <para>
2345
          Example:
2346
          <screen>
2347
# gnt-instance failover instance1.example.com
2348
          </screen>
2349
        </para>
2350
      </refsect3>
2351

    
2352
      <refsect3>
2353
        <title>MIGRATE</title>
2354

    
2355
        <cmdsynopsis>
2356
          <command>migrate</command>
2357
          <arg>-f</arg>
2358
          <arg choice="req">--cleanup</arg>
2359
          <arg choice="req"><replaceable>instance</replaceable></arg>
2360
        </cmdsynopsis>
2361

    
2362
        <cmdsynopsis>
2363
          <command>migrate</command>
2364
          <arg>-f</arg>
2365
          <arg>--non-live</arg>
2366
          <arg choice="req"><replaceable>instance</replaceable></arg>
2367
        </cmdsynopsis>
2368

    
2369
        <para>
2370
          Migrate will move the instance to its secondary node without
2371
          shutdown. It only works for instances having the drbd8 disk
2372
          template type.
2373
        </para>
2374

    
2375
        <para>
2376
          The migration command needs a perfectly healthy instance, as
2377
          we rely on the dual-master capability of drbd8 and the disks
2378
          of the instance are not allowed to be degraded.
2379
        </para>
2380

    
2381
        <para>
2382
          The <option>--non-live</option> option will switch (for the
2383
          hypervisors that support it) between a "fully live"
2384
          (i.e. the interruption is as minimal as possible) migration
2385
          and one in which the instance is frozen, its state saved and
2386
          transported to the remote node, and then resumed there. This
2387
          all depends on the hypervisor support for two different
2388
          methods. In any case, it is not an error to pass this
2389
          parameter (it will just be ignored if the hypervisor doesn't
2390
          support it).
2391
        </para>
2392

    
2393
        <para>
2394
          If the <option>--cleanup</option> option is passed, the
2395
          operation changes from migration to attempting recovery from
2396
          a failed previous migration. In this mode, ganeti checks if
2397
          the instance runs on the correct node (and updates its
2398
          configuration if not) and ensures the instances's disks are
2399
          configured correctly. In this mode, the
2400
          <option>--non-live</option> option is ignored.
2401
        </para>
2402

    
2403
        <para>
2404
          The option <option>-f</option> will skip the prompting for
2405
          confirmation.
2406
        </para>
2407
        <para>
2408
          Example (and expected output):
2409
          <screen>
2410
# gnt-instance migrate instance1
2411
Migrate will happen to the instance instance1. Note that migration is
2412
**experimental** in this version. This might impact the instance if
2413
anything goes wrong. Continue?
2414
y/[n]/?: y
2415
* checking disk consistency between source and target
2416
* ensuring the target is in secondary mode
2417
* changing disks into dual-master mode
2418
 - INFO: Waiting for instance instance1 to sync disks.
2419
 - INFO: Instance instance1's disks are in sync.
2420
* migrating instance to node2.example.com
2421
* changing the instance's disks on source node to secondary
2422
 - INFO: Waiting for instance instance1 to sync disks.
2423
 - INFO: Instance instance1's disks are in sync.
2424
* changing the instance's disks to single-master
2425
#
2426
          </screen>
2427
        </para>
2428
      </refsect3>
2429

    
2430
      <refsect3>
2431
        <title>MOVE</title>
2432

    
2433
        <cmdsynopsis>
2434
          <command>move</command>
2435
          <arg>-f</arg>
2436
          <arg>-n <replaceable>node</replaceable></arg>
2437
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2438
          <arg>--submit</arg>
2439
          <arg choice="req"><replaceable>instance</replaceable></arg>
2440
        </cmdsynopsis>
2441

    
2442
        <para>
2443
          Move will move the instance to an arbitrary node in the
2444
          cluster. This works only for instances having a plain or
2445
          file disk template.
2446
        </para>
2447

    
2448
        <para>
2449
          Note that since this operation is done via data copy, it
2450
          will take a long time for big disks (similar to
2451
          replace-disks for a drbd instance).
2452
        </para>
2453

    
2454
        <para>
2455
          The <option>--shutdown-timeout</option> is used to specify how
2456
          much time to wait before forcing the shutdown (xm destroy in xen,
2457
          killing the kvm process, for kvm). By default two minutes are
2458
          given to each instance to stop.
2459
        </para>
2460

    
2461
        <para>
2462
          The <option>--submit</option> option is used to send the job to
2463
          the master daemon but not wait for its completion. The job
2464
          ID will be shown so that it can be examined via
2465
          <command>gnt-job info</command>.
2466
        </para>
2467

    
2468
        <para>
2469
          Example:
2470
          <screen>
2471
# gnt-instance move -n node3.example.com instance1.example.com
2472
          </screen>
2473
        </para>
2474
      </refsect3>
2475

    
2476
    </refsect2>
2477

    
2478
    <refsect2>
2479
      <title>TAGS</title>
2480

    
2481
    <refsect3>
2482
        <title>ADD-TAGS</title>
2483

    
2484
        <cmdsynopsis>
2485
          <command>add-tags</command>
2486
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2487
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2488
          <arg choice="req"
2489
            rep="repeat"><replaceable>tag</replaceable></arg>
2490
        </cmdsynopsis>
2491

    
2492
        <para>
2493
          Add tags to the given instance. If any of the tags contains
2494
          invalid characters, the entire operation will abort.
2495
        </para>
2496
        <para>
2497
          If the <option>--from</option> option is given, the list of
2498
          tags will be extended with the contents of that file (each
2499
          line becomes a tag). In this case, there is not need to pass
2500
          tags on the command line (if you do, both sources will be
2501
          used). A file name of - will be interpreted as stdin.
2502
        </para>
2503
      </refsect3>
2504

    
2505
      <refsect3>
2506
        <title>LIST-TAGS</title>
2507

    
2508
        <cmdsynopsis>
2509
          <command>list-tags</command>
2510
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2511
        </cmdsynopsis>
2512

    
2513
        <para>List the tags of the given instance.</para>
2514
      </refsect3>
2515

    
2516
      <refsect3>
2517
        <title>REMOVE-TAGS</title>
2518
        <cmdsynopsis>
2519
          <command>remove-tags</command>
2520
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2521
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2522
          <arg choice="req"
2523
            rep="repeat"><replaceable>tag</replaceable></arg>
2524
        </cmdsynopsis>
2525

    
2526
        <para>
2527
          Remove tags from the given instance. If any of the tags are
2528
          not existing on the node, the entire operation will abort.
2529
        </para>
2530

    
2531
        <para>
2532
          If the <option>--from</option> option is given, the list of
2533
          tags will be extended with the contents of that file (each
2534
          line becomes a tag). In this case, there is not need to pass
2535
          tags on the command line (if you do, both sources will be
2536
          used). A file name of - will be interpreted as stdin.
2537
        </para>
2538
      </refsect3>
2539

    
2540
    </refsect2>
2541

    
2542
  </refsect1>
2543

    
2544
  &footer;
2545

    
2546
</refentry>
2547

    
2548
<!-- Keep this comment at the end of the file
2549
Local variables:
2550
mode: sgml
2551
sgml-omittag:t
2552
sgml-shorttag:t
2553
sgml-minimize-attributes:nil
2554
sgml-always-quote-attributes:t
2555
sgml-indent-step:2
2556
sgml-indent-data:t
2557
sgml-parent-document:nil
2558
sgml-default-dtd-file:nil
2559
sgml-exposed-tags:nil
2560
sgml-local-catalogs:nil
2561
sgml-local-ecat-files:nil
2562
End:
2563
-->