gnt-instance.sgml 43.8 KB
Newer Older
Iustin Pop's avatar
Iustin Pop committed
1
2
3
4
<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [

  <!-- Fill in your name for FIRSTNAME and SURNAME. -->
  <!-- Please adjust the date whenever revising the manpage. -->
5
  <!ENTITY dhdate      "<date>May 29, 2008</date>">
Iustin Pop's avatar
Iustin Pop committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
       allowed: see man(7), man(1). -->
  <!ENTITY dhsection   "<manvolnum>8</manvolnum>">
  <!ENTITY dhucpackage "<refentrytitle>gnt-instance</refentrytitle>">
  <!ENTITY dhpackage   "gnt-instance">

  <!ENTITY debian      "<productname>Debian</productname>">
  <!ENTITY gnu         "<acronym>GNU</acronym>">
  <!ENTITY gpl         "&gnu; <acronym>GPL</acronym>">
  <!ENTITY footer SYSTEM "footer.sgml">
]>

<refentry>
  <refentryinfo>
    <copyright>
      <year>2006</year>
      <year>2007</year>
23
      <year>2008</year>
Iustin Pop's avatar
Iustin Pop committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
      <holder>Google Inc.</holder>
    </copyright>
    &dhdate;
  </refentryinfo>
  <refmeta>
    &dhucpackage;

    &dhsection;
    <refmiscinfo>ganeti 1.2</refmiscinfo>
  </refmeta>
  <refnamediv>
    <refname>&dhpackage;</refname>

    <refpurpose>ganeti instance administration</refpurpose>
  </refnamediv>
  <refsynopsisdiv>
    <cmdsynopsis>
      <command>&dhpackage; </command>

      <arg choice="req">command</arg>
      <arg>arguments...</arg>
    </cmdsynopsis>
  </refsynopsisdiv>
  <refsect1>
    <title>DESCRIPTION</title>

    <para>
      The <command>&dhpackage;</command> is used for instance
      administration in the ganeti system.
    </para>

  </refsect1>
  <refsect1>
    <title>COMMANDS</title>

    <refsect2>
      <title>Creation/removal/querying</title>

      <refsect3>
        <title>ADD</title>
        <cmdsynopsis>
          <command>add</command>
          <arg>-s <replaceable>disksize</replaceable></arg>
67
          <arg>--swap-size <replaceable>disksize</replaceable></arg>
Iustin Pop's avatar
Iustin Pop committed
68
          <arg>-m <replaceable>memsize</replaceable></arg>
69
          <sbr>
70

Iustin Pop's avatar
Iustin Pop committed
71
          <arg>-b <replaceable>bridge</replaceable></arg>
72
          <arg>--mac <replaceable>MAC-address</replaceable></arg>
73
74
          <sbr>

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

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

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

86
87
          <arg>--vnc-bind-address
            <replaceable>vnc-bind-address</replaceable></arg>
Iustin Pop's avatar
Iustin Pop committed
88
          <sbr>
89
90

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

          <arg>--initrd<group choice="req">
97
98
99
              <arg>default</arg>
              <arg>none</arg>
              <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
106
107
108
              <arg>loop</arg>
              <arg>blktap</arg>
            </group></arg>
          <sbr>
109
110

          <arg choice="req">-t<group choice="req">
Iustin Pop's avatar
Iustin Pop committed
111
              <arg>diskless</arg>
112
              <arg>file</arg>
Iustin Pop's avatar
Iustin Pop committed
113
              <arg>plain</arg>
Iustin Pop's avatar
Iustin Pop committed
114
              <arg>drbd</arg>
115
            </group></arg>
116
          <sbr>
117

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

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

Iustin Pop's avatar
Iustin Pop committed
127
128
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>
129

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

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

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

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

        <para>
          The <option>-o</option> options specifies the operating
          system to be installed. The available operating systems can
          be listed with <command>gnt-os list</command>.
Iustin Pop's avatar
Iustin Pop committed
165
166
167
168
169
        </para>

        <para>
          The <option>-b</option> option specifies the bridge to which the
          instance will be connected. (defaults to the cluster-wide default
170
          bridge specified at cluster initialization time).
Iustin Pop's avatar
Iustin Pop committed
171
172
        </para>

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

182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
        <para>
          The <option>--hvm-boot-order</option> option specifies the
          boot device order for Xen HVM instances. The boot order is a
          string of letters listing the boot devices, with valid
          device letters being:
        </para>

        <para>
          <variablelist>
            <varlistentry>
              <term>a</term>
              <listitem>
                <para>
                  floppy drive
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>c</term>
              <listitem>
                <para>
                  hard disk
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>d</term>
              <listitem>
                <para>
                  CDROM drive
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>n</term>
              <listitem>
                <para>
                  network boot (PXE)
                </para>
              </listitem>
            </varlistentry>
          </variablelist>
        </para>

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

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

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

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

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

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

        <para>
          The <option>--kernel</option> option allows the instance to
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
          use a custom kernel (if a filename is passed) or to use the
          default kernel (<filename>@CUSTOM_XEN_KERNEL@</filename>), if the
          string <constant>default</constant> is passed.
        </para>

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

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

        <para>
325
          The optional second value of the <option>--node</option> is used for
326
          the drbd template type and specifies the remote node.
Iustin Pop's avatar
Iustin Pop committed
327
328
329
330
331
332
333
334
        </para>

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

335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
        <para>
          The <option>--file-storage-dir</option> specifies the relative path
          under the cluster-wide file storage directory to store file-based
          disks. It is useful for having different subdirectories for
          different instances. The full path of the directory where the disk
          files are stored will consist of cluster-wide file storage directory
          + optional subdirectory + instance name. Example:
          /srv/ganeti/file-storage/mysubdir/instance1.example.com. This option
          is only relevant for instances using the file storage backend.
        </para>

        <para>
          The <option>--file-driver</option> specifies the driver to use for
          file-based disks. Note that currently these drivers work with the
          xen hypervisor only. This option is only relevant for instances using
          the file storage backend. The available choices are:
          <variablelist>
            <varlistentry>
              <term>loop</term>
              <listitem>
                <para>Kernel loopback driver.</para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>blktap</term>
              <listitem>
                <para>blktap driver.</para>
              </listitem>
            </varlistentry>
364
          </variablelist>
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
        </para>

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

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

Iustin Pop's avatar
Iustin Pop committed
385
386
387
        <para>
          Example:
          <screen>
388
389
# gnt-instance add -t file -s 30g -m 512 -o debian-etch \
  -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
390
391
# gnt-instance add -t plain -s 30g -m 512 -o debian-etch \
  -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
Iustin Pop's avatar
Iustin Pop committed
394
395
396
397
398
399
400
401
402
          </screen>
        </para>
      </refsect3>

      <refsect3>
        <title>REMOVE</title>

        <cmdsynopsis>
          <command>remove</command>
Iustin Pop's avatar
Iustin Pop committed
403
          <arg>--ignore-failures</arg>
Iustin Pop's avatar
Iustin Pop committed
404
405
406
407
408
409
410
411
412
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>

        <para>
          Remove an instance. This will remove all data from the
          instance and there is <emphasis>no way back</emphasis>. If
          you are not sure if you use an instance again, use
          <command>shutdown</command> first and leave it in the
          shutdown state for a while.
Iustin Pop's avatar
Iustin Pop committed
413
414
415
416
417
418
419
420
421

        </para>

        <para>
          The <option>--ignore-failures</option> option will cause the
          removal to proceed even in the presence of errors during the
          removal of the instance (e.g. during the shutdown or the
          disk removal). If this option is not given, the command will
          stop at the first error.
Iustin Pop's avatar
Iustin Pop committed
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
        </para>

        <para>
          Example:
          <screen>
# gnt-instance remove instance1.example.com
          </screen>
        </para>
      </refsect3>

      <refsect3>
        <title>LIST</title>

        <cmdsynopsis>
          <command>list</command>
          <arg>--no-headers</arg>
          <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
439
          <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
Iustin Pop's avatar
Iustin Pop committed
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
        </cmdsynopsis>

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

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

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

581
582
583
584
585
586
587
588
        <para>
          If the value of the option starts with the character
          <constant>+</constant>, the new fields will be added to the
          default list. This allows to quickly see the default list
          plus a few other fields, instead of retyping the entire list
          of fields.
        </para>

Iustin Pop's avatar
Iustin Pop committed
589
590
        <para>
          There is a subtle grouping about the available output
Iustin Pop's avatar
Iustin Pop committed
591
592
593
594
          fields: all fields except for <option>oper_state</option>,
          <option>oper_ram</option> and <option>status</option> are
          configuration value and not run-time values. So if you don't
          select any of the these fields, the query will be satisfied
Iustin Pop's avatar
Iustin Pop committed
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
          instantly from the cluster configuration, without having to
          ask the remote nodes for the data. This can be helpful for
          big clusters when you only want some data and it makes sense
          to specify a reduced set of output fields.
        </para>

        <para>The default output field list is:
          <simplelist type="inline">
            <member>name</member>
            <member>os</member>
            <member>pnode</member>
            <member>admin_state</member>
            <member>oper_state</member>
            <member>oper_ram</member>
          </simplelist>.
        </para>
      </refsect3>

      <refsect3>
        <title>INFO</title>

        <cmdsynopsis>
          <command>info</command>
          <arg rep="repeat"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>

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

      <refsect3>
        <title>MODIFY</title>

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

647
648
649
650
651
652
653
654
655
656
657
658
          <sbr>
          <arg>--kernel <group choice="req">
              <arg>default</arg>
              <arg><replaceable>kernel_path</replaceable></arg>
            </group></arg>
          <sbr>
          <arg>--initrd <group choice="req">
              <arg>default</arg>
              <arg>none</arg>
              <arg><replaceable>initrd_path</replaceable></arg>
            </group> </arg>
          <sbr>
Iustin Pop's avatar
Iustin Pop committed
659
660
661
662
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>

        <para>
663
664
          Modify the memory size, number of vcpus, ip address, MAC
          address and/or bridge for an instance.
Iustin Pop's avatar
Iustin Pop committed
665
666
667
668
669
670
671
672
        </para>

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

673
        <para>
674
675
          The <option>--kernel</option>, <option>--initrd</option>
          and <option>--hvm-boot-order</option>
676
677
678
          options are described in the <command>add</command> command.
        </para>

679
680
681
682
683
        <para>
          Additionally, the HVM boot order can be reset to the default
          values by using <option>--hvm-boot-order=default</option>.
        </para>

684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
        <para>
          The <option>--hvm-acpi</option> option specifies if Xen
          should enable ACPI support for this HVM instance. Valid
          values are true or false.
        </para>

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

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

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

Iustin Pop's avatar
Iustin Pop committed
711
712
713
714
715
716
        <para>
          All the changes take effect at the next restart. If the
          instance is running, there is no effect on the instance.
        </para>
      </refsect3>

717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
      <refsect3>
        <title>REINSTALL</title>

        <cmdsynopsis>
          <command>reinstall</command>
          <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
          <arg choice="opt">-f <replaceable>force</replaceable></arg>
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>

        <para>
          Reinstalls the operating system on the given instance. The instance
          must be stopped when running this command. If the
          <option>--os-type</option> is specified, the operating system is
          changed.
        </para>
      </refsect3>

735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
      <refsect3>
        <title>RENAME</title>

        <cmdsynopsis>
          <command>rename</command>
          <arg>--no-ip-check</arg>
          <arg choice="req"><replaceable>instance</replaceable></arg>
          <arg choice="req"><replaceable>new_name</replaceable></arg>
        </cmdsynopsis>

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

Iustin Pop's avatar
Iustin Pop committed
756
757
758
759
760
761
762
763
764
765
766
    </refsect2>

    <refsect2>
      <title>Starting/stopping/connecting to console</title>

      <refsect3>
        <title>STARTUP</title>

        <cmdsynopsis>
          <command>startup</command>
          <arg>--extra=<replaceable>PARAMS</replaceable></arg>
767
          <arg>--force</arg>
768
769
770
771
772
773
774
775
776
777
778
          <sbr>
          <group choice="opt">
            <arg>--instance</arg>
            <arg>--node</arg>
            <arg>--primary</arg>
            <arg>--secondary</arg>
            <arg>--all</arg>
          </group>
          <sbr>
          <arg choice="opt"
          rep="repeat"><replaceable>name</replaceable></arg>
Iustin Pop's avatar
Iustin Pop committed
779
780
781
        </cmdsynopsis>

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

        <para>
827
828
829
          Note that although you can pass more than one selection
          option, the last one wins, so in order to guarantee the
          desired result, don't pass more than one such option.
Iustin Pop's avatar
Iustin Pop committed
830
831
832
833
834
835
836
837
838
839
        </para>

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

840
841
842
843
        <para>
          Use <option>--force</option> to start even if secondary disks are
          failing.
        </para>
Iustin Pop's avatar
Iustin Pop committed
844
845
846
847
848
849

        <para>
          Example:
          <screen>
# gnt-instance start instance1.example.com
# gnt-instance start --extra single test1.example.com
850
851
# gnt-instance start --node node1.example.com node2.example.com
# gnt-instance start --all
Iustin Pop's avatar
Iustin Pop committed
852
853
854
855
856
857
858
859
860
          </screen>
        </para>
      </refsect3>

      <refsect3>
        <title>SHUTDOWN</title>

        <cmdsynopsis>
          <command>shutdown</command>
861
862
863
864
865
866
867
868
869
870
871
872
          <sbr>
          <group choice="opt">
            <arg>--instance</arg>
            <arg>--node</arg>
            <arg>--primary</arg>
            <arg>--secondary</arg>
            <arg>--all</arg>
          </group>
          <sbr>

          <arg choice="opt"
          rep="repeat"><replaceable>name</replaceable></arg>
Iustin Pop's avatar
Iustin Pop committed
873
874
875
        </cmdsynopsis>

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

        <para>
          The <option>--instance</option>, <option>--node</option>,
          <option>--primary</option>, <option>--secondary</option> and
          <option>--all</option> options are similar as for the
          <command>startup</command> command and they influence the
Alexander Schreiber's avatar
Alexander Schreiber committed
887
          actual instances being shutdown.
Iustin Pop's avatar
Iustin Pop committed
888
889
890
891
892
893
        </para>

        <para>
          Example:
          <screen>
# gnt-instance shutdown instance1.example.com
894
# gnt-instance shutdown --all
Iustin Pop's avatar
Iustin Pop committed
895
896
897
898
          </screen>
        </para>
      </refsect3>

899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
      <refsect3>
        <title>REBOOT</title>

        <cmdsynopsis>
          <command>reboot</command>
          <sbr>
          <arg>--extra=<replaceable>PARAMS</replaceable></arg>
          <sbr>
          <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
          <sbr>
          <arg>--ignore-secondaries</arg>
          <sbr>
          <arg>--force-multiple</arg>
          <sbr>
          <group choice="opt">
            <arg>--instance</arg>
            <arg>--node</arg>
            <arg>--primary</arg>
            <arg>--secondary</arg>
            <arg>--all</arg>
          </group>
          <sbr>

          <arg choice="opt"
          rep="repeat"><replaceable>name</replaceable></arg>
        </cmdsynopsis>

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

        <para>
          For the hard reboot the option
          <option>--ignore-secondaries</option> ignores errors for the
          secondary node while re-assembling the instance disks.
        </para>

        <para>
          The <option>--instance</option>, <option>--node</option>,
          <option>--primary</option>, <option>--secondary</option> and
          <option>--all</option> options are similar as for the
          <command>startup</command> command and they influence the
          actual instances being rebooted.
        </para>
Iustin Pop's avatar
Iustin Pop committed
949

950
        <para>
951
          Use the <option>--force-multiple</option> option to keep
952
953
954
955
956
957
958
959
960
961
962
963
964
          gnt-instance from asking for confirmation when more than one
          instance is affected.
        </para>

        <para>
          Example:
          <screen>
# gnt-instance reboot instance1.example.com
# gnt-instance reboot --type=full instance1.example.com
          </screen>
        </para>
      </refsect3>

Iustin Pop's avatar
Iustin Pop committed
965
966
967
968
      <refsect3>
        <title>CONSOLE</title>
        <cmdsynopsis>
          <command>console</command>
969
          <arg choice="opt">--show-cmd</arg>
Iustin Pop's avatar
Iustin Pop committed
970
971
972
973
974
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>

        <para>
          Connects to the console of the given instance. If the instance
975
976
          is not up, an error is returned. Use the <option>--show-cmd</option>
          option to display the command instead of executing it.
Iustin Pop's avatar
Iustin Pop committed
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
        </para>

        <para>
          Example:
          <screen>
# gnt-instance console instance1.example.com
          </screen>
        </para>
      </refsect3>

    </refsect2>

    <refsect2>
      <title>Disk management</title>

      <refsect3>
        <title>REPLACE-DISKS</title>

995
996
        <cmdsynopsis>
          <command>replace-disks</command>
997
998
999
1000
1001
1002
1003

          <group choice="req">
            <arg>--iallocator <replaceable>name</replaceable></arg>
            <arg>--new-secondary <replaceable>NODE</replaceable></arg>
          </group>
          <sbr>

1004
          <arg choice="opt">-s</arg>
Iustin Pop's avatar
Iustin Pop committed
1005
1006
1007
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>

1008
1009
        <cmdsynopsis>
          <command>replace-disks</command>
1010

1011
1012
1013
1014
1015
1016
1017
          <group>
          <arg choice="req">-s</arg>
          <arg choice="req">-p</arg>
          </group>
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>

Iustin Pop's avatar
Iustin Pop committed
1018
        <para>
1019
          This command is a generalized form for adding and replacing
1020
1021
          disks. It is currently only valid for the mirrored (DRBD)
          disk template.
Iustin Pop's avatar
Iustin Pop committed
1022
        </para>
1023
1024

        <para>
1025
1026
          The first form will do a secondary node change, while the
          second form will replace the disks on either the primary
1027
1028
1029
1030
          (<option>-p</option>) or the secondary (<option>-s</option>)
          node of the instance only, without changing the node.
        </para>

1031
1032
1033
1034
1035
        <para>
          Specifying <option>--iallocator</option> enables secondary node
          replacement and and makes the new secondary be selected automatically
          by the specified allocator plugin.
        </para>
Iustin Pop's avatar
Iustin Pop committed
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
      </refsect3>

      <refsect3>
        <title>ACTIVATE-DISKS</title>

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

          In this example, <emphasis>node1.example.com</emphasis> is
          the name of the node on which the devices have been
          activated. The <emphasis>sda</emphasis> and
          <emphasis>sdb</emphasis> are the names of the block devices
1058
1059
          inside the instance. <emphasis>/dev/drbd0</emphasis> and
          <emphasis>/dev/drbd1</emphasis> are the names of the block
Iustin Pop's avatar
Iustin Pop committed
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
          devices as visible on the node.
        </para>

        <para>
          Note that it is safe to run this command while the instance
          is already running.
        </para>
      </refsect3>

      <refsect3>
        <title>DEACTIVATE-DISKS</title>

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

      </refsect3>

1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
      <refsect3>
        <title>GROW-DISK</title>
        <cmdsynopsis>
          <command>grow-disk</command>
          <arg choice="req"><replaceable>instance</replaceable></arg>
          <arg choice="req"><replaceable>disk</replaceable></arg>
          <arg choice="req"><replaceable>amount</replaceable></arg>
        </cmdsynopsis>

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

        <para>
          Note that this command only change the block device size; it
          will not grow the actual filesystems, partitions, etc. that
          live on that disk. Usually, you will need to:
          <orderedlist>
            <listitem>
              <simpara>use <command>gnt-instance grow-disk</command></simpara>
            </listitem>
            <listitem>
              <simpara>reboot the instance (later, at a convenient
              time)</simpara>
            </listitem>
            <listitem>
              <simpara>use a filesystem resizer, such as
              <citerefentry> <refentrytitle>ext2online</refentrytitle>
              <manvolnum>8</manvolnum> </citerefentry> or
              <citerefentry> <refentrytitle>xfs_growfs</refentrytitle>
              <manvolnum>8</manvolnum> </citerefentry> to resize the
              filesystem, or use <citerefentry>
              <refentrytitle>fdisk</refentrytitle>
              <manvolnum>8</manvolnum> </citerefentry> to change the
              partition table on the disk
              </simpara>
            </listitem>
          </orderedlist>
        </para>


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

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

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

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

Iustin Pop's avatar
Iustin Pop committed
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
    </refsect2>

    <refsect2>
      <title>Recovery</title>

      <refsect3>
        <title>FAILOVER</title>

        <cmdsynopsis>
          <command>failover</command>
          <arg>-f</arg>
          <arg>--ignore-consistency</arg>
1173
          <arg choice="req"><replaceable>instance</replaceable></arg>
Iustin Pop's avatar
Iustin Pop committed
1174
1175
1176
        </cmdsynopsis>

        <para>
1177
          Failover will fail the instance over its secondary
1178
1179
          node. This works only for instances having a drbd disk
          template.
Iustin Pop's avatar
Iustin Pop committed
1180
1181
1182
1183
        </para>

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

        <para>
          Example:
          <screen>
# gnt-instance failover instance1.example.com
          </screen>
        </para>
      </refsect3>

    </refsect2>

1203
1204
1205
1206
1207
1208
1209
1210
    <refsect2>
      <title>TAGS</title>

    <refsect3>
        <title>ADD-TAGS</title>

        <cmdsynopsis>
          <command>add-tags</command>
1211
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
1212
1213
1214
1215
1216
1217
1218
1219
1220
          <arg choice="req"><replaceable>instancename</replaceable></arg>
          <arg choice="req"
            rep="repeat"><replaceable>tag</replaceable></arg>
        </cmdsynopsis>

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

      <refsect3>
        <title>LIST-TAGS</title>

        <cmdsynopsis>
          <command>list-tags</command>
          <arg choice="req"><replaceable>instancename</replaceable></arg>
        </cmdsynopsis>

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

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

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

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

    </refsect2>

Iustin Pop's avatar
Iustin Pop committed
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
  </refsect1>

  &footer;

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->