Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ a53a1b18

History | View | Annotate | Download (41 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
          </variablelist>
579
        </para>
580

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

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

    
601
        <para>The default output field list is:
602
          <simplelist type="inline">
603
            <member>name</member>
604
            <member>os</member>
605
            <member>pnode</member>
606
            <member>admin_state</member>
607
            <member>oper_state</member>
608
            <member>oper_ram</member>
609
          </simplelist>.
610
        </para>
611
      </refsect3>
612

    
613
      <refsect3>
614
        <title>INFO</title>
615

    
616
        <cmdsynopsis>
617
          <command>info</command>
618
          <arg rep="repeat"><replaceable>instance</replaceable></arg>
619
        </cmdsynopsis>
620

    
621
        <para>
622
          Show detailed information about the (given) instances. This
623
          is different from <command>list</command> as it shows
624
          detailed data about the instance's disks (especially useful
625
          for drbd disk template).
626
        </para>
627
      </refsect3>
628

    
629
      <refsect3>
630
        <title>MODIFY</title>
631

    
632
        <cmdsynopsis>
633
          <command>modify</command>
634
          <arg choice="opt">-m <replaceable>memsize</replaceable></arg>
635
          <arg choice="opt">-p <replaceable>vcpus</replaceable></arg>
636
          <arg choice="opt">-i <replaceable>ip</replaceable></arg>
637
          <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
          <arg>--hvm-acpi <replaceable>ACPI-support</replaceable></arg>
641
          <arg>--hvm-pae <replaceable>PAE-support</replaceable></arg>
642
          <arg>--hvm-cdrom-image-path
643
            <replaceable>cdrom-image-path</replaceable></arg>
644
          <arg>--vnc-bind-address
645
            <replaceable>vnc-bind-address</replaceable></arg>
646

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

    
662
        <para>
663
          Modify the memory size, number of vcpus, ip address, MAC
664
          address and/or bridge for an instance.
665
        </para>
666

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

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

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

    
684
        <para>
685
          The <option>--hvm-acpi</option> option specifies if Xen
686
          should enable ACPI support for this HVM instance. Valid
687
          values are true or false.
688
        </para>
689

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

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

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

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

    
717
      <refsect3>
718
        <title>REINSTALL</title>
719

    
720
        <cmdsynopsis>
721
          <command>reinstall</command>
722
          <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
723
          <arg choice="opt">-f <replaceable>force</replaceable></arg>
724
          <arg choice="req"><replaceable>instance</replaceable></arg>
725
        </cmdsynopsis>
726

    
727
        <para>
728
          Reinstalls the operating system on the given instance. The instance
729
          must be stopped when running this command. If the
730
          <option>--os-type</option> is specified, the operating system is
731
          changed.
732
        </para>
733
      </refsect3>
734

    
735
      <refsect3>
736
        <title>RENAME</title>
737

    
738
        <cmdsynopsis>
739
          <command>rename</command>
740
          <arg>--no-ip-check</arg>
741
          <arg choice="req"><replaceable>instance</replaceable></arg>
742
          <arg choice="req"><replaceable>new_name</replaceable></arg>
743
        </cmdsynopsis>
744

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

    
756
    </refsect2>
757

    
758
    <refsect2>
759
      <title>Starting/stopping/connecting to console</title>
760

    
761
      <refsect3>
762
        <title>STARTUP</title>
763

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

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

    
826
        <para>
827
          Note that although you can pass more than one selection
828
          option, the last one wins, so in order to guarantee the
829
          desired result, don't pass more than one such option.
830
        </para>
831

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

    
840
        <para>
841
          Use <option>--force</option> to start even if secondary disks are
842
          failing.
843
        </para>
844

    
845
        <para>
846
          Example:
847
          <screen>
848
# gnt-instance start instance1.example.com
849
# gnt-instance start --extra single test1.example.com
850
# gnt-instance start --node node1.example.com node2.example.com
851
# gnt-instance start --all
852
          </screen>
853
        </para>
854
      </refsect3>
855

    
856
      <refsect3>
857
        <title>SHUTDOWN</title>
858

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

    
871
          <arg choice="opt"
872
          rep="repeat"><replaceable>name</replaceable></arg>
873
        </cmdsynopsis>
874

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

    
882
        <para>
883
          The <option>--instance</option>, <option>--node</option>,
884
          <option>--primary</option>, <option>--secondary</option> and
885
          <option>--all</option> options are similar as for the
886
          <command>startup</command> command and they influence the
887
          actual instances being shutdown.
888
        </para>
889

    
890
        <para>
891
          Example:
892
          <screen>
893
# gnt-instance shutdown instance1.example.com
894
# gnt-instance shutdown --all
895
          </screen>
896
        </para>
897
      </refsect3>
898

    
899
      <refsect3>
900
        <title>REBOOT</title>
901

    
902
        <cmdsynopsis>
903
          <command>reboot</command>
904
          <sbr>
905
          <arg>--extra=<replaceable>PARAMS</replaceable></arg>
906
          <sbr>
907
          <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
908
          <sbr>
909
          <arg>--ignore-secondaries</arg>
910
          <sbr>
911
          <arg>--force-multiple</arg>
912
          <sbr>
913
          <group choice="opt">
914
            <arg>--instance</arg>
915
            <arg>--node</arg>
916
            <arg>--primary</arg>
917
            <arg>--secondary</arg>
918
            <arg>--all</arg>
919
          </group>
920
          <sbr>
921

    
922
          <arg choice="opt"
923
          rep="repeat"><replaceable>name</replaceable></arg>
924
        </cmdsynopsis>
925

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

    
936
        <para>
937
          For the hard reboot the option
938
          <option>--ignore-secondaries</option> ignores errors for the
939
          secondary node while re-assembling the instance disks.
940
        </para>
941

    
942
        <para>
943
          The <option>--instance</option>, <option>--node</option>,
944
          <option>--primary</option>, <option>--secondary</option> and
945
          <option>--all</option> options are similar as for the
946
          <command>startup</command> command and they influence the
947
          actual instances being rebooted.
948
        </para>
949

    
950
        <para>
951
          Use the <option>--force-multiple</option> option to keep
952
          gnt-instance from asking for confirmation when more than one
953
          instance is affected.
954
        </para>
955

    
956
        <para>
957
          Example:
958
          <screen>
959
# gnt-instance reboot instance1.example.com
960
# gnt-instance reboot --type=full instance1.example.com
961
          </screen>
962
        </para>
963
      </refsect3>
964

    
965
      <refsect3>
966
        <title>CONSOLE</title>
967
        <cmdsynopsis>
968
          <command>console</command>
969
          <arg choice="opt">--show-cmd</arg>
970
          <arg choice="req"><replaceable>instance</replaceable></arg>
971
        </cmdsynopsis>
972

    
973
        <para>
974
          Connects to the console of the given instance. If the instance
975
          is not up, an error is returned. Use the <option>--show-cmd</option>
976
          option to display the command instead of executing it.
977
        </para>
978

    
979
        <para>
980
          Example:
981
          <screen>
982
# gnt-instance console instance1.example.com
983
          </screen>
984
        </para>
985
      </refsect3>
986

    
987
    </refsect2>
988

    
989
    <refsect2>
990
      <title>Disk management</title>
991

    
992
      <refsect3>
993
        <title>REPLACE-DISKS</title>
994

    
995
        <cmdsynopsis>
996
          <command>replace-disks</command>
997

    
998
          <group choice="req">
999
            <arg>--iallocator <replaceable>name</replaceable></arg>
1000
            <arg>--new-secondary <replaceable>NODE</replaceable></arg>
1001
          </group>
1002
          <sbr>
1003

    
1004
          <arg choice="opt">-s</arg>
1005
          <arg choice="req"><replaceable>instance</replaceable></arg>
1006
        </cmdsynopsis>
1007

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

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

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

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

    
1031
        <para>
1032
          Specifying <option>--iallocator</option> enables secondary node
1033
          replacement and and makes the new secondary be selected automatically
1034
          by the specified allocator plugin.
1035
        </para>
1036
      </refsect3>
1037

    
1038
      <refsect3>
1039
        <title>ACTIVATE-DISKS</title>
1040

    
1041
        <cmdsynopsis>
1042
          <command>activate-disks</command>
1043
          <arg choice="req"><replaceable>instance</replaceable></arg>
1044
        </cmdsynopsis>
1045
        <para>
1046
          Activates the block devices of the given instance. If
1047
          successful, the command will show the location and name of
1048
          the block devices:
1049
          <screen>
1050
node1.example.com:sda:/dev/drbd0
1051
node1.example.com:sdb:/dev/drbd1
1052
          </screen>
1053

    
1054
          In this example, <emphasis>node1.example.com</emphasis> is
1055
          the name of the node on which the devices have been
1056
          activated. The <emphasis>sda</emphasis> and
1057
          <emphasis>sdb</emphasis> are the names of the block devices
1058
          inside the instance. <emphasis>/dev/drbd0</emphasis> and
1059
          <emphasis>/dev/drbd1</emphasis> are the names of the block
1060
          devices as visible on the node.
1061
        </para>
1062

    
1063
        <para>
1064
          Note that it is safe to run this command while the instance
1065
          is already running.
1066
        </para>
1067
      </refsect3>
1068

    
1069
      <refsect3>
1070
        <title>DEACTIVATE-DISKS</title>
1071

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

    
1085
      </refsect3>
1086

    
1087
    </refsect2>
1088

    
1089
    <refsect2>
1090
      <title>Recovery</title>
1091

    
1092
      <refsect3>
1093
        <title>FAILOVER</title>
1094

    
1095
        <cmdsynopsis>
1096
          <command>failover</command>
1097
          <arg>-f</arg>
1098
          <arg>--ignore-consistency</arg>
1099
          <arg choice="req"><replaceable>instance</replaceable></arg>
1100
        </cmdsynopsis>
1101

    
1102
        <para>
1103
          Failover will fail the instance over its secondary
1104
          node. This works only for instances having a drbd disk
1105
          template.
1106
        </para>
1107

    
1108
        <para>
1109
          Normally the failover will check the consistency of the
1110
          disks before failing over the instance. If you are trying to
1111
          migrate instances off a dead node, this will fail. Use the
1112
          <option>--ignore-consistency</option> option for this
1113
          purpose. Note that this option can be dangerous as errors in
1114
          shutting down the instance will be ignored, resulting in
1115
          possibly having the instance running on two machines in
1116
          parallel (on disconnected DRBD drives).
1117
        </para>
1118

    
1119
        <para>
1120
          Example:
1121
          <screen>
1122
# gnt-instance failover instance1.example.com
1123
          </screen>
1124
        </para>
1125
      </refsect3>
1126

    
1127
    </refsect2>
1128

    
1129
    <refsect2>
1130
      <title>TAGS</title>
1131

    
1132
    <refsect3>
1133
        <title>ADD-TAGS</title>
1134

    
1135
        <cmdsynopsis>
1136
          <command>add-tags</command>
1137
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
1138
          <arg choice="req"><replaceable>instancename</replaceable></arg>
1139
          <arg choice="req"
1140
            rep="repeat"><replaceable>tag</replaceable></arg>
1141
        </cmdsynopsis>
1142

    
1143
        <para>
1144
          Add tags to the given instance. If any of the tags contains
1145
          invalid characters, the entire operation will abort.
1146
        </para>
1147
        <para>
1148
          If the <option>--from</option> option is given, the list of
1149
          tags will be extended with the contents of that file (each
1150
          line becomes a tag). In this case, there is not need to pass
1151
          tags on the command line (if you do, both sources will be
1152
          used). A file name of - will be interpreted as stdin.
1153
        </para>
1154
      </refsect3>
1155

    
1156
      <refsect3>
1157
        <title>LIST-TAGS</title>
1158

    
1159
        <cmdsynopsis>
1160
          <command>list-tags</command>
1161
          <arg choice="req"><replaceable>instancename</replaceable></arg>
1162
        </cmdsynopsis>
1163

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

    
1167
      <refsect3>
1168
        <title>REMOVE-TAGS</title>
1169
        <cmdsynopsis>
1170
          <command>remove-tags</command>
1171
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
1172
          <arg choice="req"><replaceable>instancename</replaceable></arg>
1173
          <arg choice="req"
1174
            rep="repeat"><replaceable>tag</replaceable></arg>
1175
        </cmdsynopsis>
1176

    
1177
        <para>
1178
          Remove tags from the given instance. If any of the tags are
1179
          not existing on the node, the entire operation will abort.
1180
        </para>
1181

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

    
1191
    </refsect2>
1192

    
1193
  </refsect1>
1194

    
1195
  &footer;
1196

    
1197
</refentry>
1198

    
1199
<!-- Keep this comment at the end of the file
1200
Local variables:
1201
mode: sgml
1202
sgml-omittag:t
1203
sgml-shorttag:t
1204
sgml-minimize-attributes:nil
1205
sgml-always-quote-attributes:t
1206
sgml-indent-step:2
1207
sgml-indent-data:t
1208
sgml-parent-document:nil
1209
sgml-default-dtd-file:nil
1210
sgml-exposed-tags:nil
1211
sgml-local-catalogs:nil
1212
sgml-local-ecat-files:nil
1213
End:
1214
-->