Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ 091c2c64

History | View | Annotate | Download (71.6 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 choice="req">-t<group choice="req">
69
              <arg>diskless</arg>
70
              <arg>file</arg>
71
              <arg>plain</arg>
72
              <arg>drbd</arg>
73
            </group></arg>
74
          <sbr>
75

    
76
          <group choice="req">
77
            <arg rep="repeat">--disk=<replaceable>N</replaceable>:size=<replaceable>VAL</replaceable><arg>,mode=<replaceable>ro|rw</replaceable></arg></arg>
78
            <arg>-s <replaceable>SIZE</replaceable></arg>
79
          </group>
80
          <sbr>
81
          <group>
82
            <arg rep="repeat">--net=<replaceable>N</replaceable><arg rep="repeat">:options</arg></arg>
83
            <arg>--no-nics</arg>
84
          </group>
85
          <sbr>
86
          <arg>-B <replaceable>BEPARAMS</replaceable></arg>
87
          <sbr>
88

    
89
          <arg>-H <replaceable>HYPERVISOR</replaceable><arg>:<arg choice="plain" rep="repeat">option=<replaceable>value</replaceable></arg></arg></arg>
90
          <sbr>
91

    
92
          <arg>--file-storage-dir <replaceable>dir_path</replaceable></arg>
93
          <arg>--file-driver<group choice="req">
94
              <arg>loop</arg>
95
              <arg>blktap</arg>
96
            </group></arg>
97
          <sbr>
98

    
99
          <group choice="req">
100
            <arg>-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg>
101
            <arg>--iallocator <replaceable>name</replaceable></arg>
102
          </group>
103
          <sbr>
104

    
105
          <arg choice="req">-o <replaceable>os-type</replaceable></arg>
106
          <sbr>
107
          <arg>--submit</arg>
108
          <sbr>
109

    
110
          <arg choice="req"><replaceable>instance</replaceable></arg>
111
        </cmdsynopsis>
112

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

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

    
133
        <para>
134
          Alternatively, a single-disk instance can be created via the
135
          <option>-s</option> option which takes a single argument,
136
          the size of the disk. This is similar to the Ganeti 1.2
137
          version (but will only create one disk).
138
        </para>
139

    
140
        <para>
141
          The minimum disk specification is therefore
142
          <userinput>--disk 0:size=20G</userinput> (or <userinput>-s
143
          20G</userinput> when using the <option>-s</option> option),
144
          and a three-disk instance can be specified as
145
          <userinput>--disk 0:size=20G --disk 1:size=4G --disk
146
          2:size=100G</userinput>.
147
        </para>
148

    
149
        <para>
150
          The NICs of the instances can be specified via the
151
          <option>--net</option> option. By default, one NIC is
152
          created for the instance, with a random MAC, and connected
153
          to the default bridge. Each NIC can take up to three
154
          parameters (all optional):
155
          <variablelist>
156
            <varlistentry>
157
              <term>mac</term>
158
              <listitem>
159
                <simpara>either a value or <constant>GENERATE</constant>
160
                  to generate a new unique MAC</simpara>
161
              </listitem>
162
            </varlistentry>
163
            <varlistentry>
164
              <term>ip</term>
165
              <listitem>
166
                <simpara>specifies the IP address assigned to the
167
                  instance from the Ganeti side (this is not necessarily
168
                  what the instance will use, but what the node expects
169
                  the instance to use)</simpara>
170
              </listitem>
171
            </varlistentry>
172
            <varlistentry>
173
              <term>bridge</term>
174
              <listitem>
175
                <simpara>specifies the bridge to attach this NIC
176
                  to</simpara>
177
              </listitem>
178
            </varlistentry>
179
          </variablelist>
180
        </para>
181

    
182
        <para>
183
          Alternatively, if no network is desired for the instance, you
184
          can prevent the default of one NIC with the
185
          <option>--no-nics</option> option.
186
        </para>
187

    
188
        <para>
189
          The <option>-o</option> options specifies the operating
190
          system to be installed. The available operating systems can
191
          be listed with <command>gnt-os list</command>.
192
        </para>
193

    
194
        <para>
195
          The <option>-B</option> option specifies the backend
196
          parameters for the instance. If no such parameters are
197
          specified, the values are inherited from the cluster. Possible
198
          parameters are:
199
          <variablelist>
200
            <varlistentry>
201
              <term>memory</term>
202
              <listitem>
203
                <simpara>the memory size of the instance; as usual,
204
                  suffixes can be used to denote the unit, otherwise the
205
                  value is taken in mebibites</simpara>
206
              </listitem>
207
            </varlistentry>
208
            <varlistentry>
209
              <term>vcpus</term>
210
              <listitem>
211
                <simpara>the number of VCPUs to assign to the instance
212
                  (if this value makes sense for the hypervisor)</simpara>
213
              </listitem>
214
            </varlistentry>
215
            <varlistentry>
216
              <term>auto_balance</term>
217
              <listitem>
218
                <simpara>whether the instance is considered in the N+1
219
                  cluster checks (enough redundancy in the cluster to
220
                  survive a node failure)</simpara>
221
              </listitem>
222
            </varlistentry>
223
          </variablelist>
224
        </para>
225

    
226
        <para>
227
          The <option>-H</option> option specified the hypervisor to
228
          use for the instance (must be one of the enabled hypervisors
229
          on the cluster) and optionally custom parameters for this
230
          instance. If not other options are used (i.e. the invocation
231
          is just <userinput>-H
232
          <replaceable>NAME</replaceable></userinput>) the instance
233
          will inherit the cluster options. The defaults below show
234
          the cluster defaults at cluster creation time.
235
        </para>
236

    
237
        <para>
238
          The possible hypervisor options are as follows:
239
          <variablelist>
240
            <varlistentry>
241
              <term>boot_order</term>
242
              <listitem>
243
                <simpara>Valid for the Xen HVM and KVM
244
                hypervisors.</simpara>
245

    
246
                <simpara>A string value denoting the boot order. This
247
                has different meaning for the Xen HVM hypervisor and
248
                for the KVM one.</simpara>
249

    
250
                <simpara>
251
                  For Xen HVM, The boot order is a string of letters
252
                  listing the boot devices, with valid device letters
253
                  being:
254
                </simpara>
255
                  <variablelist>
256
                    <varlistentry>
257
                      <term>a</term>
258
                      <listitem>
259
                        <para>
260
                          floppy drive
261
                        </para>
262
                      </listitem>
263
                    </varlistentry>
264
                    <varlistentry>
265
                      <term>c</term>
266
                      <listitem>
267
                        <para>
268
                          hard disk
269
                        </para>
270
                      </listitem>
271
                    </varlistentry>
272
                    <varlistentry>
273
                      <term>d</term>
274
                      <listitem>
275
                        <para>
276
                          CDROM drive
277
                        </para>
278
                      </listitem>
279
                    </varlistentry>
280
                    <varlistentry>
281
                      <term>n</term>
282
                      <listitem>
283
                        <para>
284
                          network boot (PXE)
285
                        </para>
286
                      </listitem>
287
                    </varlistentry>
288
                  </variablelist>
289
                <simpara>
290
                  The default is not to set an HVM boot order which is
291
                  interpreted as 'dc'.
292
                </simpara>
293

    
294
              </listitem>
295
            </varlistentry>
296
            <varlistentry>
297
              <term>cdrom_image_path</term>
298
              <listitem>
299
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
300

    
301
                <simpara>The path to a CDROM image to attach to the
302
                instance.</simpara>
303

    
304
              </listitem>
305
            </varlistentry>
306
            <varlistentry>
307
              <term>nic_type</term>
308
              <listitem>
309
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
310

    
311
                <para>
312
                  This parameter determines the way the network cards
313
                  are presented to the instance. The possible options are:
314
                  <simplelist>
315
                    <member>rtl8139 (default for Xen HVM) (HVM & KVM)</member>
316
                    <member>ne2k_isa (HVM & KVM)</member>
317
                    <member>ne2k_pci (HVM & KVM)</member>
318
                    <member>i82551 (KVM)</member>
319
                    <member>i82557b (KVM)</member>
320
                    <member>i82559er (KVM)</member>
321
                    <member>pcnet (KVM)</member>
322
                    <member>e1000 (KVM)</member>
323
                    <member>paravirtual (default for KVM) (HVM & KVM)</member>
324
                  </simplelist>
325
                </para>
326
              </listitem>
327
            </varlistentry>
328
            <varlistentry>
329
              <term>disk_type</term>
330
              <listitem>
331
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
332

    
333
                <para>
334
                  This parameter determines the way the disks are
335
                  presented to the instance. The possible options are:
336
                  <simplelist>
337
                    <member>ioemu (default for HVM & KVM) (HVM & KVM)</member>
338
                    <member>ide (HVM & KVM)</member>
339
                    <member>scsi (KVM)</member>
340
                    <member>sd (KVM)</member>
341
                    <member>mtd (KVM)</member>
342
                    <member>pflash (KVM)</member>
343
                  </simplelist>
344
                </para>
345
              </listitem>
346
            </varlistentry>
347
            <varlistentry>
348
              <term>vnc_bind_address</term>
349
              <listitem>
350
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
351

    
352
                <para>Specifies the address that the VNC listener for
353
                this instance should bind to. Valid values are IPv4
354
                addresses. Use the address 0.0.0.0 to bind to all
355
                available interfaces (this is the default) or specify
356
                the address of one of the interfaces on the node to
357
                restrict listening to that interface.</para>
358
              </listitem>
359
            </varlistentry>
360

    
361
            <varlistentry>
362
              <term>vnc_tls</term>
363
              <listitem>
364
                <simpara>Valid for the KVM hypervisor.</simpara>
365

    
366
                <simpara>A boolean option that controls whether the
367
                VNC connection is secured with TLS.</simpara>
368
              </listitem>
369
            </varlistentry>
370

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

    
376
                <para>If <option>vnc_tls</option> is enabled, this
377
                options specifies the path to the x509 certificate to
378
                use.</para>
379
              </listitem>
380
            </varlistentry>
381

    
382
            <varlistentry>
383
              <term>vnc_x509_verify</term>
384
              <listitem>
385
                <simpara>Valid for the KVM hypervisor.</simpara>
386
              </listitem>
387
            </varlistentry>
388

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

    
394
                <para>
395
                  A boolean option that specifies if the hypervisor
396
                  should enable ACPI support for this instance. By
397
                  default, ACPI is disabled.
398
                </para>
399
              </listitem>
400
            </varlistentry>
401

    
402
            <varlistentry>
403
              <term>pae</term>
404
              <listitem>
405
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
406

    
407
                <para>
408
                  A boolean option that specifies if the hypervisor
409
                  should enabled PAE support for this instance. The
410
                  default is false, disabling PAE support.
411
                </para>
412
              </listitem>
413
            </varlistentry>
414

    
415
            <varlistentry>
416
              <term>kernel_path</term>
417
              <listitem>
418
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
419

    
420
                <para>
421
                  This option specifies the path (on the node) to the
422
                  kernel to boot the instance with. Xen PVM instances
423
                  always require this, while for KVM if this option is
424
                  empty, it will cause the machine to load the kernel
425
                  from its disks.
426
                </para>
427
              </listitem>
428
            </varlistentry>
429

    
430
            <varlistentry>
431
              <term>kernel_args</term>
432
              <listitem>
433
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
434

    
435
                <para>
436
                  This options specifies extra arguments to the kernel
437
                  that will be loaded.  device. This is always used
438
                  for Xen PVM, while for KVM it is only used if the
439
                  <option>kernel_path</option> option is also
440
                  specified.
441
                </para>
442

    
443
                <para>
444
                  The default setting for this value is simply
445
                  <constant>"ro"</constant>, which mounts the root
446
                  disk (initially) in read-only one. For example,
447
                  setting this to <userinput>single</userinput> will
448
                  cause the instance to start in single-user mode.
449
                </para>
450
              </listitem>
451
            </varlistentry>
452

    
453
            <varlistentry>
454
              <term>initrd_path</term>
455
              <listitem>
456
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
457

    
458
                <para>
459
                  This option specifies the path (on the node) to the
460
                  initrd to boot the instance with. Xen PVM instances
461
                  can use this always, while for KVM if this option is
462
                  only used if the <option>kernel_path</option> option
463
                  is also specified. You can pass here either an
464
                  absolute filename (the path to the initrd) if you
465
                  want to use an initrd, or use the format
466
                  <userinput>no_initrd_path</userinput> for no initrd.
467
                </para>
468
              </listitem>
469
            </varlistentry>
470

    
471
            <varlistentry>
472
              <term>root_path</term>
473
              <listitem>
474
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
475

    
476
                <para>
477
                  This options specifies the name of the root
478
                  device. This is always needed for Xen PVM, while for
479
                  KVM it is only used if the
480
                  <option>kernel_path</option> option is also
481
                  specified.
482
                </para>
483
              </listitem>
484
            </varlistentry>
485

    
486
            <varlistentry>
487
              <term>serial_console</term>
488
              <listitem>
489
                <simpara>Valid for the KVM hypervisor.</simpara>
490

    
491
                <simpara>This boolean option specifies whether to
492
                emulate a serial console for the instance.</simpara>
493
              </listitem>
494
            </varlistentry>
495
          </variablelist>
496
        </para>
497

    
498
        <para>
499
        </para>
500

    
501
        <para>
502
          The <option>--iallocator</option> option specifies the instance
503
          allocator plugin to use. If you pass in this option the allocator
504
          will select nodes for this instance automatically, so you don't need
505
          to pass them with the <option>-n</option> option. For more
506
          information please refer to the instance allocator documentation.
507
        </para>
508

    
509
        <para>
510
          The <option>-t</option> options specifies the disk layout type for
511
          the instance. The available choices are:
512
          <variablelist>
513
            <varlistentry>
514
              <term>diskless</term>
515
              <listitem>
516
                <para>
517
                  This creates an instance with no disks. Its useful for
518
                  testing only (or other special cases).
519
                </para>
520
              </listitem>
521
            </varlistentry>
522
            <varlistentry>
523
              <term>file</term>
524
              <listitem>
525
                <para>Disk devices will be regular files.</para>
526
              </listitem>
527
            </varlistentry>
528
            <varlistentry>
529
              <term>plain</term>
530
              <listitem>
531
                <para>Disk devices will be logical volumes.</para>
532
              </listitem>
533
            </varlistentry>
534
            <varlistentry>
535
              <term>drbd</term>
536
              <listitem>
537
                <para>
538
                  Disk devices will be drbd (version 8.x) on top of
539
                  lvm volumes.
540
                </para>
541
              </listitem>
542
            </varlistentry>
543
          </variablelist>
544
        </para>
545

    
546
        <para>
547
          The optional second value of the <option>--node</option> is used for
548
          the drbd template type and specifies the remote node.
549
        </para>
550

    
551
        <para>
552
          If you do not want gnt-instance to wait for the disk mirror
553
          to be synced, use the <option>--no-wait-for-sync</option>
554
          option.
555
        </para>
556

    
557
        <para>
558
          The <option>--file-storage-dir</option> specifies the relative path
559
          under the cluster-wide file storage directory to store file-based
560
          disks. It is useful for having different subdirectories for
561
          different instances. The full path of the directory where the disk
562
          files are stored will consist of cluster-wide file storage directory
563
          + optional subdirectory + instance name. Example:
564
          /srv/ganeti/file-storage/mysubdir/instance1.example.com. This option
565
          is only relevant for instances using the file storage backend.
566
        </para>
567

    
568
        <para>
569
          The <option>--file-driver</option> specifies the driver to use for
570
          file-based disks. Note that currently these drivers work with the
571
          xen hypervisor only. This option is only relevant for instances using
572
          the file storage backend. The available choices are:
573
          <variablelist>
574
            <varlistentry>
575
              <term>loop</term>
576
              <listitem>
577
                <para>
578
                  Kernel loopback driver. This driver uses loopback
579
                  devices to access the filesystem within the
580
                  file. However, running I/O intensive applications in
581
                  your instance using the loop driver might result in
582
                  slowdowns.  Furthermore, if you use the loopback
583
                  driver consider increasing the maximum amount of
584
                  loopback devices (on most systems it's 8) using the
585
                  max_loop param.
586
                </para>
587
              </listitem>
588
            </varlistentry>
589
            <varlistentry>
590
              <term>blktap</term>
591
              <listitem>
592
                <para>The blktap driver (for Xen hypervisors). In
593
                order to be able to use the blktap driver you should
594
                check if the 'blktapctrl' user space disk agent is
595
                running (usually automatically started via xend). This
596
                user-level disk I/O interface has the advantage of
597
                better performance. Especially if you use a network
598
                file system (e.g. NFS) to store your instances this is
599
                the recommended choice.
600
                </para>
601
              </listitem>
602
            </varlistentry>
603
          </variablelist>
604
        </para>
605

    
606
        <para>
607
          The <option>--submit</option> option is used to send the job to
608
          the master daemon but not wait for its completion. The job
609
          ID will be shown so that it can be examined via
610
          <command>gnt-job info</command>.
611
        </para>
612

    
613
        <para>
614
          Example:
615
          <screen>
616
# gnt-instance add -t file --disk 0:size=30g -B memory=512 -o debian-etch \
617
  -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
618
# gnt-instance add -t plain --disk 0:size=30g -B memory=512 -o debian-etch \
619
  -n node1.example.com instance1.example.com
620
# gnt-instance add -t drbd --disk 0:size=30g -B memory=512 -o debian-etch \
621
  -n node1.example.com:node2.example.com instance2.example.com
622
          </screen>
623
        </para>
624
      </refsect3>
625

    
626
      <refsect3>
627
        <title>BATCH-CREATE</title>
628
        <cmdsynopsis>
629
          <command>batch-create</command>
630
          <arg choice="req">instances_file.json</arg>
631
        </cmdsynopsis>
632

    
633
        <para>
634
          This command (similar to the Ganeti 1.2
635
          <command>batcher</command> tool) submits multiple instance
636
          creation jobs based on a definition file. The instance
637
          configurations do not encompass all the possible options for
638
          the <command>add</command> command, but only a subset.
639
        </para>
640

    
641
        <para>
642
          The instance file should be a valid-formed JSON file,
643
          containing a dictionary with instance name and instance
644
          parameters. The accepted parameters are:
645

    
646
          <variablelist>
647
            <varlistentry>
648
              <term>disk_size</term>
649
              <listitem>
650
                <simpara>The size of the disks of the instance.</simpara>
651
              </listitem>
652
            </varlistentry>
653
            <varlistentry>
654
              <term>disk_templace</term>
655
              <listitem>
656
                <simpara>The disk template to use for the instance,
657
                the same as in the <command>add</command>
658
                command.</simpara>
659
              </listitem>
660
            </varlistentry>
661
            <varlistentry>
662
              <term>backend</term>
663
              <listitem>
664
                <simpara>A dictionary of backend parameters.</simpara>
665
              </listitem>
666
            </varlistentry>
667
            <varlistentry>
668
              <term>hypervisor</term>
669
              <listitem>
670
                <simpara>A dictionary with a single key (the
671
                hypervisor name), and as value the hypervisor
672
                options. If not passed, the default hypervisor and
673
                hypervisor options will be inherited.</simpara>
674
              </listitem>
675
            </varlistentry>
676
            <varlistentry>
677
              <term>mac, ip, bridge</term>
678
              <listitem>
679
                <simpara>Specifications for the one NIC that will be
680
                created for the instance.</simpara>
681
              </listitem>
682
            </varlistentry>
683
            <varlistentry>
684
              <term>primary_node, secondary_node</term>
685
              <listitem>
686
                <simpara>The primary and optionally the secondary node
687
                to use for the instance (in case an iallocator script
688
                is not used).</simpara>
689
              </listitem>
690
            </varlistentry>
691
            <varlistentry>
692
              <term>iallocator</term>
693
              <listitem>
694
                <simpara>Instead of specifying the nodes, an
695
                iallocator script can be used to automatically compute
696
                them.</simpara>
697
              </listitem>
698
            </varlistentry>
699
            <varlistentry>
700
              <term>start</term>
701
              <listitem>
702
                <simpara>whether to start the instance</simpara>
703
              </listitem>
704
            </varlistentry>
705
            <varlistentry>
706
              <term>ip_check</term>
707
              <listitem>
708
                <simpara>Skip the check for already-in-use instance;
709
                see the description in the <command>add</command>
710
                command for details.</simpara>
711
              </listitem>
712
            </varlistentry>
713
            <varlistentry>
714
              <term>file_storage_dir, file_driver</term>
715
              <listitem>
716
                <simpara>Configuration for the <literal>file</literal>
717
                disk type, see the <command>add</command> command for
718
                details.</simpara>
719
              </listitem>
720
            </varlistentry>
721
          </variablelist>
722
        </para>
723

    
724
        <para>
725
          A simple definition for one instance can be (with most of
726
          the parameters taken from the cluster defaults):
727
          <screen>
728
{
729
  "instance3": {
730
    "template": "drbd",
731
    "os": "debootstrap",
732
    "disk_size": ["25G"],
733
    "iallocator": "dumb"
734
  },
735
  "instance5": {
736
    "template": "drbd",
737
    "os": "debootstrap",
738
    "disk_size": ["25G"],
739
    "iallocator": "dumb",
740
    "hypervisor": "xen-hvm",
741
    "hvparams": {"acpi": true},
742
    "backend": {"memory": 512}
743
  }
744
}
745
</screen>
746
        </para>
747

    
748
        <para>
749
          The command will display the job id for each submitted instance, as follows:
750
          <screen>
751
# gnt-instance batch-create instances.json
752
instance3: 11224
753
instance5: 11225
754
</screen>
755
        </para>
756

    
757
      </refsect3>
758

    
759
      <refsect3>
760
        <title>REMOVE</title>
761

    
762
        <cmdsynopsis>
763
          <command>remove</command>
764
          <arg>--ignore-failures</arg>
765
          <arg>--submit</arg>
766
          <arg choice="req"><replaceable>instance</replaceable></arg>
767
        </cmdsynopsis>
768

    
769
        <para>
770
          Remove an instance. This will remove all data from the
771
          instance and there is <emphasis>no way back</emphasis>. If
772
          you are not sure if you use an instance again, use
773
          <command>shutdown</command> first and leave it in the
774
          shutdown state for a while.
775

    
776
        </para>
777

    
778
        <para>
779
          The <option>--ignore-failures</option> option will cause the
780
          removal to proceed even in the presence of errors during the
781
          removal of the instance (e.g. during the shutdown or the
782
          disk removal). If this option is not given, the command will
783
          stop at the first error.
784
        </para>
785

    
786
        <para>
787
          The <option>--submit</option> option is used to send the job to
788
          the master daemon but not wait for its completion. The job
789
          ID will be shown so that it can be examined via
790
          <command>gnt-job info</command>.
791
        </para>
792

    
793
        <para>
794
          Example:
795
          <screen>
796
# gnt-instance remove instance1.example.com
797
          </screen>
798
        </para>
799
      </refsect3>
800

    
801
      <refsect3>
802
        <title>LIST</title>
803

    
804
        <cmdsynopsis>
805
          <command>list</command>
806
          <arg>--no-headers</arg>
807
          <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
808
          <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
809
          <arg rep="repeat">instance</arg>
810
        </cmdsynopsis>
811

    
812
        <para>
813
          Shows the currently configured instances with memory usage,
814
          disk usage, the node they are running on, and their run
815
          status.
816
        </para>
817

    
818
        <para>
819
          The <option>--no-headers</option> option will skip the
820
          initial header line. The <option>--separator</option> option
821
          takes an argument which denotes what will be used between
822
          the output fields. Both these options are to help scripting.
823
        </para>
824

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

    
1083
        <para>
1084
          If the value of the option starts with the character
1085
          <constant>+</constant>, the new field(s) will be added to the
1086
          default list. This allows to quickly see the default list
1087
          plus a few other fields, instead of retyping the entire list
1088
          of fields.
1089
        </para>
1090

    
1091
        <para>
1092
          There is a subtle grouping about the available output
1093
          fields: all fields except for <option>oper_state</option>,
1094
          <option>oper_ram</option> and <option>status</option> are
1095
          configuration value and not run-time values. So if you don't
1096
          select any of the these fields, the query will be satisfied
1097
          instantly from the cluster configuration, without having to
1098
          ask the remote nodes for the data. This can be helpful for
1099
          big clusters when you only want some data and it makes sense
1100
          to specify a reduced set of output fields.
1101
        </para>
1102

    
1103
        <para>The default output field list is:
1104
          <simplelist type="inline">
1105
            <member>name</member>
1106
            <member>os</member>
1107
            <member>pnode</member>
1108
            <member>admin_state</member>
1109
            <member>oper_state</member>
1110
            <member>oper_ram</member>
1111
          </simplelist>.
1112
        </para>
1113
      </refsect3>
1114

    
1115
      <refsect3>
1116
        <title>INFO</title>
1117

    
1118
        <cmdsynopsis>
1119
          <command>info</command>
1120
          <group>
1121
            <arg>-s</arg>
1122
            <arg>--static</arg>
1123
          </group>
1124
          <group choice="req">
1125
            <arg>--all</arg>
1126
            <arg rep="repeat"><replaceable>instance</replaceable></arg>
1127
          </group>
1128
        </cmdsynopsis>
1129

    
1130
        <para>
1131
          Show detailed information about the given instance(s). This is
1132
          different from <command>list</command> as it shows detailed data
1133
          about the instance's disks (especially useful for the drbd disk
1134
          template).
1135
        </para>
1136

    
1137
        <para>
1138
          If the option <option>-s</option> is used, only information
1139
          available in the configuration file is returned, without
1140
          querying nodes, making the operation faster.
1141
        </para>
1142

    
1143
        <para>
1144
          Use the <option>--all</option> to get info about all instances,
1145
          rather than explicitely passing the ones you're interested in.
1146
        </para>
1147
      </refsect3>
1148

    
1149
      <refsect3>
1150
        <title>MODIFY</title>
1151

    
1152
        <cmdsynopsis>
1153
          <command>modify</command>
1154
          <sbr>
1155
          <arg choice="opt">-H <replaceable>HYPERVISOR_PARAMETERS</replaceable></arg>
1156
          <sbr>
1157
          <arg choice="opt">-B <replaceable>BACKEND_PARAMETERS</replaceable></arg>
1158
          <sbr>
1159
          <group>
1160
            <arg>--net add<replaceable><optional>:options</optional></replaceable></arg>
1161
            <arg>--net remove</arg>
1162
            <arg>--net <replaceable>N:options</replaceable></arg>
1163
          </group>
1164
          <sbr>
1165
          <group>
1166
            <arg>--disk add:size=<replaceable>SIZE</replaceable></arg>
1167
            <arg>--disk remove</arg>
1168
            <arg>--disk <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></arg>
1169
          </group>
1170

    
1171
          <sbr>
1172
          <arg>--submit</arg>
1173
          <sbr>
1174
          <arg choice="req"><replaceable>instance</replaceable></arg>
1175
        </cmdsynopsis>
1176

    
1177
        <para>
1178
          Modifies the memory size, number of vcpus, ip address, MAC
1179
          address and/or bridge for an instance. It can also add and
1180
          remove disks and NICs to/from the instance. Note that you
1181
          need to give at least one of the arguments, otherwise the
1182
          command complains.
1183
        </para>
1184

    
1185
        <para>
1186
          The <option>-H</option> option specifies hypervisor options
1187
          in the form of <userinput>name=value[,...]</userinput>. For details which options can be specified, see the <command>add</command> command.
1188
        </para>
1189

    
1190
        <para>
1191
          The <option>--disk
1192
          add:size=<replaceable>SIZE</replaceable></option> option
1193
          adds a disk to the instance. The <option>--disk
1194
          remove</option> will remove the last disk of the
1195
          instance. The <option>--disk
1196
          <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></option>
1197
          option will change the mode of the Nth disk of the instance
1198
          between read-only (<literal>ro</literal>) and read-write
1199
          (<literal>rw</literal>).
1200
        </para>
1201

    
1202
        <para>
1203
          The <option>--net
1204
          add:<replaceable>options</replaceable></option> option will
1205
          add a new NIC to the instance. The available options are the
1206
          same as in the <command>add</command> command (mac, ip,
1207
          bridge). The <option>--net remove</option> will remove the
1208
          last NIC of the instance, while the <option>--net
1209
          <replaceable>N</replaceable>:<replaceable>options</replaceable></option>
1210
          option will change the parameters of the Nth instance NIC.
1211
        </para>
1212

    
1213
        <para>
1214
          The <option>--submit</option> option is used to send the job to
1215
          the master daemon but not wait for its completion. The job
1216
          ID will be shown so that it can be examined via
1217
          <command>gnt-job info</command>.
1218
        </para>
1219

    
1220
        <para>
1221
          All the changes take effect at the next restart. If the
1222
          instance is running, there is no effect on the instance.
1223
        </para>
1224
      </refsect3>
1225

    
1226
      <refsect3>
1227
        <title>REINSTALL</title>
1228

    
1229
        <cmdsynopsis>
1230
          <command>reinstall</command>
1231
          <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
1232
          <arg choice="opt">-f <replaceable>force</replaceable></arg>
1233
          <arg>--select-os</arg>
1234
          <arg>--submit</arg>
1235
          <arg choice="req"><replaceable>instance</replaceable></arg>
1236
        </cmdsynopsis>
1237

    
1238
        <para>
1239
          Reinstalls the operating system on the given instance. The
1240
          instance must be stopped when running this command. If the
1241
          <option>--os-type</option> is specified, the operating
1242
          system is changed.
1243
        </para>
1244

    
1245
        <para>
1246
          Since reinstall is potentially dangerous command, the user
1247
          will be required to confirm this action, unless the
1248
          <option>-f</option> flag is passed.
1249
        </para>
1250

    
1251
        <para>
1252
          The <option>--select-os</option> option switches to an
1253
          interactive OS reinstall. The user is prompted to select the OS
1254
          template from the list of available OS templates.
1255
        </para>
1256

    
1257
        <para>
1258
          The <option>--submit</option> option is used to send the job to
1259
          the master daemon but not wait for its completion. The job
1260
          ID will be shown so that it can be examined via
1261
          <command>gnt-job info</command>.
1262
        </para>
1263

    
1264

    
1265
      </refsect3>
1266

    
1267
      <refsect3>
1268
        <title>RENAME</title>
1269

    
1270
        <cmdsynopsis>
1271
          <command>rename</command>
1272
          <arg>--no-ip-check</arg>
1273
          <arg>--submit</arg>
1274
          <arg choice="req"><replaceable>instance</replaceable></arg>
1275
          <arg choice="req"><replaceable>new_name</replaceable></arg>
1276
        </cmdsynopsis>
1277

    
1278
        <para>
1279
          Renames the given instance. The instance must be stopped
1280
          when running this command. The requirements for the new name
1281
          are the same as for adding an instance: the new name must be
1282
          resolvable and the IP it resolves to must not be reachable
1283
          (in order to prevent duplicate IPs the next time the
1284
          instance is started). The IP test can be skipped if the
1285
          <option>--no-ip-check</option> option is passed.
1286
        </para>
1287

    
1288
        <para>
1289
          The <option>--submit</option> option is used to send the job to
1290
          the master daemon but not wait for its completion. The job
1291
          ID will be shown so that it can be examined via
1292
          <command>gnt-job info</command>.
1293
        </para>
1294

    
1295
      </refsect3>
1296

    
1297
    </refsect2>
1298

    
1299
    <refsect2>
1300
      <title>Starting/stopping/connecting to console</title>
1301

    
1302
      <refsect3>
1303
        <title>STARTUP</title>
1304

    
1305
        <cmdsynopsis>
1306
          <command>startup</command>
1307
          <sbr>
1308
          <arg>--force</arg>
1309
          <sbr>
1310
          <arg>--force-multiple</arg>
1311
          <sbr>
1312
          <group choice="opt">
1313
            <arg>--instance</arg>
1314
            <arg>--node</arg>
1315
            <arg>--primary</arg>
1316
            <arg>--secondary</arg>
1317
            <arg>--all</arg>
1318
          </group>
1319
          <sbr>
1320
          <arg>-H <option>key=value...</option></arg>
1321
          <arg>-B <option>key=value...</option></arg>
1322
          <sbr>
1323
          <arg>--submit</arg>
1324
          <sbr>
1325
          <arg choice="opt"
1326
          rep="repeat"><replaceable>name</replaceable></arg>
1327
        </cmdsynopsis>
1328

    
1329
        <para>
1330
          Starts one or more instances, depending on the following
1331
          options. The four available modes are:
1332
          <variablelist>
1333
            <varlistentry>
1334
              <term><option>--instance</option></term>
1335
              <listitem>
1336
                <simpara>will start the instances given as arguments
1337
                (at least one argument required); this is the default
1338
                selection</simpara>
1339
              </listitem>
1340
            </varlistentry>
1341
            <varlistentry>
1342
              <term>--node</term>
1343
              <listitem>
1344
                <simpara>will start the instances who have the given
1345
                node as either primary or secondary</simpara>
1346
              </listitem>
1347
            </varlistentry>
1348
            <varlistentry>
1349
              <term><option>--primary</option></term>
1350
              <listitem>
1351
                <simpara>will start all instances whose primary node
1352
                is in the list of nodes passed as arguments (at least
1353
                one node required)</simpara>
1354
              </listitem>
1355
            </varlistentry>
1356
            <varlistentry>
1357
              <term><option>--secondary</option></term>
1358
              <listitem>
1359
                <simpara>will start all instances whose secondary node
1360
                is in the list of nodes passed as arguments (at least
1361
                one node required)</simpara>
1362
              </listitem>
1363
            </varlistentry>
1364
            <varlistentry>
1365
              <term>--all</term>
1366
              <listitem>
1367
                <simpara>will start all instances in the cluster (no
1368
                arguments accepted)</simpara>
1369
              </listitem>
1370
            </varlistentry>
1371
          </variablelist>
1372
        </para>
1373

    
1374
        <para>
1375
          Note that although you can pass more than one selection
1376
          option, the last one wins, so in order to guarantee the
1377
          desired result, don't pass more than one such option.
1378
        </para>
1379

    
1380
        <para>
1381
          Use <option>--force</option> to start even if secondary disks are
1382
          failing.
1383
        </para>
1384

    
1385
        <para>
1386
          The <option>--force-multiple</option> will skip the
1387
          interactive confirmation in the case the more than one
1388
          instance will be affected.
1389
        </para>
1390

    
1391
        <para>
1392
          The <option>-H</option> and <option>-B</option> options
1393
          specify extra, temporary hypervisor and backend parameters
1394
          that can be used to start an instance with modified
1395
          parameters. They can be useful for quick testing without
1396
          having to modify an instance back and forth, e.g.:
1397
          <screen>
1398
# gnt-instance start -H root_args="single" instance1
1399
# gnt-instance start -B memory=2048 instance2
1400
          </screen>
1401
          The first form will start the instance
1402
          <userinput>instance1</userinput> in single-user mode, and
1403
          the instance <userinput>instance2</userinput> with 2GB of
1404
          RAM (this time only, unless that is the actual instance
1405
          memory size already).
1406
        </para>
1407

    
1408
        <para>
1409
          The <option>--submit</option> option is used to send the job to
1410
          the master daemon but not wait for its completion. The job
1411
          ID will be shown so that it can be examined via
1412
          <command>gnt-job info</command>.
1413
        </para>
1414

    
1415
        <para>
1416
          Example:
1417
          <screen>
1418
# gnt-instance start instance1.example.com
1419
# gnt-instance start --node node1.example.com node2.example.com
1420
# gnt-instance start --all
1421
          </screen>
1422
        </para>
1423
      </refsect3>
1424

    
1425
      <refsect3>
1426
        <title>SHUTDOWN</title>
1427

    
1428
        <cmdsynopsis>
1429
          <command>shutdown</command>
1430
          <sbr>
1431
          <arg>--force-multiple</arg>
1432
          <sbr>
1433
          <group choice="opt">
1434
            <arg>--instance</arg>
1435
            <arg>--node</arg>
1436
            <arg>--primary</arg>
1437
            <arg>--secondary</arg>
1438
            <arg>--all</arg>
1439
          </group>
1440
          <sbr>
1441
          <arg>--submit</arg>
1442
          <sbr>
1443
          <arg choice="opt"
1444
          rep="repeat"><replaceable>name</replaceable></arg>
1445
        </cmdsynopsis>
1446

    
1447
        <para>
1448
          Stops one or more instances. If the instance cannot be
1449
          cleanly stopped during a hardcoded interval (currently 2
1450
          minutes), it will forcibly stop the instance (equivalent to
1451
          switching off the power on a physical machine).
1452
        </para>
1453

    
1454
        <para>
1455
          The <option>--instance</option>, <option>--node</option>,
1456
          <option>--primary</option>, <option>--secondary</option> and
1457
          <option>--all</option> options are similar as for the
1458
          <command>startup</command> command and they influence the
1459
          actual instances being shutdown.
1460
        </para>
1461

    
1462
        <para>
1463
          The <option>--submit</option> option is used to send the job to
1464
          the master daemon but not wait for its completion. The job
1465
          ID will be shown so that it can be examined via
1466
          <command>gnt-job info</command>.
1467
        </para>
1468

    
1469

    
1470
        <para>
1471
          Example:
1472
          <screen>
1473
# gnt-instance shutdown instance1.example.com
1474
# gnt-instance shutdown --all
1475
          </screen>
1476
        </para>
1477
      </refsect3>
1478

    
1479
      <refsect3>
1480
        <title>REBOOT</title>
1481

    
1482
        <cmdsynopsis>
1483
          <command>reboot</command>
1484
          <sbr>
1485
          <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
1486
          <sbr>
1487
          <arg>--ignore-secondaries</arg>
1488
          <sbr>
1489
          <arg>--force-multiple</arg>
1490
          <sbr>
1491
          <group choice="opt">
1492
            <arg>--instance</arg>
1493
            <arg>--node</arg>
1494
            <arg>--primary</arg>
1495
            <arg>--secondary</arg>
1496
            <arg>--all</arg>
1497
          </group>
1498
          <sbr>
1499
          <arg>--submit</arg>
1500
          <sbr>
1501
          <arg choice="opt"
1502
          rep="repeat"><replaceable>name</replaceable></arg>
1503
        </cmdsynopsis>
1504

    
1505
        <para>
1506
          Reboots one or more instances. The type of reboot depends on
1507
          the value of <option>--type</option>. A soft reboot does a
1508
          hypervisor reboot, a hard reboot does a instance stop,
1509
          recreates the hypervisor config for the instance and
1510
          starts the instance. A full reboot does the equivalent
1511
          of <command>gnt-instance shutdown &amp;&amp; gnt-instance
1512
          startup</command>. The default is hard reboot.
1513
        </para>
1514

    
1515
        <para>
1516
          For the hard reboot the option
1517
          <option>--ignore-secondaries</option> ignores errors for the
1518
          secondary node while re-assembling the instance disks.
1519
        </para>
1520

    
1521
        <para>
1522
          The <option>--instance</option>, <option>--node</option>,
1523
          <option>--primary</option>, <option>--secondary</option> and
1524
          <option>--all</option> options are similar as for the
1525
          <command>startup</command> command and they influence the
1526
          actual instances being rebooted.
1527
        </para>
1528

    
1529
        <para>
1530
          The <option>--force-multiple</option> will skip the
1531
          interactive confirmation in the case the more than one
1532
          instance will be affected.
1533
        </para>
1534

    
1535
        <para>
1536
          Example:
1537
          <screen>
1538
# gnt-instance reboot instance1.example.com
1539
# gnt-instance reboot --type=full instance1.example.com
1540
          </screen>
1541
        </para>
1542
      </refsect3>
1543

    
1544
      <refsect3>
1545
        <title>CONSOLE</title>
1546
        <cmdsynopsis>
1547
          <command>console</command>
1548
          <arg choice="opt">--show-cmd</arg>
1549
          <arg choice="req"><replaceable>instance</replaceable></arg>
1550
        </cmdsynopsis>
1551

    
1552
        <para>
1553
          Connects to the console of the given instance. If the
1554
          instance is not up, an error is returned. Use the
1555
          <option>--show-cmd</option> option to display the command
1556
          instead of executing it.
1557
        </para>
1558

    
1559
        <para>
1560
          For HVM instances, this will attempt to connect to the
1561
          serial console of the instance. To connect to the
1562
          virtualized "physical" console of a HVM instance, use a VNC
1563
          client with the connection info from the
1564
          <command>info</command> command.
1565
        </para>
1566

    
1567
        <para>
1568
          Example:
1569
          <screen>
1570
# gnt-instance console instance1.example.com
1571
          </screen>
1572
        </para>
1573
      </refsect3>
1574

    
1575
    </refsect2>
1576

    
1577
    <refsect2>
1578
      <title>Disk management</title>
1579

    
1580
      <refsect3>
1581
        <title>REPLACE-DISKS</title>
1582

    
1583
        <cmdsynopsis>
1584
          <command>replace-disks</command>
1585
          <arg>--submit</arg>
1586
          <arg choice="req">-p</arg>
1587
          <arg>--disks <replaceable>idx</replaceable></arg>
1588
          <arg choice="req"><replaceable>instance</replaceable></arg>
1589
        </cmdsynopsis>
1590

    
1591
        <cmdsynopsis>
1592
          <command>replace-disks</command>
1593
          <arg>--submit</arg>
1594
          <arg choice="req">-s</arg>
1595
          <arg>--disks <replaceable>idx</replaceable></arg>
1596
          <arg choice="req"><replaceable>instance</replaceable></arg>
1597
        </cmdsynopsis>
1598

    
1599
        <cmdsynopsis>
1600
          <command>replace-disks</command>
1601
          <arg>--submit</arg>
1602
          <group choice="req">
1603
            <arg>--iallocator <replaceable>name</replaceable></arg>
1604
            <arg>--new-secondary <replaceable>NODE</replaceable></arg>
1605
          </group>
1606

    
1607
          <arg choice="req"><replaceable>instance</replaceable></arg>
1608
        </cmdsynopsis>
1609

    
1610
        <para>
1611
          This command is a generalized form for replacing disks. It
1612
          is currently only valid for the mirrored (DRBD) disk
1613
          template.
1614
        </para>
1615

    
1616
        <para>
1617
          The first form (when passing the <option>-p</option> option)
1618
          will replace the disks on the primary, while the second form
1619
          (when passing the <option>-s</option> option will replace
1620
          the disks on the secondary node. For these two cases (as the
1621
          node doesn't change), it is possible to only run the replace
1622
          for a subset of the disks, using the option
1623
          <option>--disks</option> which takes a list of
1624
          comma-delimited disk indices (zero-based),
1625
          e.g. <userinput>0,2</userinput> to replace only the first
1626
          and third disks.
1627
        </para>
1628

    
1629
        <para>
1630
          The third form (when passing either the
1631
          <option>--iallocator</option> or the
1632
          <option>--new-secondary</option> option) is designed to
1633
          change secondary node of the instance.  Specifying
1634
          <option>--iallocator</option> makes the new secondary be
1635
          selected automatically by the specified allocator plugin,
1636
          otherwise the new secondary node will be the one chosen
1637
          manually via the <option>--new-secondary</option> option.
1638
        </para>
1639

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

    
1647
        <para>
1648
          Note that it is not possible to select an offline or drained
1649
          node as a new secondary.
1650
        </para>
1651

    
1652
      </refsect3>
1653

    
1654
      <refsect3>
1655
        <title>ACTIVATE-DISKS</title>
1656

    
1657
        <cmdsynopsis>
1658
          <command>activate-disks</command>
1659
          <arg>--submit</arg>
1660
          <arg choice="req"><replaceable>instance</replaceable></arg>
1661
        </cmdsynopsis>
1662
        <para>
1663
          Activates the block devices of the given instance. If
1664
          successful, the command will show the location and name of
1665
          the block devices:
1666
          <screen>
1667
node1.example.com:disk/0:/dev/drbd0
1668
node1.example.com:disk/1:/dev/drbd1
1669
          </screen>
1670

    
1671
          In this example, <emphasis>node1.example.com</emphasis> is
1672
          the name of the node on which the devices have been
1673
          activated. The <emphasis>disk/0</emphasis> and
1674
          <emphasis>disk/1</emphasis> are the Ganeti-names of the
1675
          instance disks; how they are visible inside the instance is
1676
          hypervisor-specific. <emphasis>/dev/drbd0</emphasis> and
1677
          <emphasis>/dev/drbd1</emphasis> are the actual block devices
1678
          as visible on the node.
1679
        </para>
1680

    
1681
        <para>
1682
          The <option>--submit</option> option is used to send the job to
1683
          the master daemon but not wait for its completion. The job
1684
          ID will be shown so that it can be examined via
1685
          <command>gnt-job info</command>.
1686
        </para>
1687

    
1688
        <para>
1689
          Note that it is safe to run this command while the instance
1690
          is already running.
1691
        </para>
1692
      </refsect3>
1693

    
1694
      <refsect3>
1695
        <title>DEACTIVATE-DISKS</title>
1696

    
1697
        <cmdsynopsis>
1698
          <command>deactivate-disks</command>
1699
          <arg>--submit</arg>
1700
          <arg choice="req"><replaceable>instance</replaceable></arg>
1701
        </cmdsynopsis>
1702
        <para>
1703
          De-activates the block devices of the given instance. Note
1704
          that if you run this command for an instance with a drbd
1705
          disk template, while it is running, it will not be able to
1706
          shutdown the block devices on the primary node, but it will
1707
          shutdown the block devices on the secondary nodes, thus
1708
          breaking the replication.
1709
        </para>
1710

    
1711
        <para>
1712
          The <option>--submit</option> option is used to send the job to
1713
          the master daemon but not wait for its completion. The job
1714
          ID will be shown so that it can be examined via
1715
          <command>gnt-job info</command>.
1716
        </para>
1717

    
1718
      </refsect3>
1719

    
1720
      <refsect3>
1721
        <title>GROW-DISK</title>
1722
        <cmdsynopsis>
1723
          <command>grow-disk</command>
1724
          <arg>--no-wait-for-sync</arg>
1725
          <arg>--submit</arg>
1726
          <arg choice="req"><replaceable>instance</replaceable></arg>
1727
          <arg choice="req"><replaceable>disk</replaceable></arg>
1728
          <arg choice="req"><replaceable>amount</replaceable></arg>
1729
        </cmdsynopsis>
1730

    
1731
        <para>
1732
          Grows an instance's disk. This is only possible for
1733
          instances having a <literal>plain</literal> or
1734
          <literal>drbd</literal> disk template.
1735
        </para>
1736

    
1737
        <para>
1738
          Note that this command only change the block device size; it
1739
          will not grow the actual filesystems, partitions, etc. that
1740
          live on that disk. Usually, you will need to:
1741
          <orderedlist>
1742
            <listitem>
1743
              <simpara>use <command>gnt-instance grow-disk</command></simpara>
1744
            </listitem>
1745
            <listitem>
1746
              <simpara>reboot the instance (later, at a convenient
1747
              time)</simpara>
1748
            </listitem>
1749
            <listitem>
1750
              <simpara>use a filesystem resizer, such as
1751
              <citerefentry> <refentrytitle>ext2online</refentrytitle>
1752
              <manvolnum>8</manvolnum> </citerefentry> or
1753
              <citerefentry> <refentrytitle>xfs_growfs</refentrytitle>
1754
              <manvolnum>8</manvolnum> </citerefentry> to resize the
1755
              filesystem, or use <citerefentry>
1756
              <refentrytitle>fdisk</refentrytitle>
1757
              <manvolnum>8</manvolnum> </citerefentry> to change the
1758
              partition table on the disk
1759
              </simpara>
1760
            </listitem>
1761
          </orderedlist>
1762
        </para>
1763

    
1764

    
1765
        <para>
1766
          The <replaceable>disk</replaceable> argument is the index of
1767
          the instance disk to grow. The
1768
          <replaceable>amount</replaceable> argument is given either
1769
          as a number (and it represents the amount to increase the
1770
          disk with in mebibytes) or can be given similar to the
1771
          arguments in the create instance operation, with a suffix
1772
          denoting the unit.
1773
        </para>
1774

    
1775
        <para>
1776
          Note that the disk grow operation might complete on one node
1777
          but fail on the other; this will leave the instance with
1778
          different-sized LVs on the two nodes, but this will not
1779
          create problems (except for unused space).
1780
        </para>
1781

    
1782
        <para>
1783
          If you do not want gnt-instance to wait for the new disk
1784
          region to be synced, use the
1785
          <option>--no-wait-for-sync</option> option.
1786
        </para>
1787

    
1788
        <para>
1789
          The <option>--submit</option> option is used to send the job to
1790
          the master daemon but not wait for its completion. The job
1791
          ID will be shown so that it can be examined via
1792
          <command>gnt-job info</command>.
1793
        </para>
1794

    
1795

    
1796
        <para>Example (increase the first disk for instance1 by 16GiB):
1797
          <screen>
1798
# gnt-instance grow-disk instance1.example.com 0 16g
1799
          </screen>
1800
        </para>
1801

    
1802
        <para>
1803
          Also note that disk shrinking is not supported; use
1804
          <command>gnt-backup export</command> and then
1805
          <command>gnt-backup import</command> to reduce the disk size
1806
          of an instance.
1807
        </para>
1808
      </refsect3>
1809

    
1810
    </refsect2>
1811

    
1812
    <refsect2>
1813
      <title>Recovery</title>
1814

    
1815
      <refsect3>
1816
        <title>FAILOVER</title>
1817

    
1818
        <cmdsynopsis>
1819
          <command>failover</command>
1820
          <arg>-f</arg>
1821
          <arg>--ignore-consistency</arg>
1822
          <arg>--submit</arg>
1823
          <arg choice="req"><replaceable>instance</replaceable></arg>
1824
        </cmdsynopsis>
1825

    
1826
        <para>
1827
          Failover will fail the instance over its secondary
1828
          node. This works only for instances having a drbd disk
1829
          template.
1830
        </para>
1831

    
1832
        <para>
1833
          Normally the failover will check the consistency of the
1834
          disks before failing over the instance. If you are trying to
1835
          migrate instances off a dead node, this will fail. Use the
1836
          <option>--ignore-consistency</option> option for this
1837
          purpose. Note that this option can be dangerous as errors in
1838
          shutting down the instance will be ignored, resulting in
1839
          possibly having the instance running on two machines in
1840
          parallel (on disconnected DRBD drives).
1841
        </para>
1842

    
1843
        <para>
1844
          The <option>--submit</option> option is used to send the job to
1845
          the master daemon but not wait for its completion. The job
1846
          ID will be shown so that it can be examined via
1847
          <command>gnt-job info</command>.
1848
        </para>
1849

    
1850
        <para>
1851
          Example:
1852
          <screen>
1853
# gnt-instance failover instance1.example.com
1854
          </screen>
1855
        </para>
1856
      </refsect3>
1857

    
1858
      <refsect3>
1859
        <title>MIGRATE</title>
1860

    
1861
        <cmdsynopsis>
1862
          <command>migrate</command>
1863
          <arg>-f</arg>
1864
          <arg choice="req">--cleanup</arg>
1865
          <arg choice="req"><replaceable>instance</replaceable></arg>
1866
        </cmdsynopsis>
1867

    
1868
        <cmdsynopsis>
1869
          <command>migrate</command>
1870
          <arg>-f</arg>
1871
          <arg>--non-live</arg>
1872
          <arg choice="req"><replaceable>instance</replaceable></arg>
1873
        </cmdsynopsis>
1874

    
1875
        <para>
1876
          Migrate will move the instance to its secondary node without
1877
          shutdown. It only works for instances having the drbd8 disk
1878
          template type.
1879
        </para>
1880

    
1881
        <para>
1882
          The migration command needs a perfectly healthy instance, as
1883
          we rely on the dual-master capability of drbd8 and the disks
1884
          of the instance are not allowed to be degraded.
1885
        </para>
1886

    
1887
        <para>
1888
          The <option>--non-live</option> option will switch (for the
1889
          hypervisors that support it) between a "fully live"
1890
          (i.e. the interruption is as minimal as possible) migration
1891
          and one in which the instance is frozen, its state saved and
1892
          transported to the remote node, and then resumed there. This
1893
          all depends on the hypervisor support for two different
1894
          methods. In any case, it is not an error to pass this
1895
          parameter (it will just be ignored if the hypervisor doesn't
1896
          support it).
1897
        </para>
1898

    
1899
        <para>
1900
          If the <option>--cleanup</option> option is passed, the
1901
          operation changes from migration to attempting recovery from
1902
          a failed previous migration. In this mode, ganeti checks if
1903
          the instance runs on the correct node (and updates its
1904
          configuration if not) and ensures the instances's disks are
1905
          configured correctly. In this mode, the
1906
          <option>--non-live</option> option is ignored.
1907
        </para>
1908

    
1909
        <para>
1910
          The option <option>-f</option> will skip the prompting for
1911
          confirmation.
1912
        </para>
1913
        <para>
1914
          Example (and expected output):
1915
          <screen>
1916
# gnt-instance migrate instance1
1917
Migrate will happen to the instance instance1. Note that migration is
1918
**experimental** in this version. This might impact the instance if
1919
anything goes wrong. Continue?
1920
y/[n]/?: y
1921
* checking disk consistency between source and target
1922
* ensuring the target is in secondary mode
1923
* changing disks into dual-master mode
1924
 - INFO: Waiting for instance instance1 to sync disks.
1925
 - INFO: Instance instance1's disks are in sync.
1926
* migrating instance to node2.example.com
1927
* changing the instance's disks on source node to secondary
1928
 - INFO: Waiting for instance instance1 to sync disks.
1929
 - INFO: Instance instance1's disks are in sync.
1930
* changing the instance's disks to single-master
1931
#
1932
          </screen>
1933
        </para>
1934
      </refsect3>
1935

    
1936
    </refsect2>
1937

    
1938
    <refsect2>
1939
      <title>TAGS</title>
1940

    
1941
    <refsect3>
1942
        <title>ADD-TAGS</title>
1943

    
1944
        <cmdsynopsis>
1945
          <command>add-tags</command>
1946
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
1947
          <arg choice="req"><replaceable>instancename</replaceable></arg>
1948
          <arg choice="req"
1949
            rep="repeat"><replaceable>tag</replaceable></arg>
1950
        </cmdsynopsis>
1951

    
1952
        <para>
1953
          Add tags to the given instance. If any of the tags contains
1954
          invalid characters, the entire operation will abort.
1955
        </para>
1956
        <para>
1957
          If the <option>--from</option> option is given, the list of
1958
          tags will be extended with the contents of that file (each
1959
          line becomes a tag). In this case, there is not need to pass
1960
          tags on the command line (if you do, both sources will be
1961
          used). A file name of - will be interpreted as stdin.
1962
        </para>
1963
      </refsect3>
1964

    
1965
      <refsect3>
1966
        <title>LIST-TAGS</title>
1967

    
1968
        <cmdsynopsis>
1969
          <command>list-tags</command>
1970
          <arg choice="req"><replaceable>instancename</replaceable></arg>
1971
        </cmdsynopsis>
1972

    
1973
        <para>List the tags of the given instance.</para>
1974
      </refsect3>
1975

    
1976
      <refsect3>
1977
        <title>REMOVE-TAGS</title>
1978
        <cmdsynopsis>
1979
          <command>remove-tags</command>
1980
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
1981
          <arg choice="req"><replaceable>instancename</replaceable></arg>
1982
          <arg choice="req"
1983
            rep="repeat"><replaceable>tag</replaceable></arg>
1984
        </cmdsynopsis>
1985

    
1986
        <para>
1987
          Remove tags from the given instance. If any of the tags are
1988
          not existing on the node, the entire operation will abort.
1989
        </para>
1990

    
1991
        <para>
1992
          If the <option>--from</option> option is given, the list of
1993
          tags will be extended with the contents of that file (each
1994
          line becomes a tag). In this case, there is not need to pass
1995
          tags on the command line (if you do, both sources will be
1996
          used). A file name of - will be interpreted as stdin.
1997
        </para>
1998
      </refsect3>
1999

    
2000
    </refsect2>
2001

    
2002
  </refsect1>
2003

    
2004
  &footer;
2005

    
2006
</refentry>
2007

    
2008
<!-- Keep this comment at the end of the file
2009
Local variables:
2010
mode: sgml
2011
sgml-omittag:t
2012
sgml-shorttag:t
2013
sgml-minimize-attributes:nil
2014
sgml-always-quote-attributes:t
2015
sgml-indent-step:2
2016
sgml-indent-data:t
2017
sgml-parent-document:nil
2018
sgml-default-dtd-file:nil
2019
sgml-exposed-tags:nil
2020
sgml-local-catalogs:nil
2021
sgml-local-ecat-files:nil
2022
End:
2023
-->