Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.rst @ 18c3417b

History | View | Annotate | Download (66.7 kB)

1
gnt-instance(8) Ganeti | Version @GANETI_VERSION@
2
=================================================
3

    
4
Name
5
----
6

    
7
gnt-instance - Ganeti instance administration
8

    
9
Synopsis
10
--------
11

    
12
**gnt-instance** {command} [arguments...]
13

    
14
DESCRIPTION
15
-----------
16

    
17
The **gnt-instance** command is used for instance administration in
18
the Ganeti system.
19

    
20
COMMANDS
21
--------
22

    
23
Creation/removal/querying
24
~~~~~~~~~~~~~~~~~~~~~~~~~
25

    
26
ADD
27
^^^
28

    
29
| **add**
30
| {-t|\--disk-template {diskless | file \| plain \| drbd \| rbd}}
31
| {\--disk=*N*: {size=*VAL* \| adopt=*LV*}[,vg=*VG*][,metavg=*VG*][,mode=*ro\|rw*]
32
|  \| {size=*VAL*,provider=*PROVIDER*}[,param=*value*... ][,mode=*ro\|rw*]
33
|  \| {-s|\--os-size} *SIZE*}
34
| [\--no-ip-check] [\--no-name-check] [\--no-start] [\--no-install]
35
| [\--net=*N* [:options...] \| \--no-nics]
36
| [{-B|\--backend-parameters} *BEPARAMS*]
37
| [{-H|\--hypervisor-parameters} *HYPERVISOR* [: option=*value*... ]]
38
| [{-O|\--os-parameters} *param*=*value*... ]
39
| [\--file-storage-dir *dir\_path*] [\--file-driver {loop \| blktap}]
40
| {{-n|\--node} *node[:secondary-node]* \| {-I|\--iallocator} *name*}
41
| {{-o|\--os-type} *os-type*}
42
| [\--submit]
43
| [\--ignore-ipolicy]
44
| {*instance*}
45

    
46
Creates a new instance on the specified host. The *instance* argument
47
must be in DNS, but depending on the bridge/routing setup, need not be
48
in the same network as the nodes in the cluster.
49

    
50
The ``disk`` option specifies the parameters for the disks of the
51
instance. The numbering of disks starts at zero, and at least one disk
52
needs to be passed. For each disk, either the size or the adoption
53
source needs to be given, and optionally the access mode (read-only or
54
the default of read-write). The size is interpreted (when no unit is
55
given) in mebibytes. You can also use one of the suffixes *m*, *g* or
56
*t* to specify the exact the units used; these suffixes map to
57
mebibytes, gibibytes and tebibytes. For LVM and DRBD devices, the LVM
58
volume group can also be specified (via the ``vg`` key). For DRBD
59
devices, a different VG can be specified for the metadata device using
60
the ``metavg`` key. For ExtStorage devices, also the ``provider``
61
option is mandatory, to specify which ExtStorage provider to use.
62

    
63
When creating ExtStorage disks, also arbitrary parameters can be passed,
64
to the ExtStorage provider. Those parameters are passed as additional
65
comma separated options. Therefore, an ExtStorage disk provided by
66
provider ``pvdr1`` with parameters ``param1``, ``param2`` would be
67
passed as ``--disk 0:size=10G,provider=pvdr1,param1=val1,param2=val2``.
68

    
69
When using the ``adopt`` key in the disk definition, Ganeti will
70
reuse those volumes (instead of creating new ones) as the
71
instance's disks. Ganeti will rename these volumes to the standard
72
format, and (without installing the OS) will use them as-is for the
73
instance. This allows migrating instances from non-managed mode
74
(e.g. plain KVM with LVM) to being managed via Ganeti. Please note that
75
this works only for the \`plain' disk template (see below for
76
template details).
77

    
78
Alternatively, a single-disk instance can be created via the ``-s``
79
option which takes a single argument, the size of the disk. This is
80
similar to the Ganeti 1.2 version (but will only create one disk).
81

    
82
The minimum disk specification is therefore ``--disk 0:size=20G`` (or
83
``-s 20G`` when using the ``-s`` option), and a three-disk instance
84
can be specified as ``--disk 0:size=20G --disk 1:size=4G --disk
85
2:size=100G``.
86

    
87
The minimum information needed to specify an ExtStorage disk are the
88
``size`` and the ``provider``. For example:
89
``--disk 0:size=20G,provider=pvdr1``.
90

    
91
The ``--no-ip-check`` skips the checks that are done to see if the
92
instance's IP is not already alive (i.e. reachable from the master
93
node).
94

    
95
The ``--no-name-check`` skips the check for the instance name via
96
the resolver (e.g. in DNS or /etc/hosts, depending on your setup).
97
Since the name check is used to compute the IP address, if you pass
98
this option you must also pass the ``--no-ip-check`` option.
99

    
100
If you don't want the instance to automatically start after
101
creation, this is possible via the ``--no-start`` option. This will
102
leave the instance down until a subsequent **gnt-instance start**
103
command.
104

    
105
The NICs of the instances can be specified via the ``--net``
106
option. By default, one NIC is created for the instance, with a
107
random MAC, and set up according the the cluster level NIC
108
parameters. Each NIC can take these parameters (all optional):
109

    
110
mac
111
    either a value or 'generate' to generate a new unique MAC
112

    
113
ip
114
    specifies the IP address assigned to the instance from the Ganeti
115
    side (this is not necessarily what the instance will use, but what
116
    the node expects the instance to use)
117

    
118
mode
119
    specifies the connection mode for this NIC: routed, bridged or
120
    openvswitch.
121

    
122
link
123
    in bridged or openvswitch mode specifies the interface to attach
124
    this NIC to, in routed mode it's intended to differentiate between
125
    different routing tables/instance groups (but the meaning is
126
    dependent on the network script, see **gnt-cluster**\(8) for more
127
    details). Note that openvswitch support is also hypervisor
128
    dependent.
129

    
130
network
131
    derives the mode and the link from the settings of the network
132
    which is identified by its name. If the network option is chosen,
133
    link and mode must not be specified. Note that the mode and link
134
    depend on the network-to-nodegroup connection, thus allowing
135
    different nodegroups to be connected to the same network in
136
    different ways.
137

    
138

    
139
Of these "mode" and "link" are NIC parameters, and inherit their
140
default at cluster level.  Alternatively, if no network is desired for
141
the instance, you can prevent the default of one NIC with the
142
``--no-nics`` option.
143

    
144
The ``-o (--os-type)`` option specifies the operating system to be
145
installed.  The available operating systems can be listed with
146
**gnt-os list**.  Passing ``--no-install`` will however skip the OS
147
installation, allowing a manual import if so desired. Note that the
148
no-installation mode will automatically disable the start-up of the
149
instance (without an OS, it most likely won't be able to start-up
150
successfully).
151

    
152
The ``-B (--backend-parameters)`` option specifies the backend
153
parameters for the instance. If no such parameters are specified, the
154
values are inherited from the cluster. Possible parameters are:
155

    
156
maxmem
157
    the maximum memory size of the instance; as usual, suffixes can be
158
    used to denote the unit, otherwise the value is taken in mebibytes
159

    
160
minmem
161
    the minimum memory size of the instance; as usual, suffixes can be
162
    used to denote the unit, otherwise the value is taken in mebibytes
163

    
164
vcpus
165
    the number of VCPUs to assign to the instance (if this value makes
166
    sense for the hypervisor)
167

    
168
auto\_balance
169
    whether the instance is considered in the N+1 cluster checks
170
    (enough redundancy in the cluster to survive a node failure)
171

    
172
always\_failover
173
    ``True`` or ``False``, whether the instance must be failed over
174
    (shut down and rebooted) always or it may be migrated (briefly
175
    suspended)
176

    
177
Note that before 2.6 Ganeti had a ``memory`` parameter, which was the
178
only value of memory an instance could have. With the
179
``maxmem``/``minmem`` change Ganeti guarantees that at least the minimum
180
memory is always available for an instance, but allows more memory to be
181
used (up to the maximum memory) should it be free.
182

    
183
The ``-H (--hypervisor-parameters)`` option specified the hypervisor
184
to use for the instance (must be one of the enabled hypervisors on the
185
cluster) and optionally custom parameters for this instance. If not
186
other options are used (i.e. the invocation is just -H *NAME*) the
187
instance will inherit the cluster options. The defaults below show the
188
cluster defaults at cluster creation time.
189

    
190
The possible hypervisor options are as follows:
191

    
192
boot\_order
193
    Valid for the Xen HVM and KVM hypervisors.
194

    
195
    A string value denoting the boot order. This has different meaning
196
    for the Xen HVM hypervisor and for the KVM one.
197

    
198
    For Xen HVM, The boot order is a string of letters listing the boot
199
    devices, with valid device letters being:
200

    
201
    a
202
        floppy drive
203

    
204
    c
205
        hard disk
206

    
207
    d
208
        CDROM drive
209

    
210
    n
211
        network boot (PXE)
212

    
213
    The default is not to set an HVM boot order, which is interpreted
214
    as 'dc'.
215

    
216
    For KVM the boot order is either "floppy", "cdrom", "disk" or
217
    "network".  Please note that older versions of KVM couldn't netboot
218
    from virtio interfaces. This has been fixed in more recent versions
219
    and is confirmed to work at least with qemu-kvm 0.11.1. Also note
220
    that if you have set the ``kernel_path`` option, that will be used
221
    for booting, and this setting will be silently ignored.
222

    
223
blockdev\_prefix
224
    Valid for the Xen HVM and PVM hypervisors.
225

    
226
    Relevant to non-pvops guest kernels, in which the disk device names
227
    are given by the host.  Allows one to specify 'xvd', which helps run
228
    Red Hat based installers, driven by anaconda.
229

    
230
floppy\_image\_path
231
    Valid for the KVM hypervisor.
232

    
233
    The path to a floppy disk image to attach to the instance.  This
234
    is useful to install Windows operating systems on Virt/IO disks
235
    because you can specify here the floppy for the drivers at
236
    installation time.
237

    
238
cdrom\_image\_path
239
    Valid for the Xen HVM and KVM hypervisors.
240

    
241
    The path to a CDROM image to attach to the instance.
242

    
243
cdrom2\_image\_path
244
    Valid for the KVM hypervisor.
245

    
246
    The path to a second CDROM image to attach to the instance.
247
    **NOTE**: This image can't be used to boot the system. To do that
248
    you have to use the 'cdrom\_image\_path' option.
249

    
250
nic\_type
251
    Valid for the Xen HVM and KVM hypervisors.
252

    
253
    This parameter determines the way the network cards are presented
254
    to the instance. The possible options are:
255

    
256
    - rtl8139 (default for Xen HVM) (HVM & KVM)
257
    - ne2k\_isa (HVM & KVM)
258
    - ne2k\_pci (HVM & KVM)
259
    - i82551 (KVM)
260
    - i82557b (KVM)
261
    - i82559er (KVM)
262
    - pcnet (KVM)
263
    - e1000 (KVM)
264
    - paravirtual (default for KVM) (HVM & KVM)
265

    
266
disk\_type
267
    Valid for the Xen HVM and KVM hypervisors.
268

    
269
    This parameter determines the way the disks are presented to the
270
    instance. The possible options are:
271

    
272
    - ioemu [default] (HVM & KVM)
273
    - ide (HVM & KVM)
274
    - scsi (KVM)
275
    - sd (KVM)
276
    - mtd (KVM)
277
    - pflash (KVM)
278

    
279

    
280
cdrom\_disk\_type
281
    Valid for the KVM hypervisor.
282

    
283
    This parameter determines the way the cdroms disks are presented
284
    to the instance. The default behavior is to get the same value of
285
    the earlier parameter (disk_type). The possible options are:
286

    
287
    - paravirtual
288
    - ide
289
    - scsi
290
    - sd
291
    - mtd
292
    - pflash
293

    
294

    
295
vnc\_bind\_address
296
    Valid for the Xen HVM and KVM hypervisors.
297

    
298
    Specifies the address that the VNC listener for this instance
299
    should bind to. Valid values are IPv4 addresses. Use the address
300
    0.0.0.0 to bind to all available interfaces (this is the default)
301
    or specify the address of one of the interfaces on the node to
302
    restrict listening to that interface.
303

    
304
vnc\_tls
305
    Valid for the KVM hypervisor.
306

    
307
    A boolean option that controls whether the VNC connection is
308
    secured with TLS.
309

    
310
vnc\_x509\_path
311
    Valid for the KVM hypervisor.
312

    
313
    If ``vnc_tls`` is enabled, this options specifies the path to the
314
    x509 certificate to use.
315

    
316
vnc\_x509\_verify
317
    Valid for the KVM hypervisor.
318

    
319
spice\_bind
320
    Valid for the KVM hypervisor.
321

    
322
    Specifies the address or interface on which the SPICE server will
323
    listen. Valid values are:
324

    
325
    - IPv4 addresses, including 0.0.0.0 and 127.0.0.1
326
    - IPv6 addresses, including :: and ::1
327
    - names of network interfaces
328

    
329
    If a network interface is specified, the SPICE server will be bound
330
    to one of the addresses of that interface.
331

    
332
spice\_ip\_version
333
    Valid for the KVM hypervisor.
334

    
335
    Specifies which version of the IP protocol should be used by the
336
    SPICE server.
337

    
338
    It is mainly intended to be used for specifying what kind of IP
339
    addresses should be used if a network interface with both IPv4 and
340
    IPv6 addresses is specified via the ``spice_bind`` parameter. In
341
    this case, if the ``spice_ip_version`` parameter is not used, the
342
    default IP version of the cluster will be used.
343

    
344
spice\_password\_file
345
    Valid for the KVM hypervisor.
346

    
347
    Specifies a file containing the password that must be used when
348
    connecting via the SPICE protocol. If the option is not specified,
349
    passwordless connections are allowed.
350

    
351
spice\_image\_compression
352
    Valid for the KVM hypervisor.
353

    
354
    Configures the SPICE lossless image compression. Valid values are:
355

    
356
    - auto_glz
357
    - auto_lz
358
    - quic
359
    - glz
360
    - lz
361
    - off
362

    
363
spice\_jpeg\_wan\_compression
364
    Valid for the KVM hypervisor.
365

    
366
    Configures how SPICE should use the jpeg algorithm for lossy image
367
    compression on slow links. Valid values are:
368

    
369
    - auto
370
    - never
371
    - always
372

    
373
spice\_zlib\_glz\_wan\_compression
374
    Valid for the KVM hypervisor.
375

    
376
    Configures how SPICE should use the zlib-glz algorithm for lossy image
377
    compression on slow links. Valid values are:
378

    
379
    - auto
380
    - never
381
    - always
382

    
383
spice\_streaming\_video
384
    Valid for the KVM hypervisor.
385

    
386
    Configures how SPICE should detect video streams. Valid values are:
387

    
388
    - off
389
    - all
390
    - filter
391

    
392
spice\_playback\_compression
393
    Valid for the KVM hypervisor.
394

    
395
    Configures whether SPICE should compress audio streams or not.
396

    
397
spice\_use\_tls
398
    Valid for the KVM hypervisor.
399

    
400
    Specifies that the SPICE server must use TLS to encrypt all the
401
    traffic with the client.
402

    
403
spice\_tls\_ciphers
404
    Valid for the KVM hypervisor.
405

    
406
    Specifies a list of comma-separated ciphers that SPICE should use
407
    for TLS connections. For the format, see man **cipher**\(1).
408

    
409
spice\_use\_vdagent
410
    Valid for the KVM hypervisor.
411

    
412
    Enables or disables passing mouse events via SPICE vdagent.
413

    
414
cpu\_type
415
    Valid for the KVM hypervisor.
416

    
417
    This parameter determines the emulated cpu for the instance. If this
418
    parameter is empty (which is the default configuration), it will not
419
    be passed to KVM.
420

    
421
    Be aware of setting this parameter to ``"host"`` if you have nodes
422
    with different CPUs from each other. Live migration may stop working
423
    in this situation.
424

    
425
    For more information please refer to the KVM manual.
426

    
427
acpi
428
    Valid for the Xen HVM and KVM hypervisors.
429

    
430
    A boolean option that specifies if the hypervisor should enable
431
    ACPI support for this instance. By default, ACPI is disabled.
432

    
433
pae
434
    Valid for the Xen HVM and KVM hypervisors.
435

    
436
    A boolean option that specifies if the hypervisor should enabled
437
    PAE support for this instance. The default is false, disabling PAE
438
    support.
439

    
440
use\_localtime
441
    Valid for the Xen HVM and KVM hypervisors.
442

    
443
    A boolean option that specifies if the instance should be started
444
    with its clock set to the localtime of the machine (when true) or
445
    to the UTC (When false). The default is false, which is useful for
446
    Linux/Unix machines; for Windows OSes, it is recommended to enable
447
    this parameter.
448

    
449
kernel\_path
450
    Valid for the Xen PVM and KVM hypervisors.
451

    
452
    This option specifies the path (on the node) to the kernel to boot
453
    the instance with. Xen PVM instances always require this, while for
454
    KVM if this option is empty, it will cause the machine to load the
455
    kernel from its disks (and the boot will be done accordingly to
456
    ``boot_order``).
457

    
458
kernel\_args
459
    Valid for the Xen PVM and KVM hypervisors.
460

    
461
    This options specifies extra arguments to the kernel that will be
462
    loaded. device. This is always used for Xen PVM, while for KVM it
463
    is only used if the ``kernel_path`` option is also specified.
464

    
465
    The default setting for this value is simply ``"ro"``, which
466
    mounts the root disk (initially) in read-only one. For example,
467
    setting this to single will cause the instance to start in
468
    single-user mode.
469

    
470
initrd\_path
471
    Valid for the Xen PVM and KVM hypervisors.
472

    
473
    This option specifies the path (on the node) to the initrd to boot
474
    the instance with. Xen PVM instances can use this always, while
475
    for KVM if this option is only used if the ``kernel_path`` option
476
    is also specified. You can pass here either an absolute filename
477
    (the path to the initrd) if you want to use an initrd, or use the
478
    format no\_initrd\_path for no initrd.
479

    
480
root\_path
481
    Valid for the Xen PVM and KVM hypervisors.
482

    
483
    This options specifies the name of the root device. This is always
484
    needed for Xen PVM, while for KVM it is only used if the
485
    ``kernel_path`` option is also specified.
486

    
487
    Please note, that if this setting is an empty string and the
488
    hypervisor is Xen it will not be written to the Xen configuration
489
    file
490

    
491
serial\_console
492
    Valid for the KVM hypervisor.
493

    
494
    This boolean option specifies whether to emulate a serial console
495
    for the instance. Note that some versions of KVM have a bug that
496
    will make an instance hang when configured to use the serial console
497
    unless a connection is made to it within about 2 seconds of the
498
    instance's startup. For such case it's recommended to disable this
499
    option, which is enabled by default.
500

    
501
serial\_speed
502
    Valid for the KVM hypervisor.
503

    
504
    This integer option specifies the speed of the serial console.
505
    Common values are 9600, 19200, 38400, 57600 and 115200: choose the
506
    one which works on your system. (The default is 38400 for historical
507
    reasons, but newer versions of kvm/qemu work with 115200)
508

    
509
disk\_cache
510
    Valid for the KVM hypervisor.
511

    
512
    The disk cache mode. It can be either default to not pass any
513
    cache option to KVM, or one of the KVM cache modes: none (for
514
    direct I/O), writethrough (to use the host cache but report
515
    completion to the guest only when the host has committed the
516
    changes to disk) or writeback (to use the host cache and report
517
    completion as soon as the data is in the host cache). Note that
518
    there are special considerations for the cache mode depending on
519
    version of KVM used and disk type (always raw file under Ganeti),
520
    please refer to the KVM documentation for more details.
521

    
522
security\_model
523
    Valid for the KVM hypervisor.
524

    
525
    The security model for kvm. Currently one of *none*, *user* or
526
    *pool*. Under *none*, the default, nothing is done and instances
527
    are run as the Ganeti daemon user (normally root).
528

    
529
    Under *user* kvm will drop privileges and become the user
530
    specified by the security\_domain parameter.
531

    
532
    Under *pool* a global cluster pool of users will be used, making
533
    sure no two instances share the same user on the same node. (this
534
    mode is not implemented yet)
535

    
536
security\_domain
537
    Valid for the KVM hypervisor.
538

    
539
    Under security model *user* the username to run the instance
540
    under.  It must be a valid username existing on the host.
541

    
542
    Cannot be set under security model *none* or *pool*.
543

    
544
kvm\_flag
545
    Valid for the KVM hypervisor.
546

    
547
    If *enabled* the -enable-kvm flag is passed to kvm. If *disabled*
548
    -disable-kvm is passed. If unset no flag is passed, and the
549
    default running mode for your kvm binary will be used.
550

    
551
mem\_path
552
    Valid for the KVM hypervisor.
553

    
554
    This option passes the -mem-path argument to kvm with the path (on
555
    the node) to the mount point of the hugetlbfs file system, along
556
    with the -mem-prealloc argument too.
557

    
558
use\_chroot
559
    Valid for the KVM hypervisor.
560

    
561
    This boolean option determines whether to run the KVM instance in a
562
    chroot directory.
563

    
564
    If it is set to ``true``, an empty directory is created before
565
    starting the instance and its path is passed via the -chroot flag
566
    to kvm. The directory is removed when the instance is stopped.
567

    
568
    It is set to ``false`` by default.
569

    
570
migration\_downtime
571
    Valid for the KVM hypervisor.
572

    
573
    The maximum amount of time (in ms) a KVM instance is allowed to be
574
    frozen during a live migration, in order to copy dirty memory
575
    pages. Default value is 30ms, but you may need to increase this
576
    value for busy instances.
577

    
578
    This option is only effective with kvm versions >= 87 and qemu-kvm
579
    versions >= 0.11.0.
580

    
581
cpu\_mask
582
    Valid for the Xen, KVM and LXC hypervisors.
583

    
584
    The processes belonging to the given instance are only scheduled
585
    on the specified CPUs.
586

    
587
    The format of the mask can be given in three forms. First, the word
588
    "all", which signifies the common case where all VCPUs can live on
589
    any CPU, based on the hypervisor's decisions.
590

    
591
    Second, a comma-separated list of CPU IDs or CPU ID ranges. The
592
    ranges are defined by a lower and higher boundary, separated by a
593
    dash, and the boundaries are inclusive. In this form, all VCPUs of
594
    the instance will be mapped on the selected list of CPUs. Example:
595
    ``0-2,5``, mapping all VCPUs (no matter how many) onto physical CPUs
596
    0, 1, 2 and 5.
597

    
598
    The last form is used for explicit control of VCPU-CPU pinnings. In
599
    this form, the list of VCPU mappings is given as a colon (:)
600
    separated list, whose elements are the possible values for the
601
    second or first form above. In this form, the number of elements in
602
    the colon-separated list _must_ equal the number of VCPUs of the
603
    instance.
604

    
605
    Example:
606

    
607
    .. code-block:: bash
608

    
609
      # Map the entire instance to CPUs 0-2
610
      gnt-instance modify -H cpu_mask=0-2 my-inst
611

    
612
      # Map vCPU 0 to physical CPU 1 and vCPU 1 to CPU 3 (assuming 2 vCPUs)
613
      gnt-instance modify -H cpu_mask=1:3 my-inst
614

    
615
      # Pin vCPU 0 to CPUs 1 or 2, and vCPU 1 to any CPU
616
      gnt-instance modify -H cpu_mask=1-2:all my-inst
617

    
618
      # Pin vCPU 0 to any CPU, vCPU 1 to CPUs 1, 3, 4 or 5, and CPU 2 to
619
      # CPU 0 (backslashes for escaping the comma)
620
      gnt-instance modify -H cpu_mask=all:1\\,3-5:0 my-inst
621

    
622
      # Pin entire VM to CPU 0
623
      gnt-instance modify -H cpu_mask=0 my-inst
624

    
625
      # Turn off CPU pinning (default setting)
626
      gnt-instance modify -H cpu_mask=all my-inst
627

    
628
cpu\_cap
629
    Valid for the Xen hypervisor.
630

    
631
    Set the maximum amount of cpu usage by the VM. The value is a percentage
632
    between 0 and (100 * number of VCPUs). Default cap is 0: unlimited.
633

    
634
cpu\_weight
635
    Valid for the Xen hypervisor.
636

    
637
    Set the cpu time ratio to be allocated to the VM. Valid values are
638
    between 1 and 65535. Default weight is 256.
639

    
640
usb\_mouse
641
    Valid for the KVM hypervisor.
642

    
643
    This option specifies the usb mouse type to be used. It can be
644
    "mouse" or "tablet". When using VNC it's recommended to set it to
645
    "tablet".
646

    
647
keymap
648
    Valid for the KVM hypervisor.
649

    
650
    This option specifies the keyboard mapping to be used. It is only
651
    needed when using the VNC console. For example: "fr" or "en-gb".
652

    
653
reboot\_behavior
654
    Valid for Xen PVM, Xen HVM and KVM hypervisors.
655

    
656
    Normally if an instance reboots, the hypervisor will restart it. If
657
    this option is set to ``exit``, the hypervisor will treat a reboot
658
    as a shutdown instead.
659

    
660
    It is set to ``reboot`` by default.
661

    
662
cpu\_cores
663
    Valid for the KVM hypervisor.
664

    
665
    Number of emulated CPU cores.
666

    
667
cpu\_threads
668
    Valid for the KVM hypervisor.
669

    
670
    Number of emulated CPU threads.
671

    
672
cpu\_sockets
673
    Valid for the KVM hypervisor.
674

    
675
    Number of emulated CPU sockets.
676

    
677
soundhw
678
    Valid for the KVM hypervisor.
679

    
680
    Comma separated list of emulated sounds cards, or "all" to enable
681
    all the available ones.
682

    
683
usb\_devices
684
    Valid for the KVM hypervisor.
685

    
686
    Comma separated list of usb devices. These can be emulated devices
687
    or passthrough ones, and each one gets passed to kvm with its own
688
    ``-usbdevice`` option. See the **qemu**\(1) manpage for the syntax
689
    of the possible components.
690

    
691
vga
692
    Valid for the KVM hypervisor.
693

    
694
    Emulated vga mode, passed the the kvm -vga option.
695

    
696
kvm\_extra
697
    Valid for the KVM hypervisor.
698

    
699
    Any other option to the KVM hypervisor, useful tweaking anything
700
    that Ganeti doesn't support.
701

    
702
machine\_version
703
    Valid for the KVM hypervisor.
704

    
705
    Use in case an instance must be booted with an exact type of
706
    machine version (due to e.g. outdated drivers). In case it's not set
707
    the default version supported by your version of kvm is used.
708

    
709
kvm\_path
710
    Valid for the KVM hypervisor.
711

    
712
    Path to the userspace KVM (or qemu) program.
713

    
714
The ``-O (--os-parameters)`` option allows customisation of the OS
715
parameters. The actual parameter names and values depends on the OS
716
being used, but the syntax is the same key=value. For example, setting
717
a hypothetical ``dhcp`` parameter to yes can be achieved by::
718

    
719
    gnt-instance add -O dhcp=yes ...
720

    
721
The ``-I (--iallocator)`` option specifies the instance allocator plugin
722
to use (``.`` means the default allocator). If you pass in this option
723
the allocator will select nodes for this instance automatically, so you
724
don't need to pass them with the ``-n`` option. For more information
725
please refer to the instance allocator documentation.
726

    
727
The ``-t (--disk-template)`` options specifies the disk layout type
728
for the instance.  The available choices are:
729

    
730
diskless
731
    This creates an instance with no disks. Its useful for testing only
732
    (or other special cases).
733

    
734
file
735
    Disk devices will be regular files.
736

    
737
sharedfile
738
    Disk devices will be regulare files on a shared directory.
739

    
740
plain
741
    Disk devices will be logical volumes.
742

    
743
drbd
744
    Disk devices will be drbd (version 8.x) on top of lvm volumes.
745

    
746
rbd
747
    Disk devices will be rbd volumes residing inside a RADOS cluster.
748

    
749
blockdev
750
    Disk devices will be adopted pre-existent block devices.
751

    
752
ext
753
    Disk devices will be provided by external shared storage,
754
    through the ExtStorage Interface using ExtStorage providers.
755

    
756
The optional second value of the ``-n (--node)`` is used for the drbd
757
template type and specifies the remote node.
758

    
759
If you do not want gnt-instance to wait for the disk mirror to be
760
synced, use the ``--no-wait-for-sync`` option.
761

    
762
The ``--file-storage-dir`` specifies the relative path under the
763
cluster-wide file storage directory to store file-based disks. It is
764
useful for having different subdirectories for different
765
instances. The full path of the directory where the disk files are
766
stored will consist of cluster-wide file storage directory + optional
767
subdirectory + instance name. Example:
768
``@RPL_FILE_STORAGE_DIR@/mysubdir/instance1.example.com``. This
769
option is only relevant for instances using the file storage backend.
770

    
771
The ``--file-driver`` specifies the driver to use for file-based
772
disks. Note that currently these drivers work with the xen hypervisor
773
only. This option is only relevant for instances using the file
774
storage backend. The available choices are:
775

    
776
loop
777
    Kernel loopback driver. This driver uses loopback devices to
778
    access the filesystem within the file. However, running I/O
779
    intensive applications in your instance using the loop driver
780
    might result in slowdowns. Furthermore, if you use the loopback
781
    driver consider increasing the maximum amount of loopback devices
782
    (on most systems it's 8) using the max\_loop param.
783

    
784
blktap
785
    The blktap driver (for Xen hypervisors). In order to be able to
786
    use the blktap driver you should check if the 'blktapctrl' user
787
    space disk agent is running (usually automatically started via
788
    xend).  This user-level disk I/O interface has the advantage of
789
    better performance. Especially if you use a network file system
790
    (e.g. NFS) to store your instances this is the recommended choice.
791

    
792
If ``--ignore-ipolicy`` is given any instance policy violations occuring
793
during this operation are ignored.
794

    
795
See **ganeti**\(7) for a description of ``--submit`` and other common
796
options.
797

    
798
Example::
799

    
800
    # gnt-instance add -t file --disk 0:size=30g -B maxmem=512 -o debian-etch \
801
      -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
802
    # gnt-instance add -t plain --disk 0:size=30g -B maxmem=1024,minmem=512 \
803
      -o debian-etch -n node1.example.com instance1.example.com
804
    # gnt-instance add -t plain --disk 0:size=30g --disk 1:size=100g,vg=san \
805
      -B maxmem=512 -o debian-etch -n node1.example.com instance1.example.com
806
    # gnt-instance add -t drbd --disk 0:size=30g -B maxmem=512 -o debian-etch \
807
      -n node1.example.com:node2.example.com instance2.example.com
808
    # gnt-instance add -t rbd --disk 0:size=30g -B maxmem=512 -o debian-etch \
809
      -n node1.example.com instance1.example.com
810
    # gnt-instance add -t ext --disk 0:size=30g,provider=pvdr1 -B maxmem=512 \
811
      -o debian-etch -n node1.example.com instance1.example.com
812
    # gnt-instance add -t ext --disk 0:size=30g,provider=pvdr1,param1=val1 \
813
      --disk 1:size=40g,provider=pvdr2,param2=val2,param3=val3 -B maxmem=512 \
814
      -o debian-etch -n node1.example.com instance1.example.com
815

    
816

    
817
BATCH-CREATE
818
^^^^^^^^^^^^
819

    
820
**batch-create** {instances\_file.json}
821

    
822
This command (similar to the Ganeti 1.2 **batcher** tool) submits
823
multiple instance creation jobs based on a definition file. The
824
instance configurations do not encompass all the possible options for
825
the **add** command, but only a subset.
826

    
827
The instance file should be a valid-formed JSON file, containing a
828
dictionary with instance name and instance parameters. The accepted
829
parameters are:
830

    
831
disk\_size
832
    The size of the disks of the instance.
833

    
834
disk\_template
835
    The disk template to use for the instance, the same as in the
836
    **add** command.
837

    
838
backend
839
    A dictionary of backend parameters.
840

    
841
hypervisor
842
    A dictionary with a single key (the hypervisor name), and as value
843
    the hypervisor options. If not passed, the default hypervisor and
844
    hypervisor options will be inherited.
845

    
846
mac, ip, mode, link
847
    Specifications for the one NIC that will be created for the
848
    instance. 'bridge' is also accepted as a backwards compatible
849
    key.
850

    
851
nics
852
    List of NICs that will be created for the instance. Each entry
853
    should be a dict, with mac, ip, mode and link as possible keys.
854
    Please don't provide the "mac, ip, mode, link" parent keys if you
855
    use this method for specifying NICs.
856

    
857
primary\_node, secondary\_node
858
    The primary and optionally the secondary node to use for the
859
    instance (in case an iallocator script is not used).
860

    
861
iallocator
862
    Instead of specifying the nodes, an iallocator script can be used
863
    to automatically compute them.
864

    
865
start
866
    whether to start the instance
867

    
868
ip\_check
869
    Skip the check for already-in-use instance; see the description in
870
    the **add** command for details.
871

    
872
name\_check
873
    Skip the name check for instances; see the description in the
874
    **add** command for details.
875

    
876
file\_storage\_dir, file\_driver
877
    Configuration for the file disk type, see the **add** command for
878
    details.
879

    
880

    
881
A simple definition for one instance can be (with most of the
882
parameters taken from the cluster defaults)::
883

    
884
    {
885
      "instance3": {
886
        "template": "drbd",
887
        "os": "debootstrap",
888
        "disk_size": ["25G"],
889
        "iallocator": "dumb"
890
      },
891
      "instance5": {
892
        "template": "drbd",
893
        "os": "debootstrap",
894
        "disk_size": ["25G"],
895
        "iallocator": "dumb",
896
        "hypervisor": "xen-hvm",
897
        "hvparams": {"acpi": true},
898
        "backend": {"maxmem": 512, "minmem": 256}
899
      }
900
    }
901

    
902
The command will display the job id for each submitted instance, as
903
follows::
904

    
905
    # gnt-instance batch-create instances.json
906
    instance3: 11224
907
    instance5: 11225
908

    
909
REMOVE
910
^^^^^^
911

    
912
**remove** [\--ignore-failures] [\--shutdown-timeout=*N*] [\--submit]
913
[\--force] {*instance*}
914

    
915
Remove an instance. This will remove all data from the instance and
916
there is *no way back*. If you are not sure if you use an instance
917
again, use **shutdown** first and leave it in the shutdown state for a
918
while.
919

    
920
The ``--ignore-failures`` option will cause the removal to proceed
921
even in the presence of errors during the removal of the instance
922
(e.g. during the shutdown or the disk removal). If this option is not
923
given, the command will stop at the first error.
924

    
925
The ``--shutdown-timeout`` is used to specify how much time to wait
926
before forcing the shutdown (e.g. ``xm destroy`` in Xen, killing the
927
kvm process for KVM, etc.). By default two minutes are given to each
928
instance to stop.
929

    
930
The ``--force`` option is used to skip the interactive confirmation.
931

    
932
See **ganeti**\(7) for a description of ``--submit`` and other common
933
options.
934

    
935
Example::
936

    
937
    # gnt-instance remove instance1.example.com
938

    
939

    
940
LIST
941
^^^^
942

    
943
| **list**
944
| [\--no-headers] [\--separator=*SEPARATOR*] [\--units=*UNITS*] [-v]
945
| [{-o|\--output} *[+]FIELD,...*] [\--filter] [instance...]
946

    
947
Shows the currently configured instances with memory usage, disk
948
usage, the node they are running on, and their run status.
949

    
950
The ``--no-headers`` option will skip the initial header line. The
951
``--separator`` option takes an argument which denotes what will be
952
used between the output fields. Both these options are to help
953
scripting.
954

    
955
The units used to display the numeric values in the output varies,
956
depending on the options given. By default, the values will be
957
formatted in the most appropriate unit. If the ``--separator`` option
958
is given, then the values are shown in mebibytes to allow parsing by
959
scripts. In both cases, the ``--units`` option can be used to enforce
960
a given output unit.
961

    
962
The ``-v`` option activates verbose mode, which changes the display of
963
special field states (see **ganeti**\(7)).
964

    
965
The ``-o (--output)`` option takes a comma-separated list of output
966
fields. The available fields and their meaning are:
967

    
968
@QUERY_FIELDS_INSTANCE@
969

    
970
If the value of the option starts with the character ``+``, the new
971
field(s) will be added to the default list. This allows one to quickly
972
see the default list plus a few other fields, instead of retyping the
973
entire list of fields.
974

    
975
There is a subtle grouping about the available output fields: all
976
fields except for ``oper_state``, ``oper_ram``, ``oper_vcpus`` and
977
``status`` are configuration value and not run-time values. So if you
978
don't select any of the these fields, the query will be satisfied
979
instantly from the cluster configuration, without having to ask the
980
remote nodes for the data. This can be helpful for big clusters when
981
you only want some data and it makes sense to specify a reduced set of
982
output fields.
983

    
984
If exactly one argument is given and it appears to be a query filter
985
(see **ganeti**\(7)), the query result is filtered accordingly. For
986
ambiguous cases (e.g. a single field name as a filter) the ``--filter``
987
(``-F``) option forces the argument to be treated as a filter (e.g.
988
``gnt-instance list -F admin_state``).
989

    
990
The default output field list is: ``name``, ``os``, ``pnode``,
991
``admin_state``, ``oper_state``, ``oper_ram``.
992

    
993

    
994
LIST-FIELDS
995
^^^^^^^^^^^
996

    
997
**list-fields** [field...]
998

    
999
Lists available fields for instances.
1000

    
1001

    
1002
INFO
1003
^^^^
1004

    
1005
**info** [-s \| \--static] [\--roman] {\--all \| *instance*}
1006

    
1007
Show detailed information about the given instance(s). This is
1008
different from **list** as it shows detailed data about the instance's
1009
disks (especially useful for the drbd disk template).
1010

    
1011
If the option ``-s`` is used, only information available in the
1012
configuration file is returned, without querying nodes, making the
1013
operation faster.
1014

    
1015
Use the ``--all`` to get info about all instances, rather than
1016
explicitly passing the ones you're interested in.
1017

    
1018
The ``--roman`` option can be used to cause envy among people who like
1019
ancient cultures, but are stuck with non-latin-friendly cluster
1020
virtualization technologies.
1021

    
1022
MODIFY
1023
^^^^^^
1024

    
1025
| **modify**
1026
| [{-H|\--hypervisor-parameters} *HYPERVISOR\_PARAMETERS*]
1027
| [{-B|\--backend-parameters} *BACKEND\_PARAMETERS*]
1028
| [{-m|\--runtime-memory} *SIZE*]
1029
| [\--net add*[:options]* \| \--net [*N*:]remove \| \--net *N:options*]
1030
| [\--disk add:size=*SIZE*[,vg=*VG*][,metavg=*VG*] \|
1031
|  \--disk add:size=*SIZE*,provider=*PROVIDER*[,param=*value*... ] \|
1032
|  \--disk [*N*:]remove \|
1033
|  \--disk *N*:mode=*MODE*]
1034
| [{-t|\--disk-template} plain | {-t|\--disk-template} drbd -n *new_secondary*] [\--no-wait-for-sync]
1035
| [\--os-type=*OS* [\--force-variant]]
1036
| [{-O|\--os-parameters} *param*=*value*... ]
1037
| [\--offline \| \--online]
1038
| [\--submit]
1039
| [\--ignore-ipolicy]
1040
| {*instance*}
1041

    
1042
Modifies the memory size, number of vcpus, ip address, MAC address
1043
and/or NIC parameters for an instance. It can also add and remove
1044
disks and NICs to/from the instance. Note that you need to give at
1045
least one of the arguments, otherwise the command complains.
1046

    
1047
The ``-H (--hypervisor-parameters)``, ``-B (--backend-parameters)``
1048
and ``-O (--os-parameters)`` options specifies hypervisor, backend and
1049
OS parameter options in the form of name=value[,...]. For details
1050
which options can be specified, see the **add** command.
1051

    
1052
The ``-t (--disk-template)`` option will change the disk template of
1053
the instance.  Currently only conversions between the plain and drbd
1054
disk templates are supported, and the instance must be stopped before
1055
attempting the conversion. When changing from the plain to the drbd
1056
disk template, a new secondary node must be specified via the ``-n``
1057
option. The option ``--no-wait-for-sync`` can be used when converting
1058
to the ``drbd`` template in order to make the instance available for
1059
startup before DRBD has finished resyncing.
1060

    
1061
The ``-m (--runtime-memory)`` option will change an instance's runtime
1062
memory to the given size (in MB if a different suffix is not specified),
1063
by ballooning it up or down to the new value.
1064

    
1065
The ``--disk add:size=``*SIZE* option adds a disk to the instance. The
1066
optional ``vg=``*VG* option specifies an LVM volume group other than the
1067
default volume group to create the disk on. For DRBD disks, the
1068
``metavg=``*VG* option specifies the volume group for the metadata
1069
device. When adding an ExtStorage disk the ``provider=``*PROVIDER*
1070
option is also mandatory and specifies the ExtStorage provider. Also,
1071
for ExtStorage disks arbitrary parameters can be passed as additional
1072
comma separated options, same as in the **add** command. ``--disk``
1073
*N*``:add,size=``**SIZE** can be used to add a disk at a specific index.
1074
The ``--disk remove`` option will remove the last disk of the instance.
1075
Use ``--disk `` *N*``:remove`` to remove a disk by its index. The
1076
``--disk`` *N*``:mode=``*MODE* option will change the mode of the Nth
1077
disk of the instance between read-only (``ro``) and read-write (``rw``).
1078

    
1079
The ``--net add:``*options* and ``--net`` *N*``:add,``*options* option
1080
will add a new network interface to the instance. The available options
1081
are the same as in the **add** command (``mac``, ``ip``, ``link``,
1082
``mode``, ``network``). The ``--net remove`` will remove the last network
1083
interface of the instance (``--net`` *N*``:remove`` for a specific index),
1084
while the ``--net`` *N*``:``*options* option will change the parameters of
1085
the Nth instance network interface.
1086

    
1087
The option ``-o (--os-type)`` will change the OS name for the instance
1088
(without reinstallation). In case an OS variant is specified that is
1089
not found, then by default the modification is refused, unless
1090
``--force-variant`` is passed. An invalid OS will also be refused,
1091
unless the ``--force`` option is given.
1092

    
1093
The ``--online`` and ``--offline`` options are used to transition an
1094
instance into and out of the ``offline`` state. An instance can be
1095
turned offline only if it was previously down. The ``--online`` option
1096
fails if the instance was not in the ``offline`` state, otherwise it
1097
changes instance's state to ``down``. These modifications take effect
1098
immediately.
1099

    
1100
If ``--ignore-ipolicy`` is given any instance policy violations occuring
1101
during this operation are ignored.
1102

    
1103
See **ganeti**\(7) for a description of ``--submit`` and other common
1104
options.
1105

    
1106
Most of the changes take effect at the next restart. If the instance is
1107
running, there is no effect on the instance.
1108

    
1109
REINSTALL
1110
^^^^^^^^^
1111

    
1112
| **reinstall** [{-o|\--os-type} *os-type*] [\--select-os] [-f *force*]
1113
| [\--force-multiple]
1114
| [\--instance \| \--node \| \--primary \| \--secondary \| \--all]
1115
| [{-O|\--os-parameters} *OS\_PARAMETERS*] [\--submit] {*instance*...}
1116

    
1117
Reinstalls the operating system on the given instance(s). The
1118
instance(s) must be stopped when running this command. If the ``-o
1119
(--os-type)`` is specified, the operating system is changed.
1120

    
1121
The ``--select-os`` option switches to an interactive OS reinstall.
1122
The user is prompted to select the OS template from the list of
1123
available OS templates. OS parameters can be overridden using ``-O
1124
(--os-parameters)`` (more documentation for this option under the
1125
**add** command).
1126

    
1127
Since this is a potentially dangerous command, the user will be
1128
required to confirm this action, unless the ``-f`` flag is passed.
1129
When multiple instances are selected (either by passing multiple
1130
arguments or by using the ``--node``, ``--primary``, ``--secondary``
1131
or ``--all`` options), the user must pass the ``--force-multiple``
1132
options to skip the interactive confirmation.
1133

    
1134
See **ganeti**\(7) for a description of ``--submit`` and other common
1135
options.
1136

    
1137
RENAME
1138
^^^^^^
1139

    
1140
| **rename** [\--no-ip-check] [\--no-name-check] [\--submit]
1141
| {*instance*} {*new\_name*}
1142

    
1143
Renames the given instance. The instance must be stopped when running
1144
this command. The requirements for the new name are the same as for
1145
adding an instance: the new name must be resolvable and the IP it
1146
resolves to must not be reachable (in order to prevent duplicate IPs
1147
the next time the instance is started). The IP test can be skipped if
1148
the ``--no-ip-check`` option is passed.
1149

    
1150
Note that you can rename an instance to its same name, to force
1151
re-executing the os-specific rename script for that instance, if
1152
needed.
1153

    
1154
The ``--no-name-check`` skips the check for the new instance name via
1155
the resolver (e.g. in DNS or /etc/hosts, depending on your setup) and
1156
that the resolved name matches the provided name. Since the name check
1157
is used to compute the IP address, if you pass this option you must also
1158
pass the ``--no-ip-check`` option.
1159

    
1160
See **ganeti**\(7) for a description of ``--submit`` and other common
1161
options.
1162

    
1163
Starting/stopping/connecting to console
1164
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1165

    
1166
STARTUP
1167
^^^^^^^
1168

    
1169
| **startup**
1170
| [\--force] [\--ignore-offline]
1171
| [\--force-multiple] [\--no-remember]
1172
| [\--instance \| \--node \| \--primary \| \--secondary \| \--all \|
1173
| \--tags \| \--node-tags \| \--pri-node-tags \| \--sec-node-tags]
1174
| [{-H|\--hypervisor-parameters} ``key=value...``]
1175
| [{-B|\--backend-parameters} ``key=value...``]
1176
| [\--submit] [\--paused]
1177
| {*name*...}
1178

    
1179
Starts one or more instances, depending on the following options.  The
1180
four available modes are:
1181

    
1182
\--instance
1183
    will start the instances given as arguments (at least one argument
1184
    required); this is the default selection
1185

    
1186
\--node
1187
    will start the instances who have the given node as either primary
1188
    or secondary
1189

    
1190
\--primary
1191
    will start all instances whose primary node is in the list of nodes
1192
    passed as arguments (at least one node required)
1193

    
1194
\--secondary
1195
    will start all instances whose secondary node is in the list of
1196
    nodes passed as arguments (at least one node required)
1197

    
1198
\--all
1199
    will start all instances in the cluster (no arguments accepted)
1200

    
1201
\--tags
1202
    will start all instances in the cluster with the tags given as
1203
    arguments
1204

    
1205
\--node-tags
1206
    will start all instances in the cluster on nodes with the tags
1207
    given as arguments
1208

    
1209
\--pri-node-tags
1210
    will start all instances in the cluster on primary nodes with the
1211
    tags given as arguments
1212

    
1213
\--sec-node-tags
1214
    will start all instances in the cluster on secondary nodes with the
1215
    tags given as arguments
1216

    
1217
Note that although you can pass more than one selection option, the
1218
last one wins, so in order to guarantee the desired result, don't pass
1219
more than one such option.
1220

    
1221
Use ``--force`` to start even if secondary disks are failing.
1222
``--ignore-offline`` can be used to ignore offline primary nodes and
1223
mark the instance as started even if the primary is not available.
1224

    
1225
The ``--force-multiple`` will skip the interactive confirmation in the
1226
case the more than one instance will be affected.
1227

    
1228
The ``--no-remember`` option will perform the startup but not change
1229
the state of the instance in the configuration file (if it was stopped
1230
before, Ganeti will still think it needs to be stopped). This can be
1231
used for testing, or for a one shot-start where you don't want the
1232
watcher to restart the instance if it crashes.
1233

    
1234
The ``-H (--hypervisor-parameters)`` and ``-B (--backend-parameters)``
1235
options specify temporary hypervisor and backend parameters that can
1236
be used to start an instance with modified parameters. They can be
1237
useful for quick testing without having to modify an instance back and
1238
forth, e.g.::
1239

    
1240
    # gnt-instance start -H kernel_args="single" instance1
1241
    # gnt-instance start -B maxmem=2048 instance2
1242

    
1243

    
1244
The first form will start the instance instance1 in single-user mode,
1245
and the instance instance2 with 2GB of RAM (this time only, unless
1246
that is the actual instance memory size already). Note that the values
1247
override the instance parameters (and not extend them): an instance
1248
with "kernel\_args=ro" when started with -H kernel\_args=single will
1249
result in "single", not "ro single".
1250

    
1251
The ``--paused`` option is only valid for Xen and kvm hypervisors.  This
1252
pauses the instance at the start of bootup, awaiting ``gnt-instance
1253
console`` to unpause it, allowing the entire boot process to be
1254
monitored for debugging.
1255

    
1256
See **ganeti**\(7) for a description of ``--submit`` and other common
1257
options.
1258

    
1259
Example::
1260

    
1261
    # gnt-instance start instance1.example.com
1262
    # gnt-instance start --node node1.example.com node2.example.com
1263
    # gnt-instance start --all
1264

    
1265

    
1266
SHUTDOWN
1267
^^^^^^^^
1268

    
1269
| **shutdown**
1270
| [\--timeout=*N*]
1271
| [\--force] [\--force-multiple] [\--ignore-offline] [\--no-remember]
1272
| [\--instance \| \--node \| \--primary \| \--secondary \| \--all \|
1273
| \--tags \| \--node-tags \| \--pri-node-tags \| \--sec-node-tags]
1274
| [\--submit]
1275
| {*name*...}
1276

    
1277
Stops one or more instances. If the instance cannot be cleanly stopped
1278
during a hardcoded interval (currently 2 minutes), it will forcibly
1279
stop the instance (equivalent to switching off the power on a physical
1280
machine).
1281

    
1282
The ``--timeout`` is used to specify how much time to wait before
1283
forcing the shutdown (e.g. ``xm destroy`` in Xen, killing the kvm
1284
process for KVM, etc.). By default two minutes are given to each
1285
instance to stop.
1286

    
1287
The ``--instance``, ``--node``, ``--primary``, ``--secondary``,
1288
``--all``, ``--tags``, ``--node-tags``, ``--pri-node-tags`` and
1289
``--sec-node-tags`` options are similar as for the **startup** command
1290
and they influence the actual instances being shutdown.
1291

    
1292
``--ignore-offline`` can be used to ignore offline primary nodes and
1293
force the instance to be marked as stopped. This option should be used
1294
with care as it can lead to an inconsistent cluster state.
1295

    
1296
Use ``--force`` to be able to shutdown an instance even when it's marked
1297
as offline. This is useful is an offline instance ends up in the
1298
``ERROR_up`` state, for example.
1299

    
1300
The ``--no-remember`` option will perform the shutdown but not change
1301
the state of the instance in the configuration file (if it was running
1302
before, Ganeti will still thinks it needs to be running). This can be
1303
useful for a cluster-wide shutdown, where some instances are marked as
1304
up and some as down, and you don't want to change the running state:
1305
you just need to disable the watcher, shutdown all instances with
1306
``--no-remember``, and when the watcher is activated again it will
1307
restore the correct runtime state for all instances.
1308

    
1309
See **ganeti**\(7) for a description of ``--submit`` and other common
1310
options.
1311

    
1312
Example::
1313

    
1314
    # gnt-instance shutdown instance1.example.com
1315
    # gnt-instance shutdown --all
1316

    
1317

    
1318
REBOOT
1319
^^^^^^
1320

    
1321
| **reboot**
1322
| [{-t|\--type} *REBOOT-TYPE*]
1323
| [\--ignore-secondaries]
1324
| [\--shutdown-timeout=*N*]
1325
| [\--force-multiple]
1326
| [\--instance \| \--node \| \--primary \| \--secondary \| \--all \|
1327
| \--tags \| \--node-tags \| \--pri-node-tags \| \--sec-node-tags]
1328
| [\--submit]
1329
| [*name*...]
1330

    
1331
Reboots one or more instances. The type of reboot depends on the value
1332
of ``-t (--type)``. A soft reboot does a hypervisor reboot, a hard reboot
1333
does a instance stop, recreates the hypervisor config for the instance
1334
and starts the instance. A full reboot does the equivalent of
1335
**gnt-instance shutdown && gnt-instance startup**.  The default is
1336
hard reboot.
1337

    
1338
For the hard reboot the option ``--ignore-secondaries`` ignores errors
1339
for the secondary node while re-assembling the instance disks.
1340

    
1341
The ``--instance``, ``--node``, ``--primary``, ``--secondary``,
1342
``--all``, ``--tags``, ``--node-tags``, ``--pri-node-tags`` and
1343
``--sec-node-tags`` options are similar as for the **startup** command
1344
and they influence the actual instances being rebooted.
1345

    
1346
The ``--shutdown-timeout`` is used to specify how much time to wait
1347
before forcing the shutdown (xm destroy in xen, killing the kvm
1348
process, for kvm). By default two minutes are given to each instance
1349
to stop.
1350

    
1351
The ``--force-multiple`` will skip the interactive confirmation in the
1352
case the more than one instance will be affected.
1353

    
1354
See **ganeti**\(7) for a description of ``--submit`` and other common
1355
options.
1356

    
1357
Example::
1358

    
1359
    # gnt-instance reboot instance1.example.com
1360
    # gnt-instance reboot --type=full instance1.example.com
1361

    
1362

    
1363
CONSOLE
1364
^^^^^^^
1365

    
1366
**console** [\--show-cmd] {*instance*}
1367

    
1368
Connects to the console of the given instance. If the instance is not
1369
up, an error is returned. Use the ``--show-cmd`` option to display the
1370
command instead of executing it.
1371

    
1372
For HVM instances, this will attempt to connect to the serial console
1373
of the instance. To connect to the virtualized "physical" console of a
1374
HVM instance, use a VNC client with the connection info from the
1375
**info** command.
1376

    
1377
For Xen/kvm instances, if the instance is paused, this attempts to
1378
unpause the instance after waiting a few seconds for the connection to
1379
the console to be made.
1380

    
1381
Example::
1382

    
1383
    # gnt-instance console instance1.example.com
1384

    
1385

    
1386
Disk management
1387
~~~~~~~~~~~~~~~
1388

    
1389
REPLACE-DISKS
1390
^^^^^^^^^^^^^
1391

    
1392
**replace-disks** [\--submit] [\--early-release] [\--ignore-ipolicy] {-p}
1393
[\--disks *idx*] {*instance*}
1394

    
1395
**replace-disks** [\--submit] [\--early-release] [\--ignore-ipolicy] {-s}
1396
[\--disks *idx*] {*instance*}
1397

    
1398
**replace-disks** [\--submit] [\--early-release] [\--ignore-ipolicy]
1399
{{-I\|\--iallocator} *name* \| {{-n|\--new-secondary} *node* } {*instance*}
1400

    
1401
**replace-disks** [\--submit] [\--early-release] [\--ignore-ipolicy]
1402
{-a\|\--auto} {*instance*}
1403

    
1404
This command is a generalized form for replacing disks. It is
1405
currently only valid for the mirrored (DRBD) disk template.
1406

    
1407
The first form (when passing the ``-p`` option) will replace the disks
1408
on the primary, while the second form (when passing the ``-s`` option
1409
will replace the disks on the secondary node. For these two cases (as
1410
the node doesn't change), it is possible to only run the replace for a
1411
subset of the disks, using the option ``--disks`` which takes a list
1412
of comma-delimited disk indices (zero-based), e.g. 0,2 to replace only
1413
the first and third disks.
1414

    
1415
The third form (when passing either the ``--iallocator`` or the
1416
``--new-secondary`` option) is designed to change secondary node of the
1417
instance. Specifying ``--iallocator`` makes the new secondary be
1418
selected automatically by the specified allocator plugin (use ``.`` to
1419
indicate the default allocator), otherwise the new secondary node will
1420
be the one chosen manually via the ``--new-secondary`` option.
1421

    
1422
Note that it is not possible to select an offline or drained node as a
1423
new secondary.
1424

    
1425
The fourth form (when using ``--auto``) will automatically determine
1426
which disks of an instance are faulty and replace them within the same
1427
node. The ``--auto`` option works only when an instance has only
1428
faulty disks on either the primary or secondary node; it doesn't work
1429
when both sides have faulty disks.
1430

    
1431
The ``--early-release`` changes the code so that the old storage on
1432
secondary node(s) is removed early (before the resync is completed)
1433
and the internal Ganeti locks for the current (and new, if any)
1434
secondary node are also released, thus allowing more parallelism in
1435
the cluster operation. This should be used only when recovering from a
1436
disk failure on the current secondary (thus the old storage is already
1437
broken) or when the storage on the primary node is known to be fine
1438
(thus we won't need the old storage for potential recovery).
1439

    
1440
The ``--ignore-ipolicy`` let the command ignore instance policy
1441
violations if replace-disks changes groups and the instance would
1442
violate the new groups instance policy.
1443

    
1444
See **ganeti**\(7) for a description of ``--submit`` and other common
1445
options.
1446

    
1447
ACTIVATE-DISKS
1448
^^^^^^^^^^^^^^
1449

    
1450
**activate-disks** [\--submit] [\--ignore-size] [\--wait-for-sync] {*instance*}
1451

    
1452
Activates the block devices of the given instance. If successful, the
1453
command will show the location and name of the block devices::
1454

    
1455
    node1.example.com:disk/0:/dev/drbd0
1456
    node1.example.com:disk/1:/dev/drbd1
1457

    
1458

    
1459
In this example, *node1.example.com* is the name of the node on which
1460
the devices have been activated. The *disk/0* and *disk/1* are the
1461
Ganeti-names of the instance disks; how they are visible inside the
1462
instance is hypervisor-specific. */dev/drbd0* and */dev/drbd1* are the
1463
actual block devices as visible on the node.
1464

    
1465
The ``--ignore-size`` option can be used to activate disks ignoring
1466
the currently configured size in Ganeti. This can be used in cases
1467
where the configuration has gotten out of sync with the real-world
1468
(e.g. after a partially-failed grow-disk operation or due to rounding
1469
in LVM devices). This should not be used in normal cases, but only
1470
when activate-disks fails without it.
1471

    
1472
The ``--wait-for-sync`` option will ensure that the command returns only
1473
after the instance's disks are synchronised (mostly for DRBD); this can
1474
be useful to ensure consistency, as otherwise there are no commands that
1475
can wait until synchronisation is done. However when passing this
1476
option, the command will have additional output, making it harder to
1477
parse the disk information.
1478

    
1479
Note that it is safe to run this command while the instance is already
1480
running.
1481

    
1482
See **ganeti**\(7) for a description of ``--submit`` and other common
1483
options.
1484

    
1485
DEACTIVATE-DISKS
1486
^^^^^^^^^^^^^^^^
1487

    
1488
**deactivate-disks** [-f] [\--submit] {*instance*}
1489

    
1490
De-activates the block devices of the given instance. Note that if you
1491
run this command for an instance with a drbd disk template, while it
1492
is running, it will not be able to shutdown the block devices on the
1493
primary node, but it will shutdown the block devices on the secondary
1494
nodes, thus breaking the replication.
1495

    
1496
The ``-f``/``--force`` option will skip checks that the instance is
1497
down; in case the hypervisor is confused and we can't talk to it,
1498
normally Ganeti will refuse to deactivate the disks, but with this
1499
option passed it will skip this check and directly try to deactivate
1500
the disks. This can still fail due to the instance actually running or
1501
other issues.
1502

    
1503
See **ganeti**\(7) for a description of ``--submit`` and other common
1504
options.
1505

    
1506
GROW-DISK
1507
^^^^^^^^^
1508

    
1509
| **grow-disk** [\--no-wait-for-sync] [\--submit] [\--absolute]
1510
| {*instance*} {*disk*} {*amount*}
1511

    
1512
Grows an instance's disk. This is only possible for instances having a
1513
plain, drbd, file, sharedfile, rbd or ext disk template. For the ext
1514
template to work, the ExtStorage provider should also support growing.
1515
This means having a ``grow`` script that actually grows the volume of
1516
the external shared storage.
1517

    
1518
Note that this command only change the block device size; it will not
1519
grow the actual filesystems, partitions, etc. that live on that
1520
disk. Usually, you will need to:
1521

    
1522
#. use **gnt-instance grow-disk**
1523

    
1524
#. reboot the instance (later, at a convenient time)
1525

    
1526
#. use a filesystem resizer, such as **ext2online**\(8) or
1527
   **xfs\_growfs**\(8) to resize the filesystem, or use **fdisk**\(8) to
1528
   change the partition table on the disk
1529

    
1530
The *disk* argument is the index of the instance disk to grow. The
1531
*amount* argument is given as a number which can have a suffix (like the
1532
disk size in instance create); if the suffix is missing, the value will
1533
be interpreted as mebibytes.
1534

    
1535
By default, the *amount* value represents the desired increase in the
1536
disk size (e.g. an amount of 1G will take a disk of size 3G to 4G). If
1537
the optional ``--absolute`` parameter is passed, then the *amount*
1538
argument doesn't represent the delta, but instead the desired final disk
1539
size (e.g. an amount of 8G will take a disk of size 4G to 8G).
1540

    
1541
For instances with a drbd template, note that the disk grow operation
1542
might complete on one node but fail on the other; this will leave the
1543
instance with different-sized LVs on the two nodes, but this will not
1544
create problems (except for unused space).
1545

    
1546
If you do not want gnt-instance to wait for the new disk region to be
1547
synced, use the ``--no-wait-for-sync`` option.
1548

    
1549
See **ganeti**\(7) for a description of ``--submit`` and other common
1550
options.
1551

    
1552
Example (increase the first disk for instance1 by 16GiB)::
1553

    
1554
    # gnt-instance grow-disk instance1.example.com 0 16g
1555

    
1556
Example for increasing the disk size to a certain size::
1557

    
1558
   # gnt-instance grow-disk --absolute instance1.example.com 0 32g
1559

    
1560
Also note that disk shrinking is not supported; use **gnt-backup
1561
export** and then **gnt-backup import** to reduce the disk size of an
1562
instance.
1563

    
1564
RECREATE-DISKS
1565
^^^^^^^^^^^^^^
1566

    
1567
| **recreate-disks** [\--submit]
1568
| [{-n node1:[node2] \| {-I\|\--iallocator *name*}}]
1569
| [\--disk=*N*[:[size=*VAL*][,mode=*ro\|rw*]]] {*instance*}
1570

    
1571
Recreates all or a subset of disks of the given instance.
1572

    
1573
Note that this functionality should only be used for missing disks; if
1574
any of the given disks already exists, the operation will fail.  While
1575
this is suboptimal, recreate-disks should hopefully not be needed in
1576
normal operation and as such the impact of this is low.
1577

    
1578
If only a subset should be recreated, any number of ``disk`` options can
1579
be specified. It expects a disk index and an optional list of disk
1580
parameters to change. Only ``size`` and ``mode`` can be changed while
1581
recreating disks. To recreate all disks while changing parameters on
1582
a subset only, a ``--disk`` option must be given for every disk of the
1583
instance.
1584

    
1585
Optionally the instance's disks can be recreated on different
1586
nodes. This can be useful if, for example, the original nodes of the
1587
instance have gone down (and are marked offline), so we can't recreate
1588
on the same nodes. To do this, pass the new node(s) via ``-n`` option,
1589
with a syntax similar to the **add** command. The number of nodes
1590
passed must equal the number of nodes that the instance currently
1591
has. Note that changing nodes is only allowed when all disks are
1592
replaced, e.g. when no ``--disk`` option is passed.
1593

    
1594
Another method of choosing which nodes to place the instance on is by
1595
using the specified iallocator, passing the ``--iallocator`` option.
1596
The primary and secondary nodes will be chosen by the specified
1597
iallocator plugin, or by the default allocator if ``.`` is specified.
1598

    
1599
See **ganeti**\(7) for a description of ``--submit`` and other common
1600
options.
1601

    
1602
Recovery/moving
1603
~~~~~~~~~~~~~~~
1604

    
1605
FAILOVER
1606
^^^^^^^^
1607

    
1608
| **failover** [-f] [\--ignore-consistency] [\--ignore-ipolicy]
1609
| [\--shutdown-timeout=*N*]
1610
| [{-n|\--target-node} *node* \| {-I|\--iallocator} *name*]
1611
| [\--submit]
1612
| {*instance*}
1613

    
1614
Failover will stop the instance (if running), change its primary node,
1615
and if it was originally running it will start it again (on the new
1616
primary). This works for instances with drbd template (in which case you
1617
can only fail to the secondary node) and for externally mirrored
1618
templates (sharedfile, blockdev, rbd and ext) (in which case you can
1619
fail to any other node).
1620

    
1621
If the instance's disk template is of type sharedfile, blockdev, rbd or
1622
ext, then you can explicitly specify the target node (which can be any
1623
node) using the ``-n`` or ``--target-node`` option, or specify an
1624
iallocator plugin using the ``-I`` or ``--iallocator`` option. If you
1625
omit both, the default iallocator will be used to specify the target
1626
node.
1627

    
1628
If the instance's disk template is of type drbd, the target node is
1629
automatically selected as the drbd's secondary node. Changing the
1630
secondary node is possible with a replace-disks operation.
1631

    
1632
Normally the failover will check the consistency of the disks before
1633
failing over the instance. If you are trying to migrate instances off
1634
a dead node, this will fail. Use the ``--ignore-consistency`` option
1635
for this purpose. Note that this option can be dangerous as errors in
1636
shutting down the instance will be ignored, resulting in possibly
1637
having the instance running on two machines in parallel (on
1638
disconnected DRBD drives).
1639

    
1640
The ``--shutdown-timeout`` is used to specify how much time to wait
1641
before forcing the shutdown (xm destroy in xen, killing the kvm
1642
process, for kvm). By default two minutes are given to each instance
1643
to stop.
1644

    
1645
If ``--ignore-ipolicy`` is given any instance policy violations occuring
1646
during this operation are ignored.
1647

    
1648
See **ganeti**\(7) for a description of ``--submit`` and other common
1649
options.
1650

    
1651
Example::
1652

    
1653
    # gnt-instance failover instance1.example.com
1654

    
1655
For externally mirrored templates also ``-n`` is available::
1656

    
1657
    # gnt-instance failover -n node3.example.com instance1.example.com
1658

    
1659

    
1660
MIGRATE
1661
^^^^^^^
1662

    
1663
| **migrate** [-f] [\--allow-failover] [\--non-live]
1664
| [\--migration-mode=live\|non-live] [\--ignore-ipolicy]
1665
| [\--no-runtime-changes] [\--submit]
1666
| [{-n|\--target-node} *node* \| {-I|\--iallocator} *name*] {*instance*}
1667

    
1668
| **migrate** [-f] \--cleanup [\--submit] {*instance*}
1669

    
1670
Migrate will move the instance to its secondary node without shutdown.
1671
As with failover, it works for instances having the drbd disk template
1672
or an externally mirrored disk template type such as sharedfile,
1673
blockdev, rbd or ext.
1674

    
1675
If the instance's disk template is of type sharedfile, blockdev, rbd or
1676
ext, then you can explicitly specify the target node (which can be any
1677
node) using the ``-n`` or ``--target-node`` option, or specify an
1678
iallocator plugin using the ``-I`` or ``--iallocator`` option. If you
1679
omit both, the default iallocator will be used to specify the target
1680
node.  Alternatively, the default iallocator can be requested by
1681
specifying ``.`` as the name of the plugin.
1682

    
1683
If the instance's disk template is of type drbd, the target node is
1684
automatically selected as the drbd's secondary node. Changing the
1685
secondary node is possible with a replace-disks operation.
1686

    
1687
The migration command needs a perfectly healthy instance for drbd
1688
instances, as we rely on the dual-master capability of drbd8 and the
1689
disks of the instance are not allowed to be degraded.
1690

    
1691
The ``--non-live`` and ``--migration-mode=non-live`` options will
1692
switch (for the hypervisors that support it) between a "fully live"
1693
(i.e. the interruption is as minimal as possible) migration and one in
1694
which the instance is frozen, its state saved and transported to the
1695
remote node, and then resumed there. This all depends on the
1696
hypervisor support for two different methods. In any case, it is not
1697
an error to pass this parameter (it will just be ignored if the
1698
hypervisor doesn't support it). The option ``--migration-mode=live``
1699
option will request a fully-live migration. The default, when neither
1700
option is passed, depends on the hypervisor parameters (and can be
1701
viewed with the **gnt-cluster info** command).
1702

    
1703
If the ``--cleanup`` option is passed, the operation changes from
1704
migration to attempting recovery from a failed previous migration. In
1705
this mode, Ganeti checks if the instance runs on the correct node (and
1706
updates its configuration if not) and ensures the instances' disks
1707
are configured correctly. In this mode, the ``--non-live`` option is
1708
ignored.
1709

    
1710
The option ``-f`` will skip the prompting for confirmation.
1711

    
1712
If ``--allow-failover`` is specified it tries to fallback to failover if
1713
it already can determine that a migration won't work (e.g. if the
1714
instance is shut down). Please note that the fallback will not happen
1715
during execution. If a migration fails during execution it still fails.
1716

    
1717
If ``--ignore-ipolicy`` is given any instance policy violations occuring
1718
during this operation are ignored.
1719

    
1720
The ``--no-runtime-changes`` option forbids migrate to alter an
1721
instance's runtime before migrating it (eg. ballooning an instance
1722
down because the target node doesn't have enough available memory).
1723

    
1724
If an instance has the backend parameter ``always_failover`` set to
1725
true, then the migration is automatically converted into a failover.
1726

    
1727
See **ganeti**\(7) for a description of ``--submit`` and other common
1728
options.
1729

    
1730
Example (and expected output)::
1731

    
1732
    # gnt-instance migrate instance1
1733
    Instance instance1 will be migrated. Note that migration
1734
    might impact the instance if anything goes wrong (e.g. due to bugs in
1735
    the hypervisor). Continue?
1736
    y/[n]/?: y
1737
    Migrating instance instance1.example.com
1738
    * checking disk consistency between source and target
1739
    * switching node node2.example.com to secondary mode
1740
    * changing into standalone mode
1741
    * changing disks into dual-master mode
1742
    * wait until resync is done
1743
    * preparing node2.example.com to accept the instance
1744
    * migrating instance to node2.example.com
1745
    * switching node node1.example.com to secondary mode
1746
    * wait until resync is done
1747
    * changing into standalone mode
1748
    * changing disks into single-master mode
1749
    * wait until resync is done
1750
    * done
1751
    #
1752

    
1753

    
1754
MOVE
1755
^^^^
1756

    
1757
| **move** [-f] [\--ignore-consistency]
1758
| [-n *node*] [\--shutdown-timeout=*N*] [\--submit] [\--ignore-ipolicy]
1759
| {*instance*}
1760

    
1761
Move will move the instance to an arbitrary node in the cluster. This
1762
works only for instances having a plain or file disk template.
1763

    
1764
Note that since this operation is done via data copy, it will take a
1765
long time for big disks (similar to replace-disks for a drbd
1766
instance).
1767

    
1768
The ``--shutdown-timeout`` is used to specify how much time to wait
1769
before forcing the shutdown (e.g. ``xm destroy`` in XEN, killing the
1770
kvm process for KVM, etc.). By default two minutes are given to each
1771
instance to stop.
1772

    
1773
The ``--ignore-consistency`` option will make Ganeti ignore any errors
1774
in trying to shutdown the instance on its node; useful if the
1775
hypervisor is broken and you want to recover the data.
1776

    
1777
If ``--ignore-ipolicy`` is given any instance policy violations occuring
1778
during this operation are ignored.
1779

    
1780
See **ganeti**\(7) for a description of ``--submit`` and other common
1781
options.
1782

    
1783
Example::
1784

    
1785
    # gnt-instance move -n node3.example.com instance1.example.com
1786

    
1787

    
1788
CHANGE-GROUP
1789
^^^^^^^^^^^^
1790

    
1791
| **change-group** [\--submit]
1792
| [\--iallocator *NAME*] [\--to *GROUP*...] {*instance*}
1793

    
1794
This command moves an instance to another node group. The move is
1795
calculated by an iallocator, either given on the command line or as a
1796
cluster default.
1797

    
1798
If no specific destination groups are specified using ``--to``, all
1799
groups except the one containing the instance are considered.
1800

    
1801
See **ganeti**\(7) for a description of ``--submit`` and other common
1802
options.
1803

    
1804
Example::
1805

    
1806
    # gnt-instance change-group -I hail --to rack2 inst1.example.com
1807

    
1808

    
1809
Tags
1810
~~~~
1811

    
1812
ADD-TAGS
1813
^^^^^^^^
1814

    
1815
**add-tags** [\--from *file*] {*instancename*} {*tag*...}
1816

    
1817
Add tags to the given instance. If any of the tags contains invalid
1818
characters, the entire operation will abort.
1819

    
1820
If the ``--from`` option is given, the list of tags will be extended
1821
with the contents of that file (each line becomes a tag).  In this
1822
case, there is not need to pass tags on the command line (if you do,
1823
both sources will be used). A file name of ``-`` will be interpreted
1824
as stdin.
1825

    
1826
LIST-TAGS
1827
^^^^^^^^^
1828

    
1829
**list-tags** {*instancename*}
1830

    
1831
List the tags of the given instance.
1832

    
1833
REMOVE-TAGS
1834
^^^^^^^^^^^
1835

    
1836
**remove-tags** [\--from *file*] {*instancename*} {*tag*...}
1837

    
1838
Remove tags from the given instance. If any of the tags are not
1839
existing on the node, the entire operation will abort.
1840

    
1841
If the ``--from`` option is given, the list of tags to be removed will
1842
be extended with the contents of that file (each line becomes a tag).
1843
In this case, there is not need to pass tags on the command line (if
1844
you do, tags from both sources will be removed). A file name of ``-``
1845
will be interpreted as stdin.
1846

    
1847
.. vim: set textwidth=72 :
1848
.. Local Variables:
1849
.. mode: rst
1850
.. fill-column: 72
1851
.. End: