gnt-instance.sgml 20.6 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!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 choice="req">-n <replaceable>node</replaceable></arg>
          <arg>-s <replaceable>disksize</replaceable></arg>
          <arg>-o <replaceable>os-type</replaceable></arg>
          <arg>-m <replaceable>memsize</replaceable></arg>
          <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>
            </group>
          </arg>
          <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
          the instance, in gigibytes (defaults to 20 GiB).
        </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>.
        </para>

        <para>
          The <option>-m</option> option specifies the memory size for
          the instance, in megibytes (defaults to 128 MiB).
        </para>

        <para>
          The <option>-b</option> option specifies the bridge to which the
          instance will be connected. (defaults to the cluster-wide default
106
          bridge specified at cluster initialization time).
Iustin Pop's avatar
Iustin Pop committed
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
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
288
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
        </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>
                  Disk devices will be md raid1 arrays with one
                  component (so it's not actually raid1): a drbd device
                  between the instance's primary node and the node given
                  by the option <option>--secondary-node</option>.
                </para>
              </listitem>
            </varlistentry>
          </variablelist>
        </para>

        <para>
          The <option>--secondary-node</option> option is used with
          the remote raid disk template type and specifies the remote
          node.
        </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>
# gnt-instance add -t plain -s 30 -m 512 -n node1.example.com \
> instance1.example.com
# gnt-instance add -t remote_raid1 --secondary-node node3.example.com \
> -s 30 -m 512 -n node1.example.com instance2.example.com
          </screen>
        </para>

      </refsect3>

      <refsect3>
        <title>REMOVE</title>

        <cmdsynopsis>
          <command>remove</command>
          <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.
        </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>
                <simpara>comma-separated list of secondary-nodes for the
                  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>

380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
      <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>

Iustin Pop's avatar
Iustin Pop committed
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
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
645
646
647
648
649
650
651
652
653
654
655
656
    </refsect2>

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

      <refsect3>
        <title>STARTUP</title>

        <cmdsynopsis>
          <command>startup</command>
          <arg>--extra=<replaceable>PARAMS</replaceable></arg>
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>

        <para>
          Starts an instance. The node where to start the instance is
          taken from the configuration.
        </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
          </screen>
        </para>
      </refsect3>

      <refsect3>
        <title>SHUTDOWN</title>

        <cmdsynopsis>
          <command>shutdown</command>
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>

        <para>
          Stops the instance. 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>
          Example:
          <screen>
# gnt-instance shutdown instance1.example.com
          </screen>
        </para>
      </refsect3>

      <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>
          <arg choice="req"><replaceable>instance</replaceable></arg>
        </cmdsynopsis>

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

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

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

    </refsect2>

  </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:
-->