Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.rst @ c9c67b50

History | View | Annotate | Download (71.1 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*[,spindles=*VAL*] \| adopt=*LV*}[,options...]
32
|  \| {size=*VAL*,provider=*PROVIDER*}[,param=*value*... ][,options...]
33
|  \| {-s|\--os-size} *SIZE*}
34
| [\--no-ip-check] [\--no-name-check] [\--no-conflicts-check]
35
| [\--no-start] [\--no-install]
36
| [\--net=*N* [:options...] \| \--no-nics]
37
| [{-B|\--backend-parameters} *BEPARAMS*]
38
| [{-H|\--hypervisor-parameters} *HYPERVISOR* [: option=*value*... ]]
39
| [{-O|\--os-parameters} *param*=*value*... ]
40
| [\--file-storage-dir *dir\_path*] [\--file-driver {loop \| blktap \| blktap2}]
41
| {{-n|\--node} *node[:secondary-node]* \| {-I|\--iallocator} *name*}
42
| {{-o|\--os-type} *os-type*}
43
| [\--submit] [\--print-job-id]
44
| [\--ignore-ipolicy]
45
| [\--no-wait-for-sync]
46
| {*instance*}
47

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

    
52
The ``disk`` option specifies the parameters for the disks of the
53
instance. The numbering of disks starts at zero, and at least one disk
54
needs to be passed. For each disk, either the size or the adoption
55
source needs to be given. The size is interpreted (when no unit is
56
given) in mebibytes. You can also use one of the suffixes *m*, *g* or
57
*t* to specify the exact the units used; these suffixes map to
58
mebibytes, gibibytes and tebibytes. Each disk can also take these
59
parameters (all optional):
60

    
61
spindles
62
  How many spindles (physical disks on the node) the disk should span.
63

    
64
mode
65
  The access mode. Either ``ro`` (read-only) or the default ``rw``
66
  (read-write).
67

    
68
name
69
   This option specifies a name for the disk, which can be used as a disk
70
   identifier. An instance can not have two disks with the same name.
71

    
72
vg
73
   The LVM volume group. This works only for LVM and DRBD devices.
74

    
75
metavg
76
   This options specifies a different VG for the metadata device. This
77
   works only for DRBD devices
78

    
79
When creating ExtStorage disks, also arbitrary parameters can be passed,
80
to the ExtStorage provider. Those parameters are passed as additional
81
comma separated options. Therefore, an ExtStorage disk provided by
82
provider ``pvdr1`` with parameters ``param1``, ``param2`` would be
83
passed as ``--disk 0:size=10G,provider=pvdr1,param1=val1,param2=val2``.
84

    
85
When using the ``adopt`` key in the disk definition, Ganeti will
86
reuse those volumes (instead of creating new ones) as the
87
instance's disks. Ganeti will rename these volumes to the standard
88
format, and (without installing the OS) will use them as-is for the
89
instance. This allows migrating instances from non-managed mode
90
(e.g. plain KVM with LVM) to being managed via Ganeti. Please note that
91
this works only for the \`plain' disk template (see below for
92
template details).
93

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

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

    
103
The minimum information needed to specify an ExtStorage disk are the
104
``size`` and the ``provider``. For example:
105
``--disk 0:size=20G,provider=pvdr1``.
106

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

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

    
116
If you don't want the instance to automatically start after
117
creation, this is possible via the ``--no-start`` option. This will
118
leave the instance down until a subsequent **gnt-instance start**
119
command.
120

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

    
126
mac
127
    either a value or 'generate' to generate a new unique MAC
128

    
129
ip
130
    specifies the IP address assigned to the instance from the Ganeti
131
    side (this is not necessarily what the instance will use, but what
132
    the node expects the instance to use). Note that if an IP in the
133
    range of a network configured with **gnt-network**\(8) is used,
134
    and the NIC is not already connected to it, this network has to be
135
    passed in the **network** parameter if this NIC is meant to be
136
    connected to the said network. ``--no-conflicts-check`` can be used
137
    to override this check. The special value **pool** causes Ganeti to
138
    select an IP from the the network the NIC is or will be connected to.
139

    
140
mode
141
    specifies the connection mode for this NIC: routed, bridged or
142
    openvswitch.
143

    
144
link
145
    in bridged or openvswitch mode specifies the interface to attach
146
    this NIC to, in routed mode it's intended to differentiate between
147
    different routing tables/instance groups (but the meaning is
148
    dependent on the network script, see **gnt-cluster**\(8) for more
149
    details). Note that openvswitch support is also hypervisor
150
    dependent.
151

    
152
network
153
    derives the mode and the link from the settings of the network
154
    which is identified by its name. If the network option is chosen,
155
    link and mode must not be specified. Note that the mode and link
156
    depend on the network-to-nodegroup connection, thus allowing
157
    different nodegroups to be connected to the same network in
158
    different ways.
159

    
160
name
161
   this option specifies a name for the NIC, which can be used as a NIC
162
   identifier. An instance can not have two NICs with the same name.
163

    
164

    
165
Of these "mode" and "link" are NIC parameters, and inherit their
166
default at cluster level.  Alternatively, if no network is desired for
167
the instance, you can prevent the default of one NIC with the
168
``--no-nics`` option.
169

    
170
The ``-o (--os-type)`` option specifies the operating system to be
171
installed.  The available operating systems can be listed with
172
**gnt-os list**.  Passing ``--no-install`` will however skip the OS
173
installation, allowing a manual import if so desired. Note that the
174
no-installation mode will automatically disable the start-up of the
175
instance (without an OS, it most likely won't be able to start-up
176
successfully).
177

    
178
The ``-B (--backend-parameters)`` option specifies the backend
179
parameters for the instance. If no such parameters are specified, the
180
values are inherited from the cluster. Possible parameters are:
181

    
182
maxmem
183
    the maximum memory size of the instance; as usual, suffixes can be
184
    used to denote the unit, otherwise the value is taken in mebibytes
185

    
186
minmem
187
    the minimum memory size of the instance; as usual, suffixes can be
188
    used to denote the unit, otherwise the value is taken in mebibytes
189

    
190
vcpus
191
    the number of VCPUs to assign to the instance (if this value makes
192
    sense for the hypervisor)
193

    
194
auto\_balance
195
    whether the instance is considered in the N+1 cluster checks
196
    (enough redundancy in the cluster to survive a node failure)
197

    
198
always\_failover
199
    ``True`` or ``False``, whether the instance must be failed over
200
    (shut down and rebooted) always or it may be migrated (briefly
201
    suspended)
202

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

    
209
The ``-H (--hypervisor-parameters)`` option specified the hypervisor
210
to use for the instance (must be one of the enabled hypervisors on the
211
cluster) and optionally custom parameters for this instance. If not
212
other options are used (i.e. the invocation is just -H *NAME*) the
213
instance will inherit the cluster options. The defaults below show the
214
cluster defaults at cluster creation time.
215

    
216
The possible hypervisor options are as follows:
217

    
218
boot\_order
219
    Valid for the Xen HVM and KVM hypervisors.
220

    
221
    A string value denoting the boot order. This has different meaning
222
    for the Xen HVM hypervisor and for the KVM one.
223

    
224
    For Xen HVM, The boot order is a string of letters listing the boot
225
    devices, with valid device letters being:
226

    
227
    a
228
        floppy drive
229

    
230
    c
231
        hard disk
232

    
233
    d
234
        CDROM drive
235

    
236
    n
237
        network boot (PXE)
238

    
239
    The default is not to set an HVM boot order, which is interpreted
240
    as 'dc'.
241

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

    
249
blockdev\_prefix
250
    Valid for the Xen HVM and PVM hypervisors.
251

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

    
256
floppy\_image\_path
257
    Valid for the KVM hypervisor.
258

    
259
    The path to a floppy disk image to attach to the instance.  This
260
    is useful to install Windows operating systems on Virt/IO disks
261
    because you can specify here the floppy for the drivers at
262
    installation time.
263

    
264
cdrom\_image\_path
265
    Valid for the Xen HVM and KVM hypervisors.
266

    
267
    The path to a CDROM image to attach to the instance.
268

    
269
cdrom2\_image\_path
270
    Valid for the KVM hypervisor.
271

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

    
276
nic\_type
277
    Valid for the Xen HVM and KVM hypervisors.
278

    
279
    This parameter determines the way the network cards are presented
280
    to the instance. The possible options are:
281

    
282
    - rtl8139 (default for Xen HVM) (HVM & KVM)
283
    - ne2k\_isa (HVM & KVM)
284
    - ne2k\_pci (HVM & KVM)
285
    - i82551 (KVM)
286
    - i82557b (KVM)
287
    - i82559er (KVM)
288
    - pcnet (KVM)
289
    - e1000 (KVM)
290
    - paravirtual (default for KVM) (HVM & KVM)
291

    
292
vif\_type
293
    Valid for the Xen HVM hypervisor.
294

    
295
    This parameter specifies the vif type of the nic configuration
296
    of the instance. Unsetting the value leads to no type being specified
297
    in the configuration. Note that this parameter only takes effect when
298
    the 'nic_type' is not set. The possible options are:
299

    
300
    - ioemu
301
    - vif
302

    
303
disk\_type
304
    Valid for the Xen HVM and KVM hypervisors.
305

    
306
    This parameter determines the way the disks are presented to the
307
    instance. The possible options are:
308

    
309
    - ioemu [default] (HVM & KVM)
310
    - paravirtual (HVM & KVM)
311
    - ide (KVM)
312
    - scsi (KVM)
313
    - sd (KVM)
314
    - mtd (KVM)
315
    - pflash (KVM)
316

    
317

    
318
cdrom\_disk\_type
319
    Valid for the KVM hypervisor.
320

    
321
    This parameter determines the way the cdroms disks are presented
322
    to the instance. The default behavior is to get the same value of
323
    the earlier parameter (disk_type). The possible options are:
324

    
325
    - paravirtual
326
    - ide
327
    - scsi
328
    - sd
329
    - mtd
330
    - pflash
331

    
332

    
333
vnc\_bind\_address
334
    Valid for the Xen HVM and KVM hypervisors.
335

    
336
    Specifies the address that the VNC listener for this instance
337
    should bind to. Valid values are IPv4 addresses. Use the address
338
    0.0.0.0 to bind to all available interfaces (this is the default)
339
    or specify the address of one of the interfaces on the node to
340
    restrict listening to that interface.
341

    
342
vnc\_password\_file
343
    Valid for the Xen HVM and KVM hypervisors.
344

    
345
    Specifies the location of the file containing the password for
346
    connections using VNC. The default is a file named
347
    vnc-cluster-password which can be found in the configuration
348
    directory.
349

    
350
vnc\_tls
351
    Valid for the KVM hypervisor.
352

    
353
    A boolean option that controls whether the VNC connection is
354
    secured with TLS.
355

    
356
vnc\_x509\_path
357
    Valid for the KVM hypervisor.
358

    
359
    If ``vnc_tls`` is enabled, this options specifies the path to the
360
    x509 certificate to use.
361

    
362
vnc\_x509\_verify
363
    Valid for the KVM hypervisor.
364

    
365
spice\_bind
366
    Valid for the KVM hypervisor.
367

    
368
    Specifies the address or interface on which the SPICE server will
369
    listen. Valid values are:
370

    
371
    - IPv4 addresses, including 0.0.0.0 and 127.0.0.1
372
    - IPv6 addresses, including :: and ::1
373
    - names of network interfaces
374

    
375
    If a network interface is specified, the SPICE server will be bound
376
    to one of the addresses of that interface.
377

    
378
spice\_ip\_version
379
    Valid for the KVM hypervisor.
380

    
381
    Specifies which version of the IP protocol should be used by the
382
    SPICE server.
383

    
384
    It is mainly intended to be used for specifying what kind of IP
385
    addresses should be used if a network interface with both IPv4 and
386
    IPv6 addresses is specified via the ``spice_bind`` parameter. In
387
    this case, if the ``spice_ip_version`` parameter is not used, the
388
    default IP version of the cluster will be used.
389

    
390
spice\_password\_file
391
    Valid for the KVM hypervisor.
392

    
393
    Specifies a file containing the password that must be used when
394
    connecting via the SPICE protocol. If the option is not specified,
395
    passwordless connections are allowed.
396

    
397
spice\_image\_compression
398
    Valid for the KVM hypervisor.
399

    
400
    Configures the SPICE lossless image compression. Valid values are:
401

    
402
    - auto_glz
403
    - auto_lz
404
    - quic
405
    - glz
406
    - lz
407
    - off
408

    
409
spice\_jpeg\_wan\_compression
410
    Valid for the KVM hypervisor.
411

    
412
    Configures how SPICE should use the jpeg algorithm for lossy image
413
    compression on slow links. Valid values are:
414

    
415
    - auto
416
    - never
417
    - always
418

    
419
spice\_zlib\_glz\_wan\_compression
420
    Valid for the KVM hypervisor.
421

    
422
    Configures how SPICE should use the zlib-glz algorithm for lossy image
423
    compression on slow links. Valid values are:
424

    
425
    - auto
426
    - never
427
    - always
428

    
429
spice\_streaming\_video
430
    Valid for the KVM hypervisor.
431

    
432
    Configures how SPICE should detect video streams. Valid values are:
433

    
434
    - off
435
    - all
436
    - filter
437

    
438
spice\_playback\_compression
439
    Valid for the KVM hypervisor.
440

    
441
    Configures whether SPICE should compress audio streams or not.
442

    
443
spice\_use\_tls
444
    Valid for the KVM hypervisor.
445

    
446
    Specifies that the SPICE server must use TLS to encrypt all the
447
    traffic with the client.
448

    
449
spice\_tls\_ciphers
450
    Valid for the KVM hypervisor.
451

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

    
455
spice\_use\_vdagent
456
    Valid for the KVM hypervisor.
457

    
458
    Enables or disables passing mouse events via SPICE vdagent.
459

    
460
cpu\_type
461
    Valid for the KVM hypervisor.
462

    
463
    This parameter determines the emulated cpu for the instance. If this
464
    parameter is empty (which is the default configuration), it will not
465
    be passed to KVM.
466

    
467
    Be aware of setting this parameter to ``"host"`` if you have nodes
468
    with different CPUs from each other. Live migration may stop working
469
    in this situation.
470

    
471
    For more information please refer to the KVM manual.
472

    
473
acpi
474
    Valid for the Xen HVM and KVM hypervisors.
475

    
476
    A boolean option that specifies if the hypervisor should enable
477
    ACPI support for this instance. By default, ACPI is disabled.
478

    
479
pae
480
    Valid for the Xen HVM and KVM hypervisors.
481

    
482
    A boolean option that specifies if the hypervisor should enable
483
    PAE support for this instance. The default is false, disabling PAE
484
    support.
485

    
486
viridian
487
    Valid for the Xen HVM hypervisor.
488

    
489
    A boolean option that specifies if the hypervisor should enable
490
    viridian (Hyper-V) for this instance. The default is false,
491
    disabling viridian support.
492

    
493
use\_localtime
494
    Valid for the Xen HVM and KVM hypervisors.
495

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

    
502
kernel\_path
503
    Valid for the Xen PVM and KVM hypervisors.
504

    
505
    This option specifies the path (on the node) to the kernel to boot
506
    the instance with. Xen PVM instances always require this, while for
507
    KVM if this option is empty, it will cause the machine to load the
508
    kernel from its disks (and the boot will be done accordingly to
509
    ``boot_order``).
510

    
511
kernel\_args
512
    Valid for the Xen PVM and KVM hypervisors.
513

    
514
    This options specifies extra arguments to the kernel that will be
515
    loaded. device. This is always used for Xen PVM, while for KVM it
516
    is only used if the ``kernel_path`` option is also specified.
517

    
518
    The default setting for this value is simply ``"ro"``, which
519
    mounts the root disk (initially) in read-only one. For example,
520
    setting this to single will cause the instance to start in
521
    single-user mode.
522

    
523
initrd\_path
524
    Valid for the Xen PVM and KVM hypervisors.
525

    
526
    This option specifies the path (on the node) to the initrd to boot
527
    the instance with. Xen PVM instances can use this always, while
528
    for KVM if this option is only used if the ``kernel_path`` option
529
    is also specified. You can pass here either an absolute filename
530
    (the path to the initrd) if you want to use an initrd, or use the
531
    format no\_initrd\_path for no initrd.
532

    
533
root\_path
534
    Valid for the Xen PVM and KVM hypervisors.
535

    
536
    This options specifies the name of the root device. This is always
537
    needed for Xen PVM, while for KVM it is only used if the
538
    ``kernel_path`` option is also specified.
539

    
540
    Please note, that if this setting is an empty string and the
541
    hypervisor is Xen it will not be written to the Xen configuration
542
    file
543

    
544
serial\_console
545
    Valid for the KVM hypervisor.
546

    
547
    This boolean option specifies whether to emulate a serial console
548
    for the instance. Note that some versions of KVM have a bug that
549
    will make an instance hang when configured to use the serial console
550
    unless a connection is made to it within about 2 seconds of the
551
    instance's startup. For such case it's recommended to disable this
552
    option, which is enabled by default.
553

    
554
serial\_speed
555
    Valid for the KVM hypervisor.
556

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

    
562
disk\_cache
563
    Valid for the KVM hypervisor.
564

    
565
    The disk cache mode. It can be either default to not pass any
566
    cache option to KVM, or one of the KVM cache modes: none (for
567
    direct I/O), writethrough (to use the host cache but report
568
    completion to the guest only when the host has committed the
569
    changes to disk) or writeback (to use the host cache and report
570
    completion as soon as the data is in the host cache). Note that
571
    there are special considerations for the cache mode depending on
572
    version of KVM used and disk type (always raw file under Ganeti),
573
    please refer to the KVM documentation for more details.
574

    
575
security\_model
576
    Valid for the KVM hypervisor.
577

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

    
582
    Under *user* kvm will drop privileges and become the user
583
    specified by the security\_domain parameter.
584

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

    
589
security\_domain
590
    Valid for the KVM hypervisor.
591

    
592
    Under security model *user* the username to run the instance
593
    under.  It must be a valid username existing on the host.
594

    
595
    Cannot be set under security model *none* or *pool*.
596

    
597
kvm\_flag
598
    Valid for the KVM hypervisor.
599

    
600
    If *enabled* the -enable-kvm flag is passed to kvm. If *disabled*
601
    -disable-kvm is passed. If unset no flag is passed, and the
602
    default running mode for your kvm binary will be used.
603

    
604
mem\_path
605
    Valid for the KVM hypervisor.
606

    
607
    This option passes the -mem-path argument to kvm with the path (on
608
    the node) to the mount point of the hugetlbfs file system, along
609
    with the -mem-prealloc argument too.
610

    
611
use\_chroot
612
    Valid for the KVM hypervisor.
613

    
614
    This boolean option determines whether to run the KVM instance in a
615
    chroot directory.
616

    
617
    If it is set to ``true``, an empty directory is created before
618
    starting the instance and its path is passed via the -chroot flag
619
    to kvm. The directory is removed when the instance is stopped.
620

    
621
    It is set to ``false`` by default.
622

    
623
migration\_downtime
624
    Valid for the KVM hypervisor.
625

    
626
    The maximum amount of time (in ms) a KVM instance is allowed to be
627
    frozen during a live migration, in order to copy dirty memory
628
    pages. Default value is 30ms, but you may need to increase this
629
    value for busy instances.
630

    
631
    This option is only effective with kvm versions >= 87 and qemu-kvm
632
    versions >= 0.11.0.
633

    
634
cpu\_mask
635
    Valid for the Xen, KVM and LXC hypervisors.
636

    
637
    The processes belonging to the given instance are only scheduled
638
    on the specified CPUs.
639

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

    
644
    Second, a comma-separated list of CPU IDs or CPU ID ranges. The
645
    ranges are defined by a lower and higher boundary, separated by a
646
    dash, and the boundaries are inclusive. In this form, all VCPUs of
647
    the instance will be mapped on the selected list of CPUs. Example:
648
    ``0-2,5``, mapping all VCPUs (no matter how many) onto physical CPUs
649
    0, 1, 2 and 5.
650

    
651
    The last form is used for explicit control of VCPU-CPU pinnings. In
652
    this form, the list of VCPU mappings is given as a colon (:)
653
    separated list, whose elements are the possible values for the
654
    second or first form above. In this form, the number of elements in
655
    the colon-separated list _must_ equal the number of VCPUs of the
656
    instance.
657

    
658
    Example:
659

    
660
    .. code-block:: bash
661

    
662
      # Map the entire instance to CPUs 0-2
663
      gnt-instance modify -H cpu_mask=0-2 my-inst
664

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

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

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

    
675
      # Pin entire VM to CPU 0
676
      gnt-instance modify -H cpu_mask=0 my-inst
677

    
678
      # Turn off CPU pinning (default setting)
679
      gnt-instance modify -H cpu_mask=all my-inst
680

    
681
cpu\_cap
682
    Valid for the Xen hypervisor.
683

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

    
687
cpu\_weight
688
    Valid for the Xen hypervisor.
689

    
690
    Set the cpu time ratio to be allocated to the VM. Valid values are
691
    between 1 and 65535. Default weight is 256.
692

    
693
usb\_mouse
694
    Valid for the KVM hypervisor.
695

    
696
    This option specifies the usb mouse type to be used. It can be
697
    "mouse" or "tablet". When using VNC it's recommended to set it to
698
    "tablet".
699

    
700
keymap
701
    Valid for the KVM hypervisor.
702

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

    
706
reboot\_behavior
707
    Valid for Xen PVM, Xen HVM and KVM hypervisors.
708

    
709
    Normally if an instance reboots, the hypervisor will restart it. If
710
    this option is set to ``exit``, the hypervisor will treat a reboot
711
    as a shutdown instead.
712

    
713
    It is set to ``reboot`` by default.
714

    
715
cpu\_cores
716
    Valid for the KVM hypervisor.
717

    
718
    Number of emulated CPU cores.
719

    
720
cpu\_threads
721
    Valid for the KVM hypervisor.
722

    
723
    Number of emulated CPU threads.
724

    
725
cpu\_sockets
726
    Valid for the KVM hypervisor.
727

    
728
    Number of emulated CPU sockets.
729

    
730
soundhw
731
    Valid for the KVM hypervisor.
732

    
733
    Comma separated list of emulated sounds cards, or "all" to enable
734
    all the available ones.
735

    
736
usb\_devices
737
    Valid for the KVM hypervisor.
738

    
739
    Space separated list of usb devices. These can be emulated devices
740
    or passthrough ones, and each one gets passed to kvm with its own
741
    ``-usbdevice`` option. See the **qemu**\(1) manpage for the syntax
742
    of the possible components. Note that values set with this
743
    parameter are split on a space character and currently don't support
744
    quoting. For backwards compatibility reasons, the RAPI interface keeps
745
    accepting comma separated lists too.
746

    
747
vga
748
    Valid for the KVM hypervisor.
749

    
750
    Emulated vga mode, passed the the kvm -vga option.
751

    
752
kvm\_extra
753
    Valid for the KVM hypervisor.
754

    
755
    Any other option to the KVM hypervisor, useful tweaking anything
756
    that Ganeti doesn't support. Note that values set with this
757
    parameter are split on a space character and currently don't support
758
    quoting.
759

    
760
machine\_version
761
    Valid for the KVM hypervisor.
762

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

    
767
kvm\_path
768
    Valid for the KVM hypervisor.
769

    
770
    Path to the userspace KVM (or qemu) program.
771

    
772
vnet\_hdr
773
    Valid for the KVM hypervisor.
774

    
775
    This boolean option determines whether the tap devices used by the
776
    KVM paravirtual nics (virtio-net) will get created with VNET_HDR
777
    (IFF_VNET_HDR) support.
778

    
779
    If set to false, it effectively disables offloading on the virio-net
780
    interfaces, which prevents host kernel tainting and log flooding,
781
    when dealing with broken or malicious virtio-net drivers.
782

    
783
    It is set to ``true`` by default.
784

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

    
790
    gnt-instance add -O dhcp=yes ...
791

    
792
The ``-I (--iallocator)`` option specifies the instance allocator plugin
793
to use (``.`` means the default allocator). If you pass in this option
794
the allocator will select nodes for this instance automatically, so you
795
don't need to pass them with the ``-n`` option. For more information
796
please refer to the instance allocator documentation.
797

    
798
The ``-t (--disk-template)`` options specifies the disk layout type
799
for the instance. If no disk template is specified, the default disk
800
template is used. The default disk template is the first in the list
801
of enabled disk templates, which can be adjusted cluster-wide with
802
``gnt-cluster modify``. The available choices for disk templates are:
803

    
804
diskless
805
    This creates an instance with no disks. Its useful for testing only
806
    (or other special cases).
807

    
808
file
809
    Disk devices will be regular files.
810

    
811
sharedfile
812
    Disk devices will be regulare files on a shared directory.
813

    
814
plain
815
    Disk devices will be logical volumes.
816

    
817
drbd
818
    Disk devices will be drbd (version 8.x) on top of lvm volumes.
819

    
820
rbd
821
    Disk devices will be rbd volumes residing inside a RADOS cluster.
822

    
823
blockdev
824
    Disk devices will be adopted pre-existent block devices.
825

    
826
ext
827
    Disk devices will be provided by external shared storage,
828
    through the ExtStorage Interface using ExtStorage providers.
829

    
830
The optional second value of the ``-n (--node)`` is used for the drbd
831
template type and specifies the remote node.
832

    
833
If you do not want gnt-instance to wait for the disk mirror to be
834
synced, use the ``--no-wait-for-sync`` option.
835

    
836
The ``--file-storage-dir`` specifies the relative path under the
837
cluster-wide file storage directory to store file-based disks. It is
838
useful for having different subdirectories for different
839
instances. The full path of the directory where the disk files are
840
stored will consist of cluster-wide file storage directory + optional
841
subdirectory + instance name. This option is only relevant for
842
instances using the file storage backend.
843

    
844
The ``--file-driver`` specifies the driver to use for file-based
845
disks. Note that currently these drivers work with the xen hypervisor
846
only. This option is only relevant for instances using the file
847
storage backend. The available choices are:
848

    
849
loop
850
    Kernel loopback driver. This driver uses loopback devices to
851
    access the filesystem within the file. However, running I/O
852
    intensive applications in your instance using the loop driver
853
    might result in slowdowns. Furthermore, if you use the loopback
854
    driver consider increasing the maximum amount of loopback devices
855
    (on most systems it's 8) using the max\_loop param.
856

    
857
blktap
858
    The blktap driver (for Xen hypervisors). In order to be able to
859
    use the blktap driver you should check if the 'blktapctrl' user
860
    space disk agent is running (usually automatically started via
861
    xend).  This user-level disk I/O interface has the advantage of
862
    better performance. Especially if you use a network file system
863
    (e.g. NFS) to store your instances this is the recommended choice.
864

    
865
blktap2
866
    Analogous to the blktap driver, but used by newer versions of Xen.
867

    
868
If ``--ignore-ipolicy`` is given any instance policy violations occuring
869
during this operation are ignored.
870

    
871
See **ganeti**\(7) for a description of ``--submit`` and other common
872
options.
873

    
874
Example::
875

    
876
    # gnt-instance add -t file --disk 0:size=30g -B maxmem=512 -o debian-etch \
877
      -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
878
    # gnt-instance add -t plain --disk 0:size=30g -B maxmem=1024,minmem=512 \
879
      -o debian-etch -n node1.example.com instance1.example.com
880
    # gnt-instance add -t plain --disk 0:size=30g --disk 1:size=100g,vg=san \
881
      -B maxmem=512 -o debian-etch -n node1.example.com instance1.example.com
882
    # gnt-instance add -t drbd --disk 0:size=30g -B maxmem=512 -o debian-etch \
883
      -n node1.example.com:node2.example.com instance2.example.com
884
    # gnt-instance add -t rbd --disk 0:size=30g -B maxmem=512 -o debian-etch \
885
      -n node1.example.com instance1.example.com
886
    # gnt-instance add -t ext --disk 0:size=30g,provider=pvdr1 -B maxmem=512 \
887
      -o debian-etch -n node1.example.com instance1.example.com
888
    # gnt-instance add -t ext --disk 0:size=30g,provider=pvdr1,param1=val1 \
889
      --disk 1:size=40g,provider=pvdr2,param2=val2,param3=val3 -B maxmem=512 \
890
      -o debian-etch -n node1.example.com instance1.example.com
891

    
892

    
893
BATCH-CREATE
894
^^^^^^^^^^^^
895

    
896
| **batch-create**
897
| [{-I|\--iallocator} *instance allocator*]
898
| {instances\_file.json}
899

    
900
This command (similar to the Ganeti 1.2 **batcher** tool) submits
901
multiple instance creation jobs based on a definition file. This
902
file can contain all options which are valid when adding an instance
903
with the exception of the ``iallocator`` field. The IAllocator is,
904
for optimization purposes, only allowed to be set for the whole batch
905
operation using the ``--iallocator`` parameter.
906

    
907
The instance file must be a valid-formed JSON file, containing an
908
array of dictionaries with instance creation parameters. All parameters
909
(except ``iallocator``) which are valid for the instance creation
910
OP code are allowed. The most important ones are:
911

    
912
instance\_name
913
    The FQDN of the new instance.
914

    
915
disk\_template
916
    The disk template to use for the instance, the same as in the
917
    **add** command.
918

    
919
disks
920
    Array of disk specifications. Each entry describes one disk as a
921
    dictionary of disk parameters.
922

    
923
beparams
924
    A dictionary of backend parameters.
925

    
926
hypervisor
927
    The hypervisor for the instance.
928

    
929
hvparams
930
    A dictionary with the hypervisor options. If not passed, the default
931
    hypervisor options will be inherited.
932

    
933
nics
934
    List of NICs that will be created for the instance. Each entry
935
    should be a dict, with mac, ip, mode and link as possible keys.
936
    Please don't provide the "mac, ip, mode, link" parent keys if you
937
    use this method for specifying NICs.
938

    
939
pnode, snode
940
    The primary and optionally the secondary node to use for the
941
    instance (in case an iallocator script is not used). If those
942
    parameters are given, they have to be given consistently for all
943
    instances in the batch operation.
944

    
945
start
946
    whether to start the instance
947

    
948
ip\_check
949
    Skip the check for already-in-use instance; see the description in
950
    the **add** command for details.
951

    
952
name\_check
953
    Skip the name check for instances; see the description in the
954
    **add** command for details.
955

    
956
file\_storage\_dir, file\_driver
957
    Configuration for the file disk type, see the **add** command for
958
    details.
959

    
960

    
961
A simple definition for one instance can be (with most of the
962
parameters taken from the cluster defaults)::
963

    
964
    [
965
      {
966
        "mode": "create",
967
        "instance_name": "instance1.example.com",
968
        "disk_template": "drbd",
969
        "os_type": "debootstrap",
970
        "disks": [{"size":"1024"}],
971
        "nics": [{}],
972
        "hypervisor": "xen-pvm"
973
      },
974
      {
975
        "mode": "create",
976
        "instance_name": "instance2.example.com",
977
        "disk_template": "drbd",
978
        "os_type": "debootstrap",
979
        "disks": [{"size":"4096", "mode": "rw", "vg": "xenvg"}],
980
        "nics": [{}],
981
        "hypervisor": "xen-hvm",
982
        "hvparams": {"acpi": true},
983
        "beparams": {"maxmem": 512, "minmem": 256}
984
      }
985
    ]
986

    
987
The command will display the job id for each submitted instance, as
988
follows::
989

    
990
    # gnt-instance batch-create instances.json
991
    Submitted jobs 37, 38
992

    
993
REMOVE
994
^^^^^^
995

    
996
| **remove** [\--ignore-failures] [\--shutdown-timeout=*N*] [\--submit]
997
| [\--print-job-id] [\--force] {*instance*}
998

    
999
Remove an instance. This will remove all data from the instance and
1000
there is *no way back*. If you are not sure if you use an instance
1001
again, use **shutdown** first and leave it in the shutdown state for a
1002
while.
1003

    
1004
The ``--ignore-failures`` option will cause the removal to proceed
1005
even in the presence of errors during the removal of the instance
1006
(e.g. during the shutdown or the disk removal). If this option is not
1007
given, the command will stop at the first error.
1008

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

    
1014
The ``--force`` option is used to skip the interactive confirmation.
1015

    
1016
See **ganeti**\(7) for a description of ``--submit`` and other common
1017
options.
1018

    
1019
Example::
1020

    
1021
    # gnt-instance remove instance1.example.com
1022

    
1023

    
1024
LIST
1025
^^^^
1026

    
1027
| **list**
1028
| [\--no-headers] [\--separator=*SEPARATOR*] [\--units=*UNITS*] [-v]
1029
| [{-o|\--output} *[+]FIELD,...*] [\--filter] [instance...]
1030

    
1031
Shows the currently configured instances with memory usage, disk
1032
usage, the node they are running on, and their run status.
1033

    
1034
The ``--no-headers`` option will skip the initial header line. The
1035
``--separator`` option takes an argument which denotes what will be
1036
used between the output fields. Both these options are to help
1037
scripting.
1038

    
1039
The units used to display the numeric values in the output varies,
1040
depending on the options given. By default, the values will be
1041
formatted in the most appropriate unit. If the ``--separator`` option
1042
is given, then the values are shown in mebibytes to allow parsing by
1043
scripts. In both cases, the ``--units`` option can be used to enforce
1044
a given output unit.
1045

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

    
1049
The ``-o (--output)`` option takes a comma-separated list of output
1050
fields. The available fields and their meaning are:
1051

    
1052
@QUERY_FIELDS_INSTANCE@
1053

    
1054
If the value of the option starts with the character ``+``, the new
1055
field(s) will be added to the default list. This allows one to quickly
1056
see the default list plus a few other fields, instead of retyping the
1057
entire list of fields.
1058

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

    
1068
If exactly one argument is given and it appears to be a query filter
1069
(see **ganeti**\(7)), the query result is filtered accordingly. For
1070
ambiguous cases (e.g. a single field name as a filter) the ``--filter``
1071
(``-F``) option forces the argument to be treated as a filter (e.g.
1072
``gnt-instance list -F admin_state``).
1073

    
1074
The default output field list is: ``name``, ``os``, ``pnode``,
1075
``admin_state``, ``oper_state``, ``oper_ram``.
1076

    
1077

    
1078
LIST-FIELDS
1079
^^^^^^^^^^^
1080

    
1081
**list-fields** [field...]
1082

    
1083
Lists available fields for instances.
1084

    
1085

    
1086
INFO
1087
^^^^
1088

    
1089
**info** [-s \| \--static] [\--roman] {\--all \| *instance*}
1090

    
1091
Show detailed information about the given instance(s). This is
1092
different from **list** as it shows detailed data about the instance's
1093
disks (especially useful for the drbd disk template).
1094

    
1095
If the option ``-s`` is used, only information available in the
1096
configuration file is returned, without querying nodes, making the
1097
operation faster.
1098

    
1099
Use the ``--all`` to get info about all instances, rather than
1100
explicitly passing the ones you're interested in.
1101

    
1102
The ``--roman`` option can be used to cause envy among people who like
1103
ancient cultures, but are stuck with non-latin-friendly cluster
1104
virtualization technologies.
1105

    
1106
MODIFY
1107
^^^^^^
1108

    
1109
| **modify**
1110
| [{-H|\--hypervisor-parameters} *HYPERVISOR\_PARAMETERS*]
1111
| [{-B|\--backend-parameters} *BACKEND\_PARAMETERS*]
1112
| [{-m|\--runtime-memory} *SIZE*]
1113
| [\--net add[:options...] \|
1114
|  \--net [*N*:]add[,options...] \|
1115
|  \--net [*ID*:]remove \|
1116
|  \--net *ID*:modify[,options...]]
1117
| [\--disk add:size=*SIZE*[,options...] \|
1118
|  \--disk *N*:add,size=*SIZE*[,options...] \|
1119
|  \--disk *N*:add,size=*SIZE*,provider=*PROVIDER*[,options...][,param=*value*... ] \|
1120
|  \--disk *ID*:modify[,options...]
1121
|  \--disk [*ID*:]remove]
1122
| [{-t|\--disk-template} plain \| {-t|\--disk-template} drbd -n *new_secondary*] [\--no-wait-for-sync]
1123
| [\--new-primary=*node*]
1124
| [\--os-type=*OS* [\--force-variant]]
1125
| [{-O|\--os-parameters} *param*=*value*... ]
1126
| [\--offline \| \--online]
1127
| [\--submit] [\--print-job-id]
1128
| [\--ignore-ipolicy]
1129
| {*instance*}
1130

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

    
1136
The ``-H (--hypervisor-parameters)``, ``-B (--backend-parameters)``
1137
and ``-O (--os-parameters)`` options specifies hypervisor, backend and
1138
OS parameter options in the form of name=value[,...]. For details
1139
which options can be specified, see the **add** command.
1140

    
1141
The ``-t (--disk-template)`` option will change the disk template of
1142
the instance.  Currently only conversions between the plain and drbd
1143
disk templates are supported, and the instance must be stopped before
1144
attempting the conversion. When changing from the plain to the drbd
1145
disk template, a new secondary node must be specified via the ``-n``
1146
option. The option ``--no-wait-for-sync`` can be used when converting
1147
to the ``drbd`` template in order to make the instance available for
1148
startup before DRBD has finished resyncing.
1149

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

    
1154
The ``--disk add:size=*SIZE*,[options..]`` option adds a disk to the
1155
instance, and ``--disk *N*:add:size=*SIZE*,[options..]`` will add a disk
1156
to the the instance at a specific index. The available options are the
1157
same as in the **add** command(``spindles``, ``mode``, ``name``, ``vg``,
1158
``metavg``). When adding an ExtStorage disk the ``provider=*PROVIDER*``
1159
option is also mandatory and specifies the ExtStorage provider. Also,
1160
for ExtStorage disks arbitrary parameters can be passed as additional
1161
comma separated options, same as in the **add** command. -The ``--disk
1162
remove`` option will remove the last disk of the instance. Use ``--disk
1163
`` *ID*``:remove`` to remove a disk by its identifier. *ID* can be the
1164
index of the disk, the disks's name or the disks's UUID. The ``--disk
1165
*ID*:modify[,options...]`` will change the options of the disk.
1166
Available options are:
1167

    
1168
mode
1169
  The access mode. Either ``ro`` (read-only) or the default ``rw`` (read-write).
1170

    
1171
name
1172
   This option specifies a name for the disk, which can be used as a disk
1173
   identifier. An instance can not have two disks with the same name.
1174

    
1175
The ``--net *N*:add[,options..]`` will add a new network interface to
1176
the instance. The available options are the same as in the **add**
1177
command (``mac``, ``ip``, ``link``, ``mode``, ``network``). The
1178
``--net *ID*,remove`` will remove the intances' NIC with *ID* identifier,
1179
which can be the index of the NIC, the NIC's name or the NIC's UUID.
1180
The ``--net *ID*:modify[,options..]`` option will change the parameters of
1181
the instance network interface with the *ID* identifier.
1182

    
1183
The option ``-o (--os-type)`` will change the OS name for the instance
1184
(without reinstallation). In case an OS variant is specified that is
1185
not found, then by default the modification is refused, unless
1186
``--force-variant`` is passed. An invalid OS will also be refused,
1187
unless the ``--force`` option is given.
1188

    
1189
The option ``--new-primary`` will set the new primary node of an instance
1190
assuming the disks have already been moved manually. Unless the ``--force``
1191
option is given, it is verified that the instance is no longer running
1192
on its current primary node.
1193

    
1194
The ``--online`` and ``--offline`` options are used to transition an
1195
instance into and out of the ``offline`` state. An instance can be
1196
turned offline only if it was previously down. The ``--online`` option
1197
fails if the instance was not in the ``offline`` state, otherwise it
1198
changes instance's state to ``down``. These modifications take effect
1199
immediately.
1200

    
1201
If ``--ignore-ipolicy`` is given any instance policy violations occuring
1202
during this operation are ignored.
1203

    
1204
See **ganeti**\(7) for a description of ``--submit`` and other common
1205
options.
1206

    
1207
Most of the changes take effect at the next restart. If the instance is
1208
running, there is no effect on the instance.
1209

    
1210
REINSTALL
1211
^^^^^^^^^
1212

    
1213
| **reinstall** [{-o|\--os-type} *os-type*] [\--select-os] [-f *force*]
1214
| [\--force-multiple]
1215
| [\--instance \| \--node \| \--primary \| \--secondary \| \--all]
1216
| [{-O|\--os-parameters} *OS\_PARAMETERS*] [\--submit] [\--print-job-id]
1217
| {*instance*...}
1218

    
1219
Reinstalls the operating system on the given instance(s). The
1220
instance(s) must be stopped when running this command. If the ``-o
1221
(--os-type)`` is specified, the operating system is changed.
1222

    
1223
The ``--select-os`` option switches to an interactive OS reinstall.
1224
The user is prompted to select the OS template from the list of
1225
available OS templates. OS parameters can be overridden using ``-O
1226
(--os-parameters)`` (more documentation for this option under the
1227
**add** command).
1228

    
1229
Since this is a potentially dangerous command, the user will be
1230
required to confirm this action, unless the ``-f`` flag is passed.
1231
When multiple instances are selected (either by passing multiple
1232
arguments or by using the ``--node``, ``--primary``, ``--secondary``
1233
or ``--all`` options), the user must pass the ``--force-multiple``
1234
options to skip the interactive confirmation.
1235

    
1236
See **ganeti**\(7) for a description of ``--submit`` and other common
1237
options.
1238

    
1239
RENAME
1240
^^^^^^
1241

    
1242
| **rename** [\--no-ip-check] [\--no-name-check] [\--submit] [\--print-job-id]
1243
| {*instance*} {*new\_name*}
1244

    
1245
Renames the given instance. The instance must be stopped when running
1246
this command. The requirements for the new name are the same as for
1247
adding an instance: the new name must be resolvable and the IP it
1248
resolves to must not be reachable (in order to prevent duplicate IPs
1249
the next time the instance is started). The IP test can be skipped if
1250
the ``--no-ip-check`` option is passed.
1251

    
1252
Note that you can rename an instance to its same name, to force
1253
re-executing the os-specific rename script for that instance, if
1254
needed.
1255

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

    
1262
See **ganeti**\(7) for a description of ``--submit`` and other common
1263
options.
1264

    
1265
Starting/stopping/connecting to console
1266
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1267

    
1268
STARTUP
1269
^^^^^^^
1270

    
1271
| **startup**
1272
| [\--force] [\--ignore-offline]
1273
| [\--force-multiple] [\--no-remember]
1274
| [\--instance \| \--node \| \--primary \| \--secondary \| \--all \|
1275
| \--tags \| \--node-tags \| \--pri-node-tags \| \--sec-node-tags]
1276
| [{-H|\--hypervisor-parameters} ``key=value...``]
1277
| [{-B|\--backend-parameters} ``key=value...``]
1278
| [\--submit] [\--print-job-id] [\--paused]
1279
| {*name*...}
1280

    
1281
Starts one or more instances, depending on the following options.  The
1282
four available modes are:
1283

    
1284
\--instance
1285
    will start the instances given as arguments (at least one argument
1286
    required); this is the default selection
1287

    
1288
\--node
1289
    will start the instances who have the given node as either primary
1290
    or secondary
1291

    
1292
\--primary
1293
    will start all instances whose primary node is in the list of nodes
1294
    passed as arguments (at least one node required)
1295

    
1296
\--secondary
1297
    will start all instances whose secondary node is in the list of
1298
    nodes passed as arguments (at least one node required)
1299

    
1300
\--all
1301
    will start all instances in the cluster (no arguments accepted)
1302

    
1303
\--tags
1304
    will start all instances in the cluster with the tags given as
1305
    arguments
1306

    
1307
\--node-tags
1308
    will start all instances in the cluster on nodes with the tags
1309
    given as arguments
1310

    
1311
\--pri-node-tags
1312
    will start all instances in the cluster on primary nodes with the
1313
    tags given as arguments
1314

    
1315
\--sec-node-tags
1316
    will start all instances in the cluster on secondary nodes with the
1317
    tags given as arguments
1318

    
1319
Note that although you can pass more than one selection option, the
1320
last one wins, so in order to guarantee the desired result, don't pass
1321
more than one such option.
1322

    
1323
Use ``--force`` to start even if secondary disks are failing.
1324
``--ignore-offline`` can be used to ignore offline primary nodes and
1325
mark the instance as started even if the primary is not available.
1326

    
1327
The ``--force-multiple`` will skip the interactive confirmation in the
1328
case the more than one instance will be affected.
1329

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

    
1336
The ``-H (--hypervisor-parameters)`` and ``-B (--backend-parameters)``
1337
options specify temporary hypervisor and backend parameters that can
1338
be used to start an instance with modified parameters. They can be
1339
useful for quick testing without having to modify an instance back and
1340
forth, e.g.::
1341

    
1342
    # gnt-instance start -H kernel_args="single" instance1
1343
    # gnt-instance start -B maxmem=2048 instance2
1344

    
1345

    
1346
The first form will start the instance instance1 in single-user mode,
1347
and the instance instance2 with 2GB of RAM (this time only, unless
1348
that is the actual instance memory size already). Note that the values
1349
override the instance parameters (and not extend them): an instance
1350
with "kernel\_args=ro" when started with -H kernel\_args=single will
1351
result in "single", not "ro single".
1352

    
1353
The ``--paused`` option is only valid for Xen and kvm hypervisors.  This
1354
pauses the instance at the start of bootup, awaiting ``gnt-instance
1355
console`` to unpause it, allowing the entire boot process to be
1356
monitored for debugging.
1357

    
1358
See **ganeti**\(7) for a description of ``--submit`` and other common
1359
options.
1360

    
1361
Example::
1362

    
1363
    # gnt-instance start instance1.example.com
1364
    # gnt-instance start --node node1.example.com node2.example.com
1365
    # gnt-instance start --all
1366

    
1367

    
1368
SHUTDOWN
1369
^^^^^^^^
1370

    
1371
| **shutdown**
1372
| [\--timeout=*N*]
1373
| [\--force] [\--force-multiple] [\--ignore-offline] [\--no-remember]
1374
| [\--instance \| \--node \| \--primary \| \--secondary \| \--all \|
1375
| \--tags \| \--node-tags \| \--pri-node-tags \| \--sec-node-tags]
1376
| [\--submit] [\--print-job-id]
1377
| {*name*...}
1378

    
1379
Stops one or more instances. If the instance cannot be cleanly stopped
1380
during a hardcoded interval (currently 2 minutes), it will forcibly
1381
stop the instance (equivalent to switching off the power on a physical
1382
machine).
1383

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

    
1389
The ``--instance``, ``--node``, ``--primary``, ``--secondary``,
1390
``--all``, ``--tags``, ``--node-tags``, ``--pri-node-tags`` and
1391
``--sec-node-tags`` options are similar as for the **startup** command
1392
and they influence the actual instances being shutdown.
1393

    
1394
``--ignore-offline`` can be used to ignore offline primary nodes and
1395
force the instance to be marked as stopped. This option should be used
1396
with care as it can lead to an inconsistent cluster state.
1397

    
1398
Use ``--force`` to be able to shutdown an instance even when it's marked
1399
as offline. This is useful is an offline instance ends up in the
1400
``ERROR_up`` state, for example.
1401

    
1402
The ``--no-remember`` option will perform the shutdown but not change
1403
the state of the instance in the configuration file (if it was running
1404
before, Ganeti will still thinks it needs to be running). This can be
1405
useful for a cluster-wide shutdown, where some instances are marked as
1406
up and some as down, and you don't want to change the running state:
1407
you just need to disable the watcher, shutdown all instances with
1408
``--no-remember``, and when the watcher is activated again it will
1409
restore the correct runtime state for all instances.
1410

    
1411
See **ganeti**\(7) for a description of ``--submit`` and other common
1412
options.
1413

    
1414
Example::
1415

    
1416
    # gnt-instance shutdown instance1.example.com
1417
    # gnt-instance shutdown --all
1418

    
1419

    
1420
REBOOT
1421
^^^^^^
1422

    
1423
| **reboot**
1424
| [{-t|\--type} *REBOOT-TYPE*]
1425
| [\--ignore-secondaries]
1426
| [\--shutdown-timeout=*N*]
1427
| [\--force-multiple]
1428
| [\--instance \| \--node \| \--primary \| \--secondary \| \--all \|
1429
| \--tags \| \--node-tags \| \--pri-node-tags \| \--sec-node-tags]
1430
| [\--submit] [\--print-job-id]
1431
| [*name*...]
1432

    
1433
Reboots one or more instances. The type of reboot depends on the value
1434
of ``-t (--type)``. A soft reboot does a hypervisor reboot, a hard reboot
1435
does a instance stop, recreates the hypervisor config for the instance
1436
and starts the instance. A full reboot does the equivalent of
1437
**gnt-instance shutdown && gnt-instance startup**.  The default is
1438
hard reboot.
1439

    
1440
For the hard reboot the option ``--ignore-secondaries`` ignores errors
1441
for the secondary node while re-assembling the instance disks.
1442

    
1443
The ``--instance``, ``--node``, ``--primary``, ``--secondary``,
1444
``--all``, ``--tags``, ``--node-tags``, ``--pri-node-tags`` and
1445
``--sec-node-tags`` options are similar as for the **startup** command
1446
and they influence the actual instances being rebooted.
1447

    
1448
The ``--shutdown-timeout`` is used to specify how much time to wait
1449
before forcing the shutdown (xm destroy in xen, killing the kvm
1450
process, for kvm). By default two minutes are given to each instance
1451
to stop.
1452

    
1453
The ``--force-multiple`` will skip the interactive confirmation in the
1454
case the more than one instance will be affected.
1455

    
1456
See **ganeti**\(7) for a description of ``--submit`` and other common
1457
options.
1458

    
1459
Example::
1460

    
1461
    # gnt-instance reboot instance1.example.com
1462
    # gnt-instance reboot --type=full instance1.example.com
1463

    
1464

    
1465
CONSOLE
1466
^^^^^^^
1467

    
1468
**console** [\--show-cmd] {*instance*}
1469

    
1470
Connects to the console of the given instance. If the instance is not
1471
up, an error is returned. Use the ``--show-cmd`` option to display the
1472
command instead of executing it.
1473

    
1474
For HVM instances, this will attempt to connect to the serial console
1475
of the instance. To connect to the virtualized "physical" console of a
1476
HVM instance, use a VNC client with the connection info from the
1477
**info** command.
1478

    
1479
For Xen/kvm instances, if the instance is paused, this attempts to
1480
unpause the instance after waiting a few seconds for the connection to
1481
the console to be made.
1482

    
1483
Example::
1484

    
1485
    # gnt-instance console instance1.example.com
1486

    
1487

    
1488
Disk management
1489
~~~~~~~~~~~~~~~
1490

    
1491
REPLACE-DISKS
1492
^^^^^^^^^^^^^
1493

    
1494
| **replace-disks** [\--submit] [\--print-job-id] [\--early-release]
1495
| [\--ignore-ipolicy] {-p} [\--disks *idx*] {*instance*}
1496

    
1497
| **replace-disks** [\--submit] [\--print-job-id] [\--early-release]
1498
| [\--ignore-ipolicy] {-s} [\--disks *idx*] {*instance*}
1499

    
1500
| **replace-disks** [\--submit] [\--print-job-id] [\--early-release]
1501
| [\--ignore-ipolicy]
1502
| {{-I\|\--iallocator} *name* \| {{-n|\--new-secondary} *node* } {*instance*}
1503

    
1504
| **replace-disks** [\--submit] [\--print-job-id] [\--early-release]
1505
| [\--ignore-ipolicy] {-a\|\--auto} {*instance*}
1506

    
1507
This command is a generalized form for replacing disks. It is
1508
currently only valid for the mirrored (DRBD) disk template.
1509

    
1510
The first form (when passing the ``-p`` option) will replace the disks
1511
on the primary, while the second form (when passing the ``-s`` option
1512
will replace the disks on the secondary node. For these two cases (as
1513
the node doesn't change), it is possible to only run the replace for a
1514
subset of the disks, using the option ``--disks`` which takes a list
1515
of comma-delimited disk indices (zero-based), e.g. 0,2 to replace only
1516
the first and third disks.
1517

    
1518
The third form (when passing either the ``--iallocator`` or the
1519
``--new-secondary`` option) is designed to change secondary node of the
1520
instance. Specifying ``--iallocator`` makes the new secondary be
1521
selected automatically by the specified allocator plugin (use ``.`` to
1522
indicate the default allocator), otherwise the new secondary node will
1523
be the one chosen manually via the ``--new-secondary`` option.
1524

    
1525
Note that it is not possible to select an offline or drained node as a
1526
new secondary.
1527

    
1528
The fourth form (when using ``--auto``) will automatically determine
1529
which disks of an instance are faulty and replace them within the same
1530
node. The ``--auto`` option works only when an instance has only
1531
faulty disks on either the primary or secondary node; it doesn't work
1532
when both sides have faulty disks.
1533

    
1534
The ``--early-release`` changes the code so that the old storage on
1535
secondary node(s) is removed early (before the resync is completed)
1536
and the internal Ganeti locks for the current (and new, if any)
1537
secondary node are also released, thus allowing more parallelism in
1538
the cluster operation. This should be used only when recovering from a
1539
disk failure on the current secondary (thus the old storage is already
1540
broken) or when the storage on the primary node is known to be fine
1541
(thus we won't need the old storage for potential recovery).
1542

    
1543
The ``--ignore-ipolicy`` let the command ignore instance policy
1544
violations if replace-disks changes groups and the instance would
1545
violate the new groups instance policy.
1546

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

    
1550
ACTIVATE-DISKS
1551
^^^^^^^^^^^^^^
1552

    
1553
| **activate-disks** [\--submit] [\--print-job-id] [\--ignore-size]
1554
| [\--wait-for-sync] {*instance*}
1555

    
1556
Activates the block devices of the given instance. If successful, the
1557
command will show the location and name of the block devices::
1558

    
1559
    node1.example.com:disk/0:/dev/drbd0
1560
    node1.example.com:disk/1:/dev/drbd1
1561

    
1562

    
1563
In this example, *node1.example.com* is the name of the node on which
1564
the devices have been activated. The *disk/0* and *disk/1* are the
1565
Ganeti-names of the instance disks; how they are visible inside the
1566
instance is hypervisor-specific. */dev/drbd0* and */dev/drbd1* are the
1567
actual block devices as visible on the node.
1568

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

    
1576
The ``--wait-for-sync`` option will ensure that the command returns only
1577
after the instance's disks are synchronised (mostly for DRBD); this can
1578
be useful to ensure consistency, as otherwise there are no commands that
1579
can wait until synchronisation is done. However when passing this
1580
option, the command will have additional output, making it harder to
1581
parse the disk information.
1582

    
1583
Note that it is safe to run this command while the instance is already
1584
running.
1585

    
1586
See **ganeti**\(7) for a description of ``--submit`` and other common
1587
options.
1588

    
1589
DEACTIVATE-DISKS
1590
^^^^^^^^^^^^^^^^
1591

    
1592
**deactivate-disks** [-f] [\--submit] [\--print-job-id] {*instance*}
1593

    
1594
De-activates the block devices of the given instance. Note that if you
1595
run this command for an instance with a drbd disk template, while it
1596
is running, it will not be able to shutdown the block devices on the
1597
primary node, but it will shutdown the block devices on the secondary
1598
nodes, thus breaking the replication.
1599

    
1600
The ``-f``/``--force`` option will skip checks that the instance is
1601
down; in case the hypervisor is confused and we can't talk to it,
1602
normally Ganeti will refuse to deactivate the disks, but with this
1603
option passed it will skip this check and directly try to deactivate
1604
the disks. This can still fail due to the instance actually running or
1605
other issues.
1606

    
1607
See **ganeti**\(7) for a description of ``--submit`` and other common
1608
options.
1609

    
1610
GROW-DISK
1611
^^^^^^^^^
1612

    
1613
| **grow-disk** [\--no-wait-for-sync] [\--submit] [\--print-job-id]
1614
| [\--absolute]
1615
| {*instance*} {*disk*} {*amount*}
1616

    
1617
Grows an instance's disk. This is only possible for instances having a
1618
plain, drbd, file, sharedfile, rbd or ext disk template. For the ext
1619
template to work, the ExtStorage provider should also support growing.
1620
This means having a ``grow`` script that actually grows the volume of
1621
the external shared storage.
1622

    
1623
Note that this command only change the block device size; it will not
1624
grow the actual filesystems, partitions, etc. that live on that
1625
disk. Usually, you will need to:
1626

    
1627
#. use **gnt-instance grow-disk**
1628

    
1629
#. reboot the instance (later, at a convenient time)
1630

    
1631
#. use a filesystem resizer, such as **ext2online**\(8) or
1632
   **xfs\_growfs**\(8) to resize the filesystem, or use **fdisk**\(8) to
1633
   change the partition table on the disk
1634

    
1635
The *disk* argument is the index of the instance disk to grow. The
1636
*amount* argument is given as a number which can have a suffix (like the
1637
disk size in instance create); if the suffix is missing, the value will
1638
be interpreted as mebibytes.
1639

    
1640
By default, the *amount* value represents the desired increase in the
1641
disk size (e.g. an amount of 1G will take a disk of size 3G to 4G). If
1642
the optional ``--absolute`` parameter is passed, then the *amount*
1643
argument doesn't represent the delta, but instead the desired final disk
1644
size (e.g. an amount of 8G will take a disk of size 4G to 8G).
1645

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

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

    
1654
See **ganeti**\(7) for a description of ``--submit`` and other common
1655
options.
1656

    
1657
Example (increase the first disk for instance1 by 16GiB)::
1658

    
1659
    # gnt-instance grow-disk instance1.example.com 0 16g
1660

    
1661
Example for increasing the disk size to a certain size::
1662

    
1663
   # gnt-instance grow-disk --absolute instance1.example.com 0 32g
1664

    
1665
Also note that disk shrinking is not supported; use **gnt-backup
1666
export** and then **gnt-backup import** to reduce the disk size of an
1667
instance.
1668

    
1669
RECREATE-DISKS
1670
^^^^^^^^^^^^^^
1671

    
1672
| **recreate-disks** [\--submit] [\--print-job-id]
1673
| [{-n node1:[node2] \| {-I\|\--iallocator *name*}}]
1674
| [\--disk=*N*[:[size=*VAL*][,spindles=*VAL*][,mode=*ro\|rw*]]] {*instance*}
1675

    
1676
Recreates all or a subset of disks of the given instance.
1677

    
1678
Note that this functionality should only be used for missing disks; if
1679
any of the given disks already exists, the operation will fail.  While
1680
this is suboptimal, recreate-disks should hopefully not be needed in
1681
normal operation and as such the impact of this is low.
1682

    
1683
If only a subset should be recreated, any number of ``disk`` options can
1684
be specified. It expects a disk index and an optional list of disk
1685
parameters to change. Only ``size``, ``spindles``, and ``mode`` can be
1686
changed while recreating disks. To recreate all disks while changing
1687
parameters on a subset only, a ``--disk`` option must be given for every
1688
disk of the instance.
1689

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

    
1699
Another method of choosing which nodes to place the instance on is by
1700
using the specified iallocator, passing the ``--iallocator`` option.
1701
The primary and secondary nodes will be chosen by the specified
1702
iallocator plugin, or by the default allocator if ``.`` is specified.
1703

    
1704
See **ganeti**\(7) for a description of ``--submit`` and other common
1705
options.
1706

    
1707
Recovery/moving
1708
~~~~~~~~~~~~~~~
1709

    
1710
FAILOVER
1711
^^^^^^^^
1712

    
1713
| **failover** [-f] [\--ignore-consistency] [\--ignore-ipolicy]
1714
| [\--shutdown-timeout=*N*]
1715
| [{-n|\--target-node} *node* \| {-I|\--iallocator} *name*]
1716
| [\--cleanup]
1717
| [\--submit] [\--print-job-id]
1718
| {*instance*}
1719

    
1720
Failover will stop the instance (if running), change its primary node,
1721
and if it was originally running it will start it again (on the new
1722
primary). This works for instances with drbd template (in which case you
1723
can only fail to the secondary node) and for externally mirrored
1724
templates (sharedfile, blockdev, rbd and ext) (in which case you can
1725
fail to any other node).
1726

    
1727
If the instance's disk template is of type sharedfile, blockdev, rbd or
1728
ext, then you can explicitly specify the target node (which can be any
1729
node) using the ``-n`` or ``--target-node`` option, or specify an
1730
iallocator plugin using the ``-I`` or ``--iallocator`` option. If you
1731
omit both, the default iallocator will be used to specify the target
1732
node.
1733

    
1734
If the instance's disk template is of type drbd, the target node is
1735
automatically selected as the drbd's secondary node. Changing the
1736
secondary node is possible with a replace-disks operation.
1737

    
1738
Normally the failover will check the consistency of the disks before
1739
failing over the instance. If you are trying to migrate instances off
1740
a dead node, this will fail. Use the ``--ignore-consistency`` option
1741
for this purpose. Note that this option can be dangerous as errors in
1742
shutting down the instance will be ignored, resulting in possibly
1743
having the instance running on two machines in parallel (on
1744
disconnected DRBD drives).
1745

    
1746
The ``--shutdown-timeout`` is used to specify how much time to wait
1747
before forcing the shutdown (xm destroy in xen, killing the kvm
1748
process, for kvm). By default two minutes are given to each instance
1749
to stop.
1750

    
1751
If ``--ignore-ipolicy`` is given any instance policy violations occuring
1752
during this operation are ignored.
1753

    
1754
If the ``--cleanup`` option is passed, the operation changes from
1755
performin a failover to attempting recovery from a failed previous failover.
1756
In this mode, Ganeti checks if the instance runs on the correct node (and
1757
updates its configuration if not) and ensures the instances' disks
1758
are configured correctly.
1759

    
1760
See **ganeti**\(7) for a description of ``--submit`` and other common
1761
options.
1762

    
1763
Example::
1764

    
1765
    # gnt-instance failover instance1.example.com
1766

    
1767
For externally mirrored templates also ``-n`` is available::
1768

    
1769
    # gnt-instance failover -n node3.example.com instance1.example.com
1770

    
1771

    
1772
MIGRATE
1773
^^^^^^^
1774

    
1775
| **migrate** [-f] [\--allow-failover] [\--non-live]
1776
| [\--migration-mode=live\|non-live] [\--ignore-ipolicy]
1777
| [\--no-runtime-changes] [\--submit] [\--print-job-id]
1778
| [{-n|\--target-node} *node* \| {-I|\--iallocator} *name*] {*instance*}
1779

    
1780
| **migrate** [-f] \--cleanup [\--submit] [\--print-job-id] {*instance*}
1781

    
1782
Migrate will move the instance to its secondary node without shutdown.
1783
As with failover, it works for instances having the drbd disk template
1784
or an externally mirrored disk template type such as sharedfile,
1785
blockdev, rbd or ext.
1786

    
1787
If the instance's disk template is of type sharedfile, blockdev, rbd or
1788
ext, then you can explicitly specify the target node (which can be any
1789
node) using the ``-n`` or ``--target-node`` option, or specify an
1790
iallocator plugin using the ``-I`` or ``--iallocator`` option. If you
1791
omit both, the default iallocator will be used to specify the target
1792
node.  Alternatively, the default iallocator can be requested by
1793
specifying ``.`` as the name of the plugin.
1794

    
1795
If the instance's disk template is of type drbd, the target node is
1796
automatically selected as the drbd's secondary node. Changing the
1797
secondary node is possible with a replace-disks operation.
1798

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

    
1803
The ``--non-live`` and ``--migration-mode=non-live`` options will
1804
switch (for the hypervisors that support it) between a "fully live"
1805
(i.e. the interruption is as minimal as possible) migration and one in
1806
which the instance is frozen, its state saved and transported to the
1807
remote node, and then resumed there. This all depends on the
1808
hypervisor support for two different methods. In any case, it is not
1809
an error to pass this parameter (it will just be ignored if the
1810
hypervisor doesn't support it). The option ``--migration-mode=live``
1811
option will request a fully-live migration. The default, when neither
1812
option is passed, depends on the hypervisor parameters (and can be
1813
viewed with the **gnt-cluster info** command).
1814

    
1815
If the ``--cleanup`` option is passed, the operation changes from
1816
migration to attempting recovery from a failed previous migration. In
1817
this mode, Ganeti checks if the instance runs on the correct node (and
1818
updates its configuration if not) and ensures the instances' disks
1819
are configured correctly. In this mode, the ``--non-live`` option is
1820
ignored.
1821

    
1822
The option ``-f`` will skip the prompting for confirmation.
1823

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

    
1829
If ``--ignore-ipolicy`` is given any instance policy violations occuring
1830
during this operation are ignored.
1831

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

    
1836
If an instance has the backend parameter ``always_failover`` set to
1837
true, then the migration is automatically converted into a failover.
1838

    
1839
See **ganeti**\(7) for a description of ``--submit`` and other common
1840
options.
1841

    
1842
Example (and expected output)::
1843

    
1844
    # gnt-instance migrate instance1
1845
    Instance instance1 will be migrated. Note that migration
1846
    might impact the instance if anything goes wrong (e.g. due to bugs in
1847
    the hypervisor). Continue?
1848
    y/[n]/?: y
1849
    Migrating instance instance1.example.com
1850
    * checking disk consistency between source and target
1851
    * switching node node2.example.com to secondary mode
1852
    * changing into standalone mode
1853
    * changing disks into dual-master mode
1854
    * wait until resync is done
1855
    * preparing node2.example.com to accept the instance
1856
    * migrating instance to node2.example.com
1857
    * switching node node1.example.com to secondary mode
1858
    * wait until resync is done
1859
    * changing into standalone mode
1860
    * changing disks into single-master mode
1861
    * wait until resync is done
1862
    * done
1863
    #
1864

    
1865

    
1866
MOVE
1867
^^^^
1868

    
1869
| **move** [-f] [\--ignore-consistency]
1870
| [-n *node*] [\--shutdown-timeout=*N*] [\--submit] [\--print-job-id]
1871
| [\--ignore-ipolicy]
1872
| {*instance*}
1873

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

    
1877
Note that since this operation is done via data copy, it will take a
1878
long time for big disks (similar to replace-disks for a drbd
1879
instance).
1880

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

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

    
1890
If ``--ignore-ipolicy`` is given any instance policy violations occuring
1891
during this operation are ignored.
1892

    
1893
See **ganeti**\(7) for a description of ``--submit`` and other common
1894
options.
1895

    
1896
Example::
1897

    
1898
    # gnt-instance move -n node3.example.com instance1.example.com
1899

    
1900

    
1901
CHANGE-GROUP
1902
^^^^^^^^^^^^
1903

    
1904
| **change-group** [\--submit] [\--print-job-id]
1905
| [\--iallocator *NAME*] [\--to *GROUP*...] {*instance*}
1906

    
1907
This command moves an instance to another node group. The move is
1908
calculated by an iallocator, either given on the command line or as a
1909
cluster default.
1910

    
1911
If no specific destination groups are specified using ``--to``, all
1912
groups except the one containing the instance are considered.
1913

    
1914
See **ganeti**\(7) for a description of ``--submit`` and other common
1915
options.
1916

    
1917
Example::
1918

    
1919
    # gnt-instance change-group -I hail --to rack2 inst1.example.com
1920

    
1921

    
1922
Tags
1923
~~~~
1924

    
1925
ADD-TAGS
1926
^^^^^^^^
1927

    
1928
**add-tags** [\--from *file*] {*instancename*} {*tag*...}
1929

    
1930
Add tags to the given instance. If any of the tags contains invalid
1931
characters, the entire operation will abort.
1932

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

    
1939
LIST-TAGS
1940
^^^^^^^^^
1941

    
1942
**list-tags** {*instancename*}
1943

    
1944
List the tags of the given instance.
1945

    
1946
REMOVE-TAGS
1947
^^^^^^^^^^^
1948

    
1949
**remove-tags** [\--from *file*] {*instancename*} {*tag*...}
1950

    
1951
Remove tags from the given instance. If any of the tags are not
1952
existing on the node, the entire operation will abort.
1953

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

    
1960
.. vim: set textwidth=72 :
1961
.. Local Variables:
1962
.. mode: rst
1963
.. fill-column: 72
1964
.. End: