Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ 2ec08468

History | View | Annotate | Download (21.4 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 choice="req"><replaceable>instance</replaceable></arg>
200
        </cmdsynopsis>
201

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

    
210
        <para>
211
          Example:
212
          <screen>
213
# gnt-instance remove instance1.example.com
214
          </screen>
215
        </para>
216
      </refsect3>
217

    
218
      <refsect3>
219
        <title>LIST</title>
220

    
221
        <cmdsynopsis>
222
          <command>list</command>
223
          <arg>--no-headers</arg>
224
          <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
225
          <arg>-o <replaceable>FIELD,...</replaceable></arg>
226
        </cmdsynopsis>
227

    
228
        <para>
229
          Shows the currently configured instances with memory usage,
230
          disk usage, the node they are running on, and the CPU time,
231
          counted in seconds, used by each instance since its latest
232
          restart.
233
        </para>
234

    
235
        <para>
236
          The <option>--no-headers</option> option will skip the
237
          initial header line. The <option>--separator</option> option
238
          takes an argument which denotes what will be used between
239
          the output fields. Both these options are to help scripting.
240
        </para>
241

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

    
329
        <para>
330
          There is a subtle grouping about the available output
331
          fields: all fields except for <option>oper_state</option>
332
          and <option>oper_ram</option> are configuration value and
333
          not run-time values. So if you don't select any of the
334
          <option>oper_*</option> fields, the query will be satisfied
335
          instantly from the cluster configuration, without having to
336
          ask the remote nodes for the data. This can be helpful for
337
          big clusters when you only want some data and it makes sense
338
          to specify a reduced set of output fields.
339
        </para>
340

    
341
        <para>The default output field list is:
342
          <simplelist type="inline">
343
            <member>name</member>
344
            <member>os</member>
345
            <member>pnode</member>
346
            <member>admin_state</member>
347
            <member>oper_state</member>
348
            <member>oper_ram</member>
349
          </simplelist>.
350
        </para>
351
      </refsect3>
352

    
353
      <refsect3>
354
        <title>INFO</title>
355

    
356
        <cmdsynopsis>
357
          <command>info</command>
358
          <arg rep="repeat"><replaceable>instance</replaceable></arg>
359
        </cmdsynopsis>
360

    
361
        <para>
362
          Show detailed information about the (given) instances. This
363
          is different from <command>list</command> as it shows
364
          detailed data about the instance's disks (especially useful
365
          for remote raid templates).
366
        </para>
367
      </refsect3>
368

    
369
      <refsect3>
370
        <title>MODIFY</title>
371

    
372
        <cmdsynopsis>
373
          <command>modify</command>
374
          <arg choice="opt">-m <replaceable>memsize</replaceable></arg>
375
          <arg choice="opt">-p <replaceable>vcpus</replaceable></arg>
376
          <arg choice="opt">-i <replaceable>ip</replaceable></arg>
377
          <arg choice="opt">-b <replaceable>bridge</replaceable></arg>
378
          <arg choice="req"><replaceable>instance</replaceable></arg>
379
        </cmdsynopsis>
380

    
381
        <para>
382
          Modify the memory size, number of vcpus, ip address and/or bridge
383
          for an instance.
384
        </para>
385

    
386
        <para>
387
          The memory size is given in MiB. Note that you need to give
388
          at least one of the arguments, otherwise the command
389
          complains.
390
        </para>
391

    
392
        <para>
393
          All the changes take effect at the next restart. If the
394
          instance is running, there is no effect on the instance.
395
        </para>
396
      </refsect3>
397

    
398
      <refsect3>
399
        <title>REINSTALL</title>
400

    
401
        <cmdsynopsis>
402
          <command>reinstall</command>
403
          <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
404
          <arg choice="opt">-f <replaceable>force</replaceable></arg>
405
          <arg choice="req"><replaceable>instance</replaceable></arg>
406
        </cmdsynopsis>
407

    
408
        <para>
409
          Reinstalls the operating system on the given instance. The instance
410
          must be stopped when running this command. If the
411
          <option>--os-type</option> is specified, the operating system is
412
          changed.
413
        </para>
414
      </refsect3>
415

    
416
    </refsect2>
417

    
418
    <refsect2>
419
      <title>Starting/stopping/connecting to console</title>
420

    
421
      <refsect3>
422
        <title>STARTUP</title>
423

    
424
        <cmdsynopsis>
425
          <command>startup</command>
426
          <arg>--extra=<replaceable>PARAMS</replaceable></arg>
427
          <arg choice="req"><replaceable>instance</replaceable></arg>
428
        </cmdsynopsis>
429

    
430
        <para>
431
          Starts an instance. The node where to start the instance is
432
          taken from the configuration.
433
        </para>
434

    
435
        <para>
436
          The <option>--extra</option> option is used to pass
437
          additional argument to the instance's kernel for this start
438
          only. Currently there is no way to specify a persistent set
439
          of arguments (beside the one hardcoded). Note that this may
440
          not apply to all virtualization types.
441
        </para>
442

    
443

    
444
        <para>
445
          Example:
446
          <screen>
447
# gnt-instance start instance1.example.com
448
# gnt-instance start --extra single test1.example.com
449
          </screen>
450
        </para>
451
      </refsect3>
452

    
453
      <refsect3>
454
        <title>SHUTDOWN</title>
455

    
456
        <cmdsynopsis>
457
          <command>shutdown</command>
458
          <arg choice="req"><replaceable>instance</replaceable></arg>
459
        </cmdsynopsis>
460

    
461
        <para>
462
          Stops the instance. If the instance cannot be cleanly
463
          stopped during a hardcoded interval (currently 2 minutes),
464
          it will forcibly stop the instance (equivalent to switching
465
          off the power on a physical machine).
466
        </para>
467

    
468
        <para>
469
          Example:
470
          <screen>
471
# gnt-instance shutdown instance1.example.com
472
          </screen>
473
        </para>
474
      </refsect3>
475

    
476
      <refsect3>
477
        <title>CONSOLE</title>
478
        <cmdsynopsis>
479
          <command>console</command>
480
          <arg choice="req"><replaceable>instance</replaceable></arg>
481
        </cmdsynopsis>
482

    
483
        <para>
484
          Connects to the console of the given instance. If the instance
485
          is not up, an error is returned.
486
        </para>
487

    
488
        <para>
489
          Example:
490
          <screen>
491
# gnt-instance console instance1.example.com
492
          </screen>
493
        </para>
494
      </refsect3>
495

    
496
    </refsect2>
497

    
498
    <refsect2>
499
      <title>Disk management</title>
500

    
501
      <refsect3>
502
        <title>REPLACE-DISKS</title>
503

    
504
        <cmdsynopsis>
505
          <command>replace-disks</command>
506
          <arg choice="req">--new-secondary <replaceable>NODE</replaceable></arg>
507
          <arg choice="req"><replaceable>instance</replaceable></arg>
508
        </cmdsynopsis>
509

    
510
        <para>
511
          This command does a full add and replace for both disks of
512
          an instance.  It basically does an
513
          <command>addmirror</command> and
514
          <command>removemirror</command> for both disks of the
515
          instance.
516
        </para>
517

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

    
525
      <refsect3>
526
        <title>ADD-MIRROR</title>
527
        <cmdsynopsis>
528
          <command>add-mirror</command>
529
          <arg choice="req">-b <replaceable>sdX</replaceable></arg>
530
          <arg choice="req">-n <replaceable>node</replaceable></arg>
531
          <arg choice="req"><replaceable>instance</replaceable></arg>
532
        </cmdsynopsis>
533
        <para>
534
          Adds a new mirror to the disk layout of the instance, if the
535
          instance has a remote raid disk layout.
536

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

    
542
      <refsect3>
543
        <title>REMOVE-MIRROR</title>
544

    
545
        <cmdsynopsis>
546
          <command>removemirror</command>
547
          <arg choice="req">-b <replaceable>sdX</replaceable></arg>
548
          <arg choice="req">-p <replaceable>id</replaceable></arg>
549
          <arg choice="req"><replaceable>instance</replaceable></arg>
550
        </cmdsynopsis>
551
        <para>
552
          Removes a mirror componenent from the disk layout of the
553
          instance, if the instance has a remote raid disk layout.
554
        </para>
555

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

    
565
      <refsect3>
566
        <title>ACTIVATE-DISKS</title>
567

    
568
        <cmdsynopsis>
569
          <command>activate-disks</command>
570
          <arg choice="req"><replaceable>instance</replaceable></arg>
571
        </cmdsynopsis>
572
        <para>
573
          Activates the block devices of the given instance. If
574
          successful, the command will show the location and name of
575
          the block devices:
576
          <screen>
577
node1.example.com:sda:/dev/md0
578
node1.example.com:sdb:/dev/md1
579
          </screen>
580

    
581
          In this example, <emphasis>node1.example.com</emphasis> is
582
          the name of the node on which the devices have been
583
          activated. The <emphasis>sda</emphasis> and
584
          <emphasis>sdb</emphasis> are the names of the block devices
585
          inside the instance. <emphasis>/dev/md0</emphasis> and
586
          <emphasis>/dev/md1</emphasis> are the names of the block
587
          devices as visible on the node.
588
        </para>
589

    
590
        <para>
591
          Note that it is safe to run this command while the instance
592
          is already running.
593
        </para>
594
      </refsect3>
595

    
596
      <refsect3>
597
        <title>DEACTIVATE-DISKS</title>
598

    
599
        <cmdsynopsis>
600
          <command>deactivate-disks</command>
601
          <arg choice="req"><replaceable>instance</replaceable></arg>
602
        </cmdsynopsis>
603
        <para>
604
          De-activates the block devices of the given instance. Note
605
          that if you run this command for a remote raid instance
606
          type, while it is running, it will not be able to shutdown
607
          the block devices on the primary node, but it will shutdown
608
          the block devices on the secondary nodes, thus breaking the
609
          replication.
610
        </para>
611

    
612
      </refsect3>
613

    
614
    </refsect2>
615

    
616
    <refsect2>
617
      <title>Recovery</title>
618

    
619
      <refsect3>
620
        <title>FAILOVER</title>
621

    
622
        <cmdsynopsis>
623
          <command>failover</command>
624
          <arg>-f</arg>
625
          <arg>--ignore-consistency</arg>
626
          <arg choice="req"><replaceable>instance</replaceable></arg>
627
        </cmdsynopsis>
628

    
629
        <para>
630
          Failover will fail the instance over its secondary
631
          node. This works only for instances having a remote raid
632
          disk layout.
633
        </para>
634

    
635
        <para>
636
          Normally the failover will check the consistency of the
637
          disks before failing over the instance. If you are trying to
638
          migrate instances off a dead node, this will fail. Use the
639
          <option>--ignore-consistency</option> option for this
640
          purpose.
641
        </para>
642

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

    
651
    </refsect2>
652

    
653
  </refsect1>
654

    
655
  &footer;
656

    
657
</refentry>
658

    
659
<!-- Keep this comment at the end of the file
660
Local variables:
661
mode: sgml
662
sgml-omittag:t
663
sgml-shorttag:t
664
sgml-minimize-attributes:nil
665
sgml-always-quote-attributes:t
666
sgml-indent-step:2
667
sgml-indent-data:t
668
sgml-parent-document:nil
669
sgml-default-dtd-file:nil
670
sgml-exposed-tags:nil
671
sgml-local-catalogs:nil
672
sgml-local-ecat-files:nil
673
End:
674
-->