Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ 872c949f

History | View | Annotate | Download (38.1 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 16, 2007</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
      <holder>Google Inc.</holder>
24
    </copyright>
25
    &dhdate;
26
  </refentryinfo>
27
  <refmeta>
28
    &dhucpackage;
29

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

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

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

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

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

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

    
61
      <refsect3>
62
        <title>ADD</title>
63
        <cmdsynopsis>
64
          <command>add</command>
65
          <arg>-s <replaceable>disksize</replaceable></arg>
66
          <arg>--swap-size <replaceable>disksize</replaceable></arg>
67
          <arg>-m <replaceable>memsize</replaceable></arg>
68
          <sbr>
69
          <arg>-o <replaceable>os-type</replaceable></arg>
70
          <arg>-b <replaceable>bridge</replaceable></arg>
71
          <arg>--mac <replaceable>MAC-address</replaceable></arg>
72
          <arg>--hvm-boot-order <replaceable>boot-order</replaceable></arg>
73
          <sbr>
74
          <arg>--kernel <group choice="req">
75
              <arg>default</arg>
76
              <arg><replaceable>kernel_path</replaceable></arg>
77
            </group></arg>
78
          <sbr>
79
          <arg>--initrd <group choice="req">
80
              <arg>default</arg>
81
              <arg>none</arg>
82
              <arg><replaceable>initrd_path</replaceable></arg>
83
            </group> </arg>
84
          <sbr>
85
          <arg>--file-storage-dir <replaceable>dir_path</replaceable></arg>
86
          <arg>--file-driver <group choice="req">
87
              <arg>loop</arg>
88
              <arg>blktap</arg>
89
            </group></arg>
90
          <sbr>
91
          <arg choice="req">-t<group>
92
              <arg>diskless</arg>
93
              <arg>file</arg>
94
              <arg>plain</arg>
95
              <arg>drbd</arg>
96
            </group>
97
          </arg>
98
          <sbr>
99
          <arg choice="req">-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg>
100
          <arg choice="req"><replaceable>instance</replaceable></arg>
101
        </cmdsynopsis>
102

    
103
        <para>
104
          Creates a new instance on the specified
105
          host. <replaceable>instance</replaceable> must be in DNS and
106
          resolve to a IP in the same network as the nodes in the
107
          cluster.
108
        </para>
109

    
110
        <para>
111
          The <option>-s</option> option specifies the disk size for
112
          the instance, in mebibytes (defaults to
113
          <constant>20480MiB</constant> =
114
          <constant>20GiB</constant>). You can also use one of the
115
          suffixes <literal>m</literal>, <literal>g</literal> or
116
          <literal>t</literal> to specificy the exact the units used;
117
          these suffixes map to mebibytes, gibibytes and tebibytes.
118
        </para>
119

    
120
        <para>
121
          The <option>--swap-size</option> option specifies the swap
122
          disk size (in mebibytes) for the instance (the one presented
123
          as <filename class="devicefile">/dev/sdb</filename>). The
124
          default is <constant>4096MiB</constant>. As for the disk
125
          size, you can specify other suffixes.
126
        </para>
127

    
128
        <para>
129
          The <option>-m</option> option specifies the memory size for
130
          the instance, in mebibytes (defaults to 128 MiB). Again, you
131
          can use other suffixes (e.g. <userinput>2g</userinput>).
132
        </para>
133

    
134
        <para>
135
          The <option>-o</option> options specifies the operating
136
          system to be installed. The available operating systems can
137
          be listed with <command>gnt-os list</command>.
138
        </para>
139

    
140
        <para>
141
          The <option>-b</option> option specifies the bridge to which the
142
          instance will be connected. (defaults to the cluster-wide default
143
          bridge specified at cluster initialization time).
144
        </para>
145

    
146
        <para>
147
          The <option>--mac</option> option specifies the MAC address
148
          of the ethernet interface for the instance. If this option
149
          is not specified, a new MAC address is generated randomly with
150
          the configured MAC prefix. The randomly generated MAC
151
          address is guaranteed to be unique among the instances of
152
          this cluster.
153
        </para>
154

    
155
        <para>
156
          The <option>--hvm-boot-order</option> option specifies the
157
          boot device order for Xen HVM instances. The boot order is a
158
          string of letters listing the boot devices, with valid
159
          device letters being:
160
        </para>
161

    
162
        <para>
163
          <variablelist>
164
            <varlistentry>
165
              <term>a</term>
166
              <listitem>
167
                <para>
168
                  floppy drive
169
                </para>
170
              </listitem>
171
            </varlistentry>
172
            <varlistentry>
173
              <term>c</term>
174
              <listitem>
175
                <para>
176
                  hard disk
177
                </para>
178
              </listitem>
179
            </varlistentry>
180
            <varlistentry>
181
              <term>d</term>
182
              <listitem>
183
                <para>
184
                  CDROM drive
185
                </para>
186
              </listitem>
187
            </varlistentry>
188
            <varlistentry>
189
              <term>n</term>
190
              <listitem>
191
                <para>
192
                  network boot (PXE)
193
                </para>
194
              </listitem>
195
            </varlistentry>
196
          </variablelist>
197
        </para>
198

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

    
204
        <para>
205
          The <option>--kernel</option> options allows the instance to
206
          use a custom kernel (if a filename is passed) or to use the
207
          default kernel (<filename>@CUSTOM_XEN_KERNEL@</filename>), if the
208
          string <constant>default</constant> is passed.
209
        </para>
210

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

    
225
        <para>
226
          The <option>-t</option> options specifies the disk layout type for
227
          the instance. The available choices are:
228
          <variablelist>
229
            <varlistentry>
230
              <term>diskless</term>
231
              <listitem>
232
                <para>
233
                  This creates an instance with no disks. Its useful for
234
                  testing only (or other special cases).
235
                </para>
236
              </listitem>
237
            </varlistentry>
238
            <varlistentry>
239
              <term>file</term>
240
              <listitem>
241
                <para>Disk devices will be regular files.</para>
242
              </listitem>
243
            </varlistentry>
244
            <varlistentry>
245
              <term>plain</term>
246
              <listitem>
247
                <para>Disk devices will be logical volumes.</para>
248
              </listitem>
249
            </varlistentry>
250
            <varlistentry>
251
              <term>drbd</term>
252
              <listitem>
253
                <para>
254
                  Disk devices will be drbd (version 8.x) on top of
255
                  lvm volumes.
256
                </para>
257
              </listitem>
258
            </varlistentry>
259
          </variablelist>
260
        </para>
261

    
262
        <para>
263
          The optional second value of the <option>--node</option> is used for
264
          the remote raid template type and specifies the remote node.
265
        </para>
266

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

    
273
        <para>
274
          The <option>--file-storage-dir</option> specifies the relative path
275
          under the cluster-wide file storage directory to store file-based
276
          disks. It is useful for having different subdirectories for
277
          different instances. The full path of the directory where the disk
278
          files are stored will consist of cluster-wide file storage directory
279
          + optional subdirectory + instance name. Example:
280
          /srv/ganeti/file-storage/mysubdir/instance1.example.com. This option
281
          is only relevant for instances using the file storage backend.
282
        </para>
283

    
284
        <para>
285
          The <option>--file-driver</option> specifies the driver to use for
286
          file-based disks. Note that currently these drivers work with the
287
          xen hypervisor only. This option is only relevant for instances using
288
          the file storage backend. The available choices are:
289
          <variablelist>
290
            <varlistentry>
291
              <term>loop</term>
292
              <listitem>
293
                <para>Kernel loopback driver.</para>
294
              </listitem>
295
            </varlistentry>
296
            <varlistentry>
297
              <term>blktap</term>
298
              <listitem>
299
                <para>blktap driver.</para>
300
              </listitem>
301
            </varlistentry>
302
          <variablelist>
303
        </para>
304

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

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

    
323
        <para>
324
          Example:
325
          <screen>
326
# gnt-instance add -t file -s 30g -m 512 -o debian-etch \
327
  -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
328
# gnt-instance add -t plain -s 30g -m 512 -o debian-etch \
329
  -n node1.example.com instance1.example.com
330
# gnt-instance add -t drbd -s 30g -m 512 -o debian-etch \
331
  -n node1.example.com:node2.example.com instance2.example.com
332
          </screen>
333
        </para>
334
      </refsect3>
335

    
336
      <refsect3>
337
        <title>REMOVE</title>
338

    
339
        <cmdsynopsis>
340
          <command>remove</command>
341
          <arg>--ignore-failures</arg>
342
          <arg choice="req"><replaceable>instance</replaceable></arg>
343
        </cmdsynopsis>
344

    
345
        <para>
346
          Remove an instance. This will remove all data from the
347
          instance and there is <emphasis>no way back</emphasis>. If
348
          you are not sure if you use an instance again, use
349
          <command>shutdown</command> first and leave it in the
350
          shutdown state for a while.
351

    
352
        </para>
353

    
354
        <para>
355
          The <option>--ignore-failures</option> option will cause the
356
          removal to proceed even in the presence of errors during the
357
          removal of the instance (e.g. during the shutdown or the
358
          disk removal). If this option is not given, the command will
359
          stop at the first error.
360
        </para>
361

    
362
        <para>
363
          Example:
364
          <screen>
365
# gnt-instance remove instance1.example.com
366
          </screen>
367
        </para>
368
      </refsect3>
369

    
370
      <refsect3>
371
        <title>LIST</title>
372

    
373
        <cmdsynopsis>
374
          <command>list</command>
375
          <arg>--no-headers</arg>
376
          <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
377
          <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
378
        </cmdsynopsis>
379

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

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

    
394
        <para>
395
          The <option>-o</option> option takes a comma-separated list
396
          of output fields. The available fields and their meaning
397
          are:
398
          <variablelist>
399
            <varlistentry>
400
              <term>name</term>
401
              <listitem>
402
                <simpara>the instance name</simpara>
403
              </listitem>
404
            </varlistentry>
405
            <varlistentry>
406
              <term>os</term>
407
              <listitem>
408
                <simpara>the OS of the instance</simpara>
409
              </listitem>
410
            </varlistentry>
411
            <varlistentry>
412
              <term>pnode</term>
413
              <listitem>
414
                <simpara>the primary node of the instance</simpara>
415
              </listitem>
416
            </varlistentry>
417
            <varlistentry>
418
              <term>snodes</term>
419
              <listitem>
420
                <simpara>comma-separated list of secondary nodes for the
421
                  instance; usually this will be just one node</simpara>
422
              </listitem>
423
            </varlistentry>
424
            <varlistentry>
425
              <term>admin_state</term>
426
              <listitem>
427
                <simpara>the desired state of the instance (either "yes"
428
                  or "no" denoting the instance should run or
429
                  not)</simpara>
430
              </listitem>
431
            </varlistentry>
432
            <varlistentry>
433
              <term>admin_ram</term>
434
              <listitem>
435
                <simpara>the desired memory for the instance</simpara>
436
              </listitem>
437
            </varlistentry>
438
            <varlistentry>
439
              <term>disk_template</term>
440
              <listitem>
441
                <simpara>the disk template of the instance</simpara>
442
              </listitem>
443
            </varlistentry>
444
            <varlistentry>
445
              <term>oper_state</term>
446
              <listitem>
447
                <simpara>the actual state of the instance; can be
448
                one of the values "running", "stopped", "(node
449
                down)"</simpara>
450
              </listitem>
451
            </varlistentry>
452
            <varlistentry>
453
              <term>status</term>
454
              <listitem>
455
                <simpara>combined form of admin_state and oper_stat;
456
                this can be one of:
457
                <computeroutput>ERROR_nodedown</computeroutput> if the
458
                node of the instance is down,
459
                <computeroutput>ERROR_down</computeroutput> if the
460
                instance should run but is down,
461
                <computeroutput>ERROR_up</computeroutput> if the
462
                instance should be stopped but is actually running,
463
                <computeroutput>ADMIN_down</computeroutput> if the
464
                instance has been stopped (and is stopped) and
465
                <computeroutput>running</computeroutput> if the
466
                instance is set to be running (and is
467
                running)</simpara>
468
              </listitem>
469
            </varlistentry>
470
            <varlistentry>
471
              <term>oper_ram</term>
472
              <listitem>
473
                <simpara>the actual memory usage of the instance as seen
474
                  by the hypervisor</simpara>
475
              </listitem>
476
            </varlistentry>
477
            <varlistentry>
478
              <term>ip</term>
479
              <listitem>
480
                <simpara>the ip address ganeti recognizes as associated with
481
                the instance interface</simpara>
482
              </listitem>
483
            </varlistentry>
484
            <varlistentry>
485
              <term>mac</term>
486
              <listitem>
487
                <simpara>the instance interface MAC address</simpara>
488
              </listitem>
489
            </varlistentry>
490
            <varlistentry>
491
              <term>bridge</term>
492
              <listitem>
493
                <simpara>bridge the instance is connected to
494
                </simpara>
495
              </listitem>
496
            </varlistentry>
497
            <varlistentry>
498
              <term>sda_size</term>
499
              <listitem>
500
                <simpara>the size of the instance's first disk</simpara>
501
              </listitem>
502
            </varlistentry>
503
            <varlistentry>
504
              <term>sdb_size</term>
505
              <listitem>
506
                <simpara>the size of the instance's second disk</simpara>
507
              </listitem>
508
            </varlistentry>
509
            <varlistentry>
510
              <term>vcpus</term>
511
              <listitem>
512
                <simpara>the number of VCPUs allocated to the
513
                instance</simpara>
514
              </listitem>
515
            </varlistentry>
516
          </variablelist>
517
        </para>
518

    
519
        <para>
520
          If the value of the option starts with the character
521
          <constant>+</constant>, the new fields will be added to the
522
          default list. This allows to quickly see the default list
523
          plus a few other fields, instead of retyping the entire list
524
          of fields.
525
        </para>
526

    
527
        <para>
528
          There is a subtle grouping about the available output
529
          fields: all fields except for <option>oper_state</option>,
530
          <option>oper_ram</option> and <option>status</option> are
531
          configuration value and not run-time values. So if you don't
532
          select any of the these fields, the query will be satisfied
533
          instantly from the cluster configuration, without having to
534
          ask the remote nodes for the data. This can be helpful for
535
          big clusters when you only want some data and it makes sense
536
          to specify a reduced set of output fields.
537
        </para>
538

    
539
        <para>The default output field list is:
540
          <simplelist type="inline">
541
            <member>name</member>
542
            <member>os</member>
543
            <member>pnode</member>
544
            <member>admin_state</member>
545
            <member>oper_state</member>
546
            <member>oper_ram</member>
547
          </simplelist>.
548
        </para>
549
      </refsect3>
550

    
551
      <refsect3>
552
        <title>INFO</title>
553

    
554
        <cmdsynopsis>
555
          <command>info</command>
556
          <arg rep="repeat"><replaceable>instance</replaceable></arg>
557
        </cmdsynopsis>
558

    
559
        <para>
560
          Show detailed information about the (given) instances. This
561
          is different from <command>list</command> as it shows
562
          detailed data about the instance's disks (especially useful
563
          for remote raid templates).
564
        </para>
565
      </refsect3>
566

    
567
      <refsect3>
568
        <title>MODIFY</title>
569

    
570
        <cmdsynopsis>
571
          <command>modify</command>
572
          <arg choice="opt">-m <replaceable>memsize</replaceable></arg>
573
          <arg choice="opt">-p <replaceable>vcpus</replaceable></arg>
574
          <arg choice="opt">-i <replaceable>ip</replaceable></arg>
575
          <arg choice="opt">-b <replaceable>bridge</replaceable></arg>
576
          <arg choice="opt">--mac <replaceable>MAC-address</replaceable></arg>
577
          <arg>--hvm-boot-order <replaceable>boot-order</replaceable></arg>
578
          <sbr>
579
          <arg>--kernel <group choice="req">
580
              <arg>default</arg>
581
              <arg><replaceable>kernel_path</replaceable></arg>
582
            </group></arg>
583
          <sbr>
584
          <arg>--initrd <group choice="req">
585
              <arg>default</arg>
586
              <arg>none</arg>
587
              <arg><replaceable>initrd_path</replaceable></arg>
588
            </group> </arg>
589
          <sbr>
590
          <arg choice="req"><replaceable>instance</replaceable></arg>
591
        </cmdsynopsis>
592

    
593
        <para>
594
          Modify the memory size, number of vcpus, ip address, MAC
595
          address and/or bridge for an instance.
596
        </para>
597

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

    
604
        <para>
605
          The <option>--kernel</option>, <option>--initrd</option>
606
          and <option>--hvm-boot-order</option>
607
          options are described in the <command>add</command> command.
608
        </para>
609

    
610
        <para>
611
          Additionally, the HVM boot order can be reset to the default
612
          values by using <option>--hvm-boot-order=default</option>.
613
        </para>
614

    
615
        <para>
616
          All the changes take effect at the next restart. If the
617
          instance is running, there is no effect on the instance.
618
        </para>
619
      </refsect3>
620

    
621
      <refsect3>
622
        <title>REINSTALL</title>
623

    
624
        <cmdsynopsis>
625
          <command>reinstall</command>
626
          <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
627
          <arg choice="opt">-f <replaceable>force</replaceable></arg>
628
          <arg choice="req"><replaceable>instance</replaceable></arg>
629
        </cmdsynopsis>
630

    
631
        <para>
632
          Reinstalls the operating system on the given instance. The instance
633
          must be stopped when running this command. If the
634
          <option>--os-type</option> is specified, the operating system is
635
          changed.
636
        </para>
637
      </refsect3>
638

    
639
      <refsect3>
640
        <title>RENAME</title>
641

    
642
        <cmdsynopsis>
643
          <command>rename</command>
644
          <arg>--no-ip-check</arg>
645
          <arg choice="req"><replaceable>instance</replaceable></arg>
646
          <arg choice="req"><replaceable>new_name</replaceable></arg>
647
        </cmdsynopsis>
648

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

    
660
    </refsect2>
661

    
662
    <refsect2>
663
      <title>Starting/stopping/connecting to console</title>
664

    
665
      <refsect3>
666
        <title>STARTUP</title>
667

    
668
        <cmdsynopsis>
669
          <command>startup</command>
670
          <arg>--extra=<replaceable>PARAMS</replaceable></arg>
671
          <arg>--force</arg>
672
          <sbr>
673
          <group choice="opt">
674
            <arg>--instance</arg>
675
            <arg>--node</arg>
676
            <arg>--primary</arg>
677
            <arg>--secondary</arg>
678
            <arg>--all</arg>
679
          </group>
680
          <sbr>
681
          <arg choice="opt"
682
          rep="repeat"><replaceable>name</replaceable></arg>
683
        </cmdsynopsis>
684

    
685
        <para>
686
          Starts one or more instances, depending on the following
687
          options. The four available modes are:
688
          <variablelist>
689
            <varlistentry>
690
              <term><option>--instance</option></term>
691
              <listitem>
692
                <simpara>will start the instances given as arguments
693
                (at least one argument required); this is the default
694
                selection</simpara>
695
              </listitem>
696
            </varlistentry>
697
            <varlistentry>
698
              <term>--node</term>
699
              <listitem>
700
                <simpara>will start the instances who have the given
701
                node as either primary or secondary</simpara>
702
              </listitem>
703
            </varlistentry>
704
            <varlistentry>
705
              <term><option>--primary</option></term>
706
              <listitem>
707
                <simpara>will start all instances whose primary node
708
                is in the list of nodes passed as arguments (at least
709
                one node required)</simpara>
710
              </listitem>
711
            </varlistentry>
712
            <varlistentry>
713
              <term><option>--secondary</option></term>
714
              <listitem>
715
                <simpara>will start all instances whose secondary node
716
                is in the list of nodes passed as arguments (at least
717
                one node required)</simpara>
718
              </listitem>
719
            </varlistentry>
720
            <varlistentry>
721
              <term>--all</term>
722
              <listitem>
723
                <simpara>will start all instances in the cluster (no
724
                arguments accepted)</simpara>
725
              </listitem>
726
            </varlistentry>
727
          </variablelist>
728
        </para>
729

    
730
        <para>
731
          Note that although you can pass more than one selection
732
          option, the last one wins, so in order to guarantee the
733
          desired result, don't pass more than one such option.
734
        </para>
735

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

    
744
        <para>
745
          Use <option>--force</option> to start even if secondary disks are
746
          failing.
747
        </para>
748

    
749
        <para>
750
          Example:
751
          <screen>
752
# gnt-instance start instance1.example.com
753
# gnt-instance start --extra single test1.example.com
754
# gnt-instance start --node node1.example.com node2.example.com
755
# gnt-instance start --all
756
          </screen>
757
        </para>
758
      </refsect3>
759

    
760
      <refsect3>
761
        <title>SHUTDOWN</title>
762

    
763
        <cmdsynopsis>
764
          <command>shutdown</command>
765
          <sbr>
766
          <group choice="opt">
767
            <arg>--instance</arg>
768
            <arg>--node</arg>
769
            <arg>--primary</arg>
770
            <arg>--secondary</arg>
771
            <arg>--all</arg>
772
          </group>
773
          <sbr>
774

    
775
          <arg choice="opt"
776
          rep="repeat"><replaceable>name</replaceable></arg>
777
        </cmdsynopsis>
778

    
779
        <para>
780
          Stops one or more instances. If the instance cannot be
781
          cleanly stopped during a hardcoded interval (currently 2
782
          minutes), it will forcibly stop the instance (equivalent to
783
          switching off the power on a physical machine).
784
        </para>
785

    
786
        <para>
787
          The <option>--instance</option>, <option>--node</option>,
788
          <option>--primary</option>, <option>--secondary</option> and
789
          <option>--all</option> options are similar as for the
790
          <command>startup</command> command and they influence the
791
          actual instances being shutdown.
792
        </para>
793

    
794
        <para>
795
          Example:
796
          <screen>
797
# gnt-instance shutdown instance1.example.com
798
# gnt-instance shutdown --all
799
          </screen>
800
        </para>
801
      </refsect3>
802

    
803
      <refsect3>
804
        <title>REBOOT</title>
805

    
806
        <cmdsynopsis>
807
          <command>reboot</command>
808
          <sbr>
809
          <arg>--extra=<replaceable>PARAMS</replaceable></arg>
810
          <sbr>
811
          <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
812
          <sbr>
813
          <arg>--ignore-secondaries</arg>
814
          <sbr>
815
          <arg>--force-multiple</arg>
816
          <sbr>
817
          <group choice="opt">
818
            <arg>--instance</arg>
819
            <arg>--node</arg>
820
            <arg>--primary</arg>
821
            <arg>--secondary</arg>
822
            <arg>--all</arg>
823
          </group>
824
          <sbr>
825

    
826
          <arg choice="opt"
827
          rep="repeat"><replaceable>name</replaceable></arg>
828
        </cmdsynopsis>
829

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

    
840
        <para>
841
          For the hard reboot the option
842
          <option>--ignore-secondaries</option> ignores errors for the
843
          secondary node while re-assembling the instance disks.
844
        </para>
845

    
846
        <para>
847
          The <option>--instance</option>, <option>--node</option>,
848
          <option>--primary</option>, <option>--secondary</option> and
849
          <option>--all</option> options are similar as for the
850
          <command>startup</command> command and they influence the
851
          actual instances being rebooted.
852
        </para>
853

    
854
        <para>
855
          Use the <option>--force-multiple</option> option to keep
856
          gnt-instance from asking for confirmation when more than one
857
          instance is affected.
858
        </para>
859

    
860
        <para>
861
          Example:
862
          <screen>
863
# gnt-instance reboot instance1.example.com
864
# gnt-instance reboot --type=full instance1.example.com
865
          </screen>
866
        </para>
867
      </refsect3>
868

    
869
      <refsect3>
870
        <title>CONSOLE</title>
871
        <cmdsynopsis>
872
          <command>console</command>
873
          <arg choice="opt">--show-cmd</arg>
874
          <arg choice="req"><replaceable>instance</replaceable></arg>
875
        </cmdsynopsis>
876

    
877
        <para>
878
          Connects to the console of the given instance. If the instance
879
          is not up, an error is returned. Use the <option>--show-cmd</option>
880
          option to display the command instead of executing it.
881
        </para>
882

    
883
        <para>
884
          Example:
885
          <screen>
886
# gnt-instance console instance1.example.com
887
          </screen>
888
        </para>
889
      </refsect3>
890

    
891
    </refsect2>
892

    
893
    <refsect2>
894
      <title>Disk management</title>
895

    
896
      <refsect3>
897
        <title>REPLACE-DISKS</title>
898

    
899
        <cmdsynopsis>
900
          <command>replace-disks</command>
901
          <arg choice="opt">--new-secondary <replaceable>NODE</replaceable></arg>
902
          <arg choice="req"><replaceable>instance</replaceable></arg>
903
        </cmdsynopsis>
904

    
905
        <cmdsynopsis>
906
          <command>replace-disks</command>
907
          <arg choice="opt">-s</arg>
908
          <arg choice="req">--new-secondary <replaceable>NODE</replaceable></arg>
909
          <arg choice="req"><replaceable>instance</replaceable></arg>
910
        </cmdsynopsis>
911

    
912
        <cmdsynopsis>
913
          <command>replace-disks</command>
914
          <group>
915
          <arg choice="req">-s</arg>
916
          <arg choice="req">-p</arg>
917
          </group>
918
          <arg choice="req"><replaceable>instance</replaceable></arg>
919
        </cmdsynopsis>
920

    
921
        <para>
922
          This command is a generalized form for adding and replacing
923
          disks.
924
        </para>
925

    
926
        <para>
927
          The first form is usable with the
928
          <literal>remote_raid1</literal> disk template. This will
929
          replace the disks on both the primary and secondary node,
930
          and optionally will change the secondary node to a new one
931
          if you pass the <option>--new-secondary</option> option.
932
        </para>
933

    
934
        <para>
935
          The second and third forms are usable with the
936
          <literal>drbd</literal> disk template. The second form will
937
          do a secondary replacement, but as opposed to the
938
          <literal>remote_raid1</literal> will not replace the disks
939
          on the primary, therefore it will execute faster. The third
940
          form will replace the disks on either the primary
941
          (<option>-p</option>) or the secondary (<option>-s</option>)
942
          node of the instance only, without changing the node.
943
        </para>
944

    
945
      </refsect3>
946

    
947
      <refsect3>
948
        <title>ACTIVATE-DISKS</title>
949

    
950
        <cmdsynopsis>
951
          <command>activate-disks</command>
952
          <arg choice="req"><replaceable>instance</replaceable></arg>
953
        </cmdsynopsis>
954
        <para>
955
          Activates the block devices of the given instance. If
956
          successful, the command will show the location and name of
957
          the block devices:
958
          <screen>
959
node1.example.com:sda:/dev/md0
960
node1.example.com:sdb:/dev/md1
961
          </screen>
962

    
963
          In this example, <emphasis>node1.example.com</emphasis> is
964
          the name of the node on which the devices have been
965
          activated. The <emphasis>sda</emphasis> and
966
          <emphasis>sdb</emphasis> are the names of the block devices
967
          inside the instance. <emphasis>/dev/md0</emphasis> and
968
          <emphasis>/dev/md1</emphasis> are the names of the block
969
          devices as visible on the node.
970
        </para>
971

    
972
        <para>
973
          Note that it is safe to run this command while the instance
974
          is already running.
975
        </para>
976
      </refsect3>
977

    
978
      <refsect3>
979
        <title>DEACTIVATE-DISKS</title>
980

    
981
        <cmdsynopsis>
982
          <command>deactivate-disks</command>
983
          <arg choice="req"><replaceable>instance</replaceable></arg>
984
        </cmdsynopsis>
985
        <para>
986
          De-activates the block devices of the given instance. Note
987
          that if you run this command for a remote raid instance
988
          type, while it is running, it will not be able to shutdown
989
          the block devices on the primary node, but it will shutdown
990
          the block devices on the secondary nodes, thus breaking the
991
          replication.
992
        </para>
993

    
994
      </refsect3>
995

    
996
    </refsect2>
997

    
998
    <refsect2>
999
      <title>Recovery</title>
1000

    
1001
      <refsect3>
1002
        <title>FAILOVER</title>
1003

    
1004
        <cmdsynopsis>
1005
          <command>failover</command>
1006
          <arg>-f</arg>
1007
          <arg>--ignore-consistency</arg>
1008
          <arg choice="req"><replaceable>instance</replaceable></arg>
1009
        </cmdsynopsis>
1010

    
1011
        <para>
1012
          Failover will fail the instance over its secondary
1013
          node. This works only for instances having a remote raid
1014
          disk layout.
1015
        </para>
1016

    
1017
        <para>
1018
          Normally the failover will check the consistency of the
1019
          disks before failing over the instance. If you are trying to
1020
          migrate instances off a dead node, this will fail. Use the
1021
          <option>--ignore-consistency</option> option for this
1022
          purpose. Note that this option can be dangerous as errors in
1023
          shutting down the instance will be ignored, resulting in
1024
          possibly having the instance running on two machines in
1025
          parallel (on disconnected DRBD drives).
1026
        </para>
1027

    
1028
        <para>
1029
          Example:
1030
          <screen>
1031
# gnt-instance failover instance1.example.com
1032
          </screen>
1033
        </para>
1034
      </refsect3>
1035

    
1036
    </refsect2>
1037

    
1038
    <refsect2>
1039
      <title>TAGS</title>
1040

    
1041
    <refsect3>
1042
        <title>ADD-TAGS</title>
1043

    
1044
        <cmdsynopsis>
1045
          <command>add-tags</command>
1046
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
1047
          <arg choice="req"><replaceable>instancename</replaceable></arg>
1048
          <arg choice="req"
1049
            rep="repeat"><replaceable>tag</replaceable></arg>
1050
        </cmdsynopsis>
1051

    
1052
        <para>
1053
          Add tags to the given instance. If any of the tags contains
1054
          invalid characters, the entire operation will abort.
1055
        </para>
1056
        <para>
1057
          If the <option>--from</option> option is given, the list of
1058
          tags will be extended with the contents of that file (each
1059
          line becomes a tag). In this case, there is not need to pass
1060
          tags on the command line (if you do, both sources will be
1061
          used). A file name of - will be interpreted as stdin.
1062
        </para>
1063
      </refsect3>
1064

    
1065
      <refsect3>
1066
        <title>LIST-TAGS</title>
1067

    
1068
        <cmdsynopsis>
1069
          <command>list-tags</command>
1070
          <arg choice="req"><replaceable>instancename</replaceable></arg>
1071
        </cmdsynopsis>
1072

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

    
1076
      <refsect3>
1077
        <title>REMOVE-TAGS</title>
1078
        <cmdsynopsis>
1079
          <command>remove-tags</command>
1080
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
1081
          <arg choice="req"><replaceable>instancename</replaceable></arg>
1082
          <arg choice="req"
1083
            rep="repeat"><replaceable>tag</replaceable></arg>
1084
        </cmdsynopsis>
1085

    
1086
        <para>
1087
          Remove tags from the given instance. If any of the tags are
1088
          not existing on the node, the entire operation will abort.
1089
        </para>
1090

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

    
1100
    </refsect2>
1101

    
1102
  </refsect1>
1103

    
1104
  &footer;
1105

    
1106
</refentry>
1107

    
1108
<!-- Keep this comment at the end of the file
1109
Local variables:
1110
mode: sgml
1111
sgml-omittag:t
1112
sgml-shorttag:t
1113
sgml-minimize-attributes:nil
1114
sgml-always-quote-attributes:t
1115
sgml-indent-step:2
1116
sgml-indent-data:t
1117
sgml-parent-document:nil
1118
sgml-default-dtd-file:nil
1119
sgml-exposed-tags:nil
1120
sgml-local-catalogs:nil
1121
sgml-local-ecat-files:nil
1122
End:
1123
-->