Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ 312ac745

History | View | Annotate | Download (24.3 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
          <sbr>
428
          <group choice="opt">
429
            <arg>--instance</arg>
430
            <arg>--node</arg>
431
            <arg>--primary</arg>
432
            <arg>--secondary</arg>
433
            <arg>--all</arg>
434
          </group>
435
          <sbr>
436
          <arg choice="opt"
437
          rep="repeat"><replaceable>name</replaceable></arg>
438
        </cmdsynopsis>
439

    
440
        <para>
441
          Starts one or more instances, depending on the
442
          <option>--by-*</option> mode. The four available modes are:
443
          <variablelist>
444
            <varlistentry>
445
              <term><option>--instance</option></term>
446
              <listitem>
447
                <simpara>will start the instances given as arguments
448
                (at least one argument required); this is the default
449
                selection</simpara>
450
              </listitem>
451
            </varlistentry>
452
            <varlistentry>
453
              <term>--node</term>
454
              <listitem>
455
                <simpara>will start the instances who have the given
456
                node as either primary or secondary</simpara>
457
              </listitem>
458
            </varlistentry>
459
            <varlistentry>
460
              <term><option>--primary</option></term>
461
              <listitem>
462
                <simpara>will start all instances whose primary node
463
                is in the list of nodes passed as arguments (at least
464
                one node required)</simpara>
465
              </listitem>
466
            </varlistentry>
467
            <varlistentry>
468
              <term><option>--secondary</option></term>
469
              <listitem>
470
                <simpara>will start all instances whose secondary node
471
                is in the list of nodes passed as arguments (at least
472
                one node required)</simpara>
473
              </listitem>
474
            </varlistentry>
475
            <varlistentry>
476
              <term>--all</term>
477
              <listitem>
478
                <simpara>will start all instances in the cluster (no
479
                arguments accepted)</simpara>
480
              </listitem>
481
            </varlistentry>
482
          </variablelist>
483
        </para>
484

    
485
        <para>
486
          Note that although you can pass more than one
487
          <option>--by-</option> option, the last one wins, so in
488
          order to guarantee the desired result, don't pass more than
489
          one such option.
490
        </para>
491

    
492
        <para>
493
          The <option>--extra</option> option is used to pass
494
          additional argument to the instance's kernel for this start
495
          only. Currently there is no way to specify a persistent set
496
          of arguments (beside the one hardcoded). Note that this may
497
          not apply to all virtualization types.
498
        </para>
499

    
500

    
501
        <para>
502
          Example:
503
          <screen>
504
# gnt-instance start instance1.example.com
505
# gnt-instance start --extra single test1.example.com
506
# gnt-instance start --by-node node1.example.com node2.example.com
507
# gnt-instance start --by-cluster
508
          </screen>
509
        </para>
510
      </refsect3>
511

    
512
      <refsect3>
513
        <title>SHUTDOWN</title>
514

    
515
        <cmdsynopsis>
516
          <command>shutdown</command>
517
          <sbr>
518
          <group choice="opt">
519
            <arg>--instance</arg>
520
            <arg>--node</arg>
521
            <arg>--primary</arg>
522
            <arg>--secondary</arg>
523
            <arg>--all</arg>
524
          </group>
525
          <sbr>
526

    
527
          <arg choice="opt"
528
          rep="repeat"><replaceable>name</replaceable></arg>
529
        </cmdsynopsis>
530

    
531
        <para>
532
          Stops one or more instances. If the instance cannot be
533
          cleanly stopped during a hardcoded interval (currently 2
534
          minutes), it will forcibly stop the instance (equivalent to
535
          switching off the power on a physical machine).
536
        </para>
537

    
538
        <para>
539
          The <option>--instance</option>, <option>--node</option>,
540
          <option>--primary</option>, <option>--secondary</option> and
541
          <option>--all</option> options are similar as for the
542
          <command>startup</command> command and they influence the
543
          actual instances being shutodnw.
544
        </para>
545

    
546
        <para>
547
          Example:
548
          <screen>
549
# gnt-instance shutdown instance1.example.com
550
# gnt-instance shutdown --by-cluster
551
          </screen>
552
        </para>
553
      </refsect3>
554

    
555
      <refsect3>
556
        <title>CONSOLE</title>
557
        <cmdsynopsis>
558
          <command>console</command>
559
          <arg choice="req"><replaceable>instance</replaceable></arg>
560
        </cmdsynopsis>
561

    
562
        <para>
563
          Connects to the console of the given instance. If the instance
564
          is not up, an error is returned.
565
        </para>
566

    
567
        <para>
568
          Example:
569
          <screen>
570
# gnt-instance console instance1.example.com
571
          </screen>
572
        </para>
573
      </refsect3>
574

    
575
    </refsect2>
576

    
577
    <refsect2>
578
      <title>Disk management</title>
579

    
580
      <refsect3>
581
        <title>REPLACE-DISKS</title>
582

    
583
        <cmdsynopsis>
584
          <command>replace-disks</command>
585
          <arg choice="req">--new-secondary <replaceable>NODE</replaceable></arg>
586
          <arg choice="req"><replaceable>instance</replaceable></arg>
587
        </cmdsynopsis>
588

    
589
        <para>
590
          This command does a full add and replace for both disks of
591
          an instance.  It basically does an
592
          <command>addmirror</command> and
593
          <command>removemirror</command> for both disks of the
594
          instance.
595
        </para>
596

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

    
604
      <refsect3>
605
        <title>ADD-MIRROR</title>
606
        <cmdsynopsis>
607
          <command>add-mirror</command>
608
          <arg choice="req">-b <replaceable>sdX</replaceable></arg>
609
          <arg choice="req">-n <replaceable>node</replaceable></arg>
610
          <arg choice="req"><replaceable>instance</replaceable></arg>
611
        </cmdsynopsis>
612
        <para>
613
          Adds a new mirror to the disk layout of the instance, if the
614
          instance has a remote raid disk layout.
615

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

    
621
      <refsect3>
622
        <title>REMOVE-MIRROR</title>
623

    
624
        <cmdsynopsis>
625
          <command>removemirror</command>
626
          <arg choice="req">-b <replaceable>sdX</replaceable></arg>
627
          <arg choice="req">-p <replaceable>id</replaceable></arg>
628
          <arg choice="req"><replaceable>instance</replaceable></arg>
629
        </cmdsynopsis>
630
        <para>
631
          Removes a mirror componenent from the disk layout of the
632
          instance, if the instance has a remote raid disk layout.
633
        </para>
634

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

    
644
      <refsect3>
645
        <title>ACTIVATE-DISKS</title>
646

    
647
        <cmdsynopsis>
648
          <command>activate-disks</command>
649
          <arg choice="req"><replaceable>instance</replaceable></arg>
650
        </cmdsynopsis>
651
        <para>
652
          Activates the block devices of the given instance. If
653
          successful, the command will show the location and name of
654
          the block devices:
655
          <screen>
656
node1.example.com:sda:/dev/md0
657
node1.example.com:sdb:/dev/md1
658
          </screen>
659

    
660
          In this example, <emphasis>node1.example.com</emphasis> is
661
          the name of the node on which the devices have been
662
          activated. The <emphasis>sda</emphasis> and
663
          <emphasis>sdb</emphasis> are the names of the block devices
664
          inside the instance. <emphasis>/dev/md0</emphasis> and
665
          <emphasis>/dev/md1</emphasis> are the names of the block
666
          devices as visible on the node.
667
        </para>
668

    
669
        <para>
670
          Note that it is safe to run this command while the instance
671
          is already running.
672
        </para>
673
      </refsect3>
674

    
675
      <refsect3>
676
        <title>DEACTIVATE-DISKS</title>
677

    
678
        <cmdsynopsis>
679
          <command>deactivate-disks</command>
680
          <arg choice="req"><replaceable>instance</replaceable></arg>
681
        </cmdsynopsis>
682
        <para>
683
          De-activates the block devices of the given instance. Note
684
          that if you run this command for a remote raid instance
685
          type, while it is running, it will not be able to shutdown
686
          the block devices on the primary node, but it will shutdown
687
          the block devices on the secondary nodes, thus breaking the
688
          replication.
689
        </para>
690

    
691
      </refsect3>
692

    
693
    </refsect2>
694

    
695
    <refsect2>
696
      <title>Recovery</title>
697

    
698
      <refsect3>
699
        <title>FAILOVER</title>
700

    
701
        <cmdsynopsis>
702
          <command>failover</command>
703
          <arg>-f</arg>
704
          <arg>--ignore-consistency</arg>
705
          <arg choice="req"><replaceable>instance</replaceable></arg>
706
        </cmdsynopsis>
707

    
708
        <para>
709
          Failover will fail the instance over its secondary
710
          node. This works only for instances having a remote raid
711
          disk layout.
712
        </para>
713

    
714
        <para>
715
          Normally the failover will check the consistency of the
716
          disks before failing over the instance. If you are trying to
717
          migrate instances off a dead node, this will fail. Use the
718
          <option>--ignore-consistency</option> option for this
719
          purpose.
720
        </para>
721

    
722
        <para>
723
          Example:
724
          <screen>
725
# gnt-instance failover instance1.example.com
726
          </screen>
727
        </para>
728
      </refsect3>
729

    
730
    </refsect2>
731

    
732
  </refsect1>
733

    
734
  &footer;
735

    
736
</refentry>
737

    
738
<!-- Keep this comment at the end of the file
739
Local variables:
740
mode: sgml
741
sgml-omittag:t
742
sgml-shorttag:t
743
sgml-minimize-attributes:nil
744
sgml-always-quote-attributes:t
745
sgml-indent-step:2
746
sgml-indent-data:t
747
sgml-parent-document:nil
748
sgml-default-dtd-file:nil
749
sgml-exposed-tags:nil
750
sgml-local-catalogs:nil
751
sgml-local-ecat-files:nil
752
End:
753
-->