Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ d3b4cf9f

History | View | Annotate | Download (68.7 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>February 11, 2009</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
      <year>2008</year>
24
      <year>2009</year>
25
      <holder>Google Inc.</holder>
26
    </copyright>
27
    &dhdate;
28
  </refentryinfo>
29
  <refmeta>
30
    &dhucpackage;
31

    
32
    &dhsection;
33
    <refmiscinfo>ganeti 2.0</refmiscinfo>
34
  </refmeta>
35
  <refnamediv>
36
    <refname>&dhpackage;</refname>
37

    
38
    <refpurpose>ganeti instance administration</refpurpose>
39
  </refnamediv>
40
  <refsynopsisdiv>
41
    <cmdsynopsis>
42
      <command>&dhpackage; </command>
43

    
44
      <arg choice="req">command</arg>
45
      <arg>arguments...</arg>
46
    </cmdsynopsis>
47
  </refsynopsisdiv>
48
  <refsect1>
49
    <title>DESCRIPTION</title>
50

    
51
    <para>
52
      The <command>&dhpackage;</command> is used for instance
53
      administration in the ganeti system.
54
    </para>
55

    
56
  </refsect1>
57
  <refsect1>
58
    <title>COMMANDS</title>
59

    
60
    <refsect2>
61
      <title>Creation/removal/querying</title>
62

    
63
      <refsect3>
64
        <title>ADD</title>
65
        <cmdsynopsis>
66
          <command>add</command>
67
          <sbr>
68
          <arg rep="repeat">--disk=<replaceable>N</replaceable>:size=<replaceable>VAL</replaceable><arg>,mode=<replaceable>ro|rw</replaceable></arg></arg>
69
          <sbr>
70
          <group>
71
            <arg rep="repeat">--net=<replaceable>N</replaceable><arg rep="repeat">:options</arg></arg>
72
            <arg>--no-nics</arg>
73
          </group>
74
          <sbr>
75
          <arg>-B <replaceable>BEPARAMS</replaceable></arg>
76
          <sbr>
77

    
78
          <arg>-H <replaceable>HYPERVISOR</replaceable><arg>:<arg choice="plain" rep="repeat">option=<replaceable>value</replaceable></arg></arg></arg>
79
          <sbr>
80

    
81
          <arg>--file-storage-dir <replaceable>dir_path</replaceable></arg>
82
          <arg>--file-driver<group choice="req">
83
              <arg>loop</arg>
84
              <arg>blktap</arg>
85
            </group></arg>
86
          <sbr>
87

    
88
          <arg choice="req">-t<group choice="req">
89
              <arg>diskless</arg>
90
              <arg>file</arg>
91
              <arg>plain</arg>
92
              <arg>drbd</arg>
93
            </group></arg>
94
          <sbr>
95

    
96
          <group choice="req">
97
            <arg>-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg>
98
            <arg>--iallocator <replaceable>name</replaceable></arg>
99
          </group>
100
          <sbr>
101

    
102
          <arg choice="req">-o <replaceable>os-type</replaceable></arg>
103
          <sbr>
104
          <arg>--submit</arg>
105
          <sbr>
106

    
107
          <arg choice="req"><replaceable>instance</replaceable></arg>
108
        </cmdsynopsis>
109

    
110
        <para>
111
          Creates a new instance on the specified host. The
112
          <replaceable>instance</replaceable> argument must be in DNS,
113
          but depending on the bridge setup, need not be in the same
114
          network as the nodes in the cluster.
115
        </para>
116

    
117
        <para>
118
          The <option>disk</option> option specifies the parameters
119
          for the disks of the instance. The numbering of disks starts
120
          at zero, and at least one disk needs to be passed. For each
121
          disk, at least the size needs to be given, and optionally
122
          the access mode (read-only or the default of read-write) can
123
          also be specified.  The size is interpreted (when no unit is
124
          given) in mebibytes. You can also use one of the suffixes
125
          <literal>m</literal>, <literal>g</literal> or
126
          <literal>t</literal> to specificy the exact the units used;
127
          these suffixes map to mebibytes, gibibytes and tebibytes.
128
        </para>
129

    
130
        <para>
131
          The minimum disk specification is therefore
132
          <userinput>--disk 0:size=20G</userinput>, and a three-disk
133
          instance can be specified as <userinput>--disk 0:size=20G
134
            --disk 1:size=4G --disk 2:size=100G</userinput>.
135
        </para>
136

    
137
        <para>
138
          The NICs of the instances can be specified via the
139
          <option>--nic</option> option. By default, one NIC is
140
          created for the instance, with a random MAC, and connected
141
          to the default bridge. Each NIC can take up to three
142
          parameters (all optional):
143
          <variablelist>
144
            <varlistentry>
145
              <term>mac</term>
146
              <listitem>
147
                <simpara>either a value or <constant>GENERATE</constant>
148
                  to generate a new unique MAC</simpara>
149
              </listitem>
150
            </varlistentry>
151
            <varlistentry>
152
              <term>ip</term>
153
              <listitem>
154
                <simpara>specifies the IP address assigned to the
155
                  instance from the Ganeti side (this is not necessarily
156
                  what the instance will use, but what the node expects
157
                  the instance to use)</simpara>
158
              </listitem>
159
            </varlistentry>
160
            <varlistentry>
161
              <term>bridge</term>
162
              <listitem>
163
                <simpara>specifies the bridge to attach this NIC
164
                  to</simpara>
165
              </listitem>
166
            </varlistentry>
167
          </variablelist>
168
        </para>
169

    
170
        <para>
171
          Alternatively, if no network is desired for the instance, you
172
          can prevent the default of one NIC with the
173
          <option>--no-nics</option> option.
174
        </para>
175

    
176
        <para>
177
          The <option>-o</option> options specifies the operating
178
          system to be installed. The available operating systems can
179
          be listed with <command>gnt-os list</command>.
180
        </para>
181

    
182
        <para>
183
          The <option>-B</option> option specifies the backend
184
          parameters for the instance. If no such parameters are
185
          specified, the values are inherited from the cluster. Possible
186
          parameters are:
187
          <variablelist>
188
            <varlistentry>
189
              <term>memory</term>
190
              <listitem>
191
                <simpara>the memory size of the instance; as usual,
192
                  suffixes can be used to denote the unit, otherwise the
193
                  value is taken in mebibites</simpara>
194
              </listitem>
195
            </varlistentry>
196
            <varlistentry>
197
              <term>vcpus</term>
198
              <listitem>
199
                <simpara>the number of VCPUs to assign to the instance
200
                  (if this value makes sense for the hypervisor)</simpara>
201
              </listitem>
202
            </varlistentry>
203
            <varlistentry>
204
              <term>auto_balance</term>
205
              <listitem>
206
                <simpara>whether the instance is considered in the N+1
207
                  cluster checks (enough redundancy in the cluster to
208
                  survive a node failure)</simpara>
209
              </listitem>
210
            </varlistentry>
211
          </variablelist>
212
        </para>
213

    
214
        <para>
215
          The <option>-H</option> option specified the hypervisor to
216
          use for the instance (must be one of the enabled hypervisors
217
          on the cluster) and optionally custom parameters for this
218
          instance. If not other options are used (i.e. the invocation
219
          is just <userinput>-H
220
          <replaceable>NAME</replaceable></userinput>) the instance
221
          will inherit the cluster options. The defaults below show
222
          the cluster defaults at cluster creation time.
223
        </para>
224

    
225
        <para>
226
          The possible hypervisor options are as follows:
227
          <variablelist>
228
            <varlistentry>
229
              <term>boot_order</term>
230
              <listitem>
231
                <simpara>Valid for the Xen HVM and KVM
232
                hypervisors.</simpara>
233

    
234
                <simpara>A string value denoting the boot order. This
235
                has different meaning for the Xen HVM hypervisor and
236
                for the KVM one.</simpara>
237

    
238
                <simpara>
239
                  For Xen HVM, The boot order is a string of letters
240
                  listing the boot devices, with valid device letters
241
                  being:
242
                </simpara>
243
                  <variablelist>
244
                    <varlistentry>
245
                      <term>a</term>
246
                      <listitem>
247
                        <para>
248
                          floppy drive
249
                        </para>
250
                      </listitem>
251
                    </varlistentry>
252
                    <varlistentry>
253
                      <term>c</term>
254
                      <listitem>
255
                        <para>
256
                          hard disk
257
                        </para>
258
                      </listitem>
259
                    </varlistentry>
260
                    <varlistentry>
261
                      <term>d</term>
262
                      <listitem>
263
                        <para>
264
                          CDROM drive
265
                        </para>
266
                      </listitem>
267
                    </varlistentry>
268
                    <varlistentry>
269
                      <term>n</term>
270
                      <listitem>
271
                        <para>
272
                          network boot (PXE)
273
                        </para>
274
                      </listitem>
275
                    </varlistentry>
276
                  </variablelist>
277
                <simpara>
278
                  The default is not to set an HVM boot order which is
279
                  interpreted as 'dc'.
280
                </simpara>
281

    
282
              </listitem>
283
            </varlistentry>
284
            <varlistentry>
285
              <term>cdrom_image_path</term>
286
              <listitem>
287
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
288

    
289
                <simpara>The path to a CDROM image to attach to the
290
                instance.</simpara>
291

    
292
              </listitem>
293
            </varlistentry>
294
            <varlistentry>
295
              <term>nic_type</term>
296
              <listitem>
297
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
298

    
299
                <para>
300
                  This parameter determines the way the network cards
301
                  are presented to the instance. The possible options are:
302
                  <simplelist>
303
                    <member>rtl8139 (default for Xen HVM) (HVM & KVM)</member>
304
                    <member>ne2k_isa (HVM & KVM)</member>
305
                    <member>ne2k_pci (HVM & KVM)</member>
306
                    <member>i82551 (KVM)</member>
307
                    <member>i82557b (KVM)</member>
308
                    <member>i82559er (KVM)</member>
309
                    <member>pcnet (KVM)</member>
310
                    <member>e1000 (KVM)</member>
311
                    <member>paravirtual (default for KVM) (HVM & KVM)</member>
312
                  </simplelist>
313
                </para>
314
              </listitem>
315
            </varlistentry>
316
            <varlistentry>
317
              <term>disk_type</term>
318
              <listitem>
319
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
320

    
321
                <para>
322
                  This parameter determines the way the disks are
323
                  presented to the instance. The possible options are:
324
                  <simplelist>
325
                    <member>ioemu (default for HVM & KVM) (HVM & KVM)</member>
326
                    <member>ide (HVM & KVM)</member>
327
                    <member>scsi (KVM)</member>
328
                    <member>sd (KVM)</member>
329
                    <member>mtd (KVM)</member>
330
                    <member>pflash (KVM)</member>
331
                  </simplelist>
332
                </para>
333
              </listitem>
334
            </varlistentry>
335
            <varlistentry>
336
              <term>vnc_bind_address</term>
337
              <listitem>
338
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
339

    
340
                <para>Specifies the address that the VNC listener for
341
                this instance should bind to. Valid values are IPv4
342
                addresses. Use the address 0.0.0.0 to bind to all
343
                available interfaces (this is the default) or specify
344
                the address of one of the interfaces on the node to
345
                restrict listening to that interface.</para>
346
              </listitem>
347
            </varlistentry>
348

    
349
            <varlistentry>
350
              <term>vnc_tls</term>
351
              <listitem>
352
                <simpara>Valid for the KVM hypervisor.</simpara>
353

    
354
                <simpara>A boolean option that controls whether the
355
                VNC connection is secured with TLS.</simpara>
356
              </listitem>
357
            </varlistentry>
358

    
359
            <varlistentry>
360
              <term>vnc_x509_path</term>
361
              <listitem>
362
                <simpara>Valid for the KVM hypervisor.</simpara>
363

    
364
                <para>If <option>vnc_tls</option> is enabled, this
365
                options specifies the path to the x509 certificate to
366
                use.</para>
367
              </listitem>
368
            </varlistentry>
369

    
370
            <varlistentry>
371
              <term>vnc_x509_verify</term>
372
              <listitem>
373
                <simpara>Valid for the KVM hypervisor.</simpara>
374
              </listitem>
375
            </varlistentry>
376

    
377
            <varlistentry>
378
              <term>acpi</term>
379
              <listitem>
380
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
381

    
382
                <para>
383
                  A boolean option that specifies if the hypervisor
384
                  should enable ACPI support for this instance. By
385
                  default, ACPI is disabled.
386
                </para>
387
              </listitem>
388
            </varlistentry>
389

    
390
            <varlistentry>
391
              <term>pae</term>
392
              <listitem>
393
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
394

    
395
                <para>
396
                  A boolean option that specifies if the hypervisor
397
                  should enabled PAE support for this instance. The
398
                  default is false, disabling PAE support.
399
                </para>
400
              </listitem>
401
            </varlistentry>
402

    
403
            <varlistentry>
404
              <term>kernel_path</term>
405
              <listitem>
406
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
407

    
408
                <para>
409
                  This option specifies the path (on the node) to the
410
                  kernel to boot the instance with. Xen PVM instances
411
                  always require this, while for KVM if this option is
412
                  empty, it will cause the machine to load the kernel
413
                  from its disks.
414
                </para>
415
              </listitem>
416
            </varlistentry>
417

    
418
            <varlistentry>
419
              <term>initrd_path</term>
420
              <listitem>
421
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
422

    
423
                <para>
424
                  This option specifies the path (on the node) to the
425
                  initrd to boot the instance with. Xen PVM instances
426
                  can use this always, while for KVM if this option is
427
                  only used if the <option>kernel_path</option> option
428
                  is also specified.
429
                </para>
430
              </listitem>
431
            </varlistentry>
432

    
433
            <varlistentry>
434
              <term>root_path</term>
435
              <listitem>
436
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
437

    
438
                <para>
439
                  This options specifies the name of the root
440
                  device. This is always needed for Xen PVM, while for
441
                  KVM it is only used if the
442
                  <option>kernel_path</option> option is also
443
                  specified.
444
                </para>
445
              </listitem>
446
            </varlistentry>
447

    
448
            <varlistentry>
449
              <term>serial_console</term>
450
              <listitem>
451
                <simpara>Valid for the KVM hypervisor.</simpara>
452

    
453
                <simpara>This boolean option specifies whether to
454
                emulate a serial console for the instance.</simpara>
455
              </listitem>
456
            </varlistentry>
457
          </variablelist>
458
        </para>
459

    
460
        <para>
461
        </para>
462

    
463
        <para>
464
          The <option>--iallocator</option> option specifies the instance
465
          allocator plugin to use. If you pass in this option the allocator
466
          will select nodes for this instance automatically, so you don't need
467
          to pass them with the <option>-n</option> option. For more
468
          information please refer to the instance allocator documentation.
469
        </para>
470

    
471
        <para>
472
          The <option>-t</option> options specifies the disk layout type for
473
          the instance. The available choices are:
474
          <variablelist>
475
            <varlistentry>
476
              <term>diskless</term>
477
              <listitem>
478
                <para>
479
                  This creates an instance with no disks. Its useful for
480
                  testing only (or other special cases).
481
                </para>
482
              </listitem>
483
            </varlistentry>
484
            <varlistentry>
485
              <term>file</term>
486
              <listitem>
487
                <para>Disk devices will be regular files.</para>
488
              </listitem>
489
            </varlistentry>
490
            <varlistentry>
491
              <term>plain</term>
492
              <listitem>
493
                <para>Disk devices will be logical volumes.</para>
494
              </listitem>
495
            </varlistentry>
496
            <varlistentry>
497
              <term>drbd</term>
498
              <listitem>
499
                <para>
500
                  Disk devices will be drbd (version 8.x) on top of
501
                  lvm volumes.
502
                </para>
503
              </listitem>
504
            </varlistentry>
505
          </variablelist>
506
        </para>
507

    
508
        <para>
509
          The optional second value of the <option>--node</option> is used for
510
          the drbd template type and specifies the remote node.
511
        </para>
512

    
513
        <para>
514
          If you do not want gnt-instance to wait for the disk mirror
515
          to be synced, use the <option>--no-wait-for-sync</option>
516
          option.
517
        </para>
518

    
519
        <para>
520
          The <option>--file-storage-dir</option> specifies the relative path
521
          under the cluster-wide file storage directory to store file-based
522
          disks. It is useful for having different subdirectories for
523
          different instances. The full path of the directory where the disk
524
          files are stored will consist of cluster-wide file storage directory
525
          + optional subdirectory + instance name. Example:
526
          /srv/ganeti/file-storage/mysubdir/instance1.example.com. This option
527
          is only relevant for instances using the file storage backend.
528
        </para>
529

    
530
        <para>
531
          The <option>--file-driver</option> specifies the driver to use for
532
          file-based disks. Note that currently these drivers work with the
533
          xen hypervisor only. This option is only relevant for instances using
534
          the file storage backend. The available choices are:
535
          <variablelist>
536
            <varlistentry>
537
              <term>loop</term>
538
              <listitem>
539
                <para>
540
                  Kernel loopback driver. This driver uses loopback
541
                  devices to access the filesystem within the
542
                  file. However, running I/O intensive applications in
543
                  your instance using the loop driver might result in
544
                  slowdowns.  Furthermore, if you use the loopback
545
                  driver consider increasing the maximum amount of
546
                  loopback devices (on most systems it's 8) using the
547
                  max_loop param.
548
                </para>
549
              </listitem>
550
            </varlistentry>
551
            <varlistentry>
552
              <term>blktap</term>
553
              <listitem>
554
                <para>The blktap driver (for Xen hypervisors). In
555
                order to be able to use the blktap driver you should
556
                check if the 'blktapctrl' user space disk agent is
557
                running (usually automatically started via xend). This
558
                user-level disk I/O interface has the advantage of
559
                better performance. Especially if you use a network
560
                file system (e.g. NFS) to store your instances this is
561
                the recommended choice.
562
                </para>
563
              </listitem>
564
            </varlistentry>
565
          </variablelist>
566
        </para>
567

    
568
        <para>
569
          The <option>--submit</option> option is used to send the job to
570
          the master daemon but not wait for its completion. The job
571
          ID will be shown so that it can be examined via
572
          <command>gnt-job info</command>.
573
        </para>
574

    
575
        <para>
576
          Example:
577
          <screen>
578
# gnt-instance add -t file --disk 0:size=30g -B memory=512 -o debian-etch \
579
  -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
580
# gnt-instance add -t plain --disk 0:size=30g -B memory=512 -o debian-etch \
581
  -n node1.example.com instance1.example.com
582
# gnt-instance add -t drbd --disk 0:size=30g -B memory=512 -o debian-etch \
583
  -n node1.example.com:node2.example.com instance2.example.com
584
          </screen>
585
        </para>
586
      </refsect3>
587

    
588
      <refsect3>
589
        <title>BATCH-CREATE</title>
590
        <cmdsynopsis>
591
          <command>batch-create</command>
592
          <arg choice="req">instances_file.json</arg>
593
        </cmdsynopsis>
594

    
595
        <para>
596
          This command (similar to the Ganeti 1.2
597
          <command>batcher</command> tool) submits multiple instance
598
          creation jobs based on a definition file. The instance
599
          configurations do not encompass all the possible options for
600
          the <command>add</command> command, but only a subset.
601
        </para>
602

    
603
        <para>
604
          The instance file should be a valid-formed JSON file,
605
          containing a dictionary with instance name and instance
606
          parameters. The accepted parameters are:
607

    
608
          <variablelist>
609
            <varlistentry>
610
              <term>disk_size</term>
611
              <listitem>
612
                <simpara>The size of the disks of the instance.</simpara>
613
              </listitem>
614
            </varlistentry>
615
            <varlistentry>
616
              <term>disk_templace</term>
617
              <listitem>
618
                <simpara>The disk template to use for the instance,
619
                the same as in the <command>add</command>
620
                command.</simpara>
621
              </listitem>
622
            </varlistentry>
623
            <varlistentry>
624
              <term>backend</term>
625
              <listitem>
626
                <simpara>A dictionary of backend parameters.</simpara>
627
              </listitem>
628
            </varlistentry>
629
            <varlistentry>
630
              <term>hypervisor</term>
631
              <listitem>
632
                <simpara>A dictionary with a single key (the
633
                hypervisor name), and as value the hypervisor
634
                options. If not passed, the default hypervisor and
635
                hypervisor options will be inherited.</simpara>
636
              </listitem>
637
            </varlistentry>
638
            <varlistentry>
639
              <term>mac, ip, bridge</term>
640
              <listitem>
641
                <simpara>Specifications for the one NIC that will be
642
                created for the instance.</simpara>
643
              </listitem>
644
            </varlistentry>
645
            <varlistentry>
646
              <term>primary_node, secondary_node</term>
647
              <listitem>
648
                <simpara>The primary and optionally the secondary node
649
                to use for the instance (in case an iallocator script
650
                is not used).</simpara>
651
              </listitem>
652
            </varlistentry>
653
            <varlistentry>
654
              <term>iallocator</term>
655
              <listitem>
656
                <simpara>Instead of specifying the nodes, an
657
                iallocator script can be used to automatically compute
658
                them.</simpara>
659
              </listitem>
660
            </varlistentry>
661
            <varlistentry>
662
              <term>start</term>
663
              <listitem>
664
                <simpara>whether to start the instance</simpara>
665
              </listitem>
666
            </varlistentry>
667
            <varlistentry>
668
              <term>ip_check</term>
669
              <listitem>
670
                <simpara>Skip the check for already-in-use instance;
671
                see the description in the <command>add</command>
672
                command for details.</simpara>
673
              </listitem>
674
            </varlistentry>
675
            <varlistentry>
676
              <term>file_storage_dir, file_driver</term>
677
              <listitem>
678
                <simpara>Configuration for the <literal>file</literal>
679
                disk type, see the <command>add</command> command for
680
                details.</simpara>
681
              </listitem>
682
            </varlistentry>
683
          </variablelist>
684
        </para>
685

    
686
        <para>
687
          A simple definition for one instance can be (with most of
688
          the parameters taken from the cluster defaults):
689
          <screen>
690
{
691
  "instance3": {
692
    "template": "drbd",
693
    "os": "debootstrap",
694
    "disk_size": ["25G"],
695
    "iallocator": "dumb"
696
  },
697
  "instance5": {
698
    "template": "drbd",
699
    "os": "debootstrap",
700
    "disk_size": ["25G"],
701
    "iallocator": "dumb",
702
    "hypervisor": "xen-hvm",
703
    "hvparams": {"acpi": true},
704
    "backend": {"memory": 512}
705
  }
706
}
707
</screen>
708
        </para>
709

    
710
        <para>
711
          The command will display the job id for each submitted instance, as follows:
712
          <screen>
713
# gnt-instance batch-create instances.json
714
instance3: 11224
715
instance5: 11225
716
</screen>
717
        </para>
718

    
719
      </refsect3>
720

    
721
      <refsect3>
722
        <title>REMOVE</title>
723

    
724
        <cmdsynopsis>
725
          <command>remove</command>
726
          <arg>--ignore-failures</arg>
727
          <arg>--submit</arg>
728
          <arg choice="req"><replaceable>instance</replaceable></arg>
729
        </cmdsynopsis>
730

    
731
        <para>
732
          Remove an instance. This will remove all data from the
733
          instance and there is <emphasis>no way back</emphasis>. If
734
          you are not sure if you use an instance again, use
735
          <command>shutdown</command> first and leave it in the
736
          shutdown state for a while.
737

    
738
        </para>
739

    
740
        <para>
741
          The <option>--ignore-failures</option> option will cause the
742
          removal to proceed even in the presence of errors during the
743
          removal of the instance (e.g. during the shutdown or the
744
          disk removal). If this option is not given, the command will
745
          stop at the first error.
746
        </para>
747

    
748
        <para>
749
          The <option>--submit</option> option is used to send the job to
750
          the master daemon but not wait for its completion. The job
751
          ID will be shown so that it can be examined via
752
          <command>gnt-job info</command>.
753
        </para>
754

    
755
        <para>
756
          Example:
757
          <screen>
758
# gnt-instance remove instance1.example.com
759
          </screen>
760
        </para>
761
      </refsect3>
762

    
763
      <refsect3>
764
        <title>LIST</title>
765

    
766
        <cmdsynopsis>
767
          <command>list</command>
768
          <arg>--no-headers</arg>
769
          <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
770
          <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
771
          <arg rep="repeat">instance</arg>
772
        </cmdsynopsis>
773

    
774
        <para>
775
          Shows the currently configured instances with memory usage,
776
          disk usage, the node they are running on, and their run
777
          status.
778
        </para>
779

    
780
        <para>
781
          The <option>--no-headers</option> option will skip the
782
          initial header line. The <option>--separator</option> option
783
          takes an argument which denotes what will be used between
784
          the output fields. Both these options are to help scripting.
785
        </para>
786

    
787
        <para>
788
          The <option>-o</option> option takes a comma-separated list
789
          of output fields. The available fields and their meaning
790
          are:
791
          <variablelist>
792
            <varlistentry>
793
              <term>name</term>
794
              <listitem>
795
                <simpara>the instance name</simpara>
796
              </listitem>
797
            </varlistentry>
798
            <varlistentry>
799
              <term>os</term>
800
              <listitem>
801
                <simpara>the OS of the instance</simpara>
802
              </listitem>
803
            </varlistentry>
804
            <varlistentry>
805
              <term>pnode</term>
806
              <listitem>
807
                <simpara>the primary node of the instance</simpara>
808
              </listitem>
809
            </varlistentry>
810
            <varlistentry>
811
              <term>snodes</term>
812
              <listitem>
813
                <simpara>comma-separated list of secondary nodes for the
814
                  instance; usually this will be just one node</simpara>
815
              </listitem>
816
            </varlistentry>
817
            <varlistentry>
818
              <term>admin_state</term>
819
              <listitem>
820
                <simpara>the desired state of the instance (either "yes"
821
                  or "no" denoting the instance should run or
822
                  not)</simpara>
823
              </listitem>
824
            </varlistentry>
825
            <varlistentry>
826
              <term>disk_template</term>
827
              <listitem>
828
                <simpara>the disk template of the instance</simpara>
829
              </listitem>
830
            </varlistentry>
831
            <varlistentry>
832
              <term>oper_state</term>
833
              <listitem>
834
                <simpara>the actual state of the instance; can be
835
                one of the values "running", "stopped", "(node
836
                down)"</simpara>
837
              </listitem>
838
            </varlistentry>
839
            <varlistentry>
840
              <term>status</term>
841
              <listitem>
842
                <simpara>combined form of admin_state and oper_stat;
843
                this can be one of:
844
                <computeroutput>ERROR_nodedown</computeroutput> if the
845
                node of the instance is down,
846
                <computeroutput>ERROR_down</computeroutput> if the
847
                instance should run but is down,
848
                <computeroutput>ERROR_up</computeroutput> if the
849
                instance should be stopped but is actually running,
850
                <computeroutput>ADMIN_down</computeroutput> if the
851
                instance has been stopped (and is stopped) and
852
                <computeroutput>running</computeroutput> if the
853
                instance is set to be running (and is
854
                running)</simpara>
855
              </listitem>
856
            </varlistentry>
857
            <varlistentry>
858
              <term>oper_ram</term>
859
              <listitem>
860
                <simpara>the actual memory usage of the instance as seen
861
                  by the hypervisor</simpara>
862
              </listitem>
863
            </varlistentry>
864
            <varlistentry>
865
              <term>ip</term>
866
              <listitem>
867
                <simpara>the ip address ganeti recognizes as associated with
868
                the first instance interface</simpara>
869
              </listitem>
870
            </varlistentry>
871
            <varlistentry>
872
              <term>mac</term>
873
              <listitem>
874
                <simpara>the first instance interface MAC address</simpara>
875
              </listitem>
876
            </varlistentry>
877
            <varlistentry>
878
              <term>bridge</term>
879
              <listitem>
880
                <simpara>the bridge of the first instance NIC
881
                </simpara>
882
              </listitem>
883
            </varlistentry>
884
            <varlistentry>
885
              <term>sda_size</term>
886
              <listitem>
887
                <simpara>the size of the instance's first disk</simpara>
888
              </listitem>
889
            </varlistentry>
890
            <varlistentry>
891
              <term>sdb_size</term>
892
              <listitem>
893
                <simpara>the size of the instance's second disk, if
894
                any</simpara>
895
              </listitem>
896
            </varlistentry>
897
            <varlistentry>
898
              <term>vcpus</term>
899
              <listitem>
900
                <simpara>the number of VCPUs allocated to the
901
                instance</simpara>
902
              </listitem>
903
            </varlistentry>
904
            <varlistentry>
905
              <term>tags</term>
906
              <listitem>
907
                <simpara>comma-separated list of the instances's
908
                tags</simpara>
909
              </listitem>
910
            </varlistentry>
911
            <varlistentry>
912
              <term>serial_no</term>
913
              <listitem>
914
                <simpara>the so called 'serial number' of the
915
                instance; this is a numeric field that is incremented
916
                each time the instance is modified, and it can be used
917
                to track modifications</simpara>
918
              </listitem>
919
            </varlistentry>
920
            <varlistentry>
921
              <term>network_port</term>
922
              <listitem>
923
                <simpara>If the instance has a network port assigned
924
                to it (e.g. for VNC connections), this will be shown,
925
                otherwise <literal>-</literal> will be
926
                displayed.</simpara>
927
              </listitem>
928
            </varlistentry>
929
            <varlistentry>
930
              <term>beparams</term>
931
              <listitem>
932
                <simpara>A text format of the entire beparams for the
933
                instance. It's more useful to select individual fields
934
                from this dictionary, see below.</simpara>
935
              </listitem>
936
            </varlistentry>
937
            <varlistentry>
938
              <term>disk.count</term>
939
              <listitem>
940
                <simpara>The number of instance disks.</simpara>
941
              </listitem>
942
            </varlistentry>
943
            <varlistentry>
944
              <term>disk.size/N</term>
945
              <listitem>
946
                <simpara>The size of the instance's Nth disk. This is
947
                a more generic form of the <literal>sda_size</literal>
948
                and <literal>sdb_size</literal> fields.</simpara>
949
              </listitem>
950
            </varlistentry>
951
            <varlistentry>
952
              <term>disk.sizes</term>
953
              <listitem>
954
                <simpara>A comma-separated list of the disk sizes for
955
                this instance.</simpara>
956
              </listitem>
957
            </varlistentry>
958
            <varlistentry>
959
              <term>disk_usage</term>
960
              <listitem>
961
                <simpara>The total disk space used by this instance on
962
                each of its nodes. This is not the instance-visible
963
                disk size, but the actual disk "cost" of the
964
                instance.</simpara>
965
              </listitem>
966
            </varlistentry>
967
            <varlistentry>
968
              <term>nic.mac/N</term>
969
              <listitem>
970
                <simpara>The MAC of the Nth instance NIC.</simpara>
971
              </listitem>
972
            </varlistentry>
973
            <varlistentry>
974
              <term>nic.ip/N</term>
975
              <listitem>
976
                <simpara>The IP address of the Nth instance NIC.</simpara>
977
              </listitem>
978
            </varlistentry>
979
            <varlistentry>
980
              <term>nic.bridge/N</term>
981
              <listitem>
982
                <simpara>The bridge the Nth instance NIC is attached
983
                to.</simpara>
984
              </listitem>
985
            </varlistentry>
986
            <varlistentry>
987
              <term>nic.macs</term>
988
              <listitem>
989
                <simpara>A comma-separated list of all the MACs of the
990
                instance's NICs.</simpara>
991
              </listitem>
992
            </varlistentry>
993
            <varlistentry>
994
              <term>nic.ips</term>
995
              <listitem>
996
                <simpara>A comma-separated list of all the IP
997
                addresses of the instance's NICs.</simpara>
998
              </listitem>
999
            </varlistentry>
1000
            <varlistentry>
1001
              <term>nic.bridges</term>
1002
              <listitem>
1003
                <simpara>A comma-separated list of all the bridges of the
1004
                instance's NICs.</simpara>
1005
              </listitem>
1006
            </varlistentry>
1007
            <varlistentry>
1008
              <term>nic.count</term>
1009
              <listitem>
1010
                <simpara>The number of instance nics.</simpara>
1011
              </listitem>
1012
            </varlistentry>
1013
            <varlistentry>
1014
              <term>hv/<replaceable>NAME</replaceable></term>
1015
              <listitem>
1016
                <simpara>The value of the hypervisor parameter called
1017
                <replaceable>NAME</replaceable>. For details of what
1018
                hypervisor parameters exist and their meaning, see the
1019
                <command>add</command> command.</simpara>
1020
              </listitem>
1021
            </varlistentry>
1022
            <varlistentry>
1023
              <term>be/memory</term>
1024
              <listitem>
1025
                <simpara>The configured memory for the instance.</simpara>
1026
              </listitem>
1027
            </varlistentry>
1028
            <varlistentry>
1029
              <term>be/vcpus</term>
1030
              <listitem>
1031
                <simpara>The configured number of VCPUs for the
1032
                instance.</simpara>
1033
              </listitem>
1034
            </varlistentry>
1035
            <varlistentry>
1036
              <term>be/auto_balance</term>
1037
              <listitem>
1038
                <simpara>Whether the instance is considered in N+1
1039
                checks.</simpara>
1040
              </listitem>
1041
            </varlistentry>
1042
          </variablelist>
1043
        </para>
1044

    
1045
        <para>
1046
          If the value of the option starts with the character
1047
          <constant>+</constant>, the new field(s) will be added to the
1048
          default list. This allows to quickly see the default list
1049
          plus a few other fields, instead of retyping the entire list
1050
          of fields.
1051
        </para>
1052

    
1053
        <para>
1054
          There is a subtle grouping about the available output
1055
          fields: all fields except for <option>oper_state</option>,
1056
          <option>oper_ram</option> and <option>status</option> are
1057
          configuration value and not run-time values. So if you don't
1058
          select any of the these fields, the query will be satisfied
1059
          instantly from the cluster configuration, without having to
1060
          ask the remote nodes for the data. This can be helpful for
1061
          big clusters when you only want some data and it makes sense
1062
          to specify a reduced set of output fields.
1063
        </para>
1064

    
1065
        <para>The default output field list is:
1066
          <simplelist type="inline">
1067
            <member>name</member>
1068
            <member>os</member>
1069
            <member>pnode</member>
1070
            <member>admin_state</member>
1071
            <member>oper_state</member>
1072
            <member>oper_ram</member>
1073
          </simplelist>.
1074
        </para>
1075
      </refsect3>
1076

    
1077
      <refsect3>
1078
        <title>INFO</title>
1079

    
1080
        <cmdsynopsis>
1081
          <command>info</command>
1082
          <group>
1083
            <arg>-s</arg>
1084
            <arg>--static</arg>
1085
          </group>
1086
          <arg rep="repeat"><replaceable>instance</replaceable></arg>
1087
        </cmdsynopsis>
1088

    
1089
        <para>
1090
          Show detailed information about the (given) instances. This
1091
          is different from <command>list</command> as it shows
1092
          detailed data about the instance's disks (especially useful
1093
          for drbd disk template).
1094
        </para>
1095

    
1096
        <para>
1097
          If the option <option>-s</option> is used, only information
1098
          available in the configuration file is returned, without
1099
          querying nodes, making the operation faster.
1100
        </para>
1101
      </refsect3>
1102

    
1103
      <refsect3>
1104
        <title>MODIFY</title>
1105

    
1106
        <cmdsynopsis>
1107
          <command>modify</command>
1108
          <sbr>
1109
          <arg choice="opt">-H <replaceable>HYPERVISOR_PARAMETERS</replaceable></arg>
1110
          <sbr>
1111
          <arg choice="opt">-B <replaceable>BACKEND_PARAMETERS</replaceable></arg>
1112
          <sbr>
1113
          <group>
1114
            <arg>--net add<replaceable><optional>:options</optional></replaceable></arg>
1115
            <arg>--net remove</arg>
1116
            <arg>--net <replaceable>N:options</replaceable></arg>
1117
          </group>
1118
          <sbr>
1119
          <group>
1120
            <arg>--disk add:size=<replaceable>SIZE</replaceable></arg>
1121
            <arg>--disk remove</arg>
1122
            <arg>--disk <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></arg>
1123
          </group>
1124

    
1125
          <sbr>
1126
          <arg>--submit</arg>
1127
          <sbr>
1128
          <arg choice="req"><replaceable>instance</replaceable></arg>
1129
        </cmdsynopsis>
1130

    
1131
        <para>
1132
          Modifies the memory size, number of vcpus, ip address, MAC
1133
          address and/or bridge for an instance. It can also add and
1134
          remove disks and NICs to/from the instance. Note that you
1135
          need to give at least one of the arguments, otherwise the
1136
          command complains.
1137
        </para>
1138

    
1139
        <para>
1140
          The <option>-H</option> option specifies hypervisor options
1141
          in the form of <userinput>name=value[,...]</userinput>. For details which options can be specified, see the <command>add</command> command.
1142
        </para>
1143

    
1144
        <para>
1145
          The <option>--disk
1146
          add:size=<replaceable>SIZE</replaceable></option> option
1147
          adds a disk to the instance. The <option>--disk
1148
          remove</option> will remove the last disk of the
1149
          instance. The <option>--disk
1150
          <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></option>
1151
          option will change the mode of the Nth disk of the instance
1152
          between read-only (<literal>ro</literal>) and read-write
1153
          (<literal>rw</literal>).
1154
        </para>
1155

    
1156
        <para>
1157
          The <option>--nic
1158
          add:<replaceable>options</replaceable></option> option will
1159
          add a new NIC to the instance. The available options are the
1160
          same as in the <command>add</command> command (mac, ip,
1161
          bridge). The <option>--nice remove</option> will remove the
1162
          last NIC of the instance, while the <option>--nic
1163
          <replaceable>N</replaceable>:<replaceable>options</replaceable></option>
1164
          option will change the parameters of the Nth instance NIC.
1165
        </para>
1166

    
1167
        <para>
1168
          The <option>--submit</option> option is used to send the job to
1169
          the master daemon but not wait for its completion. The job
1170
          ID will be shown so that it can be examined via
1171
          <command>gnt-job info</command>.
1172
        </para>
1173

    
1174
        <para>
1175
          All the changes take effect at the next restart. If the
1176
          instance is running, there is no effect on the instance.
1177
        </para>
1178
      </refsect3>
1179

    
1180
      <refsect3>
1181
        <title>REINSTALL</title>
1182

    
1183
        <cmdsynopsis>
1184
          <command>reinstall</command>
1185
          <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
1186
          <arg choice="opt">-f <replaceable>force</replaceable></arg>
1187
          <arg>--select-os</arg>
1188
          <arg>--submit</arg>
1189
          <arg choice="req"><replaceable>instance</replaceable></arg>
1190
        </cmdsynopsis>
1191

    
1192
        <para>
1193
          Reinstalls the operating system on the given instance. The instance
1194
          must be stopped when running this command. If the
1195
          <option>--os-type</option> is specified, the operating system is
1196
          changed.
1197
        </para>
1198

    
1199
        <para>
1200
          The <option>--select-os</option> option switches to an
1201
          interactive OS reinstall. The user is prompted to select the OS
1202
          template from the list of available OS templates.
1203
        </para>
1204

    
1205
        <para>
1206
          The <option>--submit</option> option is used to send the job to
1207
          the master daemon but not wait for its completion. The job
1208
          ID will be shown so that it can be examined via
1209
          <command>gnt-job info</command>.
1210
        </para>
1211

    
1212

    
1213
      </refsect3>
1214

    
1215
      <refsect3>
1216
        <title>RENAME</title>
1217

    
1218
        <cmdsynopsis>
1219
          <command>rename</command>
1220
          <arg>--no-ip-check</arg>
1221
          <arg>--submit</arg>
1222
          <arg choice="req"><replaceable>instance</replaceable></arg>
1223
          <arg choice="req"><replaceable>new_name</replaceable></arg>
1224
        </cmdsynopsis>
1225

    
1226
        <para>
1227
          Renames the given instance. The instance must be stopped
1228
          when running this command. The requirements for the new name
1229
          are the same as for adding an instance: the new name must be
1230
          resolvable and the IP it resolves to must not be reachable
1231
          (in order to prevent duplicate IPs the next time the
1232
          instance is started). The IP test can be skipped if the
1233
          <option>--no-ip-check</option> option is passed.
1234
        </para>
1235

    
1236
        <para>
1237
          The <option>--submit</option> option is used to send the job to
1238
          the master daemon but not wait for its completion. The job
1239
          ID will be shown so that it can be examined via
1240
          <command>gnt-job info</command>.
1241
        </para>
1242

    
1243
      </refsect3>
1244

    
1245
    </refsect2>
1246

    
1247
    <refsect2>
1248
      <title>Starting/stopping/connecting to console</title>
1249

    
1250
      <refsect3>
1251
        <title>STARTUP</title>
1252

    
1253
        <cmdsynopsis>
1254
          <command>startup</command>
1255
          <sbr>
1256
          <arg>--extra=<replaceable>PARAMS</replaceable></arg>
1257
          <arg>--force</arg>
1258
          <sbr>
1259
          <arg>--force-multiple</arg>
1260
          <sbr>
1261
          <group choice="opt">
1262
            <arg>--instance</arg>
1263
            <arg>--node</arg>
1264
            <arg>--primary</arg>
1265
            <arg>--secondary</arg>
1266
            <arg>--all</arg>
1267
          </group>
1268
          <sbr>
1269
          <arg>--submit</arg>
1270
          <sbr>
1271
          <arg choice="opt"
1272
          rep="repeat"><replaceable>name</replaceable></arg>
1273
        </cmdsynopsis>
1274

    
1275
        <para>
1276
          Starts one or more instances, depending on the following
1277
          options. The four available modes are:
1278
          <variablelist>
1279
            <varlistentry>
1280
              <term><option>--instance</option></term>
1281
              <listitem>
1282
                <simpara>will start the instances given as arguments
1283
                (at least one argument required); this is the default
1284
                selection</simpara>
1285
              </listitem>
1286
            </varlistentry>
1287
            <varlistentry>
1288
              <term>--node</term>
1289
              <listitem>
1290
                <simpara>will start the instances who have the given
1291
                node as either primary or secondary</simpara>
1292
              </listitem>
1293
            </varlistentry>
1294
            <varlistentry>
1295
              <term><option>--primary</option></term>
1296
              <listitem>
1297
                <simpara>will start all instances whose primary node
1298
                is in the list of nodes passed as arguments (at least
1299
                one node required)</simpara>
1300
              </listitem>
1301
            </varlistentry>
1302
            <varlistentry>
1303
              <term><option>--secondary</option></term>
1304
              <listitem>
1305
                <simpara>will start all instances whose secondary node
1306
                is in the list of nodes passed as arguments (at least
1307
                one node required)</simpara>
1308
              </listitem>
1309
            </varlistentry>
1310
            <varlistentry>
1311
              <term>--all</term>
1312
              <listitem>
1313
                <simpara>will start all instances in the cluster (no
1314
                arguments accepted)</simpara>
1315
              </listitem>
1316
            </varlistentry>
1317
          </variablelist>
1318
        </para>
1319

    
1320
        <para>
1321
          Note that although you can pass more than one selection
1322
          option, the last one wins, so in order to guarantee the
1323
          desired result, don't pass more than one such option.
1324
        </para>
1325

    
1326
        <para>
1327
          The <option>--extra</option> option is used to pass
1328
          additional argument to the instance's kernel for this start
1329
          only. Currently there is no way to specify a persistent set
1330
          of arguments (beside the one hardcoded). Note that this may
1331
          not apply to all virtualization types.
1332
        </para>
1333

    
1334
        <para>
1335
          Use <option>--force</option> to start even if secondary disks are
1336
          failing.
1337
        </para>
1338

    
1339
        <para>
1340
          The <option>--force-multiple</option> will skip the
1341
          interactive confirmation in the case the more than one
1342
          instance will be affected.
1343
        </para>
1344

    
1345
        <para>
1346
          The <option>--submit</option> option is used to send the job to
1347
          the master daemon but not wait for its completion. The job
1348
          ID will be shown so that it can be examined via
1349
          <command>gnt-job info</command>.
1350
        </para>
1351

    
1352
        <para>
1353
          Example:
1354
          <screen>
1355
# gnt-instance start instance1.example.com
1356
# gnt-instance start --extra single test1.example.com
1357
# gnt-instance start --node node1.example.com node2.example.com
1358
# gnt-instance start --all
1359
          </screen>
1360
        </para>
1361
      </refsect3>
1362

    
1363
      <refsect3>
1364
        <title>SHUTDOWN</title>
1365

    
1366
        <cmdsynopsis>
1367
          <command>shutdown</command>
1368
          <sbr>
1369
          <arg>--force-multiple</arg>
1370
          <sbr>
1371
          <group choice="opt">
1372
            <arg>--instance</arg>
1373
            <arg>--node</arg>
1374
            <arg>--primary</arg>
1375
            <arg>--secondary</arg>
1376
            <arg>--all</arg>
1377
          </group>
1378
          <sbr>
1379
          <arg>--submit</arg>
1380
          <sbr>
1381
          <arg choice="opt"
1382
          rep="repeat"><replaceable>name</replaceable></arg>
1383
        </cmdsynopsis>
1384

    
1385
        <para>
1386
          Stops one or more instances. If the instance cannot be
1387
          cleanly stopped during a hardcoded interval (currently 2
1388
          minutes), it will forcibly stop the instance (equivalent to
1389
          switching off the power on a physical machine).
1390
        </para>
1391

    
1392
        <para>
1393
          The <option>--instance</option>, <option>--node</option>,
1394
          <option>--primary</option>, <option>--secondary</option> and
1395
          <option>--all</option> options are similar as for the
1396
          <command>startup</command> command and they influence the
1397
          actual instances being shutdown.
1398
        </para>
1399

    
1400
        <para>
1401
          The <option>--submit</option> option is used to send the job to
1402
          the master daemon but not wait for its completion. The job
1403
          ID will be shown so that it can be examined via
1404
          <command>gnt-job info</command>.
1405
        </para>
1406

    
1407

    
1408
        <para>
1409
          Example:
1410
          <screen>
1411
# gnt-instance shutdown instance1.example.com
1412
# gnt-instance shutdown --all
1413
          </screen>
1414
        </para>
1415
      </refsect3>
1416

    
1417
      <refsect3>
1418
        <title>REBOOT</title>
1419

    
1420
        <cmdsynopsis>
1421
          <command>reboot</command>
1422
          <sbr>
1423
          <arg>--extra=<replaceable>PARAMS</replaceable></arg>
1424
          <sbr>
1425
          <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
1426
          <sbr>
1427
          <arg>--ignore-secondaries</arg>
1428
          <sbr>
1429
          <arg>--force-multiple</arg>
1430
          <sbr>
1431
          <group choice="opt">
1432
            <arg>--instance</arg>
1433
            <arg>--node</arg>
1434
            <arg>--primary</arg>
1435
            <arg>--secondary</arg>
1436
            <arg>--all</arg>
1437
          </group>
1438
          <sbr>
1439
          <arg>--submit</arg>
1440
          <sbr>
1441
          <arg choice="opt"
1442
          rep="repeat"><replaceable>name</replaceable></arg>
1443
        </cmdsynopsis>
1444

    
1445
        <para>
1446
          Reboots one or more instances. The type of reboot depends on
1447
          the value of <option>--type</option>. A soft reboot does a
1448
          hypervisor reboot, a hard reboot does a instance stop,
1449
          recreates the hypervisor config for the instance and
1450
          starts the instance. A full reboot does the equivalent
1451
          of <command>gnt-instance shutdown &amp;&amp; gnt-instance
1452
          startup</command>. The default is hard reboot.
1453
        </para>
1454

    
1455
        <para>
1456
          For the hard reboot the option
1457
          <option>--ignore-secondaries</option> ignores errors for the
1458
          secondary node while re-assembling the instance disks.
1459
        </para>
1460

    
1461
        <para>
1462
          The <option>--instance</option>, <option>--node</option>,
1463
          <option>--primary</option>, <option>--secondary</option> and
1464
          <option>--all</option> options are similar as for the
1465
          <command>startup</command> command and they influence the
1466
          actual instances being rebooted.
1467
        </para>
1468

    
1469
        <para>
1470
          The <option>--force-multiple</option> will skip the
1471
          interactive confirmation in the case the more than one
1472
          instance will be affected.
1473
        </para>
1474

    
1475
        <para>
1476
          Example:
1477
          <screen>
1478
# gnt-instance reboot instance1.example.com
1479
# gnt-instance reboot --type=full instance1.example.com
1480
          </screen>
1481
        </para>
1482
      </refsect3>
1483

    
1484
      <refsect3>
1485
        <title>CONSOLE</title>
1486
        <cmdsynopsis>
1487
          <command>console</command>
1488
          <arg choice="opt">--show-cmd</arg>
1489
          <arg choice="req"><replaceable>instance</replaceable></arg>
1490
        </cmdsynopsis>
1491

    
1492
        <para>
1493
          Connects to the console of the given instance. If the
1494
          instance is not up, an error is returned. Use the
1495
          <option>--show-cmd</option> option to display the command
1496
          instead of executing it.
1497
        </para>
1498

    
1499
        <para>
1500
          For HVM instances, this will attempt to connect to the
1501
          serial console of the instance. To connect to the
1502
          virtualized "physical" console of a HVM instance, use a VNC
1503
          client with the connection info from the
1504
          <command>info</command> command.
1505
        </para>
1506

    
1507
        <para>
1508
          Example:
1509
          <screen>
1510
# gnt-instance console instance1.example.com
1511
          </screen>
1512
        </para>
1513
      </refsect3>
1514

    
1515
    </refsect2>
1516

    
1517
    <refsect2>
1518
      <title>Disk management</title>
1519

    
1520
      <refsect3>
1521
        <title>REPLACE-DISKS</title>
1522

    
1523
        <cmdsynopsis>
1524
          <command>replace-disks</command>
1525
          <arg>--submit</arg>
1526
          <arg choice="req">-p</arg>
1527
          <arg choice="req"><replaceable>instance</replaceable></arg>
1528
        </cmdsynopsis>
1529

    
1530
        <cmdsynopsis>
1531
          <command>replace-disks</command>
1532
          <arg>--submit</arg>
1533
          <arg choice="req">-s</arg>
1534
          <arg choice="req"><replaceable>instance</replaceable></arg>
1535
        </cmdsynopsis>
1536

    
1537
        <cmdsynopsis>
1538
          <command>replace-disks</command>
1539
          <arg>--submit</arg>
1540
          <group choice="req">
1541
            <arg>--iallocator <replaceable>name</replaceable></arg>
1542
            <arg>--new-secondary <replaceable>NODE</replaceable></arg>
1543
          </group>
1544

    
1545
          <arg choice="req"><replaceable>instance</replaceable></arg>
1546
        </cmdsynopsis>
1547

    
1548
        <para>
1549
          This command is a generalized form for adding and replacing
1550
          disks. It is currently only valid for the mirrored (DRBD)
1551
          disk template.
1552
        </para>
1553

    
1554
        <para>
1555
          The first form (when passing the <option>-p</option> option)
1556
          will replace the disks on the primary, while the second form
1557
          (when passing the <option>-s</option> option will replace
1558
          the disks on the secondary node.
1559
        </para>
1560

    
1561
        <para>
1562
          The third form (when passing either the
1563
          <option>--iallocator</option> or the
1564
          <option>--new-secondary</option> option) is designed to
1565
          change secondary node of the instance.  Specifying
1566
          <option>--iallocator</option> makes the new secondary be
1567
          selected automatically by the specified allocator plugin,
1568
          otherwise the new secondary node will be the one chosen
1569
          manually via the <option>--new-secondary</option> option.
1570
        </para>
1571

    
1572
        <para>
1573
          The <option>--submit</option> option is used to send the job to
1574
          the master daemon but not wait for its completion. The job
1575
          ID will be shown so that it can be examined via
1576
          <command>gnt-job info</command>.
1577
        </para>
1578

    
1579
        <para>
1580
          Note that it is not possible to select an offline or drained
1581
          node as a new secondary.
1582
        </para>
1583

    
1584
      </refsect3>
1585

    
1586
      <refsect3>
1587
        <title>ACTIVATE-DISKS</title>
1588

    
1589
        <cmdsynopsis>
1590
          <command>activate-disks</command>
1591
          <arg>--submit</arg>
1592
          <arg choice="req"><replaceable>instance</replaceable></arg>
1593
        </cmdsynopsis>
1594
        <para>
1595
          Activates the block devices of the given instance. If
1596
          successful, the command will show the location and name of
1597
          the block devices:
1598
          <screen>
1599
node1.example.com:disk/0:/dev/drbd0
1600
node1.example.com:disk/1:/dev/drbd1
1601
          </screen>
1602

    
1603
          In this example, <emphasis>node1.example.com</emphasis> is
1604
          the name of the node on which the devices have been
1605
          activated. The <emphasis>disk/0</emphasis> and
1606
          <emphasis>disk/1</emphasis> are the Ganeti-names of the
1607
          instance disks; how they are visible inside the instance is
1608
          hypervisor-specific. <emphasis>/dev/drbd0</emphasis> and
1609
          <emphasis>/dev/drbd1</emphasis> are the actual block devices
1610
          as visible on the node.
1611
        </para>
1612

    
1613
        <para>
1614
          The <option>--submit</option> option is used to send the job to
1615
          the master daemon but not wait for its completion. The job
1616
          ID will be shown so that it can be examined via
1617
          <command>gnt-job info</command>.
1618
        </para>
1619

    
1620
        <para>
1621
          Note that it is safe to run this command while the instance
1622
          is already running.
1623
        </para>
1624
      </refsect3>
1625

    
1626
      <refsect3>
1627
        <title>DEACTIVATE-DISKS</title>
1628

    
1629
        <cmdsynopsis>
1630
          <command>deactivate-disks</command>
1631
          <arg>--submit</arg>
1632
          <arg choice="req"><replaceable>instance</replaceable></arg>
1633
        </cmdsynopsis>
1634
        <para>
1635
          De-activates the block devices of the given instance. Note
1636
          that if you run this command for an instance with a drbd
1637
          disk template, while it is running, it will not be able to
1638
          shutdown the block devices on the primary node, but it will
1639
          shutdown the block devices on the secondary nodes, thus
1640
          breaking the replication.
1641
        </para>
1642

    
1643
        <para>
1644
          The <option>--submit</option> option is used to send the job to
1645
          the master daemon but not wait for its completion. The job
1646
          ID will be shown so that it can be examined via
1647
          <command>gnt-job info</command>.
1648
        </para>
1649

    
1650
      </refsect3>
1651

    
1652
      <refsect3>
1653
        <title>GROW-DISK</title>
1654
        <cmdsynopsis>
1655
          <command>grow-disk</command>
1656
          <arg>--no-wait-for-sync</arg>
1657
          <arg>--submit</arg>
1658
          <arg choice="req"><replaceable>instance</replaceable></arg>
1659
          <arg choice="req"><replaceable>disk</replaceable></arg>
1660
          <arg choice="req"><replaceable>amount</replaceable></arg>
1661
        </cmdsynopsis>
1662

    
1663
        <para>
1664
          Grows an instance's disk. This is only possible for
1665
          instances having a <literal>plain</literal> or
1666
          <literal>drbd</literal> disk template.
1667
        </para>
1668

    
1669
        <para>
1670
          Note that this command only change the block device size; it
1671
          will not grow the actual filesystems, partitions, etc. that
1672
          live on that disk. Usually, you will need to:
1673
          <orderedlist>
1674
            <listitem>
1675
              <simpara>use <command>gnt-instance grow-disk</command></simpara>
1676
            </listitem>
1677
            <listitem>
1678
              <simpara>reboot the instance (later, at a convenient
1679
              time)</simpara>
1680
            </listitem>
1681
            <listitem>
1682
              <simpara>use a filesystem resizer, such as
1683
              <citerefentry> <refentrytitle>ext2online</refentrytitle>
1684
              <manvolnum>8</manvolnum> </citerefentry> or
1685
              <citerefentry> <refentrytitle>xfs_growfs</refentrytitle>
1686
              <manvolnum>8</manvolnum> </citerefentry> to resize the
1687
              filesystem, or use <citerefentry>
1688
              <refentrytitle>fdisk</refentrytitle>
1689
              <manvolnum>8</manvolnum> </citerefentry> to change the
1690
              partition table on the disk
1691
              </simpara>
1692
            </listitem>
1693
          </orderedlist>
1694
        </para>
1695

    
1696

    
1697
        <para>
1698
          The <replaceable>disk</replaceable> argument is the index of
1699
          the instance disk to grow. The
1700
          <replaceable>amount</replaceable> argument is given either
1701
          as a number (and it represents the amount to increase the
1702
          disk with in mebibytes) or can be given similar to the
1703
          arguments in the create instance operation, with a suffix
1704
          denoting the unit.
1705
        </para>
1706

    
1707
        <para>
1708
          Note that the disk grow operation might complete on one node
1709
          but fail on the other; this will leave the instance with
1710
          different-sized LVs on the two nodes, but this will not
1711
          create problems (except for unused space).
1712
        </para>
1713

    
1714
        <para>
1715
          If you do not want gnt-instance to wait for the new disk
1716
          region to be synced, use the
1717
          <option>--no-wait-for-sync</option> option.
1718
        </para>
1719

    
1720
        <para>
1721
          The <option>--submit</option> option is used to send the job to
1722
          the master daemon but not wait for its completion. The job
1723
          ID will be shown so that it can be examined via
1724
          <command>gnt-job info</command>.
1725
        </para>
1726

    
1727

    
1728
        <para>Example (increase the first disk for instance1 by 16GiB):
1729
          <screen>
1730
# gnt-instance grow-disk instance1.example.com 0 16g
1731
          </screen>
1732
        </para>
1733

    
1734
        <para>
1735
          Also note that disk shrinking is not supported; use
1736
          <command>gnt-backup export</command> and then
1737
          <command>gnt-backup import</command> to reduce the disk size
1738
          of an instance.
1739
        </para>
1740
      </refsect3>
1741

    
1742
    </refsect2>
1743

    
1744
    <refsect2>
1745
      <title>Recovery</title>
1746

    
1747
      <refsect3>
1748
        <title>FAILOVER</title>
1749

    
1750
        <cmdsynopsis>
1751
          <command>failover</command>
1752
          <arg>-f</arg>
1753
          <arg>--ignore-consistency</arg>
1754
          <arg>--submit</arg>
1755
          <arg choice="req"><replaceable>instance</replaceable></arg>
1756
        </cmdsynopsis>
1757

    
1758
        <para>
1759
          Failover will fail the instance over its secondary
1760
          node. This works only for instances having a drbd disk
1761
          template.
1762
        </para>
1763

    
1764
        <para>
1765
          Normally the failover will check the consistency of the
1766
          disks before failing over the instance. If you are trying to
1767
          migrate instances off a dead node, this will fail. Use the
1768
          <option>--ignore-consistency</option> option for this
1769
          purpose. Note that this option can be dangerous as errors in
1770
          shutting down the instance will be ignored, resulting in
1771
          possibly having the instance running on two machines in
1772
          parallel (on disconnected DRBD drives).
1773
        </para>
1774

    
1775
        <para>
1776
          The <option>--submit</option> option is used to send the job to
1777
          the master daemon but not wait for its completion. The job
1778
          ID will be shown so that it can be examined via
1779
          <command>gnt-job info</command>.
1780
        </para>
1781

    
1782
        <para>
1783
          Example:
1784
          <screen>
1785
# gnt-instance failover instance1.example.com
1786
          </screen>
1787
        </para>
1788
      </refsect3>
1789

    
1790
      <refsect3>
1791
        <title>MIGRATE</title>
1792

    
1793
        <cmdsynopsis>
1794
          <command>migrate</command>
1795
          <arg>-f</arg>
1796
          <arg choice="req">--cleanup</arg>
1797
          <arg choice="req"><replaceable>instance</replaceable></arg>
1798
        </cmdsynopsis>
1799

    
1800
        <cmdsynopsis>
1801
          <command>migrate</command>
1802
          <arg>-f</arg>
1803
          <arg>--non-live</arg>
1804
          <arg choice="req"><replaceable>instance</replaceable></arg>
1805
        </cmdsynopsis>
1806

    
1807
        <para>
1808
          Migrate will move the instance to its secondary node without
1809
          shutdown. It only works for instances having the drbd8 disk
1810
          template type.
1811
        </para>
1812

    
1813
        <para>
1814
          The migration command needs a perfectly healthy instance, as
1815
          we rely on the dual-master capability of drbd8 and the disks
1816
          of the instance are not allowed to be degraded.
1817
        </para>
1818

    
1819
        <para>
1820
          The <option>--non-live</option> option will switch (for the
1821
          hypervisors that support it) between a "fully live"
1822
          (i.e. the interruption is as minimal as possible) migration
1823
          and one in which the instance is frozen, its state saved and
1824
          transported to the remote node, and then resumed there. This
1825
          all depends on the hypervisor support for two different
1826
          methods. In any case, it is not an error to pass this
1827
          parameter (it will just be ignored if the hypervisor doesn't
1828
          support it).
1829
        </para>
1830

    
1831
        <para>
1832
          If the <option>--cleanup</option> option is passed, the
1833
          operation changes from migration to attempting recovery from
1834
          a failed previous migration. In this mode, ganeti checks if
1835
          the instance runs on the correct node (and updates its
1836
          configuration if not) and ensures the instances's disks are
1837
          configured correctly. In this mode, the
1838
          <option>--non-live</option> option is ignored.
1839
        </para>
1840

    
1841
        <para>
1842
          The option <option>-f</option> will skip the prompting for
1843
          confirmation.
1844
        </para>
1845
        <para>
1846
          Example (and expected output):
1847
          <screen>
1848
# gnt-instance migrate instance1
1849
Migrate will happen to the instance instance1. Note that migration is
1850
**experimental** in this version. This might impact the instance if
1851
anything goes wrong. Continue?
1852
y/[n]/?: y
1853
* checking disk consistency between source and target
1854
* ensuring the target is in secondary mode
1855
* changing disks into dual-master mode
1856
 - INFO: Waiting for instance instance1 to sync disks.
1857
 - INFO: Instance instance1's disks are in sync.
1858
* migrating instance to node2.example.com
1859
* changing the instance's disks on source node to secondary
1860
 - INFO: Waiting for instance instance1 to sync disks.
1861
 - INFO: Instance instance1's disks are in sync.
1862
* changing the instance's disks to single-master
1863
#
1864
          </screen>
1865
        </para>
1866
      </refsect3>
1867

    
1868
    </refsect2>
1869

    
1870
    <refsect2>
1871
      <title>TAGS</title>
1872

    
1873
    <refsect3>
1874
        <title>ADD-TAGS</title>
1875

    
1876
        <cmdsynopsis>
1877
          <command>add-tags</command>
1878
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
1879
          <arg choice="req"><replaceable>instancename</replaceable></arg>
1880
          <arg choice="req"
1881
            rep="repeat"><replaceable>tag</replaceable></arg>
1882
        </cmdsynopsis>
1883

    
1884
        <para>
1885
          Add tags to the given instance. If any of the tags contains
1886
          invalid characters, the entire operation will abort.
1887
        </para>
1888
        <para>
1889
          If the <option>--from</option> option is given, the list of
1890
          tags will be extended with the contents of that file (each
1891
          line becomes a tag). In this case, there is not need to pass
1892
          tags on the command line (if you do, both sources will be
1893
          used). A file name of - will be interpreted as stdin.
1894
        </para>
1895
      </refsect3>
1896

    
1897
      <refsect3>
1898
        <title>LIST-TAGS</title>
1899

    
1900
        <cmdsynopsis>
1901
          <command>list-tags</command>
1902
          <arg choice="req"><replaceable>instancename</replaceable></arg>
1903
        </cmdsynopsis>
1904

    
1905
        <para>List the tags of the given instance.</para>
1906
      </refsect3>
1907

    
1908
      <refsect3>
1909
        <title>REMOVE-TAGS</title>
1910
        <cmdsynopsis>
1911
          <command>remove-tags</command>
1912
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
1913
          <arg choice="req"><replaceable>instancename</replaceable></arg>
1914
          <arg choice="req"
1915
            rep="repeat"><replaceable>tag</replaceable></arg>
1916
        </cmdsynopsis>
1917

    
1918
        <para>
1919
          Remove tags from the given instance. If any of the tags are
1920
          not existing on the node, the entire operation will abort.
1921
        </para>
1922

    
1923
        <para>
1924
          If the <option>--from</option> option is given, the list of
1925
          tags will be extended with the contents of that file (each
1926
          line becomes a tag). In this case, there is not need to pass
1927
          tags on the command line (if you do, both sources will be
1928
          used). A file name of - will be interpreted as stdin.
1929
        </para>
1930
      </refsect3>
1931

    
1932
    </refsect2>
1933

    
1934
  </refsect1>
1935

    
1936
  &footer;
1937

    
1938
</refentry>
1939

    
1940
<!-- Keep this comment at the end of the file
1941
Local variables:
1942
mode: sgml
1943
sgml-omittag:t
1944
sgml-shorttag:t
1945
sgml-minimize-attributes:nil
1946
sgml-always-quote-attributes:t
1947
sgml-indent-step:2
1948
sgml-indent-data:t
1949
sgml-parent-document:nil
1950
sgml-default-dtd-file:nil
1951
sgml-exposed-tags:nil
1952
sgml-local-catalogs:nil
1953
sgml-local-ecat-files:nil
1954
End:
1955
-->