Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.rst @ 091034b2

History | View | Annotate | Download (70.6 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
| {*instance*}
46

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

    
51
The ``disk`` option specifies the parameters for the disks of the
52
instance. The numbering of disks starts at zero, and at least one disk
53
needs to be passed. For each disk, either the size or the adoption
54
source needs to be given. 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. Each disk can also take these
58
parameters (all optional):
59

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
163

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

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

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

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

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

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

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

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

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

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

    
215
The possible hypervisor options are as follows:
216

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

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

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

    
226
    a
227
        floppy drive
228

    
229
    c
230
        hard disk
231

    
232
    d
233
        CDROM drive
234

    
235
    n
236
        network boot (PXE)
237

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
299
    - ioemu
300
    - vif
301

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

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

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

    
316

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

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

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

    
331

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

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

    
341
vnc\_tls
342
    Valid for the KVM hypervisor.
343

    
344
    A boolean option that controls whether the VNC connection is
345
    secured with TLS.
346

    
347
vnc\_x509\_path
348
    Valid for the KVM hypervisor.
349

    
350
    If ``vnc_tls`` is enabled, this options specifies the path to the
351
    x509 certificate to use.
352

    
353
vnc\_x509\_verify
354
    Valid for the KVM hypervisor.
355

    
356
spice\_bind
357
    Valid for the KVM hypervisor.
358

    
359
    Specifies the address or interface on which the SPICE server will
360
    listen. Valid values are:
361

    
362
    - IPv4 addresses, including 0.0.0.0 and 127.0.0.1
363
    - IPv6 addresses, including :: and ::1
364
    - names of network interfaces
365

    
366
    If a network interface is specified, the SPICE server will be bound
367
    to one of the addresses of that interface.
368

    
369
spice\_ip\_version
370
    Valid for the KVM hypervisor.
371

    
372
    Specifies which version of the IP protocol should be used by the
373
    SPICE server.
374

    
375
    It is mainly intended to be used for specifying what kind of IP
376
    addresses should be used if a network interface with both IPv4 and
377
    IPv6 addresses is specified via the ``spice_bind`` parameter. In
378
    this case, if the ``spice_ip_version`` parameter is not used, the
379
    default IP version of the cluster will be used.
380

    
381
spice\_password\_file
382
    Valid for the KVM hypervisor.
383

    
384
    Specifies a file containing the password that must be used when
385
    connecting via the SPICE protocol. If the option is not specified,
386
    passwordless connections are allowed.
387

    
388
spice\_image\_compression
389
    Valid for the KVM hypervisor.
390

    
391
    Configures the SPICE lossless image compression. Valid values are:
392

    
393
    - auto_glz
394
    - auto_lz
395
    - quic
396
    - glz
397
    - lz
398
    - off
399

    
400
spice\_jpeg\_wan\_compression
401
    Valid for the KVM hypervisor.
402

    
403
    Configures how SPICE should use the jpeg algorithm for lossy image
404
    compression on slow links. Valid values are:
405

    
406
    - auto
407
    - never
408
    - always
409

    
410
spice\_zlib\_glz\_wan\_compression
411
    Valid for the KVM hypervisor.
412

    
413
    Configures how SPICE should use the zlib-glz algorithm for lossy image
414
    compression on slow links. Valid values are:
415

    
416
    - auto
417
    - never
418
    - always
419

    
420
spice\_streaming\_video
421
    Valid for the KVM hypervisor.
422

    
423
    Configures how SPICE should detect video streams. Valid values are:
424

    
425
    - off
426
    - all
427
    - filter
428

    
429
spice\_playback\_compression
430
    Valid for the KVM hypervisor.
431

    
432
    Configures whether SPICE should compress audio streams or not.
433

    
434
spice\_use\_tls
435
    Valid for the KVM hypervisor.
436

    
437
    Specifies that the SPICE server must use TLS to encrypt all the
438
    traffic with the client.
439

    
440
spice\_tls\_ciphers
441
    Valid for the KVM hypervisor.
442

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

    
446
spice\_use\_vdagent
447
    Valid for the KVM hypervisor.
448

    
449
    Enables or disables passing mouse events via SPICE vdagent.
450

    
451
cpu\_type
452
    Valid for the KVM hypervisor.
453

    
454
    This parameter determines the emulated cpu for the instance. If this
455
    parameter is empty (which is the default configuration), it will not
456
    be passed to KVM.
457

    
458
    Be aware of setting this parameter to ``"host"`` if you have nodes
459
    with different CPUs from each other. Live migration may stop working
460
    in this situation.
461

    
462
    For more information please refer to the KVM manual.
463

    
464
acpi
465
    Valid for the Xen HVM and KVM hypervisors.
466

    
467
    A boolean option that specifies if the hypervisor should enable
468
    ACPI support for this instance. By default, ACPI is disabled.
469

    
470
pae
471
    Valid for the Xen HVM and KVM hypervisors.
472

    
473
    A boolean option that specifies if the hypervisor should enable
474
    PAE support for this instance. The default is false, disabling PAE
475
    support.
476

    
477
viridian
478
    Valid for the Xen HVM hypervisor.
479

    
480
    A boolean option that specifies if the hypervisor should enable
481
    viridian (Hyper-V) for this instance. The default is false,
482
    disabling viridian support.
483

    
484
use\_localtime
485
    Valid for the Xen HVM and KVM hypervisors.
486

    
487
    A boolean option that specifies if the instance should be started
488
    with its clock set to the localtime of the machine (when true) or
489
    to the UTC (When false). The default is false, which is useful for
490
    Linux/Unix machines; for Windows OSes, it is recommended to enable
491
    this parameter.
492

    
493
kernel\_path
494
    Valid for the Xen PVM and KVM hypervisors.
495

    
496
    This option specifies the path (on the node) to the kernel to boot
497
    the instance with. Xen PVM instances always require this, while for
498
    KVM if this option is empty, it will cause the machine to load the
499
    kernel from its disks (and the boot will be done accordingly to
500
    ``boot_order``).
501

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

    
505
    This options specifies extra arguments to the kernel that will be
506
    loaded. device. This is always used for Xen PVM, while for KVM it
507
    is only used if the ``kernel_path`` option is also specified.
508

    
509
    The default setting for this value is simply ``"ro"``, which
510
    mounts the root disk (initially) in read-only one. For example,
511
    setting this to single will cause the instance to start in
512
    single-user mode.
513

    
514
initrd\_path
515
    Valid for the Xen PVM and KVM hypervisors.
516

    
517
    This option specifies the path (on the node) to the initrd to boot
518
    the instance with. Xen PVM instances can use this always, while
519
    for KVM if this option is only used if the ``kernel_path`` option
520
    is also specified. You can pass here either an absolute filename
521
    (the path to the initrd) if you want to use an initrd, or use the
522
    format no\_initrd\_path for no initrd.
523

    
524
root\_path
525
    Valid for the Xen PVM and KVM hypervisors.
526

    
527
    This options specifies the name of the root device. This is always
528
    needed for Xen PVM, while for KVM it is only used if the
529
    ``kernel_path`` option is also specified.
530

    
531
    Please note, that if this setting is an empty string and the
532
    hypervisor is Xen it will not be written to the Xen configuration
533
    file
534

    
535
serial\_console
536
    Valid for the KVM hypervisor.
537

    
538
    This boolean option specifies whether to emulate a serial console
539
    for the instance. Note that some versions of KVM have a bug that
540
    will make an instance hang when configured to use the serial console
541
    unless a connection is made to it within about 2 seconds of the
542
    instance's startup. For such case it's recommended to disable this
543
    option, which is enabled by default.
544

    
545
serial\_speed
546
    Valid for the KVM hypervisor.
547

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

    
553
disk\_cache
554
    Valid for the KVM hypervisor.
555

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

    
566
security\_model
567
    Valid for the KVM hypervisor.
568

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

    
573
    Under *user* kvm will drop privileges and become the user
574
    specified by the security\_domain parameter.
575

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

    
580
security\_domain
581
    Valid for the KVM hypervisor.
582

    
583
    Under security model *user* the username to run the instance
584
    under.  It must be a valid username existing on the host.
585

    
586
    Cannot be set under security model *none* or *pool*.
587

    
588
kvm\_flag
589
    Valid for the KVM hypervisor.
590

    
591
    If *enabled* the -enable-kvm flag is passed to kvm. If *disabled*
592
    -disable-kvm is passed. If unset no flag is passed, and the
593
    default running mode for your kvm binary will be used.
594

    
595
mem\_path
596
    Valid for the KVM hypervisor.
597

    
598
    This option passes the -mem-path argument to kvm with the path (on
599
    the node) to the mount point of the hugetlbfs file system, along
600
    with the -mem-prealloc argument too.
601

    
602
use\_chroot
603
    Valid for the KVM hypervisor.
604

    
605
    This boolean option determines whether to run the KVM instance in a
606
    chroot directory.
607

    
608
    If it is set to ``true``, an empty directory is created before
609
    starting the instance and its path is passed via the -chroot flag
610
    to kvm. The directory is removed when the instance is stopped.
611

    
612
    It is set to ``false`` by default.
613

    
614
migration\_downtime
615
    Valid for the KVM hypervisor.
616

    
617
    The maximum amount of time (in ms) a KVM instance is allowed to be
618
    frozen during a live migration, in order to copy dirty memory
619
    pages. Default value is 30ms, but you may need to increase this
620
    value for busy instances.
621

    
622
    This option is only effective with kvm versions >= 87 and qemu-kvm
623
    versions >= 0.11.0.
624

    
625
cpu\_mask
626
    Valid for the Xen, KVM and LXC hypervisors.
627

    
628
    The processes belonging to the given instance are only scheduled
629
    on the specified CPUs.
630

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

    
635
    Second, a comma-separated list of CPU IDs or CPU ID ranges. The
636
    ranges are defined by a lower and higher boundary, separated by a
637
    dash, and the boundaries are inclusive. In this form, all VCPUs of
638
    the instance will be mapped on the selected list of CPUs. Example:
639
    ``0-2,5``, mapping all VCPUs (no matter how many) onto physical CPUs
640
    0, 1, 2 and 5.
641

    
642
    The last form is used for explicit control of VCPU-CPU pinnings. In
643
    this form, the list of VCPU mappings is given as a colon (:)
644
    separated list, whose elements are the possible values for the
645
    second or first form above. In this form, the number of elements in
646
    the colon-separated list _must_ equal the number of VCPUs of the
647
    instance.
648

    
649
    Example:
650

    
651
    .. code-block:: bash
652

    
653
      # Map the entire instance to CPUs 0-2
654
      gnt-instance modify -H cpu_mask=0-2 my-inst
655

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

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

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

    
666
      # Pin entire VM to CPU 0
667
      gnt-instance modify -H cpu_mask=0 my-inst
668

    
669
      # Turn off CPU pinning (default setting)
670
      gnt-instance modify -H cpu_mask=all my-inst
671

    
672
cpu\_cap
673
    Valid for the Xen hypervisor.
674

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

    
678
cpu\_weight
679
    Valid for the Xen hypervisor.
680

    
681
    Set the cpu time ratio to be allocated to the VM. Valid values are
682
    between 1 and 65535. Default weight is 256.
683

    
684
usb\_mouse
685
    Valid for the KVM hypervisor.
686

    
687
    This option specifies the usb mouse type to be used. It can be
688
    "mouse" or "tablet". When using VNC it's recommended to set it to
689
    "tablet".
690

    
691
keymap
692
    Valid for the KVM hypervisor.
693

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

    
697
reboot\_behavior
698
    Valid for Xen PVM, Xen HVM and KVM hypervisors.
699

    
700
    Normally if an instance reboots, the hypervisor will restart it. If
701
    this option is set to ``exit``, the hypervisor will treat a reboot
702
    as a shutdown instead.
703

    
704
    It is set to ``reboot`` by default.
705

    
706
cpu\_cores
707
    Valid for the KVM hypervisor.
708

    
709
    Number of emulated CPU cores.
710

    
711
cpu\_threads
712
    Valid for the KVM hypervisor.
713

    
714
    Number of emulated CPU threads.
715

    
716
cpu\_sockets
717
    Valid for the KVM hypervisor.
718

    
719
    Number of emulated CPU sockets.
720

    
721
soundhw
722
    Valid for the KVM hypervisor.
723

    
724
    Comma separated list of emulated sounds cards, or "all" to enable
725
    all the available ones.
726

    
727
usb\_devices
728
    Valid for the KVM hypervisor.
729

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

    
735
vga
736
    Valid for the KVM hypervisor.
737

    
738
    Emulated vga mode, passed the the kvm -vga option.
739

    
740
kvm\_extra
741
    Valid for the KVM hypervisor.
742

    
743
    Any other option to the KVM hypervisor, useful tweaking anything
744
    that Ganeti doesn't support. Note that values set with this
745
    parameter are split on a space character and currently don't support
746
    quoting.
747

    
748
machine\_version
749
    Valid for the KVM hypervisor.
750

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

    
755
kvm\_path
756
    Valid for the KVM hypervisor.
757

    
758
    Path to the userspace KVM (or qemu) program.
759

    
760
vnet\_hdr
761
    Valid for the KVM hypervisor.
762

    
763
    This boolean option determines whether the tap devices used by the
764
    KVM paravirtual nics (virtio-net) will get created with VNET_HDR
765
    (IFF_VNET_HDR) support.
766

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

    
771
    It is set to ``true`` by default.
772

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

    
778
    gnt-instance add -O dhcp=yes ...
779

    
780
The ``-I (--iallocator)`` option specifies the instance allocator plugin
781
to use (``.`` means the default allocator). If you pass in this option
782
the allocator will select nodes for this instance automatically, so you
783
don't need to pass them with the ``-n`` option. For more information
784
please refer to the instance allocator documentation.
785

    
786
The ``-t (--disk-template)`` options specifies the disk layout type
787
for the instance. If no disk template is specified, the default disk
788
template is used. The default disk template is the first in the list
789
of enabled disk templates, which can be adjusted cluster-wide with
790
``gnt-cluster modify``. The available choices for disk templates are:
791

    
792
diskless
793
    This creates an instance with no disks. Its useful for testing only
794
    (or other special cases).
795

    
796
file
797
    Disk devices will be regular files.
798

    
799
sharedfile
800
    Disk devices will be regulare files on a shared directory.
801

    
802
plain
803
    Disk devices will be logical volumes.
804

    
805
drbd
806
    Disk devices will be drbd (version 8.x) on top of lvm volumes.
807

    
808
rbd
809
    Disk devices will be rbd volumes residing inside a RADOS cluster.
810

    
811
blockdev
812
    Disk devices will be adopted pre-existent block devices.
813

    
814
ext
815
    Disk devices will be provided by external shared storage,
816
    through the ExtStorage Interface using ExtStorage providers.
817

    
818
The optional second value of the ``-n (--node)`` is used for the drbd
819
template type and specifies the remote node.
820

    
821
If you do not want gnt-instance to wait for the disk mirror to be
822
synced, use the ``--no-wait-for-sync`` option.
823

    
824
The ``--file-storage-dir`` specifies the relative path under the
825
cluster-wide file storage directory to store file-based disks. It is
826
useful for having different subdirectories for different
827
instances. The full path of the directory where the disk files are
828
stored will consist of cluster-wide file storage directory + optional
829
subdirectory + instance name. This option is only relevant for
830
instances using the file storage backend.
831

    
832
The ``--file-driver`` specifies the driver to use for file-based
833
disks. Note that currently these drivers work with the xen hypervisor
834
only. This option is only relevant for instances using the file
835
storage backend. The available choices are:
836

    
837
loop
838
    Kernel loopback driver. This driver uses loopback devices to
839
    access the filesystem within the file. However, running I/O
840
    intensive applications in your instance using the loop driver
841
    might result in slowdowns. Furthermore, if you use the loopback
842
    driver consider increasing the maximum amount of loopback devices
843
    (on most systems it's 8) using the max\_loop param.
844

    
845
blktap
846
    The blktap driver (for Xen hypervisors). In order to be able to
847
    use the blktap driver you should check if the 'blktapctrl' user
848
    space disk agent is running (usually automatically started via
849
    xend).  This user-level disk I/O interface has the advantage of
850
    better performance. Especially if you use a network file system
851
    (e.g. NFS) to store your instances this is the recommended choice.
852

    
853
blktap2
854
    Analogous to the blktap driver, but used by newer versions of Xen.
855

    
856
If ``--ignore-ipolicy`` is given any instance policy violations occuring
857
during this operation are ignored.
858

    
859
See **ganeti**\(7) for a description of ``--submit`` and other common
860
options.
861

    
862
Example::
863

    
864
    # gnt-instance add -t file --disk 0:size=30g -B maxmem=512 -o debian-etch \
865
      -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
866
    # gnt-instance add -t plain --disk 0:size=30g -B maxmem=1024,minmem=512 \
867
      -o debian-etch -n node1.example.com instance1.example.com
868
    # gnt-instance add -t plain --disk 0:size=30g --disk 1:size=100g,vg=san \
869
      -B maxmem=512 -o debian-etch -n node1.example.com instance1.example.com
870
    # gnt-instance add -t drbd --disk 0:size=30g -B maxmem=512 -o debian-etch \
871
      -n node1.example.com:node2.example.com instance2.example.com
872
    # gnt-instance add -t rbd --disk 0:size=30g -B maxmem=512 -o debian-etch \
873
      -n node1.example.com instance1.example.com
874
    # gnt-instance add -t ext --disk 0:size=30g,provider=pvdr1 -B maxmem=512 \
875
      -o debian-etch -n node1.example.com instance1.example.com
876
    # gnt-instance add -t ext --disk 0:size=30g,provider=pvdr1,param1=val1 \
877
      --disk 1:size=40g,provider=pvdr2,param2=val2,param3=val3 -B maxmem=512 \
878
      -o debian-etch -n node1.example.com instance1.example.com
879

    
880

    
881
BATCH-CREATE
882
^^^^^^^^^^^^
883

    
884
| **batch-create**
885
| [{-I|\--iallocator} *instance allocator*]
886
| {instances\_file.json}
887

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

    
895
The instance file must be a valid-formed JSON file, containing an
896
array of dictionaries with instance creation parameters. All parameters
897
(except ``iallocator``) which are valid for the instance creation
898
OP code are allowed. The most important ones are:
899

    
900
instance\_name
901
    The FQDN of the new instance.
902

    
903
disk\_template
904
    The disk template to use for the instance, the same as in the
905
    **add** command.
906

    
907
disks
908
    Array of disk specifications. Each entry describes one disk as a
909
    dictionary of disk parameters.
910

    
911
beparams
912
    A dictionary of backend parameters.
913

    
914
hypervisor
915
    The hypervisor for the instance.
916

    
917
hvparams
918
    A dictionary with the hypervisor options. If not passed, the default
919
    hypervisor options will be inherited.
920

    
921
nics
922
    List of NICs that will be created for the instance. Each entry
923
    should be a dict, with mac, ip, mode and link as possible keys.
924
    Please don't provide the "mac, ip, mode, link" parent keys if you
925
    use this method for specifying NICs.
926

    
927
pnode, snode
928
    The primary and optionally the secondary node to use for the
929
    instance (in case an iallocator script is not used). If those
930
    parameters are given, they have to be given consistently for all
931
    instances in the batch operation.
932

    
933
start
934
    whether to start the instance
935

    
936
ip\_check
937
    Skip the check for already-in-use instance; see the description in
938
    the **add** command for details.
939

    
940
name\_check
941
    Skip the name check for instances; see the description in the
942
    **add** command for details.
943

    
944
file\_storage\_dir, file\_driver
945
    Configuration for the file disk type, see the **add** command for
946
    details.
947

    
948

    
949
A simple definition for one instance can be (with most of the
950
parameters taken from the cluster defaults)::
951

    
952
    [
953
      {
954
        "mode": "create",
955
        "instance_name": "instance1.example.com",
956
        "disk_template": "drbd",
957
        "os_type": "debootstrap",
958
        "disks": [{"size":"1024"}],
959
        "nics": [{}],
960
        "hypervisor": "xen-pvm"
961
      },
962
      {
963
        "mode": "create",
964
        "instance_name": "instance2.example.com",
965
        "disk_template": "drbd",
966
        "os_type": "debootstrap",
967
        "disks": [{"size":"4096", "mode": "rw", "vg": "xenvg"}],
968
        "nics": [{}],
969
        "hypervisor": "xen-hvm",
970
        "hvparams": {"acpi": true},
971
        "beparams": {"maxmem": 512, "minmem": 256}
972
      }
973
    ]
974

    
975
The command will display the job id for each submitted instance, as
976
follows::
977

    
978
    # gnt-instance batch-create instances.json
979
    Submitted jobs 37, 38
980

    
981
REMOVE
982
^^^^^^
983

    
984
| **remove** [\--ignore-failures] [\--shutdown-timeout=*N*] [\--submit]
985
| [\--print-job-id] [\--force] {*instance*}
986

    
987
Remove an instance. This will remove all data from the instance and
988
there is *no way back*. If you are not sure if you use an instance
989
again, use **shutdown** first and leave it in the shutdown state for a
990
while.
991

    
992
The ``--ignore-failures`` option will cause the removal to proceed
993
even in the presence of errors during the removal of the instance
994
(e.g. during the shutdown or the disk removal). If this option is not
995
given, the command will stop at the first error.
996

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

    
1002
The ``--force`` option is used to skip the interactive confirmation.
1003

    
1004
See **ganeti**\(7) for a description of ``--submit`` and other common
1005
options.
1006

    
1007
Example::
1008

    
1009
    # gnt-instance remove instance1.example.com
1010

    
1011

    
1012
LIST
1013
^^^^
1014

    
1015
| **list**
1016
| [\--no-headers] [\--separator=*SEPARATOR*] [\--units=*UNITS*] [-v]
1017
| [{-o|\--output} *[+]FIELD,...*] [\--filter] [instance...]
1018

    
1019
Shows the currently configured instances with memory usage, disk
1020
usage, the node they are running on, and their run status.
1021

    
1022
The ``--no-headers`` option will skip the initial header line. The
1023
``--separator`` option takes an argument which denotes what will be
1024
used between the output fields. Both these options are to help
1025
scripting.
1026

    
1027
The units used to display the numeric values in the output varies,
1028
depending on the options given. By default, the values will be
1029
formatted in the most appropriate unit. If the ``--separator`` option
1030
is given, then the values are shown in mebibytes to allow parsing by
1031
scripts. In both cases, the ``--units`` option can be used to enforce
1032
a given output unit.
1033

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

    
1037
The ``-o (--output)`` option takes a comma-separated list of output
1038
fields. The available fields and their meaning are:
1039

    
1040
@QUERY_FIELDS_INSTANCE@
1041

    
1042
If the value of the option starts with the character ``+``, the new
1043
field(s) will be added to the default list. This allows one to quickly
1044
see the default list plus a few other fields, instead of retyping the
1045
entire list of fields.
1046

    
1047
There is a subtle grouping about the available output fields: all
1048
fields except for ``oper_state``, ``oper_ram``, ``oper_vcpus`` and
1049
``status`` are configuration value and not run-time values. So if you
1050
don't select any of the these fields, the query will be satisfied
1051
instantly from the cluster configuration, without having to ask the
1052
remote nodes for the data. This can be helpful for big clusters when
1053
you only want some data and it makes sense to specify a reduced set of
1054
output fields.
1055

    
1056
If exactly one argument is given and it appears to be a query filter
1057
(see **ganeti**\(7)), the query result is filtered accordingly. For
1058
ambiguous cases (e.g. a single field name as a filter) the ``--filter``
1059
(``-F``) option forces the argument to be treated as a filter (e.g.
1060
``gnt-instance list -F admin_state``).
1061

    
1062
The default output field list is: ``name``, ``os``, ``pnode``,
1063
``admin_state``, ``oper_state``, ``oper_ram``.
1064

    
1065

    
1066
LIST-FIELDS
1067
^^^^^^^^^^^
1068

    
1069
**list-fields** [field...]
1070

    
1071
Lists available fields for instances.
1072

    
1073

    
1074
INFO
1075
^^^^
1076

    
1077
**info** [-s \| \--static] [\--roman] {\--all \| *instance*}
1078

    
1079
Show detailed information about the given instance(s). This is
1080
different from **list** as it shows detailed data about the instance's
1081
disks (especially useful for the drbd disk template).
1082

    
1083
If the option ``-s`` is used, only information available in the
1084
configuration file is returned, without querying nodes, making the
1085
operation faster.
1086

    
1087
Use the ``--all`` to get info about all instances, rather than
1088
explicitly passing the ones you're interested in.
1089

    
1090
The ``--roman`` option can be used to cause envy among people who like
1091
ancient cultures, but are stuck with non-latin-friendly cluster
1092
virtualization technologies.
1093

    
1094
MODIFY
1095
^^^^^^
1096

    
1097
| **modify**
1098
| [{-H|\--hypervisor-parameters} *HYPERVISOR\_PARAMETERS*]
1099
| [{-B|\--backend-parameters} *BACKEND\_PARAMETERS*]
1100
| [{-m|\--runtime-memory} *SIZE*]
1101
| [\--net add[:options...] \|
1102
|  \--net [*N*:]add[,options...] \|
1103
|  \--net [*ID*:]remove \|
1104
|  \--net *ID*:modify[,options...]]
1105
| [\--disk add:size=*SIZE*[,options...] \|
1106
|  \--disk *N*:add,size=*SIZE*[,options...] \|
1107
|  \--disk *N*:add,size=*SIZE*,provider=*PROVIDER*[,options...][,param=*value*... ] \|
1108
|  \--disk *ID*:modify[,options...]
1109
|  \--disk [*ID*:]remove]
1110
| [{-t|\--disk-template} plain \| {-t|\--disk-template} drbd -n *new_secondary*] [\--no-wait-for-sync]
1111
| [\--new-primary=*node*]
1112
| [\--os-type=*OS* [\--force-variant]]
1113
| [{-O|\--os-parameters} *param*=*value*... ]
1114
| [\--offline \| \--online]
1115
| [\--submit] [\--print-job-id]
1116
| [\--ignore-ipolicy]
1117
| {*instance*}
1118

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

    
1124
The ``-H (--hypervisor-parameters)``, ``-B (--backend-parameters)``
1125
and ``-O (--os-parameters)`` options specifies hypervisor, backend and
1126
OS parameter options in the form of name=value[,...]. For details
1127
which options can be specified, see the **add** command.
1128

    
1129
The ``-t (--disk-template)`` option will change the disk template of
1130
the instance.  Currently only conversions between the plain and drbd
1131
disk templates are supported, and the instance must be stopped before
1132
attempting the conversion. When changing from the plain to the drbd
1133
disk template, a new secondary node must be specified via the ``-n``
1134
option. The option ``--no-wait-for-sync`` can be used when converting
1135
to the ``drbd`` template in order to make the instance available for
1136
startup before DRBD has finished resyncing.
1137

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

    
1142
The ``--disk add:size=*SIZE*,[options..]`` option adds a disk to the
1143
instance, and ``--disk *N*:add:size=*SIZE*,[options..]`` will add a disk
1144
to the the instance at a specific index. The available options are the
1145
same as in the **add** command(``spindles``, ``mode``, ``name``, ``vg``,
1146
``metavg``). When adding an ExtStorage disk the ``provider=*PROVIDER*``
1147
option is also mandatory and specifies the ExtStorage provider. Also,
1148
for ExtStorage disks arbitrary parameters can be passed as additional
1149
comma separated options, same as in the **add** command. -The ``--disk
1150
remove`` option will remove the last disk of the instance. Use ``--disk
1151
`` *ID*``:remove`` to remove a disk by its identifier. *ID* can be the
1152
index of the disk, the disks's name or the disks's UUID. The ``--disk
1153
*ID*:modify[,options...]`` will change the options of the disk.
1154
Available options are:
1155

    
1156
mode
1157
  The access mode. Either ``ro`` (read-only) or the default ``rw`` (read-write).
1158

    
1159
name
1160
   This option specifies a name for the disk, which can be used as a disk
1161
   identifier. An instance can not have two disks with the same name.
1162

    
1163
The ``--net *N*:add[,options..]`` will add a new network interface to
1164
the instance. The available options are the same as in the **add**
1165
command (``mac``, ``ip``, ``link``, ``mode``, ``network``). The
1166
``--net *ID*,remove`` will remove the intances' NIC with *ID* identifier,
1167
which can be the index of the NIC, the NIC's name or the NIC's UUID.
1168
The ``--net *ID*:modify[,options..]`` option will change the parameters of
1169
the instance network interface with the *ID* identifier.
1170

    
1171
The option ``-o (--os-type)`` will change the OS name for the instance
1172
(without reinstallation). In case an OS variant is specified that is
1173
not found, then by default the modification is refused, unless
1174
``--force-variant`` is passed. An invalid OS will also be refused,
1175
unless the ``--force`` option is given.
1176

    
1177
The option ``--new-primary`` will set the new primary node of an instance
1178
assuming the disks have already been moved manually. Unless the ``--force``
1179
option is given, it is verified that the instance is no longer running
1180
on its current primary node.
1181

    
1182
The ``--online`` and ``--offline`` options are used to transition an
1183
instance into and out of the ``offline`` state. An instance can be
1184
turned offline only if it was previously down. The ``--online`` option
1185
fails if the instance was not in the ``offline`` state, otherwise it
1186
changes instance's state to ``down``. These modifications take effect
1187
immediately.
1188

    
1189
If ``--ignore-ipolicy`` is given any instance policy violations occuring
1190
during this operation are ignored.
1191

    
1192
See **ganeti**\(7) for a description of ``--submit`` and other common
1193
options.
1194

    
1195
Most of the changes take effect at the next restart. If the instance is
1196
running, there is no effect on the instance.
1197

    
1198
REINSTALL
1199
^^^^^^^^^
1200

    
1201
| **reinstall** [{-o|\--os-type} *os-type*] [\--select-os] [-f *force*]
1202
| [\--force-multiple]
1203
| [\--instance \| \--node \| \--primary \| \--secondary \| \--all]
1204
| [{-O|\--os-parameters} *OS\_PARAMETERS*] [\--submit] [\--print-job-id]
1205
| {*instance*...}
1206

    
1207
Reinstalls the operating system on the given instance(s). The
1208
instance(s) must be stopped when running this command. If the ``-o
1209
(--os-type)`` is specified, the operating system is changed.
1210

    
1211
The ``--select-os`` option switches to an interactive OS reinstall.
1212
The user is prompted to select the OS template from the list of
1213
available OS templates. OS parameters can be overridden using ``-O
1214
(--os-parameters)`` (more documentation for this option under the
1215
**add** command).
1216

    
1217
Since this is a potentially dangerous command, the user will be
1218
required to confirm this action, unless the ``-f`` flag is passed.
1219
When multiple instances are selected (either by passing multiple
1220
arguments or by using the ``--node``, ``--primary``, ``--secondary``
1221
or ``--all`` options), the user must pass the ``--force-multiple``
1222
options to skip the interactive confirmation.
1223

    
1224
See **ganeti**\(7) for a description of ``--submit`` and other common
1225
options.
1226

    
1227
RENAME
1228
^^^^^^
1229

    
1230
| **rename** [\--no-ip-check] [\--no-name-check] [\--submit] [\--print-job-id]
1231
| {*instance*} {*new\_name*}
1232

    
1233
Renames the given instance. The instance must be stopped when running
1234
this command. The requirements for the new name are the same as for
1235
adding an instance: the new name must be resolvable and the IP it
1236
resolves to must not be reachable (in order to prevent duplicate IPs
1237
the next time the instance is started). The IP test can be skipped if
1238
the ``--no-ip-check`` option is passed.
1239

    
1240
Note that you can rename an instance to its same name, to force
1241
re-executing the os-specific rename script for that instance, if
1242
needed.
1243

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

    
1250
See **ganeti**\(7) for a description of ``--submit`` and other common
1251
options.
1252

    
1253
Starting/stopping/connecting to console
1254
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1255

    
1256
STARTUP
1257
^^^^^^^
1258

    
1259
| **startup**
1260
| [\--force] [\--ignore-offline]
1261
| [\--force-multiple] [\--no-remember]
1262
| [\--instance \| \--node \| \--primary \| \--secondary \| \--all \|
1263
| \--tags \| \--node-tags \| \--pri-node-tags \| \--sec-node-tags]
1264
| [{-H|\--hypervisor-parameters} ``key=value...``]
1265
| [{-B|\--backend-parameters} ``key=value...``]
1266
| [\--submit] [\--print-job-id] [\--paused]
1267
| {*name*...}
1268

    
1269
Starts one or more instances, depending on the following options.  The
1270
four available modes are:
1271

    
1272
\--instance
1273
    will start the instances given as arguments (at least one argument
1274
    required); this is the default selection
1275

    
1276
\--node
1277
    will start the instances who have the given node as either primary
1278
    or secondary
1279

    
1280
\--primary
1281
    will start all instances whose primary node is in the list of nodes
1282
    passed as arguments (at least one node required)
1283

    
1284
\--secondary
1285
    will start all instances whose secondary node is in the list of
1286
    nodes passed as arguments (at least one node required)
1287

    
1288
\--all
1289
    will start all instances in the cluster (no arguments accepted)
1290

    
1291
\--tags
1292
    will start all instances in the cluster with the tags given as
1293
    arguments
1294

    
1295
\--node-tags
1296
    will start all instances in the cluster on nodes with the tags
1297
    given as arguments
1298

    
1299
\--pri-node-tags
1300
    will start all instances in the cluster on primary nodes with the
1301
    tags given as arguments
1302

    
1303
\--sec-node-tags
1304
    will start all instances in the cluster on secondary nodes with the
1305
    tags given as arguments
1306

    
1307
Note that although you can pass more than one selection option, the
1308
last one wins, so in order to guarantee the desired result, don't pass
1309
more than one such option.
1310

    
1311
Use ``--force`` to start even if secondary disks are failing.
1312
``--ignore-offline`` can be used to ignore offline primary nodes and
1313
mark the instance as started even if the primary is not available.
1314

    
1315
The ``--force-multiple`` will skip the interactive confirmation in the
1316
case the more than one instance will be affected.
1317

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

    
1324
The ``-H (--hypervisor-parameters)`` and ``-B (--backend-parameters)``
1325
options specify temporary hypervisor and backend parameters that can
1326
be used to start an instance with modified parameters. They can be
1327
useful for quick testing without having to modify an instance back and
1328
forth, e.g.::
1329

    
1330
    # gnt-instance start -H kernel_args="single" instance1
1331
    # gnt-instance start -B maxmem=2048 instance2
1332

    
1333

    
1334
The first form will start the instance instance1 in single-user mode,
1335
and the instance instance2 with 2GB of RAM (this time only, unless
1336
that is the actual instance memory size already). Note that the values
1337
override the instance parameters (and not extend them): an instance
1338
with "kernel\_args=ro" when started with -H kernel\_args=single will
1339
result in "single", not "ro single".
1340

    
1341
The ``--paused`` option is only valid for Xen and kvm hypervisors.  This
1342
pauses the instance at the start of bootup, awaiting ``gnt-instance
1343
console`` to unpause it, allowing the entire boot process to be
1344
monitored for debugging.
1345

    
1346
See **ganeti**\(7) for a description of ``--submit`` and other common
1347
options.
1348

    
1349
Example::
1350

    
1351
    # gnt-instance start instance1.example.com
1352
    # gnt-instance start --node node1.example.com node2.example.com
1353
    # gnt-instance start --all
1354

    
1355

    
1356
SHUTDOWN
1357
^^^^^^^^
1358

    
1359
| **shutdown**
1360
| [\--timeout=*N*]
1361
| [\--force] [\--force-multiple] [\--ignore-offline] [\--no-remember]
1362
| [\--instance \| \--node \| \--primary \| \--secondary \| \--all \|
1363
| \--tags \| \--node-tags \| \--pri-node-tags \| \--sec-node-tags]
1364
| [\--submit] [\--print-job-id]
1365
| {*name*...}
1366

    
1367
Stops one or more instances. If the instance cannot be cleanly stopped
1368
during a hardcoded interval (currently 2 minutes), it will forcibly
1369
stop the instance (equivalent to switching off the power on a physical
1370
machine).
1371

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

    
1377
The ``--instance``, ``--node``, ``--primary``, ``--secondary``,
1378
``--all``, ``--tags``, ``--node-tags``, ``--pri-node-tags`` and
1379
``--sec-node-tags`` options are similar as for the **startup** command
1380
and they influence the actual instances being shutdown.
1381

    
1382
``--ignore-offline`` can be used to ignore offline primary nodes and
1383
force the instance to be marked as stopped. This option should be used
1384
with care as it can lead to an inconsistent cluster state.
1385

    
1386
Use ``--force`` to be able to shutdown an instance even when it's marked
1387
as offline. This is useful is an offline instance ends up in the
1388
``ERROR_up`` state, for example.
1389

    
1390
The ``--no-remember`` option will perform the shutdown but not change
1391
the state of the instance in the configuration file (if it was running
1392
before, Ganeti will still thinks it needs to be running). This can be
1393
useful for a cluster-wide shutdown, where some instances are marked as
1394
up and some as down, and you don't want to change the running state:
1395
you just need to disable the watcher, shutdown all instances with
1396
``--no-remember``, and when the watcher is activated again it will
1397
restore the correct runtime state for all instances.
1398

    
1399
See **ganeti**\(7) for a description of ``--submit`` and other common
1400
options.
1401

    
1402
Example::
1403

    
1404
    # gnt-instance shutdown instance1.example.com
1405
    # gnt-instance shutdown --all
1406

    
1407

    
1408
REBOOT
1409
^^^^^^
1410

    
1411
| **reboot**
1412
| [{-t|\--type} *REBOOT-TYPE*]
1413
| [\--ignore-secondaries]
1414
| [\--shutdown-timeout=*N*]
1415
| [\--force-multiple]
1416
| [\--instance \| \--node \| \--primary \| \--secondary \| \--all \|
1417
| \--tags \| \--node-tags \| \--pri-node-tags \| \--sec-node-tags]
1418
| [\--submit] [\--print-job-id]
1419
| [*name*...]
1420

    
1421
Reboots one or more instances. The type of reboot depends on the value
1422
of ``-t (--type)``. A soft reboot does a hypervisor reboot, a hard reboot
1423
does a instance stop, recreates the hypervisor config for the instance
1424
and starts the instance. A full reboot does the equivalent of
1425
**gnt-instance shutdown && gnt-instance startup**.  The default is
1426
hard reboot.
1427

    
1428
For the hard reboot the option ``--ignore-secondaries`` ignores errors
1429
for the secondary node while re-assembling the instance disks.
1430

    
1431
The ``--instance``, ``--node``, ``--primary``, ``--secondary``,
1432
``--all``, ``--tags``, ``--node-tags``, ``--pri-node-tags`` and
1433
``--sec-node-tags`` options are similar as for the **startup** command
1434
and they influence the actual instances being rebooted.
1435

    
1436
The ``--shutdown-timeout`` is used to specify how much time to wait
1437
before forcing the shutdown (xm destroy in xen, killing the kvm
1438
process, for kvm). By default two minutes are given to each instance
1439
to stop.
1440

    
1441
The ``--force-multiple`` will skip the interactive confirmation in the
1442
case the more than one instance will be affected.
1443

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

    
1447
Example::
1448

    
1449
    # gnt-instance reboot instance1.example.com
1450
    # gnt-instance reboot --type=full instance1.example.com
1451

    
1452

    
1453
CONSOLE
1454
^^^^^^^
1455

    
1456
**console** [\--show-cmd] {*instance*}
1457

    
1458
Connects to the console of the given instance. If the instance is not
1459
up, an error is returned. Use the ``--show-cmd`` option to display the
1460
command instead of executing it.
1461

    
1462
For HVM instances, this will attempt to connect to the serial console
1463
of the instance. To connect to the virtualized "physical" console of a
1464
HVM instance, use a VNC client with the connection info from the
1465
**info** command.
1466

    
1467
For Xen/kvm instances, if the instance is paused, this attempts to
1468
unpause the instance after waiting a few seconds for the connection to
1469
the console to be made.
1470

    
1471
Example::
1472

    
1473
    # gnt-instance console instance1.example.com
1474

    
1475

    
1476
Disk management
1477
~~~~~~~~~~~~~~~
1478

    
1479
REPLACE-DISKS
1480
^^^^^^^^^^^^^
1481

    
1482
| **replace-disks** [\--submit] [\--print-job-id] [\--early-release]
1483
| [\--ignore-ipolicy] {-p} [\--disks *idx*] {*instance*}
1484

    
1485
| **replace-disks** [\--submit] [\--print-job-id] [\--early-release]
1486
| [\--ignore-ipolicy] {-s} [\--disks *idx*] {*instance*}
1487

    
1488
| **replace-disks** [\--submit] [\--print-job-id] [\--early-release]
1489
| [\--ignore-ipolicy]
1490
| {{-I\|\--iallocator} *name* \| {{-n|\--new-secondary} *node* } {*instance*}
1491

    
1492
| **replace-disks** [\--submit] [\--print-job-id] [\--early-release]
1493
| [\--ignore-ipolicy] {-a\|\--auto} {*instance*}
1494

    
1495
This command is a generalized form for replacing disks. It is
1496
currently only valid for the mirrored (DRBD) disk template.
1497

    
1498
The first form (when passing the ``-p`` option) will replace the disks
1499
on the primary, while the second form (when passing the ``-s`` option
1500
will replace the disks on the secondary node. For these two cases (as
1501
the node doesn't change), it is possible to only run the replace for a
1502
subset of the disks, using the option ``--disks`` which takes a list
1503
of comma-delimited disk indices (zero-based), e.g. 0,2 to replace only
1504
the first and third disks.
1505

    
1506
The third form (when passing either the ``--iallocator`` or the
1507
``--new-secondary`` option) is designed to change secondary node of the
1508
instance. Specifying ``--iallocator`` makes the new secondary be
1509
selected automatically by the specified allocator plugin (use ``.`` to
1510
indicate the default allocator), otherwise the new secondary node will
1511
be the one chosen manually via the ``--new-secondary`` option.
1512

    
1513
Note that it is not possible to select an offline or drained node as a
1514
new secondary.
1515

    
1516
The fourth form (when using ``--auto``) will automatically determine
1517
which disks of an instance are faulty and replace them within the same
1518
node. The ``--auto`` option works only when an instance has only
1519
faulty disks on either the primary or secondary node; it doesn't work
1520
when both sides have faulty disks.
1521

    
1522
The ``--early-release`` changes the code so that the old storage on
1523
secondary node(s) is removed early (before the resync is completed)
1524
and the internal Ganeti locks for the current (and new, if any)
1525
secondary node are also released, thus allowing more parallelism in
1526
the cluster operation. This should be used only when recovering from a
1527
disk failure on the current secondary (thus the old storage is already
1528
broken) or when the storage on the primary node is known to be fine
1529
(thus we won't need the old storage for potential recovery).
1530

    
1531
The ``--ignore-ipolicy`` let the command ignore instance policy
1532
violations if replace-disks changes groups and the instance would
1533
violate the new groups instance policy.
1534

    
1535
See **ganeti**\(7) for a description of ``--submit`` and other common
1536
options.
1537

    
1538
ACTIVATE-DISKS
1539
^^^^^^^^^^^^^^
1540

    
1541
| **activate-disks** [\--submit] [\--print-job-id] [\--ignore-size]
1542
| [\--wait-for-sync] {*instance*}
1543

    
1544
Activates the block devices of the given instance. If successful, the
1545
command will show the location and name of the block devices::
1546

    
1547
    node1.example.com:disk/0:/dev/drbd0
1548
    node1.example.com:disk/1:/dev/drbd1
1549

    
1550

    
1551
In this example, *node1.example.com* is the name of the node on which
1552
the devices have been activated. The *disk/0* and *disk/1* are the
1553
Ganeti-names of the instance disks; how they are visible inside the
1554
instance is hypervisor-specific. */dev/drbd0* and */dev/drbd1* are the
1555
actual block devices as visible on the node.
1556

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

    
1564
The ``--wait-for-sync`` option will ensure that the command returns only
1565
after the instance's disks are synchronised (mostly for DRBD); this can
1566
be useful to ensure consistency, as otherwise there are no commands that
1567
can wait until synchronisation is done. However when passing this
1568
option, the command will have additional output, making it harder to
1569
parse the disk information.
1570

    
1571
Note that it is safe to run this command while the instance is already
1572
running.
1573

    
1574
See **ganeti**\(7) for a description of ``--submit`` and other common
1575
options.
1576

    
1577
DEACTIVATE-DISKS
1578
^^^^^^^^^^^^^^^^
1579

    
1580
**deactivate-disks** [-f] [\--submit] [\--print-job-id] {*instance*}
1581

    
1582
De-activates the block devices of the given instance. Note that if you
1583
run this command for an instance with a drbd disk template, while it
1584
is running, it will not be able to shutdown the block devices on the
1585
primary node, but it will shutdown the block devices on the secondary
1586
nodes, thus breaking the replication.
1587

    
1588
The ``-f``/``--force`` option will skip checks that the instance is
1589
down; in case the hypervisor is confused and we can't talk to it,
1590
normally Ganeti will refuse to deactivate the disks, but with this
1591
option passed it will skip this check and directly try to deactivate
1592
the disks. This can still fail due to the instance actually running or
1593
other issues.
1594

    
1595
See **ganeti**\(7) for a description of ``--submit`` and other common
1596
options.
1597

    
1598
GROW-DISK
1599
^^^^^^^^^
1600

    
1601
| **grow-disk** [\--no-wait-for-sync] [\--submit] [\--print-job-id]
1602
| [\--absolute]
1603
| {*instance*} {*disk*} {*amount*}
1604

    
1605
Grows an instance's disk. This is only possible for instances having a
1606
plain, drbd, file, sharedfile, rbd or ext disk template. For the ext
1607
template to work, the ExtStorage provider should also support growing.
1608
This means having a ``grow`` script that actually grows the volume of
1609
the external shared storage.
1610

    
1611
Note that this command only change the block device size; it will not
1612
grow the actual filesystems, partitions, etc. that live on that
1613
disk. Usually, you will need to:
1614

    
1615
#. use **gnt-instance grow-disk**
1616

    
1617
#. reboot the instance (later, at a convenient time)
1618

    
1619
#. use a filesystem resizer, such as **ext2online**\(8) or
1620
   **xfs\_growfs**\(8) to resize the filesystem, or use **fdisk**\(8) to
1621
   change the partition table on the disk
1622

    
1623
The *disk* argument is the index of the instance disk to grow. The
1624
*amount* argument is given as a number which can have a suffix (like the
1625
disk size in instance create); if the suffix is missing, the value will
1626
be interpreted as mebibytes.
1627

    
1628
By default, the *amount* value represents the desired increase in the
1629
disk size (e.g. an amount of 1G will take a disk of size 3G to 4G). If
1630
the optional ``--absolute`` parameter is passed, then the *amount*
1631
argument doesn't represent the delta, but instead the desired final disk
1632
size (e.g. an amount of 8G will take a disk of size 4G to 8G).
1633

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

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

    
1642
See **ganeti**\(7) for a description of ``--submit`` and other common
1643
options.
1644

    
1645
Example (increase the first disk for instance1 by 16GiB)::
1646

    
1647
    # gnt-instance grow-disk instance1.example.com 0 16g
1648

    
1649
Example for increasing the disk size to a certain size::
1650

    
1651
   # gnt-instance grow-disk --absolute instance1.example.com 0 32g
1652

    
1653
Also note that disk shrinking is not supported; use **gnt-backup
1654
export** and then **gnt-backup import** to reduce the disk size of an
1655
instance.
1656

    
1657
RECREATE-DISKS
1658
^^^^^^^^^^^^^^
1659

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

    
1664
Recreates all or a subset of disks of the given instance.
1665

    
1666
Note that this functionality should only be used for missing disks; if
1667
any of the given disks already exists, the operation will fail.  While
1668
this is suboptimal, recreate-disks should hopefully not be needed in
1669
normal operation and as such the impact of this is low.
1670

    
1671
If only a subset should be recreated, any number of ``disk`` options can
1672
be specified. It expects a disk index and an optional list of disk
1673
parameters to change. Only ``size``, ``spindles``, and ``mode`` can be
1674
changed while recreating disks. To recreate all disks while changing
1675
parameters on a subset only, a ``--disk`` option must be given for every
1676
disk of the instance.
1677

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

    
1687
Another method of choosing which nodes to place the instance on is by
1688
using the specified iallocator, passing the ``--iallocator`` option.
1689
The primary and secondary nodes will be chosen by the specified
1690
iallocator plugin, or by the default allocator if ``.`` is specified.
1691

    
1692
See **ganeti**\(7) for a description of ``--submit`` and other common
1693
options.
1694

    
1695
Recovery/moving
1696
~~~~~~~~~~~~~~~
1697

    
1698
FAILOVER
1699
^^^^^^^^
1700

    
1701
| **failover** [-f] [\--ignore-consistency] [\--ignore-ipolicy]
1702
| [\--shutdown-timeout=*N*]
1703
| [{-n|\--target-node} *node* \| {-I|\--iallocator} *name*]
1704
| [\--cleanup]
1705
| [\--submit] [\--print-job-id]
1706
| {*instance*}
1707

    
1708
Failover will stop the instance (if running), change its primary node,
1709
and if it was originally running it will start it again (on the new
1710
primary). This works for instances with drbd template (in which case you
1711
can only fail to the secondary node) and for externally mirrored
1712
templates (sharedfile, blockdev, rbd and ext) (in which case you can
1713
fail to any other node).
1714

    
1715
If the instance's disk template is of type sharedfile, blockdev, rbd or
1716
ext, then you can explicitly specify the target node (which can be any
1717
node) using the ``-n`` or ``--target-node`` option, or specify an
1718
iallocator plugin using the ``-I`` or ``--iallocator`` option. If you
1719
omit both, the default iallocator will be used to specify the target
1720
node.
1721

    
1722
If the instance's disk template is of type drbd, the target node is
1723
automatically selected as the drbd's secondary node. Changing the
1724
secondary node is possible with a replace-disks operation.
1725

    
1726
Normally the failover will check the consistency of the disks before
1727
failing over the instance. If you are trying to migrate instances off
1728
a dead node, this will fail. Use the ``--ignore-consistency`` option
1729
for this purpose. Note that this option can be dangerous as errors in
1730
shutting down the instance will be ignored, resulting in possibly
1731
having the instance running on two machines in parallel (on
1732
disconnected DRBD drives).
1733

    
1734
The ``--shutdown-timeout`` is used to specify how much time to wait
1735
before forcing the shutdown (xm destroy in xen, killing the kvm
1736
process, for kvm). By default two minutes are given to each instance
1737
to stop.
1738

    
1739
If ``--ignore-ipolicy`` is given any instance policy violations occuring
1740
during this operation are ignored.
1741

    
1742
If the ``--cleanup`` option is passed, the operation changes from
1743
performin a failover to attempting recovery from a failed previous failover.
1744
In this mode, Ganeti checks if the instance runs on the correct node (and
1745
updates its configuration if not) and ensures the instances' disks
1746
are configured correctly.
1747

    
1748
See **ganeti**\(7) for a description of ``--submit`` and other common
1749
options.
1750

    
1751
Example::
1752

    
1753
    # gnt-instance failover instance1.example.com
1754

    
1755
For externally mirrored templates also ``-n`` is available::
1756

    
1757
    # gnt-instance failover -n node3.example.com instance1.example.com
1758

    
1759

    
1760
MIGRATE
1761
^^^^^^^
1762

    
1763
| **migrate** [-f] [\--allow-failover] [\--non-live]
1764
| [\--migration-mode=live\|non-live] [\--ignore-ipolicy]
1765
| [\--no-runtime-changes] [\--submit] [\--print-job-id]
1766
| [{-n|\--target-node} *node* \| {-I|\--iallocator} *name*] {*instance*}
1767

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

    
1770
Migrate will move the instance to its secondary node without shutdown.
1771
As with failover, it works for instances having the drbd disk template
1772
or an externally mirrored disk template type such as sharedfile,
1773
blockdev, rbd or ext.
1774

    
1775
If the instance's disk template is of type sharedfile, blockdev, rbd or
1776
ext, then you can explicitly specify the target node (which can be any
1777
node) using the ``-n`` or ``--target-node`` option, or specify an
1778
iallocator plugin using the ``-I`` or ``--iallocator`` option. If you
1779
omit both, the default iallocator will be used to specify the target
1780
node.  Alternatively, the default iallocator can be requested by
1781
specifying ``.`` as the name of the plugin.
1782

    
1783
If the instance's disk template is of type drbd, the target node is
1784
automatically selected as the drbd's secondary node. Changing the
1785
secondary node is possible with a replace-disks operation.
1786

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

    
1791
The ``--non-live`` and ``--migration-mode=non-live`` options will
1792
switch (for the hypervisors that support it) between a "fully live"
1793
(i.e. the interruption is as minimal as possible) migration and one in
1794
which the instance is frozen, its state saved and transported to the
1795
remote node, and then resumed there. This all depends on the
1796
hypervisor support for two different methods. In any case, it is not
1797
an error to pass this parameter (it will just be ignored if the
1798
hypervisor doesn't support it). The option ``--migration-mode=live``
1799
option will request a fully-live migration. The default, when neither
1800
option is passed, depends on the hypervisor parameters (and can be
1801
viewed with the **gnt-cluster info** command).
1802

    
1803
If the ``--cleanup`` option is passed, the operation changes from
1804
migration to attempting recovery from a failed previous migration. In
1805
this mode, Ganeti checks if the instance runs on the correct node (and
1806
updates its configuration if not) and ensures the instances' disks
1807
are configured correctly. In this mode, the ``--non-live`` option is
1808
ignored.
1809

    
1810
The option ``-f`` will skip the prompting for confirmation.
1811

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

    
1817
If ``--ignore-ipolicy`` is given any instance policy violations occuring
1818
during this operation are ignored.
1819

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

    
1824
If an instance has the backend parameter ``always_failover`` set to
1825
true, then the migration is automatically converted into a failover.
1826

    
1827
See **ganeti**\(7) for a description of ``--submit`` and other common
1828
options.
1829

    
1830
Example (and expected output)::
1831

    
1832
    # gnt-instance migrate instance1
1833
    Instance instance1 will be migrated. Note that migration
1834
    might impact the instance if anything goes wrong (e.g. due to bugs in
1835
    the hypervisor). Continue?
1836
    y/[n]/?: y
1837
    Migrating instance instance1.example.com
1838
    * checking disk consistency between source and target
1839
    * switching node node2.example.com to secondary mode
1840
    * changing into standalone mode
1841
    * changing disks into dual-master mode
1842
    * wait until resync is done
1843
    * preparing node2.example.com to accept the instance
1844
    * migrating instance to node2.example.com
1845
    * switching node node1.example.com to secondary mode
1846
    * wait until resync is done
1847
    * changing into standalone mode
1848
    * changing disks into single-master mode
1849
    * wait until resync is done
1850
    * done
1851
    #
1852

    
1853

    
1854
MOVE
1855
^^^^
1856

    
1857
| **move** [-f] [\--ignore-consistency]
1858
| [-n *node*] [\--shutdown-timeout=*N*] [\--submit] [\--print-job-id]
1859
| [\--ignore-ipolicy]
1860
| {*instance*}
1861

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

    
1865
Note that since this operation is done via data copy, it will take a
1866
long time for big disks (similar to replace-disks for a drbd
1867
instance).
1868

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

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

    
1878
If ``--ignore-ipolicy`` is given any instance policy violations occuring
1879
during this operation are ignored.
1880

    
1881
See **ganeti**\(7) for a description of ``--submit`` and other common
1882
options.
1883

    
1884
Example::
1885

    
1886
    # gnt-instance move -n node3.example.com instance1.example.com
1887

    
1888

    
1889
CHANGE-GROUP
1890
^^^^^^^^^^^^
1891

    
1892
| **change-group** [\--submit] [\--print-job-id]
1893
| [\--iallocator *NAME*] [\--to *GROUP*...] {*instance*}
1894

    
1895
This command moves an instance to another node group. The move is
1896
calculated by an iallocator, either given on the command line or as a
1897
cluster default.
1898

    
1899
If no specific destination groups are specified using ``--to``, all
1900
groups except the one containing the instance are considered.
1901

    
1902
See **ganeti**\(7) for a description of ``--submit`` and other common
1903
options.
1904

    
1905
Example::
1906

    
1907
    # gnt-instance change-group -I hail --to rack2 inst1.example.com
1908

    
1909

    
1910
Tags
1911
~~~~
1912

    
1913
ADD-TAGS
1914
^^^^^^^^
1915

    
1916
**add-tags** [\--from *file*] {*instancename*} {*tag*...}
1917

    
1918
Add tags to the given instance. If any of the tags contains invalid
1919
characters, the entire operation will abort.
1920

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

    
1927
LIST-TAGS
1928
^^^^^^^^^
1929

    
1930
**list-tags** {*instancename*}
1931

    
1932
List the tags of the given instance.
1933

    
1934
REMOVE-TAGS
1935
^^^^^^^^^^^
1936

    
1937
**remove-tags** [\--from *file*] {*instancename*} {*tag*...}
1938

    
1939
Remove tags from the given instance. If any of the tags are not
1940
existing on the node, the entire operation will abort.
1941

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

    
1948
.. vim: set textwidth=72 :
1949
.. Local Variables:
1950
.. mode: rst
1951
.. fill-column: 72
1952
.. End: