Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.sgml @ 7ba594c0

History | View | Annotate | Download (91.2 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>January 22, 2010</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
      <year>2010</year>
26
      <holder>Google Inc.</holder>
27
    </copyright>
28
    &dhdate;
29
  </refentryinfo>
30
  <refmeta>
31
    &dhucpackage;
32

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

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

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

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

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

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

    
64
      <refsect3>
65
        <title>ADD</title>
66
        <cmdsynopsis>
67
          <command>add</command>
68
          <sbr>
69
          <arg choice="req">-t<group choice="req">
70
              <arg>diskless</arg>
71
              <arg>file</arg>
72
              <arg>plain</arg>
73
              <arg>drbd</arg>
74
            </group></arg>
75
          <sbr>
76

    
77
          <group choice="req">
78
            <arg rep="repeat">--disk=<replaceable>N</replaceable>:<group choice="req">
79
                <arg>size=<replaceable>VAL</replaceable></arg>
80
                <arg>adopt=<replaceable>LV</replaceable></arg>
81
              </group>,mode=<replaceable>ro|rw</replaceable></arg>
82
            <arg>-s <replaceable>SIZE</replaceable></arg>
83
          </group>
84
          <sbr>
85
          <arg>--no-ip-check</arg>
86
          <arg>--no-name-check</arg>
87
          <arg>--no-start</arg>
88
          <arg>--no-install</arg>
89
          <sbr>
90
          <group>
91
            <arg rep="repeat">--net=<replaceable>N</replaceable><arg rep="repeat">:options</arg></arg>
92
            <arg>--no-nics</arg>
93
          </group>
94
          <sbr>
95
          <arg>-B <replaceable>BEPARAMS</replaceable></arg>
96
          <sbr>
97

    
98
          <arg>-H <replaceable>HYPERVISOR</replaceable><arg>:<arg choice="plain" rep="repeat">option=<replaceable>value</replaceable></arg></arg></arg>
99
          <sbr>
100

    
101
          <arg>--file-storage-dir <replaceable>dir_path</replaceable></arg>
102
          <arg>--file-driver<group choice="req">
103
              <arg>loop</arg>
104
              <arg>blktap</arg>
105
            </group></arg>
106
          <sbr>
107

    
108
          <group choice="req">
109
            <arg>-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg>
110
            <arg>--iallocator <replaceable>name</replaceable></arg>
111
          </group>
112
          <sbr>
113

    
114
          <arg choice="req">-o <replaceable>os-type</replaceable></arg>
115
          <sbr>
116
          <arg>--submit</arg>
117
          <sbr>
118

    
119
          <arg choice="req"><replaceable>instance</replaceable></arg>
120
        </cmdsynopsis>
121

    
122
        <para>
123
          Creates a new instance on the specified host. The
124
          <replaceable>instance</replaceable> argument must be in DNS,
125
          but depending on the bridge/routing setup, need not be in
126
          the same network as the nodes in the cluster.
127
        </para>
128

    
129
        <para>
130
          The <option>disk</option> option specifies the parameters
131
          for the disks of the instance. The numbering of disks starts
132
          at zero, and at least one disk needs to be passed. For each
133
          disk, either the size or the adoption source needs to be
134
          given, and optionally the access mode (read-only or the
135
          default of read-write) can also be specified.  The size is
136
          interpreted (when no unit is given) in mebibytes. You can
137
          also use one of the suffixes
138
          <literal>m</literal>, <literal>g</literal> or
139
          <literal>t</literal> to specificy the exact the units used;
140
          these suffixes map to mebibytes, gibibytes and tebibytes.
141
        </para>
142

    
143
        <para>
144
          When using the <option>adopt</option> key in the disk
145
          definition, Ganeti will reuse those volumes (instead of
146
          creating new ones) as the instance's disks. Ganeti will
147
          rename these volumes to the standard format, and (without
148
          installing the OS) will use them as-is for the
149
          instance. This allows migrating instances from non-managed
150
          mode (e.q. plain KVM with LVM) to being managed via
151
          Ganeti. Note that this works only for the `plain' disk
152
          template (see below for template details).
153
        </para>
154

    
155
        <para>
156
          Alternatively, a single-disk instance can be created via the
157
          <option>-s</option> option which takes a single argument,
158
          the size of the disk. This is similar to the Ganeti 1.2
159
          version (but will only create one disk).
160
        </para>
161

    
162
        <para>
163
          The minimum disk specification is therefore
164
          <userinput>--disk 0:size=20G</userinput> (or <userinput>-s
165
          20G</userinput> when using the <option>-s</option> option),
166
          and a three-disk instance can be specified as
167
          <userinput>--disk 0:size=20G --disk 1:size=4G --disk
168
          2:size=100G</userinput>.
169
        </para>
170

    
171
        <para>
172
          The <option>--no-ip-check</option> skips the checks that are
173
          done to see if the instance's IP is not already alive
174
          (i.e. reachable from the master node).
175
        </para>
176

    
177
        <para>
178
          The <option>--no-name-check</option> skips the check for the
179
          instance name via the resolver (e.g. in DNS or /etc/hosts,
180
          depending on your setup). Since the name check is used to
181
          compute the IP address, if you pass this option you must
182
          also pass the <option>--no-ip-check</option> option.
183
        </para>
184

    
185
        <para>
186
          If you don't wat the instance to automatically start after
187
          creation, this is possible via the
188
          <option>--no-start</option> option. This will leave the
189
          instance down until a subsequent <command>gnt-instance
190
          start</command> command.
191
        </para>
192

    
193
        <para>
194
          The NICs of the instances can be specified via the
195
          <option>--net</option> option. By default, one NIC is
196
          created for the instance, with a random MAC, and set
197
          up according the the cluster level nic parameters.
198
          Each NIC can take these parameters (all optional):
199
          <variablelist>
200
            <varlistentry>
201
              <term>mac</term>
202
              <listitem>
203
                <simpara>either a value or <constant>GENERATE</constant>
204
                  to generate a new unique MAC</simpara>
205
              </listitem>
206
            </varlistentry>
207
            <varlistentry>
208
              <term>ip</term>
209
              <listitem>
210
                <simpara>specifies the IP address assigned to the
211
                  instance from the Ganeti side (this is not necessarily
212
                  what the instance will use, but what the node expects
213
                  the instance to use)</simpara>
214
              </listitem>
215
            </varlistentry>
216
            <varlistentry>
217
              <term>mode</term>
218
              <listitem>
219
                <simpara>specifies the connection mode for this nic:
220
                  routed or bridged.</simpara>
221
              </listitem>
222
            </varlistentry>
223
            <varlistentry>
224
              <term>link</term>
225
              <listitem>
226
                <simpara>in bridged mode specifies the bridge to attach
227
                  this NIC to, in routed mode it's intended to
228
                  differentiate between different routing tables/instance
229
                  groups (but the meaning is dependent on the network
230
                  script, see gnt-cluster(8) for more details)</simpara>
231
              </listitem>
232
            </varlistentry>
233
          </variablelist>
234
          Of these "mode" and "link" are nic parameters, and inherit their
235
          default at cluster level.
236
        </para>
237

    
238
        <para>
239
          Alternatively, if no network is desired for the instance, you
240
          can prevent the default of one NIC with the
241
          <option>--no-nics</option> option.
242
        </para>
243

    
244
        <para>
245
          The <option>-o</option> options specifies the operating
246
          system to be installed. The available operating systems can
247
          be listed with <command>gnt-os
248
          list</command>. Passing <option>--no-install</option> will
249
          however skip the OS installation, allowing a manual import
250
          if so desired. Note that the no-installation mode will
251
          automatically disable the start-up of the instance (without
252
          an OS, it most likely won't be able to start-up
253
          successfully).
254
        </para>
255

    
256
        <para>
257
          The <option>-B</option> option specifies the backend
258
          parameters for the instance. If no such parameters are
259
          specified, the values are inherited from the cluster. Possible
260
          parameters are:
261
          <variablelist>
262
            <varlistentry>
263
              <term>memory</term>
264
              <listitem>
265
                <simpara>the memory size of the instance; as usual,
266
                  suffixes can be used to denote the unit, otherwise the
267
                  value is taken in mebibites</simpara>
268
              </listitem>
269
            </varlistentry>
270
            <varlistentry>
271
              <term>vcpus</term>
272
              <listitem>
273
                <simpara>the number of VCPUs to assign to the instance
274
                  (if this value makes sense for the hypervisor)</simpara>
275
              </listitem>
276
            </varlistentry>
277
            <varlistentry>
278
              <term>auto_balance</term>
279
              <listitem>
280
                <simpara>whether the instance is considered in the N+1
281
                  cluster checks (enough redundancy in the cluster to
282
                  survive a node failure)</simpara>
283
              </listitem>
284
            </varlistentry>
285
          </variablelist>
286
        </para>
287

    
288
        <para>
289
          The <option>-H</option> option specified the hypervisor to
290
          use for the instance (must be one of the enabled hypervisors
291
          on the cluster) and optionally custom parameters for this
292
          instance. If not other options are used (i.e. the invocation
293
          is just <userinput>-H
294
          <replaceable>NAME</replaceable></userinput>) the instance
295
          will inherit the cluster options. The defaults below show
296
          the cluster defaults at cluster creation time.
297
        </para>
298

    
299
        <para>
300
          The possible hypervisor options are as follows:
301
          <variablelist>
302
            <varlistentry>
303
              <term>boot_order</term>
304
              <listitem>
305
                <simpara>Valid for the Xen HVM and KVM
306
                hypervisors.</simpara>
307

    
308
                <simpara>A string value denoting the boot order. This
309
                has different meaning for the Xen HVM hypervisor and
310
                for the KVM one.</simpara>
311

    
312
                <simpara>
313
                  For Xen HVM, The boot order is a string of letters
314
                  listing the boot devices, with valid device letters
315
                  being:
316
                </simpara>
317
                  <variablelist>
318
                    <varlistentry>
319
                      <term>a</term>
320
                      <listitem>
321
                        <para>
322
                          floppy drive
323
                        </para>
324
                      </listitem>
325
                    </varlistentry>
326
                    <varlistentry>
327
                      <term>c</term>
328
                      <listitem>
329
                        <para>
330
                          hard disk
331
                        </para>
332
                      </listitem>
333
                    </varlistentry>
334
                    <varlistentry>
335
                      <term>d</term>
336
                      <listitem>
337
                        <para>
338
                          CDROM drive
339
                        </para>
340
                      </listitem>
341
                    </varlistentry>
342
                    <varlistentry>
343
                      <term>n</term>
344
                      <listitem>
345
                        <para>
346
                          network boot (PXE)
347
                        </para>
348
                      </listitem>
349
                    </varlistentry>
350
                  </variablelist>
351
                <simpara>
352
                  The default is not to set an HVM boot order which is
353
                  interpreted as 'dc'.
354
                </simpara>
355

    
356
                <simpara>
357
                  For KVM the boot order is either
358
                  <quote>cdrom</quote>, <quote>disk</quote> or
359
                  <quote>network</quote>. Please note that older
360
                  versions of KVM couldn't netboot from virtio
361
                  interfaces. This has been fixed in more recent
362
                  versions and is confirmed to work at least with
363
                  qemu-kvm 0.11.1.
364
                </simpara>
365

    
366
              </listitem>
367
            </varlistentry>
368
            <varlistentry>
369
              <term>cdrom_image_path</term>
370
              <listitem>
371
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
372

    
373
                <simpara>The path to a CDROM image to attach to the
374
                instance.</simpara>
375

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

    
383
                <para>
384
                  This parameter determines the way the network cards
385
                  are presented to the instance. The possible options are:
386
                  <simplelist>
387
                    <member>rtl8139 (default for Xen HVM) (HVM & KVM)</member>
388
                    <member>ne2k_isa (HVM & KVM)</member>
389
                    <member>ne2k_pci (HVM & KVM)</member>
390
                    <member>i82551 (KVM)</member>
391
                    <member>i82557b (KVM)</member>
392
                    <member>i82559er (KVM)</member>
393
                    <member>pcnet (KVM)</member>
394
                    <member>e1000 (KVM)</member>
395
                    <member>paravirtual (default for KVM) (HVM & KVM)</member>
396
                  </simplelist>
397
                </para>
398
              </listitem>
399
            </varlistentry>
400
            <varlistentry>
401
              <term>disk_type</term>
402
              <listitem>
403
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
404

    
405
                <para>
406
                  This parameter determines the way the disks are
407
                  presented to the instance. The possible options are:
408
                  <simplelist>
409
                    <member>ioemu (default for HVM & KVM) (HVM & KVM)</member>
410
                    <member>ide (HVM & KVM)</member>
411
                    <member>scsi (KVM)</member>
412
                    <member>sd (KVM)</member>
413
                    <member>mtd (KVM)</member>
414
                    <member>pflash (KVM)</member>
415
                  </simplelist>
416
                </para>
417
              </listitem>
418
            </varlistentry>
419
            <varlistentry>
420
              <term>vnc_bind_address</term>
421
              <listitem>
422
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
423

    
424
                <para>Specifies the address that the VNC listener for
425
                this instance should bind to. Valid values are IPv4
426
                addresses. Use the address 0.0.0.0 to bind to all
427
                available interfaces (this is the default) or specify
428
                the address of one of the interfaces on the node to
429
                restrict listening to that interface.</para>
430
              </listitem>
431
            </varlistentry>
432

    
433
            <varlistentry>
434
              <term>vnc_tls</term>
435
              <listitem>
436
                <simpara>Valid for the KVM hypervisor.</simpara>
437

    
438
                <simpara>A boolean option that controls whether the
439
                VNC connection is secured with TLS.</simpara>
440
              </listitem>
441
            </varlistentry>
442

    
443
            <varlistentry>
444
              <term>vnc_x509_path</term>
445
              <listitem>
446
                <simpara>Valid for the KVM hypervisor.</simpara>
447

    
448
                <para>If <option>vnc_tls</option> is enabled, this
449
                options specifies the path to the x509 certificate to
450
                use.</para>
451
              </listitem>
452
            </varlistentry>
453

    
454
            <varlistentry>
455
              <term>vnc_x509_verify</term>
456
              <listitem>
457
                <simpara>Valid for the KVM hypervisor.</simpara>
458
              </listitem>
459
            </varlistentry>
460

    
461
            <varlistentry>
462
              <term>acpi</term>
463
              <listitem>
464
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
465

    
466
                <para>
467
                  A boolean option that specifies if the hypervisor
468
                  should enable ACPI support for this instance. By
469
                  default, ACPI is disabled.
470
                </para>
471
              </listitem>
472
            </varlistentry>
473

    
474
            <varlistentry>
475
              <term>pae</term>
476
              <listitem>
477
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
478

    
479
                <para>
480
                  A boolean option that specifies if the hypervisor
481
                  should enabled PAE support for this instance. The
482
                  default is false, disabling PAE support.
483
                </para>
484
              </listitem>
485
            </varlistentry>
486

    
487
            <varlistentry>
488
              <term>use_localtime</term>
489
              <listitem>
490
                <simpara>Valid for the Xen HVM and KVM hypervisors.</simpara>
491

    
492
                <para>
493
                  A boolean option that specifies if the instance
494
                  should be started with its clock set to the
495
                  localtime of the machine (when true) or to the UTC
496
                  (When false). The default is false, which is useful
497
                  for Linux/Unix machines; for Windows OSes, it is
498
                  recommended to enable this parameter.
499
                </para>
500
              </listitem>
501
            </varlistentry>
502

    
503
            <varlistentry>
504
              <term>kernel_path</term>
505
              <listitem>
506
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
507

    
508
                <para>
509
                  This option specifies the path (on the node) to the
510
                  kernel to boot the instance with. Xen PVM instances
511
                  always require this, while for KVM if this option is
512
                  empty, it will cause the machine to load the kernel
513
                  from its disks.
514
                </para>
515
              </listitem>
516
            </varlistentry>
517

    
518
            <varlistentry>
519
              <term>kernel_args</term>
520
              <listitem>
521
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
522

    
523
                <para>
524
                  This options specifies extra arguments to the kernel
525
                  that will be loaded.  device. This is always used
526
                  for Xen PVM, while for KVM it is only used if the
527
                  <option>kernel_path</option> option is also
528
                  specified.
529
                </para>
530

    
531
                <para>
532
                  The default setting for this value is simply
533
                  <constant>"ro"</constant>, which mounts the root
534
                  disk (initially) in read-only one. For example,
535
                  setting this to <userinput>single</userinput> will
536
                  cause the instance to start in single-user mode.
537
                </para>
538
              </listitem>
539
            </varlistentry>
540

    
541
            <varlistentry>
542
              <term>initrd_path</term>
543
              <listitem>
544
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
545

    
546
                <para>
547
                  This option specifies the path (on the node) to the
548
                  initrd to boot the instance with. Xen PVM instances
549
                  can use this always, while for KVM if this option is
550
                  only used if the <option>kernel_path</option> option
551
                  is also specified. You can pass here either an
552
                  absolute filename (the path to the initrd) if you
553
                  want to use an initrd, or use the format
554
                  <userinput>no_initrd_path</userinput> for no initrd.
555
                </para>
556
              </listitem>
557
            </varlistentry>
558

    
559
            <varlistentry>
560
              <term>root_path</term>
561
              <listitem>
562
                <simpara>Valid for the Xen PVM and KVM hypervisors.</simpara>
563

    
564
                <para>
565
                  This options specifies the name of the root
566
                  device. This is always needed for Xen PVM, while for
567
                  KVM it is only used if the
568
                  <option>kernel_path</option> option is also
569
                  specified.
570
                </para>
571
              </listitem>
572
            </varlistentry>
573

    
574
            <varlistentry>
575
              <term>serial_console</term>
576
              <listitem>
577
                <simpara>Valid for the KVM hypervisor.</simpara>
578

    
579
                <simpara>This boolean option specifies whether to
580
                emulate a serial console for the instance.</simpara>
581
              </listitem>
582
            </varlistentry>
583

    
584
            <varlistentry>
585
              <term>disk_cache</term>
586
              <listitem>
587
                <simpara>Valid for the KVM hypervisor.</simpara>
588

    
589
                <simpara>The disk cache mode. It can be either
590
                <userinput>default</userinput> to not pass any cache
591
                option to KVM, or one of the KVM cache modes: none
592
                (for direct I/O), writethrough (to use the host cache
593
                but report completion to the guest only when the host
594
                has commited the changes to disk) or writeback (to use
595
                the host cache and report completion as soon as the
596
                data is in the host cache). Note that there are
597
                special considerations for the cache mode depending on
598
                version of KVM used and disk type (always raw file
599
                under Ganeti), please refer to the KVM documentation
600
                for more details.
601
                </simpara>
602
              </listitem>
603
            </varlistentry>
604

    
605
            <varlistentry>
606
              <term>security_model</term>
607
              <listitem>
608
                <simpara>Valid for the KVM hypervisor.</simpara>
609

    
610
                <simpara>The security model for kvm. Currently one of
611
                <quote>none</quote>, <quote>user</quote> or
612
                <quote>pool</quote>. Under <quote>none</quote>, the
613
                default, nothing is done and instances are run as
614
                the ganeti daemon user (normally root).
615
                </simpara>
616

    
617
                <simpara>Under <quote>user</quote> kvm will drop
618
                privileges and become the user specified by the
619
                security_domain parameter.
620
                </simpara>
621

    
622
                <simpara>Under <quote>pool</quote> a global cluster
623
                pool of users will be used, making sure no two
624
                instances share the same user on the same node.
625
                (this mode is not implemented yet)
626
                </simpara>
627

    
628
              </listitem>
629
            </varlistentry>
630

    
631
            <varlistentry>
632
              <term>security_domain</term>
633
              <listitem>
634
                <simpara>Valid for the KVM hypervisor.</simpara>
635

    
636
                <simpara>Under security model <quote>user</quote> the username to
637
                run the instance under. It must be a valid username
638
                existing on the host.
639
                </simpara>
640
                <simpara>Cannot be set under security model <quote>none</quote>
641
                or <quote>pool</quote>.
642
                </simpara>
643

    
644
              </listitem>
645
            </varlistentry>
646

    
647
            <varlistentry>
648
              <term>kvm_flag</term>
649
              <listitem>
650
                <simpara>Valid for the KVM hypervisor.</simpara>
651

    
652
                <simpara>If <quote>enabled</quote> the -enable-kvm flag is
653
                passed to kvm. If <quote>disabled</quote> -disable-kvm is
654
                passed. If unset no flag is passed, and the default running
655
                mode for your kvm binary will be used.
656
                </simpara>
657

    
658
              </listitem>
659
            </varlistentry>
660

    
661
          </variablelist>
662

    
663
        </para>
664

    
665
        <para>
666
          The <option>--iallocator</option> option specifies the instance
667
          allocator plugin to use. If you pass in this option the allocator
668
          will select nodes for this instance automatically, so you don't need
669
          to pass them with the <option>-n</option> option. For more
670
          information please refer to the instance allocator documentation.
671
        </para>
672

    
673
        <para>
674
          The <option>-t</option> options specifies the disk layout type for
675
          the instance. The available choices are:
676
          <variablelist>
677
            <varlistentry>
678
              <term>diskless</term>
679
              <listitem>
680
                <para>
681
                  This creates an instance with no disks. Its useful for
682
                  testing only (or other special cases).
683
                </para>
684
              </listitem>
685
            </varlistentry>
686
            <varlistentry>
687
              <term>file</term>
688
              <listitem>
689
                <para>Disk devices will be regular files.</para>
690
              </listitem>
691
            </varlistentry>
692
            <varlistentry>
693
              <term>plain</term>
694
              <listitem>
695
                <para>Disk devices will be logical volumes.</para>
696
              </listitem>
697
            </varlistentry>
698
            <varlistentry>
699
              <term>drbd</term>
700
              <listitem>
701
                <para>
702
                  Disk devices will be drbd (version 8.x) on top of
703
                  lvm volumes.
704
                </para>
705
              </listitem>
706
            </varlistentry>
707
          </variablelist>
708
        </para>
709

    
710
        <para>
711
          The optional second value of the <option>--node</option> is used for
712
          the drbd template type and specifies the remote node.
713
        </para>
714

    
715
        <para>
716
          If you do not want gnt-instance to wait for the disk mirror
717
          to be synced, use the <option>--no-wait-for-sync</option>
718
          option.
719
        </para>
720

    
721
        <para>
722
          The <option>--file-storage-dir</option> specifies the relative path
723
          under the cluster-wide file storage directory to store file-based
724
          disks. It is useful for having different subdirectories for
725
          different instances. The full path of the directory where the disk
726
          files are stored will consist of cluster-wide file storage directory
727
          + optional subdirectory + instance name. Example:
728
          /srv/ganeti/file-storage/mysubdir/instance1.example.com. This option
729
          is only relevant for instances using the file storage backend.
730
        </para>
731

    
732
        <para>
733
          The <option>--file-driver</option> specifies the driver to use for
734
          file-based disks. Note that currently these drivers work with the
735
          xen hypervisor only. This option is only relevant for instances using
736
          the file storage backend. The available choices are:
737
          <variablelist>
738
            <varlistentry>
739
              <term>loop</term>
740
              <listitem>
741
                <para>
742
                  Kernel loopback driver. This driver uses loopback
743
                  devices to access the filesystem within the
744
                  file. However, running I/O intensive applications in
745
                  your instance using the loop driver might result in
746
                  slowdowns.  Furthermore, if you use the loopback
747
                  driver consider increasing the maximum amount of
748
                  loopback devices (on most systems it's 8) using the
749
                  max_loop param.
750
                </para>
751
              </listitem>
752
            </varlistentry>
753
            <varlistentry>
754
              <term>blktap</term>
755
              <listitem>
756
                <para>The blktap driver (for Xen hypervisors). In
757
                order to be able to use the blktap driver you should
758
                check if the 'blktapctrl' user space disk agent is
759
                running (usually automatically started via xend). This
760
                user-level disk I/O interface has the advantage of
761
                better performance. Especially if you use a network
762
                file system (e.g. NFS) to store your instances this is
763
                the recommended choice.
764
                </para>
765
              </listitem>
766
            </varlistentry>
767
          </variablelist>
768
        </para>
769

    
770
        <para>
771
          The <option>--submit</option> option is used to send the job to
772
          the master daemon but not wait for its completion. The job
773
          ID will be shown so that it can be examined via
774
          <command>gnt-job info</command>.
775
        </para>
776

    
777
        <para>
778
          Example:
779
          <screen>
780
# gnt-instance add -t file --disk 0:size=30g -B memory=512 -o debian-etch \
781
  -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
782
# gnt-instance add -t plain --disk 0:size=30g -B memory=512 -o debian-etch \
783
  -n node1.example.com instance1.example.com
784
# gnt-instance add -t drbd --disk 0:size=30g -B memory=512 -o debian-etch \
785
  -n node1.example.com:node2.example.com instance2.example.com
786
          </screen>
787
        </para>
788
      </refsect3>
789

    
790
      <refsect3>
791
        <title>BATCH-CREATE</title>
792
        <cmdsynopsis>
793
          <command>batch-create</command>
794
          <arg choice="req">instances_file.json</arg>
795
        </cmdsynopsis>
796

    
797
        <para>
798
          This command (similar to the Ganeti 1.2
799
          <command>batcher</command> tool) submits multiple instance
800
          creation jobs based on a definition file. The instance
801
          configurations do not encompass all the possible options for
802
          the <command>add</command> command, but only a subset.
803
        </para>
804

    
805
        <para>
806
          The instance file should be a valid-formed JSON file,
807
          containing a dictionary with instance name and instance
808
          parameters. The accepted parameters are:
809

    
810
          <variablelist>
811
            <varlistentry>
812
              <term>disk_size</term>
813
              <listitem>
814
                <simpara>The size of the disks of the instance.</simpara>
815
              </listitem>
816
            </varlistentry>
817
            <varlistentry>
818
              <term>disk_templace</term>
819
              <listitem>
820
                <simpara>The disk template to use for the instance,
821
                the same as in the <command>add</command>
822
                command.</simpara>
823
              </listitem>
824
            </varlistentry>
825
            <varlistentry>
826
              <term>backend</term>
827
              <listitem>
828
                <simpara>A dictionary of backend parameters.</simpara>
829
              </listitem>
830
            </varlistentry>
831
            <varlistentry>
832
              <term>hypervisor</term>
833
              <listitem>
834
                <simpara>A dictionary with a single key (the
835
                hypervisor name), and as value the hypervisor
836
                options. If not passed, the default hypervisor and
837
                hypervisor options will be inherited.</simpara>
838
              </listitem>
839
            </varlistentry>
840
            <varlistentry>
841
              <term>mac, ip, mode, link</term>
842
              <listitem>
843
                <simpara>Specifications for the one NIC that will be
844
                created for the instance. 'bridge' is also accepted
845
                as a backwards compatibile key.</simpara>
846
              </listitem>
847
            </varlistentry>
848
            <varlistentry>
849
              <term>nics</term>
850
              <listitem>
851
                <simpara>List of nics that will be created for the
852
                instance. Each entry should be a dict, with mac, ip, mode
853
                and link as possible keys. Please don't provide the "mac,
854
                ip, mode, link" parent keys if you use this method for
855
                specifying nics.</simpara>
856
              </listitem>
857
            </varlistentry>
858
            <varlistentry>
859
              <term>primary_node, secondary_node</term>
860
              <listitem>
861
                <simpara>The primary and optionally the secondary node
862
                to use for the instance (in case an iallocator script
863
                is not used).</simpara>
864
              </listitem>
865
            </varlistentry>
866
            <varlistentry>
867
              <term>iallocator</term>
868
              <listitem>
869
                <simpara>Instead of specifying the nodes, an
870
                iallocator script can be used to automatically compute
871
                them.</simpara>
872
              </listitem>
873
            </varlistentry>
874
            <varlistentry>
875
              <term>start</term>
876
              <listitem>
877
                <simpara>whether to start the instance</simpara>
878
              </listitem>
879
            </varlistentry>
880
            <varlistentry>
881
              <term>ip_check</term>
882
              <listitem>
883
                <simpara>Skip the check for already-in-use instance;
884
                see the description in the <command>add</command>
885
                command for details.</simpara>
886
              </listitem>
887
            </varlistentry>
888
            <varlistentry>
889
              <term>name_check</term>
890
              <listitem>
891
                <simpara>Skip the name check for instances;
892
                see the description in the <command>add</command>
893
                command for details.</simpara>
894
              </listitem>
895
            </varlistentry>
896
            <varlistentry>
897
              <term>file_storage_dir, file_driver</term>
898
              <listitem>
899
                <simpara>Configuration for the <literal>file</literal>
900
                disk type, see the <command>add</command> command for
901
                details.</simpara>
902
              </listitem>
903
            </varlistentry>
904
          </variablelist>
905
        </para>
906

    
907
        <para>
908
          A simple definition for one instance can be (with most of
909
          the parameters taken from the cluster defaults):
910
          <screen>
911
{
912
  "instance3": {
913
    "template": "drbd",
914
    "os": "debootstrap",
915
    "disk_size": ["25G"],
916
    "iallocator": "dumb"
917
  },
918
  "instance5": {
919
    "template": "drbd",
920
    "os": "debootstrap",
921
    "disk_size": ["25G"],
922
    "iallocator": "dumb",
923
    "hypervisor": "xen-hvm",
924
    "hvparams": {"acpi": true},
925
    "backend": {"memory": 512}
926
  }
927
}
928
</screen>
929
        </para>
930

    
931
        <para>
932
          The command will display the job id for each submitted instance, as follows:
933
          <screen>
934
# gnt-instance batch-create instances.json
935
instance3: 11224
936
instance5: 11225
937
</screen>
938
        </para>
939

    
940
      </refsect3>
941

    
942
      <refsect3>
943
        <title>REMOVE</title>
944

    
945
        <cmdsynopsis>
946
          <command>remove</command>
947
          <arg>--ignore-failures</arg>
948
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
949
          <arg>--submit</arg>
950
          <arg choice="req"><replaceable>instance</replaceable></arg>
951
        </cmdsynopsis>
952

    
953
        <para>
954
          Remove an instance. This will remove all data from the
955
          instance and there is <emphasis>no way back</emphasis>. If
956
          you are not sure if you use an instance again, use
957
          <command>shutdown</command> first and leave it in the
958
          shutdown state for a while.
959

    
960
        </para>
961

    
962
        <para>
963
          The <option>--ignore-failures</option> option will cause the
964
          removal to proceed even in the presence of errors during the
965
          removal of the instance (e.g. during the shutdown or the
966
          disk removal). If this option is not given, the command will
967
          stop at the first error.
968
        </para>
969

    
970
        <para>
971
          The <option>--shutdown-timeout</option> is used to specify how
972
          much time to wait before forcing the shutdown (xm destroy in xen,
973
          killing the kvm process, for kvm). By default two minutes are
974
          given to each instance to stop.
975
        </para>
976

    
977
        <para>
978
          The <option>--submit</option> option is used to send the job to
979
          the master daemon but not wait for its completion. The job
980
          ID will be shown so that it can be examined via
981
          <command>gnt-job info</command>.
982
        </para>
983

    
984
        <para>
985
          Example:
986
          <screen>
987
# gnt-instance remove instance1.example.com
988
          </screen>
989
        </para>
990
      </refsect3>
991

    
992
      <refsect3>
993
        <title>LIST</title>
994

    
995
        <cmdsynopsis>
996
          <command>list</command>
997
          <arg>--no-headers</arg>
998
          <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
999
          <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
1000
          <arg rep="repeat">instance</arg>
1001
        </cmdsynopsis>
1002

    
1003
        <para>
1004
          Shows the currently configured instances with memory usage,
1005
          disk usage, the node they are running on, and their run
1006
          status.
1007
        </para>
1008

    
1009
        <para>
1010
          The <option>--no-headers</option> option will skip the
1011
          initial header line. The <option>--separator</option> option
1012
          takes an argument which denotes what will be used between
1013
          the output fields. Both these options are to help scripting.
1014
        </para>
1015

    
1016
        <para>
1017
          The <option>-o</option> option takes a comma-separated list
1018
          of output fields. The available fields and their meaning
1019
          are:
1020
          <variablelist>
1021
            <varlistentry>
1022
              <term>name</term>
1023
              <listitem>
1024
                <simpara>the instance name</simpara>
1025
              </listitem>
1026
            </varlistentry>
1027
            <varlistentry>
1028
              <term>os</term>
1029
              <listitem>
1030
                <simpara>the OS of the instance</simpara>
1031
              </listitem>
1032
            </varlistentry>
1033
            <varlistentry>
1034
              <term>pnode</term>
1035
              <listitem>
1036
                <simpara>the primary node of the instance</simpara>
1037
              </listitem>
1038
            </varlistentry>
1039
            <varlistentry>
1040
              <term>snodes</term>
1041
              <listitem>
1042
                <simpara>comma-separated list of secondary nodes for the
1043
                  instance; usually this will be just one node</simpara>
1044
              </listitem>
1045
            </varlistentry>
1046
            <varlistentry>
1047
              <term>admin_state</term>
1048
              <listitem>
1049
                <simpara>the desired state of the instance (either "yes"
1050
                  or "no" denoting the instance should run or
1051
                  not)</simpara>
1052
              </listitem>
1053
            </varlistentry>
1054
            <varlistentry>
1055
              <term>disk_template</term>
1056
              <listitem>
1057
                <simpara>the disk template of the instance</simpara>
1058
              </listitem>
1059
            </varlistentry>
1060
            <varlistentry>
1061
              <term>oper_state</term>
1062
              <listitem>
1063
                <simpara>the actual state of the instance; can be
1064
                one of the values "running", "stopped", "(node
1065
                down)"</simpara>
1066
              </listitem>
1067
            </varlistentry>
1068
            <varlistentry>
1069
              <term>status</term>
1070
              <listitem>
1071
                <simpara>combined form of admin_state and oper_stat;
1072
                this can be one of:
1073
                <computeroutput>ERROR_nodedown</computeroutput> if the
1074
                node of the instance is down,
1075
                <computeroutput>ERROR_down</computeroutput> if the
1076
                instance should run but is down,
1077
                <computeroutput>ERROR_up</computeroutput> if the
1078
                instance should be stopped but is actually running,
1079
                <computeroutput>ADMIN_down</computeroutput> if the
1080
                instance has been stopped (and is stopped) and
1081
                <computeroutput>running</computeroutput> if the
1082
                instance is set to be running (and is
1083
                running)</simpara>
1084
              </listitem>
1085
            </varlistentry>
1086
            <varlistentry>
1087
              <term>oper_ram</term>
1088
              <listitem>
1089
                <simpara>the actual memory usage of the instance as seen
1090
                  by the hypervisor</simpara>
1091
              </listitem>
1092
            </varlistentry>
1093
            <varlistentry>
1094
              <term>ip</term>
1095
              <listitem>
1096
                <simpara>the ip address ganeti recognizes as associated with
1097
                the first instance interface</simpara>
1098
              </listitem>
1099
            </varlistentry>
1100
            <varlistentry>
1101
              <term>mac</term>
1102
              <listitem>
1103
                <simpara>the first instance interface MAC address</simpara>
1104
              </listitem>
1105
            </varlistentry>
1106

    
1107
            <varlistentry>
1108
              <term>nic_mode</term>
1109
              <listitem>
1110
                <simpara>the mode of the first instance NIC
1111
                (routed or bridged)</simpara>
1112
              </listitem>
1113
            </varlistentry>
1114
            <varlistentry>
1115
              <term>nic_link</term>
1116
              <listitem>
1117
                <simpara>the link of the first instance NIC
1118
                </simpara>
1119
              </listitem>
1120
            </varlistentry>
1121
            <varlistentry>
1122
              <term>sda_size</term>
1123
              <listitem>
1124
                <simpara>the size of the instance's first disk</simpara>
1125
              </listitem>
1126
            </varlistentry>
1127
            <varlistentry>
1128
              <term>sdb_size</term>
1129
              <listitem>
1130
                <simpara>the size of the instance's second disk, if
1131
                any</simpara>
1132
              </listitem>
1133
            </varlistentry>
1134
            <varlistentry>
1135
              <term>vcpus</term>
1136
              <listitem>
1137
                <simpara>the number of VCPUs allocated to the
1138
                instance</simpara>
1139
              </listitem>
1140
            </varlistentry>
1141
            <varlistentry>
1142
              <term>tags</term>
1143
              <listitem>
1144
                <simpara>comma-separated list of the instances's
1145
                tags</simpara>
1146
              </listitem>
1147
            </varlistentry>
1148
            <varlistentry>
1149
              <term>serial_no</term>
1150
              <listitem>
1151
                <simpara>the so called 'serial number' of the
1152
                instance; this is a numeric field that is incremented
1153
                each time the instance is modified, and it can be used
1154
                to track modifications</simpara>
1155
              </listitem>
1156
            </varlistentry>
1157
            <varlistentry>
1158
              <term>ctime</term>
1159
              <listitem>
1160
                <para>
1161
                  the creation time of the instance; note that this
1162
                  field contains spaces and as such it's harder to
1163
                  parse
1164
                </para>
1165
                <para>
1166
                  if this attribute is not present (e.g. when
1167
                  upgrading from older versions), then "N/A" will be
1168
                  shown instead
1169
                </para>
1170
              </listitem>
1171
            </varlistentry>
1172
            <varlistentry>
1173
              <term>mtime</term>
1174
              <listitem>
1175
                <para>
1176
                  the last modification time of the instance; note
1177
                  that this field contains spaces and as such it's
1178
                  harder to parse
1179
                </para>
1180
                <para>
1181
                  if this attribute is not present (e.g. when
1182
                  upgrading from older versions), then "N/A" will be
1183
                  shown instead
1184
                </para>
1185
              </listitem>
1186
            </varlistentry>
1187

    
1188
            <varlistentry>
1189
              <term>uuid</term>
1190
              <listitem>
1191
                <simpara>Show the UUID of the instance (generated
1192
                automatically by Ganeti)</simpara>
1193
              </listitem>
1194
            </varlistentry>
1195

    
1196
            <varlistentry>
1197
              <term>network_port</term>
1198
              <listitem>
1199
                <simpara>If the instance has a network port assigned
1200
                to it (e.g. for VNC connections), this will be shown,
1201
                otherwise <literal>-</literal> will be
1202
                displayed.</simpara>
1203
              </listitem>
1204
            </varlistentry>
1205
            <varlistentry>
1206
              <term>beparams</term>
1207
              <listitem>
1208
                <simpara>A text format of the entire beparams for the
1209
                instance. It's more useful to select individual fields
1210
                from this dictionary, see below.</simpara>
1211
              </listitem>
1212
            </varlistentry>
1213
            <varlistentry>
1214
              <term>disk.count</term>
1215
              <listitem>
1216
                <simpara>The number of instance disks.</simpara>
1217
              </listitem>
1218
            </varlistentry>
1219
            <varlistentry>
1220
              <term>disk.size/N</term>
1221
              <listitem>
1222
                <simpara>The size of the instance's Nth disk. This is
1223
                a more generic form of the <literal>sda_size</literal>
1224
                and <literal>sdb_size</literal> fields.</simpara>
1225
              </listitem>
1226
            </varlistentry>
1227
            <varlistentry>
1228
              <term>disk.sizes</term>
1229
              <listitem>
1230
                <simpara>A comma-separated list of the disk sizes for
1231
                this instance.</simpara>
1232
              </listitem>
1233
            </varlistentry>
1234
            <varlistentry>
1235
              <term>disk_usage</term>
1236
              <listitem>
1237
                <simpara>The total disk space used by this instance on
1238
                each of its nodes. This is not the instance-visible
1239
                disk size, but the actual disk "cost" of the
1240
                instance.</simpara>
1241
              </listitem>
1242
            </varlistentry>
1243
            <varlistentry>
1244
              <term>nic.mac/N</term>
1245
              <listitem>
1246
                <simpara>The MAC of the Nth instance NIC.</simpara>
1247
              </listitem>
1248
            </varlistentry>
1249
            <varlistentry>
1250
              <term>nic.ip/N</term>
1251
              <listitem>
1252
                <simpara>The IP address of the Nth instance NIC.</simpara>
1253
              </listitem>
1254
            </varlistentry>
1255
            <varlistentry>
1256
              <term>nic.mode/N</term>
1257
              <listitem>
1258
                <simpara>The mode of the Nth instance NIC</simpara>
1259
              </listitem>
1260
            </varlistentry>
1261
            <varlistentry>
1262
              <term>nic.link/N</term>
1263
              <listitem>
1264
                <simpara>The link of the Nth instance NIC</simpara>
1265
              </listitem>
1266
            </varlistentry>
1267
            <varlistentry>
1268
              <term>nic.macs</term>
1269
              <listitem>
1270
                <simpara>A comma-separated list of all the MACs of the
1271
                instance's NICs.</simpara>
1272
              </listitem>
1273
            </varlistentry>
1274
            <varlistentry>
1275
              <term>nic.ips</term>
1276
              <listitem>
1277
                <simpara>A comma-separated list of all the IP
1278
                addresses of the instance's NICs.</simpara>
1279
              </listitem>
1280
            </varlistentry>
1281
            <varlistentry>
1282
              <term>nic.modes</term>
1283
              <listitem>
1284
                <simpara>A comma-separated list of all the modes of the
1285
                instance's NICs.</simpara>
1286
              </listitem>
1287
            </varlistentry>
1288
            <varlistentry>
1289
              <term>nic.links</term>
1290
              <listitem>
1291
                <simpara>A comma-separated list of all the link parameters
1292
                of the instance's NICs.</simpara>
1293
              </listitem>
1294
            </varlistentry>
1295
            <varlistentry>
1296
              <term>nic.count</term>
1297
              <listitem>
1298
                <simpara>The number of instance nics.</simpara>
1299
              </listitem>
1300
            </varlistentry>
1301
            <varlistentry>
1302
              <term>hv/<replaceable>NAME</replaceable></term>
1303
              <listitem>
1304
                <simpara>The value of the hypervisor parameter called
1305
                <replaceable>NAME</replaceable>. For details of what
1306
                hypervisor parameters exist and their meaning, see the
1307
                <command>add</command> command.</simpara>
1308
              </listitem>
1309
            </varlistentry>
1310
            <varlistentry>
1311
              <term>be/memory</term>
1312
              <listitem>
1313
                <simpara>The configured memory for the instance.</simpara>
1314
              </listitem>
1315
            </varlistentry>
1316
            <varlistentry>
1317
              <term>be/vcpus</term>
1318
              <listitem>
1319
                <simpara>The configured number of VCPUs for the
1320
                instance.</simpara>
1321
              </listitem>
1322
            </varlistentry>
1323
            <varlistentry>
1324
              <term>be/auto_balance</term>
1325
              <listitem>
1326
                <simpara>Whether the instance is considered in N+1
1327
                checks.</simpara>
1328
              </listitem>
1329
            </varlistentry>
1330
          </variablelist>
1331
        </para>
1332

    
1333
        <para>
1334
          If the value of the option starts with the character
1335
          <constant>+</constant>, the new field(s) will be added to the
1336
          default list. This allows to quickly see the default list
1337
          plus a few other fields, instead of retyping the entire list
1338
          of fields.
1339
        </para>
1340

    
1341
        <para>
1342
          There is a subtle grouping about the available output
1343
          fields: all fields except for <option>oper_state</option>,
1344
          <option>oper_ram</option> and <option>status</option> are
1345
          configuration value and not run-time values. So if you don't
1346
          select any of the these fields, the query will be satisfied
1347
          instantly from the cluster configuration, without having to
1348
          ask the remote nodes for the data. This can be helpful for
1349
          big clusters when you only want some data and it makes sense
1350
          to specify a reduced set of output fields.
1351
        </para>
1352

    
1353
        <para>The default output field list is:
1354
          <simplelist type="inline">
1355
            <member>name</member>
1356
            <member>os</member>
1357
            <member>pnode</member>
1358
            <member>admin_state</member>
1359
            <member>oper_state</member>
1360
            <member>oper_ram</member>
1361
          </simplelist>.
1362
        </para>
1363
      </refsect3>
1364

    
1365
      <refsect3>
1366
        <title>INFO</title>
1367

    
1368
        <cmdsynopsis>
1369
          <command>info</command>
1370
          <group>
1371
            <arg>-s</arg>
1372
            <arg>--static</arg>
1373
          </group>
1374
          <group choice="req">
1375
            <arg>--all</arg>
1376
            <arg rep="repeat"><replaceable>instance</replaceable></arg>
1377
          </group>
1378
        </cmdsynopsis>
1379

    
1380
        <para>
1381
          Show detailed information about the given instance(s). This is
1382
          different from <command>list</command> as it shows detailed data
1383
          about the instance's disks (especially useful for the drbd disk
1384
          template).
1385
        </para>
1386

    
1387
        <para>
1388
          If the option <option>-s</option> is used, only information
1389
          available in the configuration file is returned, without
1390
          querying nodes, making the operation faster.
1391
        </para>
1392

    
1393
        <para>
1394
          Use the <option>--all</option> to get info about all instances,
1395
          rather than explicitly passing the ones you're interested in.
1396
        </para>
1397
      </refsect3>
1398

    
1399
      <refsect3>
1400
        <title>MODIFY</title>
1401

    
1402
        <cmdsynopsis>
1403
          <command>modify</command>
1404
          <sbr>
1405
          <arg choice="opt">-H <replaceable>HYPERVISOR_PARAMETERS</replaceable></arg>
1406
          <sbr>
1407
          <arg choice="opt">-B <replaceable>BACKEND_PARAMETERS</replaceable></arg>
1408
          <sbr>
1409
          <group>
1410
            <arg>--net add<replaceable><optional>:options</optional></replaceable></arg>
1411
            <arg>--net remove</arg>
1412
            <arg>--net <replaceable>N:options</replaceable></arg>
1413
          </group>
1414
          <sbr>
1415
          <group>
1416
            <arg>--disk add:size=<replaceable>SIZE</replaceable></arg>
1417
            <arg>--disk remove</arg>
1418
            <arg>--disk <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></arg>
1419
          </group>
1420

    
1421
          <sbr>
1422
          <arg>-t<group choice="req">
1423
              <arg>plain</arg>
1424
              <arg>drbd</arg>
1425
            </group></arg>
1426

    
1427
          <sbr>
1428
            <arg>--os-name=<replaceable>OS</replaceable> <arg>--force-variant</arg></arg>
1429

    
1430
          <sbr>
1431
          <arg>--submit</arg>
1432
          <sbr>
1433
          <arg choice="req"><replaceable>instance</replaceable></arg>
1434
        </cmdsynopsis>
1435

    
1436
        <para>
1437
          Modifies the memory size, number of vcpus, ip address, MAC
1438
          address and/or nic parameters for an instance. It can also
1439
          add and remove disks and NICs to/from the instance. Note
1440
          that you need to give at least one of the arguments, otherwise
1441
          the command complains.
1442
        </para>
1443

    
1444
        <para>
1445
          The <option>-H</option> option specifies hypervisor options
1446
          in the form of <userinput>name=value[,...]</userinput>. For details which options can be specified, see the <command>add</command> command.
1447
        </para>
1448

    
1449
        <para>
1450
          The <option>-t</option> option will change the disk template
1451
          of the instance. Currently only conversions between the
1452
          plain and drbd disk templates are supported, and the
1453
          instance must be stopped before attempting the conversion.
1454
        </para>
1455

    
1456
        <para>
1457
          The <option>--disk
1458
          add:size=<replaceable>SIZE</replaceable></option> option
1459
          adds a disk to the instance. The <option>--disk
1460
          remove</option> will remove the last disk of the
1461
          instance. The <option>--disk
1462
          <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></option>
1463
          option will change the mode of the Nth disk of the instance
1464
          between read-only (<literal>ro</literal>) and read-write
1465
          (<literal>rw</literal>).
1466
        </para>
1467

    
1468
        <para>
1469
          The <option>--net
1470
          add:<replaceable>options</replaceable></option> option will
1471
          add a new NIC to the instance. The available options are the
1472
          same as in the <command>add</command> command (mac, ip, link,
1473
          mode). The <option>--net remove</option> will remove the
1474
          last NIC of the instance, while the <option>--net
1475
          <replaceable>N</replaceable>:<replaceable>options</replaceable></option>
1476
          option will change the parameters of the Nth instance NIC.
1477
        </para>
1478

    
1479
        <para>
1480
          The option <option>--os-name</option> will change the OS
1481
          name for the instance (without reinstallation). In case an
1482
          OS variant is specified that is not found, then by default
1483
          the modification is refused,
1484
          unless <option>--force-variant</option> is passed. An
1485
          invalid OS will also be refused, unless
1486
          the <option>--force</option> option is given.
1487
        </para>
1488

    
1489
        <para>
1490
          The <option>--submit</option> option is used to send the job to
1491
          the master daemon but not wait for its completion. The job
1492
          ID will be shown so that it can be examined via
1493
          <command>gnt-job info</command>.
1494
        </para>
1495

    
1496
        <para>
1497
          All the changes take effect at the next restart. If the
1498
          instance is running, there is no effect on the instance.
1499
        </para>
1500
      </refsect3>
1501

    
1502
      <refsect3>
1503
        <title>REINSTALL</title>
1504

    
1505
        <cmdsynopsis>
1506
          <command>reinstall</command>
1507
          <arg choice="opt">-o <replaceable>os-type</replaceable></arg>
1508
          <arg>--select-os</arg>
1509
          <arg choice="opt">-f <replaceable>force</replaceable></arg>
1510
          <arg>--force-multiple</arg>
1511
          <sbr>
1512
          <group choice="opt">
1513
            <arg>--instance</arg>
1514
            <arg>--node</arg>
1515
            <arg>--primary</arg>
1516
            <arg>--secondary</arg>
1517
            <arg>--all</arg>
1518
          </group>
1519
          <arg>--submit</arg>
1520
          <arg choice="opt" rep="repeat"><replaceable>instance</replaceable></arg>
1521
        </cmdsynopsis>
1522

    
1523
        <para>
1524
          Reinstalls the operating system on the given instance(s). The
1525
          instance(s) must be stopped when running this command. If the
1526
          <option>--os-type</option> is specified, the operating
1527
          system is changed.
1528
        </para>
1529

    
1530
        <para>
1531
          The <option>--select-os</option> option switches to an
1532
          interactive OS reinstall. The user is prompted to select the OS
1533
          template from the list of available OS templates.
1534
        </para>
1535

    
1536
        <para>
1537
          Since this is a potentially dangerous command, the user will
1538
          be required to confirm this action, unless the
1539
          <option>-f</option> flag is passed. When multiple instances
1540
          are selected (either by passing multiple arguments or by
1541
          using the <option>--node</option>,
1542
          <option>--primary</option>, <option>--secondary</option> or
1543
          <option>--all</option> options), the user must pass both the
1544
          <option>--force</option> and
1545
          <option>--force-multiple</option> options to skip the
1546
          interactive confirmation.
1547
        </para>
1548

    
1549
        <para>
1550
          The <option>--submit</option> option is used to send the job to
1551
          the master daemon but not wait for its completion. The job
1552
          ID will be shown so that it can be examined via
1553
          <command>gnt-job info</command>.
1554
        </para>
1555

    
1556

    
1557
      </refsect3>
1558

    
1559
      <refsect3>
1560
        <title>RENAME</title>
1561

    
1562
        <cmdsynopsis>
1563
          <command>rename</command>
1564
          <arg>--no-ip-check</arg>
1565
          <arg>--submit</arg>
1566
          <arg choice="req"><replaceable>instance</replaceable></arg>
1567
          <arg choice="req"><replaceable>new_name</replaceable></arg>
1568
        </cmdsynopsis>
1569

    
1570
        <para>
1571
          Renames the given instance. The instance must be stopped
1572
          when running this command. The requirements for the new name
1573
          are the same as for adding an instance: the new name must be
1574
          resolvable and the IP it resolves to must not be reachable
1575
          (in order to prevent duplicate IPs the next time the
1576
          instance is started). The IP test can be skipped if the
1577
          <option>--no-ip-check</option> option is passed.
1578
        </para>
1579

    
1580
        <para>
1581
          The <option>--submit</option> option is used to send the job to
1582
          the master daemon but not wait for its completion. The job
1583
          ID will be shown so that it can be examined via
1584
          <command>gnt-job info</command>.
1585
        </para>
1586

    
1587
      </refsect3>
1588

    
1589
    </refsect2>
1590

    
1591
    <refsect2>
1592
      <title>Starting/stopping/connecting to console</title>
1593

    
1594
      <refsect3>
1595
        <title>STARTUP</title>
1596

    
1597
        <cmdsynopsis>
1598
          <command>startup</command>
1599
          <sbr>
1600
          <arg>--force</arg>
1601
          <sbr>
1602
          <arg>--force-multiple</arg>
1603
          <sbr>
1604
          <group choice="opt">
1605
            <arg>--instance</arg>
1606
            <arg>--node</arg>
1607
            <arg>--primary</arg>
1608
            <arg>--secondary</arg>
1609
            <arg>--all</arg>
1610
            <arg>--tags</arg>
1611
            <arg>--node-tags</arg>
1612
            <arg>--pri-node-tags</arg>
1613
            <arg>--sec-node-tags</arg>
1614
          </group>
1615
          <sbr>
1616
          <arg>-H <option>key=value...</option></arg>
1617
          <arg>-B <option>key=value...</option></arg>
1618
          <sbr>
1619
          <arg>--submit</arg>
1620
          <sbr>
1621
          <arg choice="opt"
1622
          rep="repeat"><replaceable>name</replaceable></arg>
1623
        </cmdsynopsis>
1624

    
1625
        <para>
1626
          Starts one or more instances, depending on the following
1627
          options. The four available modes are:
1628
          <variablelist>
1629
            <varlistentry>
1630
              <term><option>--instance</option></term>
1631
              <listitem>
1632
                <simpara>will start the instances given as arguments
1633
                (at least one argument required); this is the default
1634
                selection</simpara>
1635
              </listitem>
1636
            </varlistentry>
1637
            <varlistentry>
1638
              <term>--node</term>
1639
              <listitem>
1640
                <simpara>will start the instances who have the given
1641
                node as either primary or secondary</simpara>
1642
              </listitem>
1643
            </varlistentry>
1644
            <varlistentry>
1645
              <term><option>--primary</option></term>
1646
              <listitem>
1647
                <simpara>will start all instances whose primary node
1648
                is in the list of nodes passed as arguments (at least
1649
                one node required)</simpara>
1650
              </listitem>
1651
            </varlistentry>
1652
            <varlistentry>
1653
              <term><option>--secondary</option></term>
1654
              <listitem>
1655
                <simpara>will start all instances whose secondary node
1656
                is in the list of nodes passed as arguments (at least
1657
                one node required)</simpara>
1658
              </listitem>
1659
            </varlistentry>
1660
            <varlistentry>
1661
              <term>--all</term>
1662
              <listitem>
1663
                <simpara>will start all instances in the cluster (no
1664
                arguments accepted)</simpara>
1665
              </listitem>
1666
            </varlistentry>
1667
            <varlistentry>
1668
              <term>--tags</term>
1669
              <listitem>
1670
                <simpara>will start all instances in the cluster with
1671
                the tags given as arguments</simpara>
1672
              </listitem>
1673
            </varlistentry>
1674
            <varlistentry>
1675
              <term>--node-tags</term>
1676
              <listitem>
1677
                <simpara>will start all instances in the cluster on
1678
                nodes with the tags given as arguments</simpara>
1679
              </listitem>
1680
            </varlistentry>
1681
            <varlistentry>
1682
              <term>--pri-node-tags</term>
1683
              <listitem>
1684
                <simpara>will start all instances in the cluster on
1685
                primary nodes with the tags given as
1686
                arguments</simpara>
1687
              </listitem>
1688
            </varlistentry>
1689
            <varlistentry>
1690
              <term>--sec-node-tags</term>
1691
              <listitem>
1692
                <simpara>will start all instances in the cluster on
1693
                secondary nodes with the tags given as
1694
                arguments</simpara>
1695
              </listitem>
1696
            </varlistentry>
1697
          </variablelist>
1698
        </para>
1699

    
1700
        <para>
1701
          Note that although you can pass more than one selection
1702
          option, the last one wins, so in order to guarantee the
1703
          desired result, don't pass more than one such option.
1704
        </para>
1705

    
1706
        <para>
1707
          Use <option>--force</option> to start even if secondary disks are
1708
          failing.
1709
        </para>
1710

    
1711
        <para>
1712
          The <option>--force-multiple</option> will skip the
1713
          interactive confirmation in the case the more than one
1714
          instance will be affected.
1715
        </para>
1716

    
1717
        <para>
1718
          The <option>-H</option> and <option>-B</option> options
1719
          specify temporary hypervisor and backend parameters that can
1720
          be used to start an instance with modified parameters. They
1721
          can be useful for quick testing without having to modify an
1722
          instance back and forth, e.g.:
1723
          <screen>
1724
# gnt-instance start -H root_args="single" instance1
1725
# gnt-instance start -B memory=2048 instance2
1726
          </screen>
1727
          The first form will start the instance
1728
          <userinput>instance1</userinput> in single-user mode, and
1729
          the instance <userinput>instance2</userinput> with 2GB of
1730
          RAM (this time only, unless that is the actual instance
1731
          memory size already). Note that the values override the
1732
          instance parameters (and not extend them): an instance with
1733
          "root_args=ro" when started with <userinput>-H
1734
          root_args=single</userinput> will result in "single", not
1735
          "ro single".
1736
        </para>
1737

    
1738
        <para>
1739
          The <option>--submit</option> option is used to send the job to
1740
          the master daemon but not wait for its completion. The job
1741
          ID will be shown so that it can be examined via
1742
          <command>gnt-job info</command>.
1743
        </para>
1744

    
1745
        <para>
1746
          Example:
1747
          <screen>
1748
# gnt-instance start instance1.example.com
1749
# gnt-instance start --node node1.example.com node2.example.com
1750
# gnt-instance start --all
1751
          </screen>
1752
        </para>
1753
      </refsect3>
1754

    
1755
      <refsect3>
1756
        <title>SHUTDOWN</title>
1757

    
1758
        <cmdsynopsis>
1759
          <command>shutdown</command>
1760
          <sbr>
1761
          <arg>--timeout=<replaceable>N</replaceable></arg>
1762
          <sbr>
1763
          <arg>--force-multiple</arg>
1764
          <sbr>
1765
          <group choice="opt">
1766
            <arg>--instance</arg>
1767
            <arg>--node</arg>
1768
            <arg>--primary</arg>
1769
            <arg>--secondary</arg>
1770
            <arg>--all</arg>
1771
            <arg>--tags</arg>
1772
            <arg>--node-tags</arg>
1773
            <arg>--pri-node-tags</arg>
1774
            <arg>--sec-node-tags</arg>
1775
          </group>
1776
          <sbr>
1777
          <arg>--submit</arg>
1778
          <sbr>
1779
          <arg choice="opt"
1780
          rep="repeat"><replaceable>name</replaceable></arg>
1781
        </cmdsynopsis>
1782

    
1783
        <para>
1784
          Stops one or more instances. If the instance cannot be
1785
          cleanly stopped during a hardcoded interval (currently 2
1786
          minutes), it will forcibly stop the instance (equivalent to
1787
          switching off the power on a physical machine).
1788
        </para>
1789

    
1790
        <para>
1791
          The <option>--timeout</option> is used to specify how much time to
1792
          wait before forcing the shutdown (xm destroy in xen, killing the kvm
1793
          process, for kvm). By default two minutes are given to each instance
1794
          to stop.
1795
        </para>
1796

    
1797
        <para>
1798
          The <option>--instance</option>, <option>--node</option>,
1799
          <option>--primary</option>, <option>--secondary</option>,
1800
          <option>--all</option>, <option>--tags</option>,
1801
          <option>--node-tags</option>, <option>--pri-node-tags</option> and
1802
          <option>--sec-node-tags</option> options are similar as for the
1803
          <command>startup</command> command and they influence the
1804
          actual instances being shutdown.
1805
        </para>
1806

    
1807
        <para>
1808
          The <option>--submit</option> option is used to send the job to
1809
          the master daemon but not wait for its completion. The job
1810
          ID will be shown so that it can be examined via
1811
          <command>gnt-job info</command>.
1812
        </para>
1813

    
1814

    
1815
        <para>
1816
          Example:
1817
          <screen>
1818
# gnt-instance shutdown instance1.example.com
1819
# gnt-instance shutdown --all
1820
          </screen>
1821
        </para>
1822
      </refsect3>
1823

    
1824
      <refsect3>
1825
        <title>REBOOT</title>
1826

    
1827
        <cmdsynopsis>
1828
          <command>reboot</command>
1829
          <sbr>
1830
          <arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg>
1831
          <sbr>
1832
          <arg>--ignore-secondaries</arg>
1833
          <sbr>
1834
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
1835
          <sbr>
1836
          <arg>--force-multiple</arg>
1837
          <sbr>
1838
          <group choice="opt">
1839
            <arg>--instance</arg>
1840
            <arg>--node</arg>
1841
            <arg>--primary</arg>
1842
            <arg>--secondary</arg>
1843
            <arg>--all</arg>
1844
            <arg>--tags</arg>
1845
            <arg>--node-tags</arg>
1846
            <arg>--pri-node-tags</arg>
1847
            <arg>--sec-node-tags</arg>
1848
          </group>
1849
          <sbr>
1850
          <arg>--submit</arg>
1851
          <sbr>
1852
          <arg choice="opt"
1853
          rep="repeat"><replaceable>name</replaceable></arg>
1854
        </cmdsynopsis>
1855

    
1856
        <para>
1857
          Reboots one or more instances. The type of reboot depends on
1858
          the value of <option>--type</option>. A soft reboot does a
1859
          hypervisor reboot, a hard reboot does a instance stop,
1860
          recreates the hypervisor config for the instance and
1861
          starts the instance. A full reboot does the equivalent
1862
          of <command>gnt-instance shutdown &amp;&amp; gnt-instance
1863
          startup</command>. The default is hard reboot.
1864
        </para>
1865

    
1866
        <para>
1867
          For the hard reboot the option
1868
          <option>--ignore-secondaries</option> ignores errors for the
1869
          secondary node while re-assembling the instance disks.
1870
        </para>
1871

    
1872
        <para>
1873
          The <option>--instance</option>, <option>--node</option>,
1874
          <option>--primary</option>, <option>--secondary</option>,
1875
          <option>--all</option>, <option>--tags</option>,
1876
          <option>--node-tags</option>, <option>--pri-node-tags</option> and
1877
          <option>--sec-node-tags</option> options are similar as for the
1878
          <command>startup</command> command and they influence the
1879
          actual instances being rebooted.
1880
        </para>
1881

    
1882
        <para>
1883
          The <option>--shutdown-timeout</option> is used to specify how
1884
          much time to wait before forcing the shutdown (xm destroy in xen,
1885
          killing the kvm process, for kvm). By default two minutes are
1886
          given to each instance to stop.
1887
        </para>
1888

    
1889
        <para>
1890
          The <option>--force-multiple</option> will skip the
1891
          interactive confirmation in the case the more than one
1892
          instance will be affected.
1893
        </para>
1894

    
1895
        <para>
1896
          Example:
1897
          <screen>
1898
# gnt-instance reboot instance1.example.com
1899
# gnt-instance reboot --type=full instance1.example.com
1900
          </screen>
1901
        </para>
1902
      </refsect3>
1903

    
1904
      <refsect3>
1905
        <title>CONSOLE</title>
1906
        <cmdsynopsis>
1907
          <command>console</command>
1908
          <arg choice="opt">--show-cmd</arg>
1909
          <arg choice="req"><replaceable>instance</replaceable></arg>
1910
        </cmdsynopsis>
1911

    
1912
        <para>
1913
          Connects to the console of the given instance. If the
1914
          instance is not up, an error is returned. Use the
1915
          <option>--show-cmd</option> option to display the command
1916
          instead of executing it.
1917
        </para>
1918

    
1919
        <para>
1920
          For HVM instances, this will attempt to connect to the
1921
          serial console of the instance. To connect to the
1922
          virtualized "physical" console of a HVM instance, use a VNC
1923
          client with the connection info from the
1924
          <command>info</command> command.
1925
        </para>
1926

    
1927
        <para>
1928
          Example:
1929
          <screen>
1930
# gnt-instance console instance1.example.com
1931
          </screen>
1932
        </para>
1933
      </refsect3>
1934

    
1935
    </refsect2>
1936

    
1937
    <refsect2>
1938
      <title>Disk management</title>
1939

    
1940
      <refsect3>
1941
        <title>REPLACE-DISKS</title>
1942

    
1943
        <cmdsynopsis>
1944
          <command>replace-disks</command>
1945
          <arg>--submit</arg>
1946
          <arg>--early-release</arg>
1947
          <arg choice="req">-p</arg>
1948
          <arg>--disks <replaceable>idx</replaceable></arg>
1949
          <arg choice="req"><replaceable>instance</replaceable></arg>
1950
        </cmdsynopsis>
1951

    
1952
        <cmdsynopsis>
1953
          <command>replace-disks</command>
1954
          <arg>--submit</arg>
1955
          <arg>--early-release</arg>
1956
          <arg choice="req">-s</arg>
1957
          <arg>--disks <replaceable>idx</replaceable></arg>
1958
          <arg choice="req"><replaceable>instance</replaceable></arg>
1959
        </cmdsynopsis>
1960

    
1961
        <cmdsynopsis>
1962
          <command>replace-disks</command>
1963
          <arg>--submit</arg>
1964
          <arg>--early-release</arg>
1965
          <group choice="req">
1966
            <arg>--iallocator <replaceable>name</replaceable></arg>
1967
            <arg>--new-secondary <replaceable>NODE</replaceable></arg>
1968
          </group>
1969

    
1970
          <arg choice="req"><replaceable>instance</replaceable></arg>
1971
        </cmdsynopsis>
1972

    
1973
        <cmdsynopsis>
1974
          <command>replace-disks</command>
1975
          <arg>--submit</arg>
1976
          <arg>--early-release</arg>
1977
          <arg choice="req">--auto</arg>
1978
          <arg choice="req"><replaceable>instance</replaceable></arg>
1979
        </cmdsynopsis>
1980

    
1981
        <para>
1982
          This command is a generalized form for replacing disks. It
1983
          is currently only valid for the mirrored (DRBD) disk
1984
          template.
1985
        </para>
1986

    
1987
        <para>
1988
          The first form (when passing the <option>-p</option> option)
1989
          will replace the disks on the primary, while the second form
1990
          (when passing the <option>-s</option> option will replace
1991
          the disks on the secondary node. For these two cases (as the
1992
          node doesn't change), it is possible to only run the replace
1993
          for a subset of the disks, using the option
1994
          <option>--disks</option> which takes a list of
1995
          comma-delimited disk indices (zero-based),
1996
          e.g. <userinput>0,2</userinput> to replace only the first
1997
          and third disks.
1998
        </para>
1999

    
2000
        <para>
2001
          The third form (when passing either the
2002
          <option>--iallocator</option> or the
2003
          <option>--new-secondary</option> option) is designed to
2004
          change secondary node of the instance.  Specifying
2005
          <option>--iallocator</option> makes the new secondary be
2006
          selected automatically by the specified allocator plugin,
2007
          otherwise the new secondary node will be the one chosen
2008
          manually via the <option>--new-secondary</option> option.
2009
        </para>
2010

    
2011
        <para>
2012
          The fourth form (when using <option>--auto</option>) will
2013
          automatically determine which disks of an instance are faulty and
2014
          replace them within the same node. The <option>--auto</option>
2015
          option works only when an instance has only faulty disks on
2016
          either the primary or secondary node; it doesn't work when
2017
          both sides have faulty disks.
2018
        </para>
2019

    
2020
        <para>
2021
          The <option>--submit</option> option is used to send the job to
2022
          the master daemon but not wait for its completion. The job
2023
          ID will be shown so that it can be examined via
2024
          <command>gnt-job info</command>.
2025
        </para>
2026

    
2027
        <para>
2028
          The <option>--early-release</option> changes the code so
2029
          that the old storage on secondary node(s) is removed early
2030
          (before the resync is completed) and the internal Ganeti
2031
          locks for the current (and new, if any) secondary node are
2032
          also released, thus allowing more parallelism in the cluster
2033
          operation. This should be used only when recovering from a
2034
          disk failure on the current secondary (thus the old storage
2035
          is already broken) or when the storage on the primary node
2036
          is known to be fine (thus we won't need the old storage for
2037
          potential recovery).
2038
        </para>
2039

    
2040
        <para>
2041
          Note that it is not possible to select an offline or drained
2042
          node as a new secondary.
2043
        </para>
2044

    
2045
      </refsect3>
2046

    
2047
      <refsect3>
2048
        <title>ACTIVATE-DISKS</title>
2049

    
2050
        <cmdsynopsis>
2051
          <command>activate-disks</command>
2052
          <arg>--submit</arg>
2053
          <arg>--ignore-size</arg>
2054
          <arg choice="req"><replaceable>instance</replaceable></arg>
2055
        </cmdsynopsis>
2056
        <para>
2057
          Activates the block devices of the given instance. If
2058
          successful, the command will show the location and name of
2059
          the block devices:
2060
          <screen>
2061
node1.example.com:disk/0:/dev/drbd0
2062
node1.example.com:disk/1:/dev/drbd1
2063
          </screen>
2064

    
2065
          In this example, <emphasis>node1.example.com</emphasis> is
2066
          the name of the node on which the devices have been
2067
          activated. The <emphasis>disk/0</emphasis> and
2068
          <emphasis>disk/1</emphasis> are the Ganeti-names of the
2069
          instance disks; how they are visible inside the instance is
2070
          hypervisor-specific. <emphasis>/dev/drbd0</emphasis> and
2071
          <emphasis>/dev/drbd1</emphasis> are the actual block devices
2072
          as visible on the node.
2073
        </para>
2074

    
2075
        <para>
2076
          The <option>--submit</option> option is used to send the job to
2077
          the master daemon but not wait for its completion. The job
2078
          ID will be shown so that it can be examined via
2079
          <command>gnt-job info</command>.
2080
        </para>
2081

    
2082
        <para>
2083
          The <option>--ignore-size</option> option can be used to
2084
          activate disks ignoring the currently configured size in
2085
          Ganeti. This can be used in cases where the configuration
2086
          has gotten out of sync with the real-world (e.g. after a
2087
          partially-failed grow-disk operation or due to rounding in
2088
          LVM devices). This should not be used in normal cases, but
2089
          only when activate-disks fails without it.
2090
        </para>
2091

    
2092
        <para>
2093
          Note that it is safe to run this command while the instance
2094
          is already running.
2095
        </para>
2096
      </refsect3>
2097

    
2098
      <refsect3>
2099
        <title>DEACTIVATE-DISKS</title>
2100

    
2101
        <cmdsynopsis>
2102
          <command>deactivate-disks</command>
2103
          <arg>--submit</arg>
2104
          <arg choice="req"><replaceable>instance</replaceable></arg>
2105
        </cmdsynopsis>
2106
        <para>
2107
          De-activates the block devices of the given instance. Note
2108
          that if you run this command for an instance with a drbd
2109
          disk template, while it is running, it will not be able to
2110
          shutdown the block devices on the primary node, but it will
2111
          shutdown the block devices on the secondary nodes, thus
2112
          breaking the replication.
2113
        </para>
2114

    
2115
        <para>
2116
          The <option>--submit</option> option is used to send the job to
2117
          the master daemon but not wait for its completion. The job
2118
          ID will be shown so that it can be examined via
2119
          <command>gnt-job info</command>.
2120
        </para>
2121

    
2122
      </refsect3>
2123

    
2124
      <refsect3>
2125
        <title>GROW-DISK</title>
2126
        <cmdsynopsis>
2127
          <command>grow-disk</command>
2128
          <arg>--no-wait-for-sync</arg>
2129
          <arg>--submit</arg>
2130
          <arg choice="req"><replaceable>instance</replaceable></arg>
2131
          <arg choice="req"><replaceable>disk</replaceable></arg>
2132
          <arg choice="req"><replaceable>amount</replaceable></arg>
2133
        </cmdsynopsis>
2134

    
2135
        <para>
2136
          Grows an instance's disk. This is only possible for
2137
          instances having a <literal>plain</literal> or
2138
          <literal>drbd</literal> disk template.
2139
        </para>
2140

    
2141
        <para>
2142
          Note that this command only change the block device size; it
2143
          will not grow the actual filesystems, partitions, etc. that
2144
          live on that disk. Usually, you will need to:
2145
          <orderedlist>
2146
            <listitem>
2147
              <simpara>use <command>gnt-instance grow-disk</command></simpara>
2148
            </listitem>
2149
            <listitem>
2150
              <simpara>reboot the instance (later, at a convenient
2151
              time)</simpara>
2152
            </listitem>
2153
            <listitem>
2154
              <simpara>use a filesystem resizer, such as
2155
              <citerefentry> <refentrytitle>ext2online</refentrytitle>
2156
              <manvolnum>8</manvolnum> </citerefentry> or
2157
              <citerefentry> <refentrytitle>xfs_growfs</refentrytitle>
2158
              <manvolnum>8</manvolnum> </citerefentry> to resize the
2159
              filesystem, or use <citerefentry>
2160
              <refentrytitle>fdisk</refentrytitle>
2161
              <manvolnum>8</manvolnum> </citerefentry> to change the
2162
              partition table on the disk
2163
              </simpara>
2164
            </listitem>
2165
          </orderedlist>
2166
        </para>
2167

    
2168

    
2169
        <para>
2170
          The <replaceable>disk</replaceable> argument is the index of
2171
          the instance disk to grow. The
2172
          <replaceable>amount</replaceable> argument is given either
2173
          as a number (and it represents the amount to increase the
2174
          disk with in mebibytes) or can be given similar to the
2175
          arguments in the create instance operation, with a suffix
2176
          denoting the unit.
2177
        </para>
2178

    
2179
        <para>
2180
          Note that the disk grow operation might complete on one node
2181
          but fail on the other; this will leave the instance with
2182
          different-sized LVs on the two nodes, but this will not
2183
          create problems (except for unused space).
2184
        </para>
2185

    
2186
        <para>
2187
          If you do not want gnt-instance to wait for the new disk
2188
          region to be synced, use the
2189
          <option>--no-wait-for-sync</option> option.
2190
        </para>
2191

    
2192
        <para>
2193
          The <option>--submit</option> option is used to send the job to
2194
          the master daemon but not wait for its completion. The job
2195
          ID will be shown so that it can be examined via
2196
          <command>gnt-job info</command>.
2197
        </para>
2198

    
2199

    
2200
        <para>Example (increase the first disk for instance1 by 16GiB):
2201
          <screen>
2202
# gnt-instance grow-disk instance1.example.com 0 16g
2203
          </screen>
2204
        </para>
2205

    
2206
        <para>
2207
          Also note that disk shrinking is not supported; use
2208
          <command>gnt-backup export</command> and then
2209
          <command>gnt-backup import</command> to reduce the disk size
2210
          of an instance.
2211
        </para>
2212
      </refsect3>
2213

    
2214
      <refsect3>
2215
        <title>RECREATE-DISKS</title>
2216

    
2217
        <cmdsynopsis>
2218
          <command>recreate-disks</command>
2219
          <arg>--submit</arg>
2220
          <arg>--disks=<option>indices</option></arg>
2221
          <arg choice="req"><replaceable>instance</replaceable></arg>
2222
        </cmdsynopsis>
2223
        <para>
2224
          Recreates the disks of the given instance, or only a subset
2225
          of the disks (if the option <option>disks</option> is
2226
          passed, which must be a comma-separated list of disk
2227
          indices, starting from zero).
2228
        </para>
2229

    
2230
        <para>
2231
          Note that this functionality should only be used for missing
2232
          disks; if any of the given disks already exists, the
2233
          operation will fail. While this is suboptimal,
2234
          recreate-disks should hopefully not be needed in normal
2235
          operation and as such the impact of this is low.
2236
        </para>
2237

    
2238
        <para>
2239
          The <option>--submit</option> option is used to send the job to
2240
          the master daemon but not wait for its completion. The job
2241
          ID will be shown so that it can be examined via
2242
          <command>gnt-job info</command>.
2243
        </para>
2244

    
2245
      </refsect3>
2246

    
2247
    </refsect2>
2248

    
2249
    <refsect2>
2250
      <title>Recovery</title>
2251

    
2252
      <refsect3>
2253
        <title>FAILOVER</title>
2254

    
2255
        <cmdsynopsis>
2256
          <command>failover</command>
2257
          <arg>-f</arg>
2258
          <arg>--ignore-consistency</arg>
2259
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2260
          <arg>--submit</arg>
2261
          <arg choice="req"><replaceable>instance</replaceable></arg>
2262
        </cmdsynopsis>
2263

    
2264
        <para>
2265
          Failover will fail the instance over its secondary
2266
          node. This works only for instances having a drbd disk
2267
          template.
2268
        </para>
2269

    
2270
        <para>
2271
          Normally the failover will check the consistency of the
2272
          disks before failing over the instance. If you are trying to
2273
          migrate instances off a dead node, this will fail. Use the
2274
          <option>--ignore-consistency</option> option for this
2275
          purpose. Note that this option can be dangerous as errors in
2276
          shutting down the instance will be ignored, resulting in
2277
          possibly having the instance running on two machines in
2278
          parallel (on disconnected DRBD drives).
2279
        </para>
2280

    
2281
        <para>
2282
          The <option>--shutdown-timeout</option> is used to specify how
2283
          much time to wait before forcing the shutdown (xm destroy in xen,
2284
          killing the kvm process, for kvm). By default two minutes are
2285
          given to each instance to stop.
2286
        </para>
2287

    
2288
        <para>
2289
          The <option>--submit</option> option is used to send the job to
2290
          the master daemon but not wait for its completion. The job
2291
          ID will be shown so that it can be examined via
2292
          <command>gnt-job info</command>.
2293
        </para>
2294

    
2295
        <para>
2296
          Example:
2297
          <screen>
2298
# gnt-instance failover instance1.example.com
2299
          </screen>
2300
        </para>
2301
      </refsect3>
2302

    
2303
      <refsect3>
2304
        <title>MIGRATE</title>
2305

    
2306
        <cmdsynopsis>
2307
          <command>migrate</command>
2308
          <arg>-f</arg>
2309
          <arg choice="req">--cleanup</arg>
2310
          <arg choice="req"><replaceable>instance</replaceable></arg>
2311
        </cmdsynopsis>
2312

    
2313
        <cmdsynopsis>
2314
          <command>migrate</command>
2315
          <arg>-f</arg>
2316
          <arg>--non-live</arg>
2317
          <arg choice="req"><replaceable>instance</replaceable></arg>
2318
        </cmdsynopsis>
2319

    
2320
        <para>
2321
          Migrate will move the instance to its secondary node without
2322
          shutdown. It only works for instances having the drbd8 disk
2323
          template type.
2324
        </para>
2325

    
2326
        <para>
2327
          The migration command needs a perfectly healthy instance, as
2328
          we rely on the dual-master capability of drbd8 and the disks
2329
          of the instance are not allowed to be degraded.
2330
        </para>
2331

    
2332
        <para>
2333
          The <option>--non-live</option> option will switch (for the
2334
          hypervisors that support it) between a "fully live"
2335
          (i.e. the interruption is as minimal as possible) migration
2336
          and one in which the instance is frozen, its state saved and
2337
          transported to the remote node, and then resumed there. This
2338
          all depends on the hypervisor support for two different
2339
          methods. In any case, it is not an error to pass this
2340
          parameter (it will just be ignored if the hypervisor doesn't
2341
          support it).
2342
        </para>
2343

    
2344
        <para>
2345
          If the <option>--cleanup</option> option is passed, the
2346
          operation changes from migration to attempting recovery from
2347
          a failed previous migration. In this mode, ganeti checks if
2348
          the instance runs on the correct node (and updates its
2349
          configuration if not) and ensures the instances's disks are
2350
          configured correctly. In this mode, the
2351
          <option>--non-live</option> option is ignored.
2352
        </para>
2353

    
2354
        <para>
2355
          The option <option>-f</option> will skip the prompting for
2356
          confirmation.
2357
        </para>
2358
        <para>
2359
          Example (and expected output):
2360
          <screen>
2361
# gnt-instance migrate instance1
2362
Migrate will happen to the instance instance1. Note that migration is
2363
**experimental** in this version. This might impact the instance if
2364
anything goes wrong. Continue?
2365
y/[n]/?: y
2366
* checking disk consistency between source and target
2367
* ensuring the target is in secondary mode
2368
* changing disks into dual-master mode
2369
 - INFO: Waiting for instance instance1 to sync disks.
2370
 - INFO: Instance instance1's disks are in sync.
2371
* migrating instance to node2.example.com
2372
* changing the instance's disks on source node to secondary
2373
 - INFO: Waiting for instance instance1 to sync disks.
2374
 - INFO: Instance instance1's disks are in sync.
2375
* changing the instance's disks to single-master
2376
#
2377
          </screen>
2378
        </para>
2379
      </refsect3>
2380

    
2381
      <refsect3>
2382
        <title>MOVE</title>
2383

    
2384
        <cmdsynopsis>
2385
          <command>move</command>
2386
          <arg>-f</arg>
2387
          <arg>-n <replaceable>node</replaceable></arg>
2388
          <arg>--shutdown-timeout=<replaceable>N</replaceable></arg>
2389
          <arg>--submit</arg>
2390
          <arg choice="req"><replaceable>instance</replaceable></arg>
2391
        </cmdsynopsis>
2392

    
2393
        <para>
2394
          Move will move the instance to an arbitrary node in the
2395
          cluster. This works only for instances having a plain or
2396
          file disk template.
2397
        </para>
2398

    
2399
        <para>
2400
          Note that since this operation is done via data copy, it
2401
          will take a long time for big disks (similar to
2402
          replace-disks for a drbd instance).
2403
        </para>
2404

    
2405
        <para>
2406
          The <option>--shutdown-timeout</option> is used to specify how
2407
          much time to wait before forcing the shutdown (xm destroy in xen,
2408
          killing the kvm process, for kvm). By default two minutes are
2409
          given to each instance to stop.
2410
        </para>
2411

    
2412
        <para>
2413
          The <option>--submit</option> option is used to send the job to
2414
          the master daemon but not wait for its completion. The job
2415
          ID will be shown so that it can be examined via
2416
          <command>gnt-job info</command>.
2417
        </para>
2418

    
2419
        <para>
2420
          Example:
2421
          <screen>
2422
# gnt-instance move -n node3.example.com instance1.example.com
2423
          </screen>
2424
        </para>
2425
      </refsect3>
2426

    
2427
    </refsect2>
2428

    
2429
    <refsect2>
2430
      <title>TAGS</title>
2431

    
2432
    <refsect3>
2433
        <title>ADD-TAGS</title>
2434

    
2435
        <cmdsynopsis>
2436
          <command>add-tags</command>
2437
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2438
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2439
          <arg choice="req"
2440
            rep="repeat"><replaceable>tag</replaceable></arg>
2441
        </cmdsynopsis>
2442

    
2443
        <para>
2444
          Add tags to the given instance. If any of the tags contains
2445
          invalid characters, the entire operation will abort.
2446
        </para>
2447
        <para>
2448
          If the <option>--from</option> option is given, the list of
2449
          tags will be extended with the contents of that file (each
2450
          line becomes a tag). In this case, there is not need to pass
2451
          tags on the command line (if you do, both sources will be
2452
          used). A file name of - will be interpreted as stdin.
2453
        </para>
2454
      </refsect3>
2455

    
2456
      <refsect3>
2457
        <title>LIST-TAGS</title>
2458

    
2459
        <cmdsynopsis>
2460
          <command>list-tags</command>
2461
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2462
        </cmdsynopsis>
2463

    
2464
        <para>List the tags of the given instance.</para>
2465
      </refsect3>
2466

    
2467
      <refsect3>
2468
        <title>REMOVE-TAGS</title>
2469
        <cmdsynopsis>
2470
          <command>remove-tags</command>
2471
          <arg choice="opt">--from <replaceable>file</replaceable></arg>
2472
          <arg choice="req"><replaceable>instancename</replaceable></arg>
2473
          <arg choice="req"
2474
            rep="repeat"><replaceable>tag</replaceable></arg>
2475
        </cmdsynopsis>
2476

    
2477
        <para>
2478
          Remove tags from the given instance. If any of the tags are
2479
          not existing on the node, the entire operation will abort.
2480
        </para>
2481

    
2482
        <para>
2483
          If the <option>--from</option> option is given, the list of
2484
          tags will be extended with the contents of that file (each
2485
          line becomes a tag). In this case, there is not need to pass
2486
          tags on the command line (if you do, both sources will be
2487
          used). A file name of - will be interpreted as stdin.
2488
        </para>
2489
      </refsect3>
2490

    
2491
    </refsect2>
2492

    
2493
  </refsect1>
2494

    
2495
  &footer;
2496

    
2497
</refentry>
2498

    
2499
<!-- Keep this comment at the end of the file
2500
Local variables:
2501
mode: sgml
2502
sgml-omittag:t
2503
sgml-shorttag:t
2504
sgml-minimize-attributes:nil
2505
sgml-always-quote-attributes:t
2506
sgml-indent-step:2
2507
sgml-indent-data:t
2508
sgml-parent-document:nil
2509
sgml-default-dtd-file:nil
2510
sgml-exposed-tags:nil
2511
sgml-local-catalogs:nil
2512
sgml-local-ecat-files:nil
2513
End:
2514
-->