Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ 24a40d57

History | View | Annotate | Download (30 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
          <sbr>
72
          <arg choice="req">-t<group>
73
              <arg>diskless</arg>
74
              <arg>plain</arg>
75
              <arg>local_raid1</arg>
76
              <arg>remote_raid1</arg>
77
            </group>
78
          </arg>
79
          <sbr>
80
          <arg choice="req">-n <replaceable>node</replaceable></arg>
81
          <arg choice="req"><replaceable>instance</replaceable></arg>
82
        </cmdsynopsis>
83
        <para>
84
          Creates a new instance on the specified
85
          host. <replaceable>instance</replaceable> must be in DNS and
86
          resolve to a IP in the same network as the nodes in the
87
          cluster.
88
        </para>
89

    
90
        <para>
91
          The <option>-s</option> option specifies the disk size for
92
          the instance, in mebibytes (defaults to
93
          <constant>20480MiB</constant> =
94
          <constant>20GiB</constant>). You can also use one of the
95
          suffixes <literal>m</literal>, <literal>g</literal> or
96
          <literal>t</literal> to specificy the exact the units used;
97
          these suffixes map to mebibytes, gibibytes and tebibytes.
98
        </para>
99

    
100
        <para>
101
          The <option>--swap-size</option> option specifies the swap
102
          disk size (in mebibytes) for the instance (the one presented
103
          as <filename class="devicefile">/dev/sdb</filename>). The
104
          default is <constant>4096MiB</constant>. As for the disk
105
          size, you can specify other suffixes.
106
        </para>
107

    
108
        <para>
109
          The <option>-m</option> option specifies the memory size for
110
          the instance, in mebibytes (defaults to 128 MiB). Again, you
111
          can use other suffixes (e.g. <userinput>2g</userinput>).
112
        </para>
113

    
114
        <para>
115
          The <option>-o</option> options specifies the operating
116
          system to be installed. The available operating systems can
117
          be listed with <command>gnt-os list</command>.
118
        </para>
119

    
120
        <para>
121
          The <option>-b</option> option specifies the bridge to which the
122
          instance will be connected. (defaults to the cluster-wide default
123
          bridge specified at cluster initialization time).
124
        </para>
125

    
126
        <para>
127
          The <option>-t</option> options specifies the disk layout type for
128
          the instance. The available choices are:
129
          <variablelist>
130
            <varlistentry>
131
              <term>diskless</term>
132
              <listitem>
133
                <para>
134
                  This creates an instance with no disks. Its useful for
135
                  testing only (or other special cases).
136
                </para>
137
              </listitem>
138
            </varlistentry>
139
            <varlistentry>
140
              <term>plain</term>
141
              <listitem>
142
                <para>Disk devices will be logical volumes.</para>
143
              </listitem>
144
            </varlistentry>
145
            <varlistentry>
146
              <term>local_raid1</term>
147
              <listitem>
148
                <para>
149
                  Disk devices will be md raid1 arrays over two local
150
                  logical volumes.
151
                </para>
152
              </listitem>
153
            </varlistentry>
154
            <varlistentry>
155
              <term>remote_raid1</term>
156
              <listitem>
157
                <para>
158
                  Disk devices will be md raid1 arrays with one
159
                  component (so it's not actually raid1): a drbd device
160
                  between the instance's primary node and the node given
161
                  by the option <option>--secondary-node</option>.
162
                </para>
163
              </listitem>
164
            </varlistentry>
165
          </variablelist>
166
        </para>
167

    
168
        <para>
169
          The <option>--secondary-node</option> option is used with
170
          the remote raid disk template type and specifies the remote
171
          node.
172
        </para>
173

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

    
180

    
181
        <para>
182
          Example:
183
          <screen>
184
# gnt-instance add -t plain -s 30g -m 512 -o debian-etch \
185
  -n node1.example.com instance1.example.com
186
# gnt-instance add -t remote_raid1 --secondary-node node3.example.com \
187
  -s 30g -m 512 -o debian-etch \
188
  -n node1.example.com instance2.example.com
189
          </screen>
190
        </para>
191

    
192
      </refsect3>
193

    
194
      <refsect3>
195
        <title>REMOVE</title>
196

    
197
        <cmdsynopsis>
198
          <command>remove</command>
199
          <arg>--ignore-failures</arg>
200
          <arg choice="req"><replaceable>instance</replaceable></arg>
201
        </cmdsynopsis>
202

    
203
        <para>
204
          Remove an instance. This will remove all data from the
205
          instance and there is <emphasis>no way back</emphasis>. If
206
          you are not sure if you use an instance again, use
207
          <command>shutdown</command> first and leave it in the
208
          shutdown state for a while.
209

    
210
        </para>
211

    
212
        <para>
213
          The <option>--ignore-failures</option> option will cause the
214
          removal to proceed even in the presence of errors during the
215
          removal of the instance (e.g. during the shutdown or the
216
          disk removal). If this option is not given, the command will
217
          stop at the first error.
218
        </para>
219

    
220
        <para>
221
          Example:
222
          <screen>
223
# gnt-instance remove instance1.example.com
224
          </screen>
225
        </para>
226
      </refsect3>
227

    
228
      <refsect3>
229
        <title>LIST</title>
230

    
231
        <cmdsynopsis>
232
          <command>list</command>
233
          <arg>--no-headers</arg>
234
          <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
235
          <arg>-o <replaceable>FIELD,...</replaceable></arg>
236
        </cmdsynopsis>
237

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

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

    
252
        <para>
253
          The <option>-o</option> option takes a comma-separated list
254
          of output fields. The available fields and their meaning
255
          are:
256
          <variablelist>
257
            <varlistentry>
258
              <term>name</term>
259
              <listitem>
260
                <simpara>the instance name</simpara>
261
              </listitem>
262
            </varlistentry>
263
            <varlistentry>
264
              <term>os</term>
265
              <listitem>
266
                <simpara>the OS of the instance</simpara>
267
              </listitem>
268
            </varlistentry>
269
            <varlistentry>
270
              <term>pnode</term>
271
              <listitem>
272
                <simpara>the primary node of the instance</simpara>
273
              </listitem>
274
            </varlistentry>
275
            <varlistentry>
276
              <term>snodes</term>
277
              <listitem>
278
                <simpara>comma-separated list of secondary-nodes for the
279
                  instance; usually this will be just one node</simpara>
280
              </listitem>
281
            </varlistentry>
282
            <varlistentry>
283
              <term>admin_state</term>
284
              <listitem>
285
                <simpara>the desired state of the instance (either "yes"
286
                  or "no" denoting the instance should run or
287
                  not)</simpara>
288
              </listitem>
289
            </varlistentry>
290
            <varlistentry>
291
              <term>admin_ram</term>
292
              <listitem>
293
                <simpara>the desired memory for the instance</simpara>
294
              </listitem>
295
            </varlistentry>
296
            <varlistentry>
297
              <term>disk_template</term>
298
              <listitem>
299
                <simpara>the disk template of the instance</simpara>
300
              </listitem>
301
            </varlistentry>
302
            <varlistentry>
303
              <term>oper_state</term>
304
              <listitem>
305
                <simpara>the actual state of the instance; can take of
306
                  the values "running", "stopped", "(node down)"</simpara>
307
              </listitem>
308
            </varlistentry>
309
            <varlistentry>
310
              <term>oper_ram</term>
311
              <listitem>
312
                <simpara>the actual memory usage of the instance as seen
313
                  by the hypervisor</simpara>
314
              </listitem>
315
            </varlistentry>
316
            <varlistentry>
317
              <term>ip</term>
318
              <listitem>
319
                <simpara>the ip address ganeti recognizes as associated with
320
                the instance interface</simpara>
321
              </listitem>
322
            </varlistentry>
323
            <varlistentry>
324
              <term>mac</term>
325
              <listitem>
326
                <simpara>the instance interface MAC address</simpara>
327
              </listitem>
328
            </varlistentry>
329
            <varlistentry>
330
              <term>bridge</term>
331
              <listitem>
332
                <simpara>bridge the instance is connected to
333
                </simpara>
334
              </listitem>
335
            </varlistentry>
336
          </variablelist>
337
        </para>
338

    
339
        <para>
340
          There is a subtle grouping about the available output
341
          fields: all fields except for <option>oper_state</option>
342
          and <option>oper_ram</option> are configuration value and
343
          not run-time values. So if you don't select any of the
344
          <option>oper_*</option> fields, the query will be satisfied
345
          instantly from the cluster configuration, without having to
346
          ask the remote nodes for the data. This can be helpful for
347
          big clusters when you only want some data and it makes sense
348
          to specify a reduced set of output fields.
349
        </para>
350

    
351
        <para>The default output field list is:
352
          <simplelist type="inline">
353
            <member>name</member>
354
            <member>os</member>
355
            <member>pnode</member>
356
            <member>admin_state</member>
357
            <member>oper_state</member>
358
            <member>oper_ram</member>
359
          </simplelist>.
360
        </para>
361
      </refsect3>
362

    
363
      <refsect3>
364
        <title>INFO</title>
365

    
366
        <cmdsynopsis>
367
          <command>info</command>
368
          <arg rep="repeat"><replaceable>instance</replaceable></arg>
369
        </cmdsynopsis>
370

    
371
        <para>
372
          Show detailed information about the (given) instances. This
373
          is different from <command>list</command> as it shows
374
          detailed data about the instance's disks (especially useful
375
          for remote raid templates).
376
        </para>
377
      </refsect3>
378

    
379
      <refsect3>
380
        <title>MODIFY</title>
381

    
382
        <cmdsynopsis>
383
          <command>modify</command>
384
          <arg choice="opt">-m <replaceable>memsize</replaceable></arg>
385
          <arg choice="opt">-p <replaceable>vcpus</replaceable></arg>
386
          <arg choice="opt">-i <replaceable>ip</replaceable></arg>
387
          <arg choice="opt">-b <replaceable>bridge</replaceable></arg>
388
          <arg choice="req"><replaceable>instance</replaceable></arg>
389
        </cmdsynopsis>
390

    
391
        <para>
392
          Modify the memory size, number of vcpus, ip address and/or bridge
393
          for an instance.
394
        </para>
395

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

    
402
        <para>
403
          All the changes take effect at the next restart. If the
404
          instance is running, there is no effect on the instance.
405
        </para>
406
      </refsect3>
407

    
408
      <refsect3>
409
        <title>REINSTALL</title>
410

    
411
        <cmdsynopsis>
412
          <command>reinstall</command>
413
          <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
414
          <arg choice="opt">-f <replaceable>force</replaceable></arg>
415
          <arg choice="req"><replaceable>instance</replaceable></arg>
416
        </cmdsynopsis>
417

    
418
        <para>
419
          Reinstalls the operating system on the given instance. The instance
420
          must be stopped when running this command. If the
421
          <option>--os-type</option> is specified, the operating system is
422
          changed.
423
        </para>
424
      </refsect3>
425

    
426
      <refsect3>
427
        <title>RENAME</title>
428

    
429
        <cmdsynopsis>
430
          <command>rename</command>
431
          <arg>--no-ip-check</arg>
432
          <arg choice="req"><replaceable>instance</replaceable></arg>
433
          <arg choice="req"><replaceable>new_name</replaceable></arg>
434
        </cmdsynopsis>
435

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

    
447
    </refsect2>
448

    
449
    <refsect2>
450
      <title>Starting/stopping/connecting to console</title>
451

    
452
      <refsect3>
453
        <title>STARTUP</title>
454

    
455
        <cmdsynopsis>
456
          <command>startup</command>
457
          <arg>--extra=<replaceable>PARAMS</replaceable></arg>
458
          <sbr>
459
          <group choice="opt">
460
            <arg>--instance</arg>
461
            <arg>--node</arg>
462
            <arg>--primary</arg>
463
            <arg>--secondary</arg>
464
            <arg>--all</arg>
465
          </group>
466
          <sbr>
467
          <arg choice="opt"
468
          rep="repeat"><replaceable>name</replaceable></arg>
469
        </cmdsynopsis>
470

    
471
        <para>
472
          Starts one or more instances, depending on the
473
          <option>--by-*</option> mode. The four available modes are:
474
          <variablelist>
475
            <varlistentry>
476
              <term><option>--instance</option></term>
477
              <listitem>
478
                <simpara>will start the instances given as arguments
479
                (at least one argument required); this is the default
480
                selection</simpara>
481
              </listitem>
482
            </varlistentry>
483
            <varlistentry>
484
              <term>--node</term>
485
              <listitem>
486
                <simpara>will start the instances who have the given
487
                node as either primary or secondary</simpara>
488
              </listitem>
489
            </varlistentry>
490
            <varlistentry>
491
              <term><option>--primary</option></term>
492
              <listitem>
493
                <simpara>will start all instances whose primary node
494
                is in the list of nodes passed as arguments (at least
495
                one node required)</simpara>
496
              </listitem>
497
            </varlistentry>
498
            <varlistentry>
499
              <term><option>--secondary</option></term>
500
              <listitem>
501
                <simpara>will start all instances whose secondary node
502
                is in the list of nodes passed as arguments (at least
503
                one node required)</simpara>
504
              </listitem>
505
            </varlistentry>
506
            <varlistentry>
507
              <term>--all</term>
508
              <listitem>
509
                <simpara>will start all instances in the cluster (no
510
                arguments accepted)</simpara>
511
              </listitem>
512
            </varlistentry>
513
          </variablelist>
514
        </para>
515

    
516
        <para>
517
          Note that although you can pass more than one
518
          <option>--by-</option> option, the last one wins, so in
519
          order to guarantee the desired result, don't pass more than
520
          one such option.
521
        </para>
522

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

    
531

    
532
        <para>
533
          Example:
534
          <screen>
535
# gnt-instance start instance1.example.com
536
# gnt-instance start --extra single test1.example.com
537
# gnt-instance start --by-node node1.example.com node2.example.com
538
# gnt-instance start --by-cluster
539
          </screen>
540
        </para>
541
      </refsect3>
542

    
543
      <refsect3>
544
        <title>SHUTDOWN</title>
545

    
546
        <cmdsynopsis>
547
          <command>shutdown</command>
548
          <sbr>
549
          <group choice="opt">
550
            <arg>--instance</arg>
551
            <arg>--node</arg>
552
            <arg>--primary</arg>
553
            <arg>--secondary</arg>
554
            <arg>--all</arg>
555
          </group>
556
          <sbr>
557

    
558
          <arg choice="opt"
559
          rep="repeat"><replaceable>name</replaceable></arg>
560
        </cmdsynopsis>
561

    
562
        <para>
563
          Stops one or more instances. If the instance cannot be
564
          cleanly stopped during a hardcoded interval (currently 2
565
          minutes), it will forcibly stop the instance (equivalent to
566
          switching off the power on a physical machine).
567
        </para>
568

    
569
        <para>
570
          The <option>--instance</option>, <option>--node</option>,
571
          <option>--primary</option>, <option>--secondary</option> and
572
          <option>--all</option> options are similar as for the
573
          <command>startup</command> command and they influence the
574
          actual instances being shutdown.
575
        </para>
576

    
577
        <para>
578
          Example:
579
          <screen>
580
# gnt-instance shutdown instance1.example.com
581
# gnt-instance shutdown --by-cluster
582
          </screen>
583
        </para>
584
      </refsect3>
585

    
586
      <refsect3>
587
        <title>REBOOT</title>
588

    
589
        <cmdsynopsis>
590
          <command>reboot</command>
591
          <sbr>
592
          <arg>--extra=<replaceable>PARAMS</replaceable></arg>
593
          <sbr>
594
          <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
595
          <sbr>
596
          <arg>--ignore-secondaries</arg>
597
          <sbr>
598
          <arg>--force-multiple</arg>
599
          <sbr>
600
          <group choice="opt">
601
            <arg>--instance</arg>
602
            <arg>--node</arg>
603
            <arg>--primary</arg>
604
            <arg>--secondary</arg>
605
            <arg>--all</arg>
606
          </group>
607
          <sbr>
608

    
609
          <arg choice="opt"
610
          rep="repeat"><replaceable>name</replaceable></arg>
611
        </cmdsynopsis>
612

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

    
623
        <para>
624
          For the hard reboot the option
625
          <option>--ignore-secondaries</option> ignores errors for the
626
          secondary node while re-assembling the instance disks.
627
        </para>
628

    
629
        <para>
630
          The <option>--instance</option>, <option>--node</option>,
631
          <option>--primary</option>, <option>--secondary</option> and
632
          <option>--all</option> options are similar as for the
633
          <command>startup</command> command and they influence the
634
          actual instances being rebooted.
635
        </para>
636
        
637
        <para>
638
          Use the <option>--force-multiple</option> to keep
639
          gnt-instance from asking for confirmation when more than one
640
          instance is affected.
641
        </para>
642

    
643
        <para>
644
          Example:
645
          <screen>
646
# gnt-instance reboot instance1.example.com
647
# gnt-instance reboot --type=full instance1.example.com
648
          </screen>
649
        </para>
650
      </refsect3>
651

    
652
      <refsect3>
653
        <title>CONSOLE</title>
654
        <cmdsynopsis>
655
          <command>console</command>
656
          <arg choice="req"><replaceable>instance</replaceable></arg>
657
        </cmdsynopsis>
658

    
659
        <para>
660
          Connects to the console of the given instance. If the instance
661
          is not up, an error is returned.
662
        </para>
663

    
664
        <para>
665
          Example:
666
          <screen>
667
# gnt-instance console instance1.example.com
668
          </screen>
669
        </para>
670
      </refsect3>
671

    
672
    </refsect2>
673

    
674
    <refsect2>
675
      <title>Disk management</title>
676

    
677
      <refsect3>
678
        <title>REPLACE-DISKS</title>
679

    
680
        <cmdsynopsis>
681
          <command>replace-disks</command>
682
          <arg choice="req">--new-secondary <replaceable>NODE</replaceable></arg>
683
          <arg choice="req"><replaceable>instance</replaceable></arg>
684
        </cmdsynopsis>
685

    
686
        <para>
687
          This command does a full add and replace for both disks of
688
          an instance.  It basically does an
689
          <command>addmirror</command> and
690
          <command>removemirror</command> for both disks of the
691
          instance.
692
        </para>
693

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

    
701
      <refsect3>
702
        <title>ADD-MIRROR</title>
703
        <cmdsynopsis>
704
          <command>add-mirror</command>
705
          <arg choice="req">-b <replaceable>sdX</replaceable></arg>
706
          <arg choice="req">-n <replaceable>node</replaceable></arg>
707
          <arg choice="req"><replaceable>instance</replaceable></arg>
708
        </cmdsynopsis>
709
        <para>
710
          Adds a new mirror to the disk layout of the instance, if the
711
          instance has a remote raid disk layout.
712

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

    
718
      <refsect3>
719
        <title>REMOVE-MIRROR</title>
720

    
721
        <cmdsynopsis>
722
          <command>removemirror</command>
723
          <arg choice="req">-b <replaceable>sdX</replaceable></arg>
724
          <arg choice="req">-p <replaceable>id</replaceable></arg>
725
          <arg choice="req"><replaceable>instance</replaceable></arg>
726
        </cmdsynopsis>
727
        <para>
728
          Removes a mirror componenent from the disk layout of the
729
          instance, if the instance has a remote raid disk layout.
730
        </para>
731

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

    
741
      <refsect3>
742
        <title>ACTIVATE-DISKS</title>
743

    
744
        <cmdsynopsis>
745
          <command>activate-disks</command>
746
          <arg choice="req"><replaceable>instance</replaceable></arg>
747
        </cmdsynopsis>
748
        <para>
749
          Activates the block devices of the given instance. If
750
          successful, the command will show the location and name of
751
          the block devices:
752
          <screen>
753
node1.example.com:sda:/dev/md0
754
node1.example.com:sdb:/dev/md1
755
          </screen>
756

    
757
          In this example, <emphasis>node1.example.com</emphasis> is
758
          the name of the node on which the devices have been
759
          activated. The <emphasis>sda</emphasis> and
760
          <emphasis>sdb</emphasis> are the names of the block devices
761
          inside the instance. <emphasis>/dev/md0</emphasis> and
762
          <emphasis>/dev/md1</emphasis> are the names of the block
763
          devices as visible on the node.
764
        </para>
765

    
766
        <para>
767
          Note that it is safe to run this command while the instance
768
          is already running.
769
        </para>
770
      </refsect3>
771

    
772
      <refsect3>
773
        <title>DEACTIVATE-DISKS</title>
774

    
775
        <cmdsynopsis>
776
          <command>deactivate-disks</command>
777
          <arg choice="req"><replaceable>instance</replaceable></arg>
778
        </cmdsynopsis>
779
        <para>
780
          De-activates the block devices of the given instance. Note
781
          that if you run this command for a remote raid instance
782
          type, while it is running, it will not be able to shutdown
783
          the block devices on the primary node, but it will shutdown
784
          the block devices on the secondary nodes, thus breaking the
785
          replication.
786
        </para>
787

    
788
      </refsect3>
789

    
790
    </refsect2>
791

    
792
    <refsect2>
793
      <title>Recovery</title>
794

    
795
      <refsect3>
796
        <title>FAILOVER</title>
797

    
798
        <cmdsynopsis>
799
          <command>failover</command>
800
          <arg>-f</arg>
801
          <arg>--ignore-consistency</arg>
802
          <arg choice="req"><replaceable>instance</replaceable></arg>
803
        </cmdsynopsis>
804

    
805
        <para>
806
          Failover will fail the instance over its secondary
807
          node. This works only for instances having a remote raid
808
          disk layout.
809
        </para>
810

    
811
        <para>
812
          Normally the failover will check the consistency of the
813
          disks before failing over the instance. If you are trying to
814
          migrate instances off a dead node, this will fail. Use the
815
          <option>--ignore-consistency</option> option for this
816
          purpose. Note that this option can be dangerous as errors in
817
          shutting down the instance will be ignored, resulting in
818
          possibly having the instance running on two machines in
819
          parallel (on disconnected DRBD drives).
820
        </para>
821

    
822
        <para>
823
          Example:
824
          <screen>
825
# gnt-instance failover instance1.example.com
826
          </screen>
827
        </para>
828
      </refsect3>
829

    
830
    </refsect2>
831

    
832
    <refsect2>
833
      <title>TAGS</title>
834

    
835
    <refsect3>
836
        <title>ADD-TAGS</title>
837

    
838
        <cmdsynopsis>
839
          <command>add-tags</command>
840
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
841
          <arg choice="req"><replaceable>instancename</replaceable></arg>
842
          <arg choice="req"
843
            rep="repeat"><replaceable>tag</replaceable></arg>
844
        </cmdsynopsis>
845

    
846
        <para>
847
          Add tags to the given instance. If any of the tags contains
848
          invalid characters, the entire operation will abort.
849
        </para>
850
        <para>
851
          If the <option>--from</option> option is given, the list of
852
          tags will be extended with the contents of that file (each
853
          line becomes a tag). In this case, there is not need to pass
854
          tags on the command line (if you do, both sources will be
855
          used). A file name of - will be interpreted as stdin.
856
        </para>
857
      </refsect3>
858

    
859
      <refsect3>
860
        <title>LIST-TAGS</title>
861

    
862
        <cmdsynopsis>
863
          <command>list-tags</command>
864
          <arg choice="req"><replaceable>instancename</replaceable></arg>
865
        </cmdsynopsis>
866

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

    
870
      <refsect3>
871
        <title>REMOVE-TAGS</title>
872
        <cmdsynopsis>
873
          <command>remove-tags</command>
874
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
875
          <arg choice="req"><replaceable>instancename</replaceable></arg>
876
          <arg choice="req"
877
            rep="repeat"><replaceable>tag</replaceable></arg>
878
        </cmdsynopsis>
879

    
880
        <para>
881
          Remove tags from the given instance. If any of the tags are
882
          not existing on the node, the entire operation will abort.
883
        </para>
884

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

    
894
    </refsect2>
895

    
896
  </refsect1>
897

    
898
  &footer;
899

    
900
</refentry>
901

    
902
<!-- Keep this comment at the end of the file
903
Local variables:
904
mode: sgml
905
sgml-omittag:t
906
sgml-shorttag:t
907
sgml-minimize-attributes:nil
908
sgml-always-quote-attributes:t
909
sgml-indent-step:2
910
sgml-indent-data:t
911
sgml-parent-document:nil
912
sgml-default-dtd-file:nil
913
sgml-exposed-tags:nil
914
sgml-local-catalogs:nil
915
sgml-local-ecat-files:nil
916
End:
917
-->