Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ c54784d9

History | View | Annotate | Download (44 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>May 29, 2008</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
      <holder>Google Inc.</holder>
25
    </copyright>
26
    &dhdate;
27
  </refentryinfo>
28
  <refmeta>
29
    &dhucpackage;
30

    
31
    &dhsection;
32
    <refmiscinfo>ganeti 1.2</refmiscinfo>
33
  </refmeta>
34
  <refnamediv>
35
    <refname>&dhpackage;</refname>
36

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

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

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

    
55
  </refsect1>
56
  <refsect1>
57
    <title>COMMANDS</title>
58

    
59
    <refsect2>
60
      <title>Creation/removal/querying</title>
61

    
62
      <refsect3>
63
        <title>ADD</title>
64
        <cmdsynopsis>
65
          <command>add</command>
66
          <arg>-s <replaceable>disksize</replaceable></arg>
67
          <arg>--swap-size <replaceable>disksize</replaceable></arg>
68
          <arg>-m <replaceable>memsize</replaceable></arg>
69
          <sbr>
70

    
71
          <arg>-b <replaceable>bridge</replaceable></arg>
72
          <arg>--mac <replaceable>MAC-address</replaceable></arg>
73
          <sbr>
74

    
75
          <arg>--hvm-boot-order <replaceable>boot-order</replaceable></arg>
76
          <arg>--hvm-acpi <replaceable>ACPI-support</replaceable></arg>
77
          <sbr>
78

    
79
          <arg>--hvm-pae <replaceable>PAE-support</replaceable></arg>
80
          <sbr>
81

    
82
          <arg>--hvm-cdrom-image-path
83
            <replaceable>cdrom-image-path</replaceable></arg>
84
          <sbr>
85

    
86
          <arg>--vnc-bind-address
87
            <replaceable>vnc-bind-address</replaceable></arg>
88
          <sbr>
89

    
90
          <arg>--kernel<group choice="req">
91
              <arg>default</arg>
92
              <arg><replaceable>kernel_path</replaceable></arg>
93
            </group></arg>
94
          <sbr>
95

    
96
          <arg>--initrd<group choice="req">
97
              <arg>default</arg>
98
              <arg>none</arg>
99
              <arg><replaceable>initrd_path</replaceable></arg>
100
            </group></arg>
101
          <sbr>
102

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

    
110
          <arg choice="req">-t<group choice="req">
111
              <arg>diskless</arg>
112
              <arg>file</arg>
113
              <arg>plain</arg>
114
              <arg>drbd</arg>
115
            </group></arg>
116
          <sbr>
117

    
118
          <group choice="req">
119
            <arg>-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg>
120
            <arg>--iallocator <replaceable>name</replaceable></arg>
121
          </group>
122
          <sbr>
123

    
124
          <arg choice="req">-o <replaceable>os-type</replaceable></arg>
125
          <sbr>
126

    
127
          <arg choice="req"><replaceable>instance</replaceable></arg>
128
        </cmdsynopsis>
129

    
130
        <para>
131
          Creates a new instance on the specified
132
          host. <replaceable>instance</replaceable> must be in DNS and
133
          resolve to a IP in the same network as the nodes in the
134
          cluster.
135
        </para>
136

    
137
        <para>
138
          The <option>-s</option> option specifies the disk size for
139
          the instance, in mebibytes (defaults to
140
          <constant>20480MiB</constant> =
141
          <constant>20GiB</constant>). You can also use one of the
142
          suffixes <literal>m</literal>, <literal>g</literal> or
143
          <literal>t</literal> to specificy the exact the units used;
144
          these suffixes map to mebibytes, gibibytes and tebibytes.
145
        </para>
146

    
147
        <para>
148
          The <option>--swap-size</option> option specifies the swap
149
          disk size (in mebibytes) for the instance (the one presented
150
          as <filename class="devicefile">/dev/sdb</filename>). The
151
          default is <constant>4096MiB</constant>. As for the disk
152
          size, you can specify other suffixes.
153
        </para>
154

    
155
        <para>
156
          The <option>-m</option> option specifies the memory size for
157
          the instance, in mebibytes (defaults to 128 MiB). Again, you
158
          can use other suffixes (e.g. <userinput>2g</userinput>).
159
        </para>
160

    
161
        <para>
162
          The <option>-o</option> options specifies the operating
163
          system to be installed. The available operating systems can
164
          be listed with <command>gnt-os list</command>.
165
        </para>
166

    
167
        <para>
168
          The <option>-b</option> option specifies the bridge to which the
169
          instance will be connected. (defaults to the cluster-wide default
170
          bridge specified at cluster initialization time).
171
        </para>
172

    
173
        <para>
174
          The <option>--mac</option> option specifies the MAC address
175
          of the ethernet interface for the instance. If this option
176
          is not specified, a new MAC address is generated randomly with
177
          the configured MAC prefix. The randomly generated MAC
178
          address is guaranteed to be unique among the instances of
179
          this cluster.
180
        </para>
181

    
182
        <para>
183
          The <option>--hvm-boot-order</option> option specifies the
184
          boot device order for Xen HVM instances. The boot order is a
185
          string of letters listing the boot devices, with valid
186
          device letters being:
187
        </para>
188

    
189
        <para>
190
          <variablelist>
191
            <varlistentry>
192
              <term>a</term>
193
              <listitem>
194
                <para>
195
                  floppy drive
196
                </para>
197
              </listitem>
198
            </varlistentry>
199
            <varlistentry>
200
              <term>c</term>
201
              <listitem>
202
                <para>
203
                  hard disk
204
                </para>
205
              </listitem>
206
            </varlistentry>
207
            <varlistentry>
208
              <term>d</term>
209
              <listitem>
210
                <para>
211
                  CDROM drive
212
                </para>
213
              </listitem>
214
            </varlistentry>
215
            <varlistentry>
216
              <term>n</term>
217
              <listitem>
218
                <para>
219
                  network boot (PXE)
220
                </para>
221
              </listitem>
222
            </varlistentry>
223
          </variablelist>
224
        </para>
225

    
226
        <para>
227
          The option is only relevant for Xen HVM instances and
228
          ignored by all other instances types.
229
        </para>
230

    
231
        <para>
232
          The <option>--hvm-acpi</option> option specifies if Xen
233
          should enable ACPI support for this HVM instance. Valid
234
          values are true or false.
235
        </para>
236

    
237
        <para>
238
          The <option>--hvm-pae</option> option specifies if Xen
239
          should enabled PAE support for this HVM instance. Valid
240
          values are true or false.
241
        </para>
242

    
243
        <para>
244
          The <option>--hvm-cdrom-image-path</option> option specifies the
245
          path to the file xen uses to emulate a virtual CDROM drive
246
          for this HVM instance. Valid values are either an
247
          absolute path to an existing file or None, which disables
248
          virtual CDROM support for this instance.
249
        </para>
250

    
251
        <para>
252
          The <option>--vnc-bind-address</option> option specifies the
253
          address that the VNC listener for this instance should bind
254
          to. Valid values are IPv4 addresses. Use the address 0.0.0.0
255
          to bind to all available interfaces.
256
        </para>
257

    
258
        <para>
259
          The <option>--iallocator</option> option specifies the instance
260
          allocator plugin to use. If you pass in this option the allocator
261
          will select nodes for this instance automatically, so you don't need
262
          to pass them with the <option>-n</option> option. For more
263
          information please refer to the instance allocator documentation.
264
        </para>
265

    
266
        <para>
267
          The <option>--kernel</option> option allows the instance to
268
          use a custom kernel (if a filename is passed) or to use the
269
          default kernel (<filename>@CUSTOM_XEN_KERNEL@</filename>), if the
270
          string <constant>default</constant> is passed.
271
        </para>
272

    
273
        <para>
274
          The <option>--initrd</option> option is similar: it allows
275
          the instance to use a custom initrd (if a filename is
276
          passed) or to use the default initrd
277
          (<filename>@CUSTOM_XEN_INITRD@</filename>), if the string
278
          <constant>default</constant> is passed, or to disable the
279
          use of an initrd, if the string <constant>none</constant> is
280
          passed. Note that in the case the instance is set to use the
281
          default initrd and it doesn't exist, it will be silently
282
          ignored; if the instance is set to use a custom initrd and
283
          it doesn't exist, this will be treated as an error and will
284
          prevent the startup of the instance.
285
        </para>
286

    
287
        <para>
288
          The <option>-t</option> options specifies the disk layout type for
289
          the instance. The available choices are:
290
          <variablelist>
291
            <varlistentry>
292
              <term>diskless</term>
293
              <listitem>
294
                <para>
295
                  This creates an instance with no disks. Its useful for
296
                  testing only (or other special cases).
297
                </para>
298
              </listitem>
299
            </varlistentry>
300
            <varlistentry>
301
              <term>file</term>
302
              <listitem>
303
                <para>Disk devices will be regular files.</para>
304
              </listitem>
305
            </varlistentry>
306
            <varlistentry>
307
              <term>plain</term>
308
              <listitem>
309
                <para>Disk devices will be logical volumes.</para>
310
              </listitem>
311
            </varlistentry>
312
            <varlistentry>
313
              <term>drbd</term>
314
              <listitem>
315
                <para>
316
                  Disk devices will be drbd (version 8.x) on top of
317
                  lvm volumes.
318
                </para>
319
              </listitem>
320
            </varlistentry>
321
          </variablelist>
322
        </para>
323

    
324
        <para>
325
          The optional second value of the <option>--node</option> is used for
326
          the drbd template type and specifies the remote node.
327
        </para>
328

    
329
        <para>
330
          If you do not want gnt-instance to wait for the disk mirror
331
          to be synced, use the <option>--no-wait-for-sync</option>
332
          option.
333
        </para>
334

    
335
        <para>
336
          The <option>--file-storage-dir</option> specifies the relative path
337
          under the cluster-wide file storage directory to store file-based
338
          disks. It is useful for having different subdirectories for
339
          different instances. The full path of the directory where the disk
340
          files are stored will consist of cluster-wide file storage directory
341
          + optional subdirectory + instance name. Example:
342
          /srv/ganeti/file-storage/mysubdir/instance1.example.com. This option
343
          is only relevant for instances using the file storage backend.
344
        </para>
345

    
346
        <para>
347
          The <option>--file-driver</option> specifies the driver to use for
348
          file-based disks. Note that currently these drivers work with the
349
          xen hypervisor only. This option is only relevant for instances using
350
          the file storage backend. The available choices are:
351
          <variablelist>
352
            <varlistentry>
353
              <term>loop</term>
354
              <listitem>
355
                <para>Kernel loopback driver.</para>
356
              </listitem>
357
            </varlistentry>
358
            <varlistentry>
359
              <term>blktap</term>
360
              <listitem>
361
                <para>blktap driver.</para>
362
              </listitem>
363
            </varlistentry>
364
          </variablelist>
365
        </para>
366

    
367
        <para>
368
          The loop driver uses loopback devices to access the filesystem
369
          within the file. However, running I/O intensive applications
370
          in your instance using the loop driver might result in slowdowns.
371
          Furthermore, if you use the loopback driver consider increasing
372
          the maximum amount of loopback devices (on most systems it's 8)
373
          using the max_loop param.
374
        </para>
375

    
376
        <para>
377
          In order to be able to use the blktap driver you should check
378
          if the 'blktapctrl' user space disk agent is running (usually
379
          automatically started via xend). This user-level disk I/O
380
          interface has the advantage of better performance. Especially
381
          if you use a network file system (e.g. NFS) to store your instances
382
          this is the recommended choice.
383
        </para>
384

    
385
        <para>
386
          Example:
387
          <screen>
388
# gnt-instance add -t file -s 30g -m 512 -o debian-etch \
389
  -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
390
# gnt-instance add -t plain -s 30g -m 512 -o debian-etch \
391
  -n node1.example.com instance1.example.com
392
# gnt-instance add -t drbd -s 30g -m 512 -o debian-etch \
393
  -n node1.example.com:node2.example.com instance2.example.com
394
          </screen>
395
        </para>
396
      </refsect3>
397

    
398
      <refsect3>
399
        <title>REMOVE</title>
400

    
401
        <cmdsynopsis>
402
          <command>remove</command>
403
          <arg>--ignore-failures</arg>
404
          <arg choice="req"><replaceable>instance</replaceable></arg>
405
        </cmdsynopsis>
406

    
407
        <para>
408
          Remove an instance. This will remove all data from the
409
          instance and there is <emphasis>no way back</emphasis>. If
410
          you are not sure if you use an instance again, use
411
          <command>shutdown</command> first and leave it in the
412
          shutdown state for a while.
413

    
414
        </para>
415

    
416
        <para>
417
          The <option>--ignore-failures</option> option will cause the
418
          removal to proceed even in the presence of errors during the
419
          removal of the instance (e.g. during the shutdown or the
420
          disk removal). If this option is not given, the command will
421
          stop at the first error.
422
        </para>
423

    
424
        <para>
425
          Example:
426
          <screen>
427
# gnt-instance remove instance1.example.com
428
          </screen>
429
        </para>
430
      </refsect3>
431

    
432
      <refsect3>
433
        <title>LIST</title>
434

    
435
        <cmdsynopsis>
436
          <command>list</command>
437
          <arg>--no-headers</arg>
438
          <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
439
          <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
440
        </cmdsynopsis>
441

    
442
        <para>
443
          Shows the currently configured instances with memory usage,
444
          disk usage, the node they are running on, and the CPU time,
445
          counted in seconds, used by each instance since its latest
446
          restart.
447
        </para>
448

    
449
        <para>
450
          The <option>--no-headers</option> option will skip the
451
          initial header line. The <option>--separator</option> option
452
          takes an argument which denotes what will be used between
453
          the output fields. Both these options are to help scripting.
454
        </para>
455

    
456
        <para>
457
          The <option>-o</option> option takes a comma-separated list
458
          of output fields. The available fields and their meaning
459
          are:
460
          <variablelist>
461
            <varlistentry>
462
              <term>name</term>
463
              <listitem>
464
                <simpara>the instance name</simpara>
465
              </listitem>
466
            </varlistentry>
467
            <varlistentry>
468
              <term>os</term>
469
              <listitem>
470
                <simpara>the OS of the instance</simpara>
471
              </listitem>
472
            </varlistentry>
473
            <varlistentry>
474
              <term>pnode</term>
475
              <listitem>
476
                <simpara>the primary node of the instance</simpara>
477
              </listitem>
478
            </varlistentry>
479
            <varlistentry>
480
              <term>snodes</term>
481
              <listitem>
482
                <simpara>comma-separated list of secondary nodes for the
483
                  instance; usually this will be just one node</simpara>
484
              </listitem>
485
            </varlistentry>
486
            <varlistentry>
487
              <term>admin_state</term>
488
              <listitem>
489
                <simpara>the desired state of the instance (either "yes"
490
                  or "no" denoting the instance should run or
491
                  not)</simpara>
492
              </listitem>
493
            </varlistentry>
494
            <varlistentry>
495
              <term>admin_ram</term>
496
              <listitem>
497
                <simpara>the desired memory for the instance</simpara>
498
              </listitem>
499
            </varlistentry>
500
            <varlistentry>
501
              <term>disk_template</term>
502
              <listitem>
503
                <simpara>the disk template of the instance</simpara>
504
              </listitem>
505
            </varlistentry>
506
            <varlistentry>
507
              <term>oper_state</term>
508
              <listitem>
509
                <simpara>the actual state of the instance; can be
510
                one of the values "running", "stopped", "(node
511
                down)"</simpara>
512
              </listitem>
513
            </varlistentry>
514
            <varlistentry>
515
              <term>status</term>
516
              <listitem>
517
                <simpara>combined form of admin_state and oper_stat;
518
                this can be one of:
519
                <computeroutput>ERROR_nodedown</computeroutput> if the
520
                node of the instance is down,
521
                <computeroutput>ERROR_down</computeroutput> if the
522
                instance should run but is down,
523
                <computeroutput>ERROR_up</computeroutput> if the
524
                instance should be stopped but is actually running,
525
                <computeroutput>ADMIN_down</computeroutput> if the
526
                instance has been stopped (and is stopped) and
527
                <computeroutput>running</computeroutput> if the
528
                instance is set to be running (and is
529
                running)</simpara>
530
              </listitem>
531
            </varlistentry>
532
            <varlistentry>
533
              <term>oper_ram</term>
534
              <listitem>
535
                <simpara>the actual memory usage of the instance as seen
536
                  by the hypervisor</simpara>
537
              </listitem>
538
            </varlistentry>
539
            <varlistentry>
540
              <term>ip</term>
541
              <listitem>
542
                <simpara>the ip address ganeti recognizes as associated with
543
                the instance interface</simpara>
544
              </listitem>
545
            </varlistentry>
546
            <varlistentry>
547
              <term>mac</term>
548
              <listitem>
549
                <simpara>the instance interface MAC address</simpara>
550
              </listitem>
551
            </varlistentry>
552
            <varlistentry>
553
              <term>bridge</term>
554
              <listitem>
555
                <simpara>bridge the instance is connected to
556
                </simpara>
557
              </listitem>
558
            </varlistentry>
559
            <varlistentry>
560
              <term>sda_size</term>
561
              <listitem>
562
                <simpara>the size of the instance's first disk</simpara>
563
              </listitem>
564
            </varlistentry>
565
            <varlistentry>
566
              <term>sdb_size</term>
567
              <listitem>
568
                <simpara>the size of the instance's second disk</simpara>
569
              </listitem>
570
            </varlistentry>
571
            <varlistentry>
572
              <term>vcpus</term>
573
              <listitem>
574
                <simpara>the number of VCPUs allocated to the
575
                instance</simpara>
576
              </listitem>
577
            </varlistentry>
578
            <varlistentry>
579
              <term>tags</term>
580
              <listitem>
581
                <simpara>comma-separated list of the instances's
582
                tags</simpara>
583
              </listitem>
584
            </varlistentry>
585
          </variablelist>
586
        </para>
587

    
588
        <para>
589
          If the value of the option starts with the character
590
          <constant>+</constant>, the new fields will be added to the
591
          default list. This allows to quickly see the default list
592
          plus a few other fields, instead of retyping the entire list
593
          of fields.
594
        </para>
595

    
596
        <para>
597
          There is a subtle grouping about the available output
598
          fields: all fields except for <option>oper_state</option>,
599
          <option>oper_ram</option> and <option>status</option> are
600
          configuration value and not run-time values. So if you don't
601
          select any of the these fields, the query will be satisfied
602
          instantly from the cluster configuration, without having to
603
          ask the remote nodes for the data. This can be helpful for
604
          big clusters when you only want some data and it makes sense
605
          to specify a reduced set of output fields.
606
        </para>
607

    
608
        <para>The default output field list is:
609
          <simplelist type="inline">
610
            <member>name</member>
611
            <member>os</member>
612
            <member>pnode</member>
613
            <member>admin_state</member>
614
            <member>oper_state</member>
615
            <member>oper_ram</member>
616
          </simplelist>.
617
        </para>
618
      </refsect3>
619

    
620
      <refsect3>
621
        <title>INFO</title>
622

    
623
        <cmdsynopsis>
624
          <command>info</command>
625
          <arg rep="repeat"><replaceable>instance</replaceable></arg>
626
        </cmdsynopsis>
627

    
628
        <para>
629
          Show detailed information about the (given) instances. This
630
          is different from <command>list</command> as it shows
631
          detailed data about the instance's disks (especially useful
632
          for drbd disk template).
633
        </para>
634
      </refsect3>
635

    
636
      <refsect3>
637
        <title>MODIFY</title>
638

    
639
        <cmdsynopsis>
640
          <command>modify</command>
641
          <arg choice="opt">-m <replaceable>memsize</replaceable></arg>
642
          <arg choice="opt">-p <replaceable>vcpus</replaceable></arg>
643
          <arg choice="opt">-i <replaceable>ip</replaceable></arg>
644
          <arg choice="opt">-b <replaceable>bridge</replaceable></arg>
645
          <arg choice="opt">--mac <replaceable>MAC-address</replaceable></arg>
646
          <arg>--hvm-boot-order <replaceable>boot-order</replaceable></arg>
647
          <arg>--hvm-acpi <replaceable>ACPI-support</replaceable></arg>
648
          <arg>--hvm-pae <replaceable>PAE-support</replaceable></arg>
649
          <arg>--hvm-cdrom-image-path
650
            <replaceable>cdrom-image-path</replaceable></arg>
651
          <arg>--vnc-bind-address
652
            <replaceable>vnc-bind-address</replaceable></arg>
653

    
654
          <sbr>
655
          <arg>--kernel <group choice="req">
656
              <arg>default</arg>
657
              <arg><replaceable>kernel_path</replaceable></arg>
658
            </group></arg>
659
          <sbr>
660
          <arg>--initrd <group choice="req">
661
              <arg>default</arg>
662
              <arg>none</arg>
663
              <arg><replaceable>initrd_path</replaceable></arg>
664
            </group> </arg>
665
          <sbr>
666
          <arg choice="req"><replaceable>instance</replaceable></arg>
667
        </cmdsynopsis>
668

    
669
        <para>
670
          Modify the memory size, number of vcpus, ip address, MAC
671
          address and/or bridge for an instance.
672
        </para>
673

    
674
        <para>
675
          The memory size is given in MiB. Note that you need to give
676
          at least one of the arguments, otherwise the command
677
          complains.
678
        </para>
679

    
680
        <para>
681
          The <option>--kernel</option>, <option>--initrd</option>
682
          and <option>--hvm-boot-order</option>
683
          options are described in the <command>add</command> command.
684
        </para>
685

    
686
        <para>
687
          Additionally, the HVM boot order can be reset to the default
688
          values by using <option>--hvm-boot-order=default</option>.
689
        </para>
690

    
691
        <para>
692
          The <option>--hvm-acpi</option> option specifies if Xen
693
          should enable ACPI support for this HVM instance. Valid
694
          values are true or false.
695
        </para>
696

    
697
        <para>
698
          The <option>--hvm-pae</option> option specifies if Xen
699
          should enabled PAE support for this HVM instance. Valid
700
          values are true or false.
701
        </para>
702

    
703
        <para>
704
          The <option>--hvm-cdrom-image-path</option> specifies the
705
          path to the file xen uses to emulate a virtual CDROM drive
706
          for this HVM instance. Valid values are either an
707
          absolute path to an existing file or None, which disables
708
          virtual CDROM support for this instance.
709
        </para>
710

    
711
        <para>
712
          The <option>--vnc-bind-address</option> specifies the
713
          address that the VNC listener for this instance should bind
714
          to. Valid values are IPv4 addresses. Use the address 0.0.0.0
715
          to bind to all available interfaces.
716
        </para>
717

    
718
        <para>
719
          All the changes take effect at the next restart. If the
720
          instance is running, there is no effect on the instance.
721
        </para>
722
      </refsect3>
723

    
724
      <refsect3>
725
        <title>REINSTALL</title>
726

    
727
        <cmdsynopsis>
728
          <command>reinstall</command>
729
          <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
730
          <arg choice="opt">-f <replaceable>force</replaceable></arg>
731
          <arg choice="req"><replaceable>instance</replaceable></arg>
732
        </cmdsynopsis>
733

    
734
        <para>
735
          Reinstalls the operating system on the given instance. The instance
736
          must be stopped when running this command. If the
737
          <option>--os-type</option> is specified, the operating system is
738
          changed.
739
        </para>
740
      </refsect3>
741

    
742
      <refsect3>
743
        <title>RENAME</title>
744

    
745
        <cmdsynopsis>
746
          <command>rename</command>
747
          <arg>--no-ip-check</arg>
748
          <arg choice="req"><replaceable>instance</replaceable></arg>
749
          <arg choice="req"><replaceable>new_name</replaceable></arg>
750
        </cmdsynopsis>
751

    
752
        <para>
753
          Renames the given instance. The instance must be stopped
754
          when running this command. The requirements for the new name
755
          are the same as for adding an instance: the new name must be
756
          resolvable and the IP it resolves to must not be reachable
757
          (in order to prevent duplicate IPs the next time the
758
          instance is started). The IP test can be skipped if the
759
          <option>--no-ip-check</option> option is passed.
760
        </para>
761
      </refsect3>
762

    
763
    </refsect2>
764

    
765
    <refsect2>
766
      <title>Starting/stopping/connecting to console</title>
767

    
768
      <refsect3>
769
        <title>STARTUP</title>
770

    
771
        <cmdsynopsis>
772
          <command>startup</command>
773
          <arg>--extra=<replaceable>PARAMS</replaceable></arg>
774
          <arg>--force</arg>
775
          <sbr>
776
          <group choice="opt">
777
            <arg>--instance</arg>
778
            <arg>--node</arg>
779
            <arg>--primary</arg>
780
            <arg>--secondary</arg>
781
            <arg>--all</arg>
782
          </group>
783
          <sbr>
784
          <arg choice="opt"
785
          rep="repeat"><replaceable>name</replaceable></arg>
786
        </cmdsynopsis>
787

    
788
        <para>
789
          Starts one or more instances, depending on the following
790
          options. The four available modes are:
791
          <variablelist>
792
            <varlistentry>
793
              <term><option>--instance</option></term>
794
              <listitem>
795
                <simpara>will start the instances given as arguments
796
                (at least one argument required); this is the default
797
                selection</simpara>
798
              </listitem>
799
            </varlistentry>
800
            <varlistentry>
801
              <term>--node</term>
802
              <listitem>
803
                <simpara>will start the instances who have the given
804
                node as either primary or secondary</simpara>
805
              </listitem>
806
            </varlistentry>
807
            <varlistentry>
808
              <term><option>--primary</option></term>
809
              <listitem>
810
                <simpara>will start all instances whose primary node
811
                is in the list of nodes passed as arguments (at least
812
                one node required)</simpara>
813
              </listitem>
814
            </varlistentry>
815
            <varlistentry>
816
              <term><option>--secondary</option></term>
817
              <listitem>
818
                <simpara>will start all instances whose secondary node
819
                is in the list of nodes passed as arguments (at least
820
                one node required)</simpara>
821
              </listitem>
822
            </varlistentry>
823
            <varlistentry>
824
              <term>--all</term>
825
              <listitem>
826
                <simpara>will start all instances in the cluster (no
827
                arguments accepted)</simpara>
828
              </listitem>
829
            </varlistentry>
830
          </variablelist>
831
        </para>
832

    
833
        <para>
834
          Note that although you can pass more than one selection
835
          option, the last one wins, so in order to guarantee the
836
          desired result, don't pass more than one such option.
837
        </para>
838

    
839
        <para>
840
          The <option>--extra</option> option is used to pass
841
          additional argument to the instance's kernel for this start
842
          only. Currently there is no way to specify a persistent set
843
          of arguments (beside the one hardcoded). Note that this may
844
          not apply to all virtualization types.
845
        </para>
846

    
847
        <para>
848
          Use <option>--force</option> to start even if secondary disks are
849
          failing.
850
        </para>
851

    
852
        <para>
853
          Example:
854
          <screen>
855
# gnt-instance start instance1.example.com
856
# gnt-instance start --extra single test1.example.com
857
# gnt-instance start --node node1.example.com node2.example.com
858
# gnt-instance start --all
859
          </screen>
860
        </para>
861
      </refsect3>
862

    
863
      <refsect3>
864
        <title>SHUTDOWN</title>
865

    
866
        <cmdsynopsis>
867
          <command>shutdown</command>
868
          <sbr>
869
          <group choice="opt">
870
            <arg>--instance</arg>
871
            <arg>--node</arg>
872
            <arg>--primary</arg>
873
            <arg>--secondary</arg>
874
            <arg>--all</arg>
875
          </group>
876
          <sbr>
877

    
878
          <arg choice="opt"
879
          rep="repeat"><replaceable>name</replaceable></arg>
880
        </cmdsynopsis>
881

    
882
        <para>
883
          Stops one or more instances. If the instance cannot be
884
          cleanly stopped during a hardcoded interval (currently 2
885
          minutes), it will forcibly stop the instance (equivalent to
886
          switching off the power on a physical machine).
887
        </para>
888

    
889
        <para>
890
          The <option>--instance</option>, <option>--node</option>,
891
          <option>--primary</option>, <option>--secondary</option> and
892
          <option>--all</option> options are similar as for the
893
          <command>startup</command> command and they influence the
894
          actual instances being shutdown.
895
        </para>
896

    
897
        <para>
898
          Example:
899
          <screen>
900
# gnt-instance shutdown instance1.example.com
901
# gnt-instance shutdown --all
902
          </screen>
903
        </para>
904
      </refsect3>
905

    
906
      <refsect3>
907
        <title>REBOOT</title>
908

    
909
        <cmdsynopsis>
910
          <command>reboot</command>
911
          <sbr>
912
          <arg>--extra=<replaceable>PARAMS</replaceable></arg>
913
          <sbr>
914
          <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
915
          <sbr>
916
          <arg>--ignore-secondaries</arg>
917
          <sbr>
918
          <arg>--force-multiple</arg>
919
          <sbr>
920
          <group choice="opt">
921
            <arg>--instance</arg>
922
            <arg>--node</arg>
923
            <arg>--primary</arg>
924
            <arg>--secondary</arg>
925
            <arg>--all</arg>
926
          </group>
927
          <sbr>
928

    
929
          <arg choice="opt"
930
          rep="repeat"><replaceable>name</replaceable></arg>
931
        </cmdsynopsis>
932

    
933
        <para>
934
          Reboots one or more instances. The type of reboot depends on
935
          the value of <option>--type</option>. A soft reboot does a
936
          hypervisor reboot, a hard reboot does a instance stop,
937
          recreates the hypervisor config for the instance and
938
          starts the instance. A full reboot does the equivalent
939
          of <command>gnt-instance shutdown &amp;&amp; gnt-instance
940
          startup</command>. The default is soft reboot.
941
        </para>
942

    
943
        <para>
944
          For the hard reboot the option
945
          <option>--ignore-secondaries</option> ignores errors for the
946
          secondary node while re-assembling the instance disks.
947
        </para>
948

    
949
        <para>
950
          The <option>--instance</option>, <option>--node</option>,
951
          <option>--primary</option>, <option>--secondary</option> and
952
          <option>--all</option> options are similar as for the
953
          <command>startup</command> command and they influence the
954
          actual instances being rebooted.
955
        </para>
956

    
957
        <para>
958
          Use the <option>--force-multiple</option> option to keep
959
          gnt-instance from asking for confirmation when more than one
960
          instance is affected.
961
        </para>
962

    
963
        <para>
964
          Example:
965
          <screen>
966
# gnt-instance reboot instance1.example.com
967
# gnt-instance reboot --type=full instance1.example.com
968
          </screen>
969
        </para>
970
      </refsect3>
971

    
972
      <refsect3>
973
        <title>CONSOLE</title>
974
        <cmdsynopsis>
975
          <command>console</command>
976
          <arg choice="opt">--show-cmd</arg>
977
          <arg choice="req"><replaceable>instance</replaceable></arg>
978
        </cmdsynopsis>
979

    
980
        <para>
981
          Connects to the console of the given instance. If the instance
982
          is not up, an error is returned. Use the <option>--show-cmd</option>
983
          option to display the command instead of executing it.
984
        </para>
985

    
986
        <para>
987
          Example:
988
          <screen>
989
# gnt-instance console instance1.example.com
990
          </screen>
991
        </para>
992
      </refsect3>
993

    
994
    </refsect2>
995

    
996
    <refsect2>
997
      <title>Disk management</title>
998

    
999
      <refsect3>
1000
        <title>REPLACE-DISKS</title>
1001

    
1002
        <cmdsynopsis>
1003
          <command>replace-disks</command>
1004

    
1005
          <group choice="req">
1006
            <arg>--iallocator <replaceable>name</replaceable></arg>
1007
            <arg>--new-secondary <replaceable>NODE</replaceable></arg>
1008
          </group>
1009
          <sbr>
1010

    
1011
          <arg choice="opt">-s</arg>
1012
          <arg choice="req"><replaceable>instance</replaceable></arg>
1013
        </cmdsynopsis>
1014

    
1015
        <cmdsynopsis>
1016
          <command>replace-disks</command>
1017

    
1018
          <group>
1019
          <arg choice="req">-s</arg>
1020
          <arg choice="req">-p</arg>
1021
          </group>
1022
          <arg choice="req"><replaceable>instance</replaceable></arg>
1023
        </cmdsynopsis>
1024

    
1025
        <para>
1026
          This command is a generalized form for adding and replacing
1027
          disks. It is currently only valid for the mirrored (DRBD)
1028
          disk template.
1029
        </para>
1030

    
1031
        <para>
1032
          The first form will do a secondary node change, while the
1033
          second form will replace the disks on either the primary
1034
          (<option>-p</option>) or the secondary (<option>-s</option>)
1035
          node of the instance only, without changing the node.
1036
        </para>
1037

    
1038
        <para>
1039
          Specifying <option>--iallocator</option> enables secondary node
1040
          replacement and and makes the new secondary be selected automatically
1041
          by the specified allocator plugin.
1042
        </para>
1043
      </refsect3>
1044

    
1045
      <refsect3>
1046
        <title>ACTIVATE-DISKS</title>
1047

    
1048
        <cmdsynopsis>
1049
          <command>activate-disks</command>
1050
          <arg choice="req"><replaceable>instance</replaceable></arg>
1051
        </cmdsynopsis>
1052
        <para>
1053
          Activates the block devices of the given instance. If
1054
          successful, the command will show the location and name of
1055
          the block devices:
1056
          <screen>
1057
node1.example.com:sda:/dev/drbd0
1058
node1.example.com:sdb:/dev/drbd1
1059
          </screen>
1060

    
1061
          In this example, <emphasis>node1.example.com</emphasis> is
1062
          the name of the node on which the devices have been
1063
          activated. The <emphasis>sda</emphasis> and
1064
          <emphasis>sdb</emphasis> are the names of the block devices
1065
          inside the instance. <emphasis>/dev/drbd0</emphasis> and
1066
          <emphasis>/dev/drbd1</emphasis> are the names of the block
1067
          devices as visible on the node.
1068
        </para>
1069

    
1070
        <para>
1071
          Note that it is safe to run this command while the instance
1072
          is already running.
1073
        </para>
1074
      </refsect3>
1075

    
1076
      <refsect3>
1077
        <title>DEACTIVATE-DISKS</title>
1078

    
1079
        <cmdsynopsis>
1080
          <command>deactivate-disks</command>
1081
          <arg choice="req"><replaceable>instance</replaceable></arg>
1082
        </cmdsynopsis>
1083
        <para>
1084
          De-activates the block devices of the given instance. Note
1085
          that if you run this command for an instance with a drbd
1086
          disk template, while it is running, it will not be able to
1087
          shutdown the block devices on the primary node, but it will
1088
          shutdown the block devices on the secondary nodes, thus
1089
          breaking the replication.
1090
        </para>
1091

    
1092
      </refsect3>
1093

    
1094
      <refsect3>
1095
        <title>GROW-DISK</title>
1096
        <cmdsynopsis>
1097
          <command>grow-disk</command>
1098
          <arg choice="req"><replaceable>instance</replaceable></arg>
1099
          <arg choice="req"><replaceable>disk</replaceable></arg>
1100
          <arg choice="req"><replaceable>amount</replaceable></arg>
1101
        </cmdsynopsis>
1102

    
1103
        <para>
1104
          Grows an instance's disk. This is only possible for
1105
          instances having a <literal>plain</literal> or
1106
          <literal>drbd</literal> disk template.
1107
        </para>
1108

    
1109
        <para>
1110
          Note that this command only change the block device size; it
1111
          will not grow the actual filesystems, partitions, etc. that
1112
          live on that disk. Usually, you will need to:
1113
          <orderedlist>
1114
            <listitem>
1115
              <simpara>use <command>gnt-instance grow-disk</command></simpara>
1116
            </listitem>
1117
            <listitem>
1118
              <simpara>reboot the instance (later, at a convenient
1119
              time)</simpara>
1120
            </listitem>
1121
            <listitem>
1122
              <simpara>use a filesystem resizer, such as
1123
              <citerefentry> <refentrytitle>ext2online</refentrytitle>
1124
              <manvolnum>8</manvolnum> </citerefentry> or
1125
              <citerefentry> <refentrytitle>xfs_growfs</refentrytitle>
1126
              <manvolnum>8</manvolnum> </citerefentry> to resize the
1127
              filesystem, or use <citerefentry>
1128
              <refentrytitle>fdisk</refentrytitle>
1129
              <manvolnum>8</manvolnum> </citerefentry> to change the
1130
              partition table on the disk
1131
              </simpara>
1132
            </listitem>
1133
          </orderedlist>
1134
        </para>
1135

    
1136

    
1137
        <para>
1138
          The <replaceable>disk</replaceable> argument is either
1139
          <literal>sda</literal> or <literal>sdb</literal>. The
1140
          <replaceable>amount</replaceable> argument is given either
1141
          as a number (and it represents the amount to increase the
1142
          disk with in mebibytes) or can be given similar to the
1143
          arguments in the create instance operation, with a suffix
1144
          denoting the unit.
1145
        </para>
1146

    
1147
        <para>
1148
          Note that the disk grow operation might complete on one node
1149
          but fail on the other; this will leave the instance with
1150
          different-sized LVs on the two nodes, but this will not
1151
          create problems (except for unused space).
1152
        </para>
1153

    
1154
        <para>Example (increasing sda for instance1 with 16GiB):
1155
          <screen>
1156
# gnt-instance grow-disk instance1.example.com sda 16g
1157
          </screen>
1158
        </para>
1159

    
1160
        <para>
1161
          Also note that disk shrinking will not be supported; use
1162
          <command>gnt-backup export</command> and then
1163
          <command>gnt-backup import</command> to reduce the disk size
1164
          of an instance.
1165
        </para>
1166
      </refsect3>
1167

    
1168
    </refsect2>
1169

    
1170
    <refsect2>
1171
      <title>Recovery</title>
1172

    
1173
      <refsect3>
1174
        <title>FAILOVER</title>
1175

    
1176
        <cmdsynopsis>
1177
          <command>failover</command>
1178
          <arg>-f</arg>
1179
          <arg>--ignore-consistency</arg>
1180
          <arg choice="req"><replaceable>instance</replaceable></arg>
1181
        </cmdsynopsis>
1182

    
1183
        <para>
1184
          Failover will fail the instance over its secondary
1185
          node. This works only for instances having a drbd disk
1186
          template.
1187
        </para>
1188

    
1189
        <para>
1190
          Normally the failover will check the consistency of the
1191
          disks before failing over the instance. If you are trying to
1192
          migrate instances off a dead node, this will fail. Use the
1193
          <option>--ignore-consistency</option> option for this
1194
          purpose. Note that this option can be dangerous as errors in
1195
          shutting down the instance will be ignored, resulting in
1196
          possibly having the instance running on two machines in
1197
          parallel (on disconnected DRBD drives).
1198
        </para>
1199

    
1200
        <para>
1201
          Example:
1202
          <screen>
1203
# gnt-instance failover instance1.example.com
1204
          </screen>
1205
        </para>
1206
      </refsect3>
1207

    
1208
    </refsect2>
1209

    
1210
    <refsect2>
1211
      <title>TAGS</title>
1212

    
1213
    <refsect3>
1214
        <title>ADD-TAGS</title>
1215

    
1216
        <cmdsynopsis>
1217
          <command>add-tags</command>
1218
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
1219
          <arg choice="req"><replaceable>instancename</replaceable></arg>
1220
          <arg choice="req"
1221
            rep="repeat"><replaceable>tag</replaceable></arg>
1222
        </cmdsynopsis>
1223

    
1224
        <para>
1225
          Add tags to the given instance. If any of the tags contains
1226
          invalid characters, the entire operation will abort.
1227
        </para>
1228
        <para>
1229
          If the <option>--from</option> option is given, the list of
1230
          tags will be extended with the contents of that file (each
1231
          line becomes a tag). In this case, there is not need to pass
1232
          tags on the command line (if you do, both sources will be
1233
          used). A file name of - will be interpreted as stdin.
1234
        </para>
1235
      </refsect3>
1236

    
1237
      <refsect3>
1238
        <title>LIST-TAGS</title>
1239

    
1240
        <cmdsynopsis>
1241
          <command>list-tags</command>
1242
          <arg choice="req"><replaceable>instancename</replaceable></arg>
1243
        </cmdsynopsis>
1244

    
1245
        <para>List the tags of the given instance.</para>
1246
      </refsect3>
1247

    
1248
      <refsect3>
1249
        <title>REMOVE-TAGS</title>
1250
        <cmdsynopsis>
1251
          <command>remove-tags</command>
1252
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
1253
          <arg choice="req"><replaceable>instancename</replaceable></arg>
1254
          <arg choice="req"
1255
            rep="repeat"><replaceable>tag</replaceable></arg>
1256
        </cmdsynopsis>
1257

    
1258
        <para>
1259
          Remove tags from the given instance. If any of the tags are
1260
          not existing on the node, the entire operation will abort.
1261
        </para>
1262

    
1263
        <para>
1264
          If the <option>--from</option> option is given, the list of
1265
          tags will be extended with the contents of that file (each
1266
          line becomes a tag). In this case, there is not need to pass
1267
          tags on the command line (if you do, both sources will be
1268
          used). A file name of - will be interpreted as stdin.
1269
        </para>
1270
      </refsect3>
1271

    
1272
    </refsect2>
1273

    
1274
  </refsect1>
1275

    
1276
  &footer;
1277

    
1278
</refentry>
1279

    
1280
<!-- Keep this comment at the end of the file
1281
Local variables:
1282
mode: sgml
1283
sgml-omittag:t
1284
sgml-shorttag:t
1285
sgml-minimize-attributes:nil
1286
sgml-always-quote-attributes:t
1287
sgml-indent-step:2
1288
sgml-indent-data:t
1289
sgml-parent-document:nil
1290
sgml-default-dtd-file:nil
1291
sgml-exposed-tags:nil
1292
sgml-local-catalogs:nil
1293
sgml-local-ecat-files:nil
1294
End:
1295
-->