gnt-instance.sgml 35 KB
Newer Older
Iustin Pop's avatar
Iustin Pop committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
<!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. -->
  <!ENTITY dhdate      "<date>May 16, 2007</date>">
  <!-- 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>
      <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>
66
          <arg>--swap-size <replaceable>disksize</replaceable></arg>
Iustin Pop's avatar
Iustin Pop committed
67
          <arg>-m <replaceable>memsize</replaceable></arg>
68
69
          <sbr>
          <arg>-o <replaceable>os-type</replaceable></arg>
Iustin Pop's avatar
Iustin Pop committed
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>
Iustin Pop's avatar
Iustin Pop committed
73
          <sbr>
74
75
76
77
78
79
80
81
82
83
84
          <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
85
86
87
          <arg choice="req">-t<group>
              <arg>diskless</arg>
              <arg>plain</arg>
Iustin Pop's avatar
Iustin Pop committed
88
              <arg>drbd</arg>
Iustin Pop's avatar
Iustin Pop committed
89
90
            </group>
          </arg>
91
          <sbr>
92
          <arg choice="req">-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg>
Iustin Pop's avatar
Iustin Pop committed
93
94
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>
95

Iustin Pop's avatar
Iustin Pop committed
96
97
98
99
100
101
102
103
104
        <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
105
106
107
108
109
110
          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
111
112
113
        </para>

        <para>
114
115
116
117
118
          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
119
120
121
122
        </para>

        <para>
          The <option>-m</option> option specifies the memory size for
123
124
125
126
127
128
129
130
          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
131
132
133
134
135
        </para>

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

139
140
141
142
143
144
145
146
147
        <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>

148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
        <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>

197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
        <para>
          The <option>--kernel</option> options allows the instance to
          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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
        <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>
            <varlistentry>
              <term>plain</term>
              <listitem>
                <para>Disk devices will be logical volumes.</para>
              </listitem>
            </varlistentry>
Iustin Pop's avatar
Iustin Pop committed
237
238
239
240
241
            <varlistentry>
              <term>drbd</term>
              <listitem>
                <para>
                  Disk devices will be drbd (version 8.x) on top of
242
                  lvm volumes.
Iustin Pop's avatar
Iustin Pop committed
243
244
245
246
247
248
249
                </para>
              </listitem>
            </varlistentry>
          </variablelist>
        </para>

        <para>
250
251
          The optional second value of the <option>--node</option> is used for
          the remote raid template type and specifies the remote node.
Iustin Pop's avatar
Iustin Pop committed
252
253
254
255
256
257
258
259
260
261
262
        </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>

        <para>
          Example:
          <screen>
263
264
# gnt-instance add -t plain -s 30g -m 512 -o debian-etch \
  -n node1.example.com instance1.example.com
265
# gnt-instance add -t drbd -s 30g -m 512 -o debian-etch \
266
  -n node1.example.com:node2.example.com instance2.example.com
Iustin Pop's avatar
Iustin Pop committed
267
268
269
270
271
272
273
274
275
          </screen>
        </para>
      </refsect3>

      <refsect3>
        <title>REMOVE</title>

        <cmdsynopsis>
          <command>remove</command>
Iustin Pop's avatar
Iustin Pop committed
276
          <arg>--ignore-failures</arg>
Iustin Pop's avatar
Iustin Pop committed
277
278
279
280
281
282
283
284
285
          <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
286
287
288
289
290
291
292
293
294

        </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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
        </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>
          <arg>-o <replaceable>FIELD,...</replaceable></arg>
        </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>
355
                <simpara>comma-separated list of secondary nodes for the
Iustin Pop's avatar
Iustin Pop committed
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
                  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>
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
                <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
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
              </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>
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
            <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
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
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
          </variablelist>
        </para>

        <para>
          There is a subtle grouping about the available output
          fields: all fields except for <option>oper_state</option>
          and <option>oper_ram</option> are configuration value and
          not run-time values. So if you don't select any of the
          <option>oper_*</option> fields, the query will be satisfied
          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
          for remote raid templates).
        </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>
503
          <arg choice="opt">--mac <replaceable>MAC-address</replaceable></arg>
504
          <arg>--hvm-boot-order <replaceable>boot-order</replaceable></arg>
505
506
507
508
509
510
511
512
513
514
515
516
          <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
517
518
519
520
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>

        <para>
521
522
          Modify the memory size, number of vcpus, ip address, MAC
          address and/or bridge for an instance.
Iustin Pop's avatar
Iustin Pop committed
523
524
525
526
527
528
529
530
        </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>

531
        <para>
532
533
          The <option>--kernel</option>, <option>--initrd</option>
          and <option>--hvm-boot-order</option>
534
535
536
          options are described in the <command>add</command> command.
        </para>

537
538
539
540
541
        <para>
          Additionally, the HVM boot order can be reset to the default
          values by using <option>--hvm-boot-order=default</option>.
        </para>

Iustin Pop's avatar
Iustin Pop committed
542
543
544
545
546
547
        <para>
          All the changes take effect at the next restart. If the
          instance is running, there is no effect on the instance.
        </para>
      </refsect3>

548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
      <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>

566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
      <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
587
588
589
590
591
592
593
594
595
596
597
    </refsect2>

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

      <refsect3>
        <title>STARTUP</title>

        <cmdsynopsis>
          <command>startup</command>
          <arg>--extra=<replaceable>PARAMS</replaceable></arg>
598
          <arg>--force</arg>
599
600
601
602
603
604
605
606
607
608
609
          <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
610
611
612
        </cmdsynopsis>

        <para>
613
614
          Starts one or more instances, depending on the following
          options. The four available modes are:
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
          <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>
658
659
660
          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
661
662
663
664
665
666
667
668
669
670
        </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>

671
672
673
674
        <para>
          Use <option>--force</option> to start even if secondary disks are
          failing.
        </para>
Iustin Pop's avatar
Iustin Pop committed
675
676
677
678
679
680

        <para>
          Example:
          <screen>
# gnt-instance start instance1.example.com
# gnt-instance start --extra single test1.example.com
681
682
# gnt-instance start --node node1.example.com node2.example.com
# gnt-instance start --all
Iustin Pop's avatar
Iustin Pop committed
683
684
685
686
687
688
689
690
691
          </screen>
        </para>
      </refsect3>

      <refsect3>
        <title>SHUTDOWN</title>

        <cmdsynopsis>
          <command>shutdown</command>
692
693
694
695
696
697
698
699
700
701
702
703
          <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
704
705
706
        </cmdsynopsis>

        <para>
707
708
709
710
711
712
713
714
715
716
717
          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
718
          actual instances being shutdown.
Iustin Pop's avatar
Iustin Pop committed
719
720
721
722
723
724
        </para>

        <para>
          Example:
          <screen>
# gnt-instance shutdown instance1.example.com
725
# gnt-instance shutdown --all
Iustin Pop's avatar
Iustin Pop committed
726
727
728
729
          </screen>
        </para>
      </refsect3>

730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
      <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
780

781
        <para>
782
          Use the <option>--force-multiple</option> option to keep
783
784
785
786
787
788
789
790
791
792
793
794
795
          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
796
797
798
799
      <refsect3>
        <title>CONSOLE</title>
        <cmdsynopsis>
          <command>console</command>
800
          <arg choice="opt">--show-cmd</arg>
Iustin Pop's avatar
Iustin Pop committed
801
802
803
804
805
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>

        <para>
          Connects to the console of the given instance. If the instance
806
807
          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
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
        </para>

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

    </refsect2>

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

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

        <cmdsynopsis>
          <command>replace-disks</command>
828
829
830
831
832
833
          <arg choice="opt">--new-secondary <replaceable>NODE</replaceable></arg>
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>

        <cmdsynopsis>
          <command>replace-disks</command>
834
          <arg choice="opt">-s</arg>
Iustin Pop's avatar
Iustin Pop committed
835
836
837
838
          <arg choice="req">--new-secondary <replaceable>NODE</replaceable></arg>
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>

839
840
841
842
843
844
845
846
847
        <cmdsynopsis>
          <command>replace-disks</command>
          <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
848
        <para>
849
850
          This command is a generalized form for adding and replacing
          disks.
Iustin Pop's avatar
Iustin Pop committed
851
852
853
        </para>

        <para>
854
855
856
857
858
          The first form is usable with the
          <literal>remote_raid1</literal> disk template. This will
          replace the disks on both the primary and secondary node,
          and optionally will change the secondary node to a new one
          if you pass the <option>--new-secondary</option> option.
Iustin Pop's avatar
Iustin Pop committed
859
        </para>
860
861
862
863
864
865
866
867
868
869
870
871

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

Iustin Pop's avatar
Iustin Pop committed
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
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
      </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>
node1.example.com:sda:/dev/md0
node1.example.com:sdb:/dev/md1
          </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
          inside the instance. <emphasis>/dev/md0</emphasis> and
          <emphasis>/dev/md1</emphasis> are the names of the block
          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
          that if you run this command for a remote raid instance
          type, 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.
        </para>

      </refsect3>

    </refsect2>

    <refsect2>
      <title>Recovery</title>

      <refsect3>
        <title>FAILOVER</title>

        <cmdsynopsis>
          <command>failover</command>
          <arg>-f</arg>
          <arg>--ignore-consistency</arg>
935
          <arg choice="req"><replaceable>instance</replaceable></arg>
Iustin Pop's avatar
Iustin Pop committed
936
937
938
        </cmdsynopsis>

        <para>
939
          Failover will fail the instance over its secondary
Iustin Pop's avatar
Iustin Pop committed
940
941
942
943
944
945
          node. This works only for instances having a remote raid
          disk layout.
        </para>

        <para>
          Normally the failover will check the consistency of the
946
          disks before failing over the instance. If you are trying to
Iustin Pop's avatar
Iustin Pop committed
947
948
          migrate instances off a dead node, this will fail. Use the
          <option>--ignore-consistency</option> option for this
949
950
951
952
          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
953
954
955
956
957
958
959
960
961
962
963
964
        </para>

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

    </refsect2>

965
966
967
968
969
970
971
972
    <refsect2>
      <title>TAGS</title>

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

        <cmdsynopsis>
          <command>add-tags</command>
973
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
974
975
976
977
978
979
980
981
982
          <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>
983
984
985
986
987
988
989
        <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>
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
      </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>
1007
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
1008
1009
1010
1011
1012
1013
1014
1015
1016
          <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>
1017
1018
1019
1020
1021
1022
1023
1024

        <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>
1025
1026
1027
1028
      </refsect3>

    </refsect2>

Iustin Pop's avatar
Iustin Pop committed
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
  </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:
-->