gnt-instance.sgml 30.5 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
71
72
73
74
75
76
          <arg>-b <replaceable>bridge</replaceable></arg>
          <sbr>
          <arg choice="req">-t<group>
              <arg>diskless</arg>
              <arg>plain</arg>
              <arg>local_raid1</arg>
              <arg>remote_raid1</arg>
Iustin Pop's avatar
Iustin Pop committed
77
              <arg>drbd</arg>
Iustin Pop's avatar
Iustin Pop committed
78
79
            </group>
          </arg>
80
          <sbr>
81
          <arg choice="req">-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg>
Iustin Pop's avatar
Iustin Pop committed
82
83
84
85
86
87
88
89
90
91
92
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>
        <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
93
94
95
96
97
98
          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
99
100
101
        </para>

        <para>
102
103
104
105
106
          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
107
108
109
110
        </para>

        <para>
          The <option>-m</option> option specifies the memory size for
111
112
113
114
115
116
117
118
          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
119
120
121
122
123
        </para>

        <para>
          The <option>-b</option> option specifies the bridge to which the
          instance will be connected. (defaults to the cluster-wide default
124
          bridge specified at cluster initialization time).
Iustin Pop's avatar
Iustin Pop committed
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
        </para>

        <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>
            <varlistentry>
              <term>local_raid1</term>
              <listitem>
                <para>
                  Disk devices will be md raid1 arrays over two local
                  logical volumes.
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>remote_raid1</term>
              <listitem>
                <para>
Iustin Pop's avatar
Iustin Pop committed
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
                  Disk devices will be md raid1 arrays with one
                  component (so it's not actually raid1): a drbd
                  (0.7.x) device between the instance's primary node
                  and the node given by the second value of the
                  <option>--node</option> option.
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>drbd</term>
              <listitem>
                <para>
                  Disk devices will be drbd (version 8.x) on top of
                  lvm volumes. They are equivalent in functionality to
                  <replaceable>remote_raid1</replaceable>, but are
                  recommended for new instances (if you have drbd 8.x
                  installed).
Iustin Pop's avatar
Iustin Pop committed
176
177
178
179
180
181
182
                </para>
              </listitem>
            </varlistentry>
          </variablelist>
        </para>

        <para>
183
184
          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
185
186
187
188
189
190
191
192
193
194
195
        </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>
196
197
# gnt-instance add -t plain -s 30g -m 512 -o debian-etch \
  -n node1.example.com instance1.example.com
198
199
# gnt-instance add -t remote_raid1 -s 30g -m 512 -o debian-etch \
  -n node1.example.com:node2.example.com instance2.example.com
Iustin Pop's avatar
Iustin Pop committed
200
201
202
203
204
205
206
207
208
          </screen>
        </para>
      </refsect3>

      <refsect3>
        <title>REMOVE</title>

        <cmdsynopsis>
          <command>remove</command>
Iustin Pop's avatar
Iustin Pop committed
209
          <arg>--ignore-failures</arg>
Iustin Pop's avatar
Iustin Pop committed
210
211
212
213
214
215
216
217
218
          <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
219
220
221
222
223
224
225
226
227

        </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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
        </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>
288
                <simpara>comma-separated list of secondary nodes for the
Iustin Pop's avatar
Iustin Pop committed
289
290
291
292
293
294
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
355
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
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
                  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>
                <simpara>the actual state of the instance; can take of
                  the values "running", "stopped", "(node down)"</simpara>
              </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>
          </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>
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>

        <para>
          Modify the memory size, number of vcpus, ip address and/or bridge
          for an instance.
        </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>

        <para>
          All the changes take effect at the next restart. If the
          instance is running, there is no effect on the instance.
        </para>
      </refsect3>

418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
      <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>

436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
      <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
457
458
459
460
461
462
463
464
465
466
467
    </refsect2>

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

      <refsect3>
        <title>STARTUP</title>

        <cmdsynopsis>
          <command>startup</command>
          <arg>--extra=<replaceable>PARAMS</replaceable></arg>
468
469
470
471
472
473
474
475
476
477
478
          <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
479
480
481
        </cmdsynopsis>

        <para>
482
483
          Starts one or more instances, depending on the following
          options. The four available modes are:
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
          <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>
527
528
529
          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
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
        </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>


        <para>
          Example:
          <screen>
# gnt-instance start instance1.example.com
# gnt-instance start --extra single test1.example.com
546
547
# gnt-instance start --node node1.example.com node2.example.com
# gnt-instance start --all
Iustin Pop's avatar
Iustin Pop committed
548
549
550
551
552
553
554
555
556
          </screen>
        </para>
      </refsect3>

      <refsect3>
        <title>SHUTDOWN</title>

        <cmdsynopsis>
          <command>shutdown</command>
557
558
559
560
561
562
563
564
565
566
567
568
          <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
569
570
571
        </cmdsynopsis>

        <para>
572
573
574
575
576
577
578
579
580
581
582
          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
583
          actual instances being shutdown.
Iustin Pop's avatar
Iustin Pop committed
584
585
586
587
588
589
        </para>

        <para>
          Example:
          <screen>
# gnt-instance shutdown instance1.example.com
590
# gnt-instance shutdown --all
Iustin Pop's avatar
Iustin Pop committed
591
592
593
594
          </screen>
        </para>
      </refsect3>

595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
      <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
645

646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
        <para>
          Use the <option>--force-multiple</option> to keep
          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
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
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
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
      <refsect3>
        <title>CONSOLE</title>
        <cmdsynopsis>
          <command>console</command>
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>

        <para>
          Connects to the console of the given instance. If the instance
          is not up, an error is returned.
        </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>
          <arg choice="req">--new-secondary <replaceable>NODE</replaceable></arg>
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>

        <para>
          This command does a full add and replace for both disks of
          an instance.  It basically does an
          <command>addmirror</command> and
          <command>removemirror</command> for both disks of the
          instance.
        </para>

        <para>
          If you also want to replace the secondary node during this
          process (for example to fix a broken secondary node), you
          can do so using the <option>--new-secondary</option> option.
        </para>
      </refsect3>

      <refsect3>
        <title>ADD-MIRROR</title>
        <cmdsynopsis>
          <command>add-mirror</command>
          <arg choice="req">-b <replaceable>sdX</replaceable></arg>
          <arg choice="req">-n <replaceable>node</replaceable></arg>
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>
        <para>
          Adds a new mirror to the disk layout of the instance, if the
          instance has a remote raid disk layout.

          The new mirror member will be between the instance's primary
          node and the node given with the <option>-n</option> option.
        </para>
      </refsect3>

      <refsect3>
        <title>REMOVE-MIRROR</title>

        <cmdsynopsis>
          <command>removemirror</command>
          <arg choice="req">-b <replaceable>sdX</replaceable></arg>
          <arg choice="req">-p <replaceable>id</replaceable></arg>
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>
        <para>
          Removes a mirror componenent from the disk layout of the
          instance, if the instance has a remote raid disk layout.
        </para>

        <para>
          You need to specifiy on which disk to act on using the
          <option>-b</option> option (either <filename>sda</filename>
          or <filename>sdb</filename>) and the mirror component, which
          is identified by the <option>-p</option> option. You can
          find the list of valid identifiers with the
          <command>info</command> command.
        </para>

      <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>
811
          <arg choice="req"><replaceable>instance</replaceable></arg>
Iustin Pop's avatar
Iustin Pop committed
812
813
814
        </cmdsynopsis>

        <para>
815
          Failover will fail the instance over its secondary
Iustin Pop's avatar
Iustin Pop committed
816
817
818
819
820
821
          node. This works only for instances having a remote raid
          disk layout.
        </para>

        <para>
          Normally the failover will check the consistency of the
822
          disks before failing over the instance. If you are trying to
Iustin Pop's avatar
Iustin Pop committed
823
824
          migrate instances off a dead node, this will fail. Use the
          <option>--ignore-consistency</option> option for this
825
826
827
828
          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
829
830
831
832
833
834
835
836
837
838
839
840
        </para>

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

    </refsect2>

841
842
843
844
845
846
847
848
    <refsect2>
      <title>TAGS</title>

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

        <cmdsynopsis>
          <command>add-tags</command>
849
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
850
851
852
853
854
855
856
857
858
          <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>
859
860
861
862
863
864
865
        <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>
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
      </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>
883
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
884
885
886
887
888
889
890
891
892
          <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>
893
894
895
896
897
898
899
900

        <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>
901
902
903
904
      </refsect3>

    </refsect2>

Iustin Pop's avatar
Iustin Pop committed
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
  </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:
-->