Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.rst @ 2237687b

History | View | Annotate | Download (49 kB)

1 1b7f2c85 Iustin Pop
gnt-instance(8) Ganeti | Version @GANETI_VERSION@
2 1b7f2c85 Iustin Pop
=================================================
3 1b7f2c85 Iustin Pop
4 1b7f2c85 Iustin Pop
Name
5 1b7f2c85 Iustin Pop
----
6 1b7f2c85 Iustin Pop
7 1b7f2c85 Iustin Pop
gnt-instance - Ganeti instance administration
8 1b7f2c85 Iustin Pop
9 1b7f2c85 Iustin Pop
Synopsis
10 1b7f2c85 Iustin Pop
--------
11 1b7f2c85 Iustin Pop
12 1b7f2c85 Iustin Pop
**gnt-instance** {command} [arguments...]
13 1b7f2c85 Iustin Pop
14 1b7f2c85 Iustin Pop
DESCRIPTION
15 1b7f2c85 Iustin Pop
-----------
16 1b7f2c85 Iustin Pop
17 1b7f2c85 Iustin Pop
The **gnt-instance** command is used for instance administration in
18 1b7f2c85 Iustin Pop
the Ganeti system.
19 1b7f2c85 Iustin Pop
20 1b7f2c85 Iustin Pop
COMMANDS
21 1b7f2c85 Iustin Pop
--------
22 1b7f2c85 Iustin Pop
23 1b7f2c85 Iustin Pop
Creation/removal/querying
24 1b7f2c85 Iustin Pop
~~~~~~~~~~~~~~~~~~~~~~~~~
25 1b7f2c85 Iustin Pop
26 1b7f2c85 Iustin Pop
ADD
27 1b7f2c85 Iustin Pop
^^^
28 1b7f2c85 Iustin Pop
29 1b7f2c85 Iustin Pop
| **add**
30 1b7f2c85 Iustin Pop
| {-t {diskless | file \| plain \| drbd}}
31 7af3534e Dmitry Chernyak
| {--disk=*N*: {size=*VAL* \| adopt=*LV*}[,vg=*VG*][,mode=*ro\|rw*]
32 7af3534e Dmitry Chernyak
|  \| -s *SIZE*}
33 1b7f2c85 Iustin Pop
| [--no-ip-check] [--no-name-check] [--no-start] [--no-install]
34 1b7f2c85 Iustin Pop
| [--net=*N* [:options...] \| --no-nics]
35 1b7f2c85 Iustin Pop
| [-B *BEPARAMS*]
36 1b7f2c85 Iustin Pop
| [-H *HYPERVISOR* [: option=*value*... ]]
37 1b7f2c85 Iustin Pop
| [--file-storage-dir *dir\_path*] [--file-driver {loop \| blktap}]
38 1b7f2c85 Iustin Pop
| {-n *node[:secondary-node]* \| --iallocator *name*}
39 1b7f2c85 Iustin Pop
| {-o *os-type*}
40 1b7f2c85 Iustin Pop
| [--submit]
41 1b7f2c85 Iustin Pop
| {*instance*}
42 1b7f2c85 Iustin Pop
43 1b7f2c85 Iustin Pop
Creates a new instance on the specified host. The *instance* argument
44 1b7f2c85 Iustin Pop
must be in DNS, but depending on the bridge/routing setup, need not be
45 1b7f2c85 Iustin Pop
in the same network as the nodes in the cluster.
46 1b7f2c85 Iustin Pop
47 1b7f2c85 Iustin Pop
The ``disk`` option specifies the parameters for the disks of the
48 1b7f2c85 Iustin Pop
instance. The numbering of disks starts at zero, and at least one disk
49 1b7f2c85 Iustin Pop
needs to be passed. For each disk, either the size or the adoption
50 1b7f2c85 Iustin Pop
source needs to be given, and optionally the access mode (read-only or
51 7af3534e Dmitry Chernyak
the default of read-write) and LVM volume group can also be specified.
52 7af3534e Dmitry Chernyak
The size is interpreted (when no unit is given) in mebibytes. You can
53 7af3534e Dmitry Chernyak
also use one of the suffixes *m*, *g* or *t* to specify the exact the
54 7af3534e Dmitry Chernyak
units used; these suffixes map to mebibytes, gibibytes and tebibytes.
55 1b7f2c85 Iustin Pop
56 1b7f2c85 Iustin Pop
When using the ``adopt`` key in the disk definition, Ganeti will
57 1b7f2c85 Iustin Pop
reuse those volumes (instead of creating new ones) as the
58 1b7f2c85 Iustin Pop
instance's disks. Ganeti will rename these volumes to the standard
59 1b7f2c85 Iustin Pop
format, and (without installing the OS) will use them as-is for the
60 1b7f2c85 Iustin Pop
instance. This allows migrating instances from non-managed mode
61 1b7f2c85 Iustin Pop
(e.q. plain KVM with LVM) to being managed via Ganeti. Note that
62 1b7f2c85 Iustin Pop
this works only for the \`plain' disk template (see below for
63 1b7f2c85 Iustin Pop
template details).
64 1b7f2c85 Iustin Pop
65 1b7f2c85 Iustin Pop
Alternatively, a single-disk instance can be created via the ``-s``
66 1b7f2c85 Iustin Pop
option which takes a single argument, the size of the disk. This is
67 1b7f2c85 Iustin Pop
similar to the Ganeti 1.2 version (but will only create one disk).
68 1b7f2c85 Iustin Pop
69 1b7f2c85 Iustin Pop
The minimum disk specification is therefore ``--disk 0:size=20G`` (or
70 1b7f2c85 Iustin Pop
``-s 20G`` when using the ``-s`` option), and a three-disk instance
71 1b7f2c85 Iustin Pop
can be specified as ``--disk 0:size=20G --disk 1:size=4G --disk
72 1b7f2c85 Iustin Pop
2:size=100G``.
73 1b7f2c85 Iustin Pop
74 1b7f2c85 Iustin Pop
The ``--no-ip-check`` skips the checks that are done to see if the
75 1b7f2c85 Iustin Pop
instance's IP is not already alive (i.e. reachable from the master
76 1b7f2c85 Iustin Pop
node).
77 1b7f2c85 Iustin Pop
78 1b7f2c85 Iustin Pop
The ``--no-name-check`` skips the check for the instance name via
79 1b7f2c85 Iustin Pop
the resolver (e.g. in DNS or /etc/hosts, depending on your setup).
80 1b7f2c85 Iustin Pop
Since the name check is used to compute the IP address, if you pass
81 1b7f2c85 Iustin Pop
this option you must also pass the ``--no-ip-check`` option.
82 1b7f2c85 Iustin Pop
83 1b7f2c85 Iustin Pop
If you don't wat the instance to automatically start after
84 1b7f2c85 Iustin Pop
creation, this is possible via the ``--no-start`` option. This will
85 1b7f2c85 Iustin Pop
leave the instance down until a subsequent **gnt-instance start**
86 1b7f2c85 Iustin Pop
command.
87 1b7f2c85 Iustin Pop
88 1b7f2c85 Iustin Pop
The NICs of the instances can be specified via the ``--net``
89 1b7f2c85 Iustin Pop
option. By default, one NIC is created for the instance, with a
90 1b7f2c85 Iustin Pop
random MAC, and set up according the the cluster level nic
91 1b7f2c85 Iustin Pop
parameters. Each NIC can take these parameters (all optional):
92 1b7f2c85 Iustin Pop
93 1b7f2c85 Iustin Pop
94 1b7f2c85 Iustin Pop
95 1b7f2c85 Iustin Pop
mac
96 1b7f2c85 Iustin Pop
    either a value or 'generate' to generate a new unique MAC
97 1b7f2c85 Iustin Pop
98 1b7f2c85 Iustin Pop
ip
99 1b7f2c85 Iustin Pop
    specifies the IP address assigned to the instance from the Ganeti
100 1b7f2c85 Iustin Pop
    side (this is not necessarily what the instance will use, but what
101 1b7f2c85 Iustin Pop
    the node expects the instance to use)
102 1b7f2c85 Iustin Pop
103 1b7f2c85 Iustin Pop
mode
104 1b7f2c85 Iustin Pop
    specifies the connection mode for this nic: routed or bridged.
105 1b7f2c85 Iustin Pop
106 1b7f2c85 Iustin Pop
link
107 1b7f2c85 Iustin Pop
    in bridged mode specifies the bridge to attach this NIC to, in
108 1b7f2c85 Iustin Pop
    routed mode it's intended to differentiate between different
109 1b7f2c85 Iustin Pop
    routing tables/instance groups (but the meaning is dependent on the
110 1b7f2c85 Iustin Pop
    network script, see gnt-cluster(8) for more details)
111 1b7f2c85 Iustin Pop
112 1b7f2c85 Iustin Pop
113 1b7f2c85 Iustin Pop
Of these "mode" and "link" are nic parameters, and inherit their
114 1b7f2c85 Iustin Pop
default at cluster level.
115 1b7f2c85 Iustin Pop
Alternatively, if no network is desired for the instance, you can
116 1b7f2c85 Iustin Pop
prevent the default of one NIC with the ``--no-nics`` option.
117 1b7f2c85 Iustin Pop
118 1b7f2c85 Iustin Pop
The ``-o`` options specifies the operating system to be installed.
119 1b7f2c85 Iustin Pop
The available operating systems can be listed with **gnt-os list**.
120 1b7f2c85 Iustin Pop
Passing ``--no-install`` will however skip the OS installation,
121 1b7f2c85 Iustin Pop
allowing a manual import if so desired. Note that the
122 1b7f2c85 Iustin Pop
no-installation mode will automatically disable the start-up of the
123 1b7f2c85 Iustin Pop
instance (without an OS, it most likely won't be able to start-up
124 1b7f2c85 Iustin Pop
successfully).
125 1b7f2c85 Iustin Pop
126 1b7f2c85 Iustin Pop
The ``-B`` option specifies the backend parameters for the
127 1b7f2c85 Iustin Pop
instance. If no such parameters are specified, the values are
128 1b7f2c85 Iustin Pop
inherited from the cluster. Possible parameters are:
129 1b7f2c85 Iustin Pop
130 1b7f2c85 Iustin Pop
131 1b7f2c85 Iustin Pop
132 1b7f2c85 Iustin Pop
memory
133 1b7f2c85 Iustin Pop
    the memory size of the instance; as usual, suffixes can be used to
134 1b7f2c85 Iustin Pop
    denote the unit, otherwise the value is taken in mebibites
135 1b7f2c85 Iustin Pop
136 1b7f2c85 Iustin Pop
vcpus
137 1b7f2c85 Iustin Pop
    the number of VCPUs to assign to the instance (if this value makes
138 1b7f2c85 Iustin Pop
    sense for the hypervisor)
139 1b7f2c85 Iustin Pop
140 1b7f2c85 Iustin Pop
auto\_balance
141 1b7f2c85 Iustin Pop
    whether the instance is considered in the N+1 cluster checks
142 1b7f2c85 Iustin Pop
    (enough redundancy in the cluster to survive a node failure)
143 1b7f2c85 Iustin Pop
144 1b7f2c85 Iustin Pop
145 1b7f2c85 Iustin Pop
The ``-H`` option specified the hypervisor to use for the instance
146 1b7f2c85 Iustin Pop
(must be one of the enabled hypervisors on the cluster) and
147 1b7f2c85 Iustin Pop
optionally custom parameters for this instance. If not other
148 1b7f2c85 Iustin Pop
options are used (i.e. the invocation is just -H *NAME*) the
149 1b7f2c85 Iustin Pop
instance will inherit the cluster options. The defaults below show
150 1b7f2c85 Iustin Pop
the cluster defaults at cluster creation time.
151 1b7f2c85 Iustin Pop
152 1b7f2c85 Iustin Pop
The possible hypervisor options are as follows:
153 1b7f2c85 Iustin Pop
154 1b7f2c85 Iustin Pop
155 1b7f2c85 Iustin Pop
156 1b7f2c85 Iustin Pop
boot\_order
157 1b7f2c85 Iustin Pop
    Valid for the Xen HVM and KVM hypervisors.
158 1b7f2c85 Iustin Pop
159 1b7f2c85 Iustin Pop
    A string value denoting the boot order. This has different meaning
160 1b7f2c85 Iustin Pop
    for the Xen HVM hypervisor and for the KVM one.
161 1b7f2c85 Iustin Pop
162 1b7f2c85 Iustin Pop
    For Xen HVM, The boot order is a string of letters listing the boot
163 1b7f2c85 Iustin Pop
    devices, with valid device letters being:
164 1b7f2c85 Iustin Pop
165 1b7f2c85 Iustin Pop
166 1b7f2c85 Iustin Pop
167 1b7f2c85 Iustin Pop
    a
168 1b7f2c85 Iustin Pop
        floppy drive
169 1b7f2c85 Iustin Pop
170 1b7f2c85 Iustin Pop
    c
171 1b7f2c85 Iustin Pop
        hard disk
172 1b7f2c85 Iustin Pop
173 1b7f2c85 Iustin Pop
    d
174 1b7f2c85 Iustin Pop
        CDROM drive
175 1b7f2c85 Iustin Pop
176 1b7f2c85 Iustin Pop
    n
177 1b7f2c85 Iustin Pop
        network boot (PXE)
178 1b7f2c85 Iustin Pop
179 1b7f2c85 Iustin Pop
180 1b7f2c85 Iustin Pop
    The default is not to set an HVM boot order which is interpreted as
181 1b7f2c85 Iustin Pop
    'dc'.
182 1b7f2c85 Iustin Pop
183 1b7f2c85 Iustin Pop
    For KVM the boot order is either "cdrom", "disk" or "network".
184 1b7f2c85 Iustin Pop
    Please note that older versions of KVM couldn't netboot from virtio
185 1b7f2c85 Iustin Pop
    interfaces. This has been fixed in more recent versions and is
186 1b7f2c85 Iustin Pop
    confirmed to work at least with qemu-kvm 0.11.1.
187 1b7f2c85 Iustin Pop
188 525011bc Maciej Bliziล„ski
blockdev\_prefix
189 525011bc Maciej Bliziล„ski
    Valid for the Xen HVM and PVM hypervisors.
190 525011bc Maciej Bliziล„ski
191 525011bc Maciej Bliziล„ski
    Relevant to nonpvops guest kernels, in which the disk device names are
192 525011bc Maciej Bliziล„ski
    given by the host.  Allows to specify 'xvd', which helps run Red Hat based
193 525011bc Maciej Bliziล„ski
    installers, driven by anaconda.
194 525011bc Maciej Bliziล„ski
195 1b7f2c85 Iustin Pop
cdrom\_image\_path
196 1b7f2c85 Iustin Pop
    Valid for the Xen HVM and KVM hypervisors.
197 1b7f2c85 Iustin Pop
198 1b7f2c85 Iustin Pop
    The path to a CDROM image to attach to the instance.
199 1b7f2c85 Iustin Pop
200 1b7f2c85 Iustin Pop
nic\_type
201 1b7f2c85 Iustin Pop
    Valid for the Xen HVM and KVM hypervisors.
202 1b7f2c85 Iustin Pop
203 1b7f2c85 Iustin Pop
    This parameter determines the way the network cards are presented
204 1b7f2c85 Iustin Pop
    to the instance. The possible options are:
205 1b7f2c85 Iustin Pop
206 1b7f2c85 Iustin Pop
207 1b7f2c85 Iustin Pop
208 1b7f2c85 Iustin Pop
    rtl8139 (default for Xen HVM) (HVM & KVM)
209 1b7f2c85 Iustin Pop
    ne2k\_isa (HVM & KVM)
210 1b7f2c85 Iustin Pop
    ne2k\_pci (HVM & KVM)
211 1b7f2c85 Iustin Pop
    i82551 (KVM)
212 1b7f2c85 Iustin Pop
    i82557b (KVM)
213 1b7f2c85 Iustin Pop
    i82559er (KVM)
214 1b7f2c85 Iustin Pop
    pcnet (KVM)
215 1b7f2c85 Iustin Pop
    e1000 (KVM)
216 1b7f2c85 Iustin Pop
    paravirtual (default for KVM) (HVM & KVM)
217 1b7f2c85 Iustin Pop
218 1b7f2c85 Iustin Pop
219 1b7f2c85 Iustin Pop
disk\_type
220 1b7f2c85 Iustin Pop
    Valid for the Xen HVM and KVM hypervisors.
221 1b7f2c85 Iustin Pop
222 1b7f2c85 Iustin Pop
    This parameter determines the way the disks are presented to the
223 1b7f2c85 Iustin Pop
    instance. The possible options are:
224 1b7f2c85 Iustin Pop
225 1b7f2c85 Iustin Pop
226 1b7f2c85 Iustin Pop
227 1b7f2c85 Iustin Pop
    ioemu (default for HVM & KVM) (HVM & KVM)
228 1b7f2c85 Iustin Pop
    ide (HVM & KVM)
229 1b7f2c85 Iustin Pop
    scsi (KVM)
230 1b7f2c85 Iustin Pop
    sd (KVM)
231 1b7f2c85 Iustin Pop
    mtd (KVM)
232 1b7f2c85 Iustin Pop
    pflash (KVM)
233 1b7f2c85 Iustin Pop
234 1b7f2c85 Iustin Pop
235 1b7f2c85 Iustin Pop
vnc\_bind\_address
236 1b7f2c85 Iustin Pop
    Valid for the Xen HVM and KVM hypervisors.
237 1b7f2c85 Iustin Pop
238 1b7f2c85 Iustin Pop
    Specifies the address that the VNC listener for this instance
239 1b7f2c85 Iustin Pop
    should bind to. Valid values are IPv4 addresses. Use the address
240 1b7f2c85 Iustin Pop
    0.0.0.0 to bind to all available interfaces (this is the default)
241 1b7f2c85 Iustin Pop
    or specify the address of one of the interfaces on the node to
242 1b7f2c85 Iustin Pop
    restrict listening to that interface.
243 1b7f2c85 Iustin Pop
244 1b7f2c85 Iustin Pop
vnc\_tls
245 1b7f2c85 Iustin Pop
    Valid for the KVM hypervisor.
246 1b7f2c85 Iustin Pop
247 1b7f2c85 Iustin Pop
    A boolean option that controls whether the VNC connection is
248 1b7f2c85 Iustin Pop
    secured with TLS.
249 1b7f2c85 Iustin Pop
250 1b7f2c85 Iustin Pop
vnc\_x509\_path
251 1b7f2c85 Iustin Pop
    Valid for the KVM hypervisor.
252 1b7f2c85 Iustin Pop
253 1b7f2c85 Iustin Pop
    If ``vnc_tls`` is enabled, this options specifies the path to the
254 1b7f2c85 Iustin Pop
    x509 certificate to use.
255 1b7f2c85 Iustin Pop
256 1b7f2c85 Iustin Pop
vnc\_x509\_verify
257 1b7f2c85 Iustin Pop
    Valid for the KVM hypervisor.
258 1b7f2c85 Iustin Pop
259 1b7f2c85 Iustin Pop
acpi
260 1b7f2c85 Iustin Pop
    Valid for the Xen HVM and KVM hypervisors.
261 1b7f2c85 Iustin Pop
262 1b7f2c85 Iustin Pop
    A boolean option that specifies if the hypervisor should enable
263 1b7f2c85 Iustin Pop
    ACPI support for this instance. By default, ACPI is disabled.
264 1b7f2c85 Iustin Pop
265 1b7f2c85 Iustin Pop
pae
266 1b7f2c85 Iustin Pop
    Valid for the Xen HVM and KVM hypervisors.
267 1b7f2c85 Iustin Pop
268 1b7f2c85 Iustin Pop
    A boolean option that specifies if the hypervisor should enabled
269 1b7f2c85 Iustin Pop
    PAE support for this instance. The default is false, disabling PAE
270 1b7f2c85 Iustin Pop
    support.
271 1b7f2c85 Iustin Pop
272 1b7f2c85 Iustin Pop
use\_localtime
273 1b7f2c85 Iustin Pop
    Valid for the Xen HVM and KVM hypervisors.
274 1b7f2c85 Iustin Pop
275 1b7f2c85 Iustin Pop
    A boolean option that specifies if the instance should be started
276 1b7f2c85 Iustin Pop
    with its clock set to the localtime of the machine (when true) or
277 1b7f2c85 Iustin Pop
    to the UTC (When false). The default is false, which is useful for
278 1b7f2c85 Iustin Pop
    Linux/Unix machines; for Windows OSes, it is recommended to enable
279 1b7f2c85 Iustin Pop
    this parameter.
280 1b7f2c85 Iustin Pop
281 1b7f2c85 Iustin Pop
kernel\_path
282 1b7f2c85 Iustin Pop
    Valid for the Xen PVM and KVM hypervisors.
283 1b7f2c85 Iustin Pop
284 1b7f2c85 Iustin Pop
    This option specifies the path (on the node) to the kernel to boot
285 1b7f2c85 Iustin Pop
    the instance with. Xen PVM instances always require this, while for
286 1b7f2c85 Iustin Pop
    KVM if this option is empty, it will cause the machine to load the
287 1b7f2c85 Iustin Pop
    kernel from its disks.
288 1b7f2c85 Iustin Pop
289 1b7f2c85 Iustin Pop
kernel\_args
290 1b7f2c85 Iustin Pop
    Valid for the Xen PVM and KVM hypervisors.
291 1b7f2c85 Iustin Pop
292 1b7f2c85 Iustin Pop
    This options specifies extra arguments to the kernel that will be
293 1b7f2c85 Iustin Pop
    loaded. device. This is always used for Xen PVM, while for KVM it
294 1b7f2c85 Iustin Pop
    is only used if the ``kernel_path`` option is also specified.
295 1b7f2c85 Iustin Pop
296 1b7f2c85 Iustin Pop
    The default setting for this value is simply ``"ro"``, which mounts
297 1b7f2c85 Iustin Pop
    the root disk (initially) in read-only one. For example, setting
298 1b7f2c85 Iustin Pop
    this to single will cause the instance to start in single-user
299 1b7f2c85 Iustin Pop
    mode.
300 1b7f2c85 Iustin Pop
301 1b7f2c85 Iustin Pop
initrd\_path
302 1b7f2c85 Iustin Pop
    Valid for the Xen PVM and KVM hypervisors.
303 1b7f2c85 Iustin Pop
304 1b7f2c85 Iustin Pop
    This option specifies the path (on the node) to the initrd to boot
305 1b7f2c85 Iustin Pop
    the instance with. Xen PVM instances can use this always, while for
306 1b7f2c85 Iustin Pop
    KVM if this option is only used if the ``kernel_path`` option is
307 1b7f2c85 Iustin Pop
    also specified. You can pass here either an absolute filename (the
308 1b7f2c85 Iustin Pop
    path to the initrd) if you want to use an initrd, or use the format
309 1b7f2c85 Iustin Pop
    no\_initrd\_path for no initrd.
310 1b7f2c85 Iustin Pop
311 1b7f2c85 Iustin Pop
root\_path
312 1b7f2c85 Iustin Pop
    Valid for the Xen PVM and KVM hypervisors.
313 1b7f2c85 Iustin Pop
314 1b7f2c85 Iustin Pop
    This options specifies the name of the root device. This is always
315 1b7f2c85 Iustin Pop
    needed for Xen PVM, while for KVM it is only used if the
316 1b7f2c85 Iustin Pop
    ``kernel_path`` option is also specified.
317 1b7f2c85 Iustin Pop
318 1b7f2c85 Iustin Pop
serial\_console
319 1b7f2c85 Iustin Pop
    Valid for the KVM hypervisor.
320 1b7f2c85 Iustin Pop
321 1b7f2c85 Iustin Pop
    This boolean option specifies whether to emulate a serial console
322 1b7f2c85 Iustin Pop
    for the instance.
323 1b7f2c85 Iustin Pop
324 1b7f2c85 Iustin Pop
disk\_cache
325 1b7f2c85 Iustin Pop
    Valid for the KVM hypervisor.
326 1b7f2c85 Iustin Pop
327 1b7f2c85 Iustin Pop
    The disk cache mode. It can be either default to not pass any cache
328 1b7f2c85 Iustin Pop
    option to KVM, or one of the KVM cache modes: none (for direct
329 1b7f2c85 Iustin Pop
    I/O), writethrough (to use the host cache but report completion to
330 1b7f2c85 Iustin Pop
    the guest only when the host has committed the changes to disk) or
331 1b7f2c85 Iustin Pop
    writeback (to use the host cache and report completion as soon as
332 1b7f2c85 Iustin Pop
    the data is in the host cache). Note that there are special
333 1b7f2c85 Iustin Pop
    considerations for the cache mode depending on version of KVM used
334 1b7f2c85 Iustin Pop
    and disk type (always raw file under Ganeti), please refer to the
335 1b7f2c85 Iustin Pop
    KVM documentation for more details.
336 1b7f2c85 Iustin Pop
337 1b7f2c85 Iustin Pop
security\_model
338 1b7f2c85 Iustin Pop
    Valid for the KVM hypervisor.
339 1b7f2c85 Iustin Pop
340 1b7f2c85 Iustin Pop
    The security model for kvm. Currently one of "none", "user" or
341 1b7f2c85 Iustin Pop
    "pool". Under "none", the default, nothing is done and instances
342 1b7f2c85 Iustin Pop
    are run as the Ganeti daemon user (normally root).
343 1b7f2c85 Iustin Pop
344 1b7f2c85 Iustin Pop
    Under "user" kvm will drop privileges and become the user specified
345 1b7f2c85 Iustin Pop
    by the security\_domain parameter.
346 1b7f2c85 Iustin Pop
347 1b7f2c85 Iustin Pop
    Under "pool" a global cluster pool of users will be used, making
348 1b7f2c85 Iustin Pop
    sure no two instances share the same user on the same node. (this
349 1b7f2c85 Iustin Pop
    mode is not implemented yet)
350 1b7f2c85 Iustin Pop
351 1b7f2c85 Iustin Pop
security\_domain
352 1b7f2c85 Iustin Pop
    Valid for the KVM hypervisor.
353 1b7f2c85 Iustin Pop
354 1b7f2c85 Iustin Pop
    Under security model "user" the username to run the instance under.
355 1b7f2c85 Iustin Pop
    It must be a valid username existing on the host.
356 1b7f2c85 Iustin Pop
357 1b7f2c85 Iustin Pop
    Cannot be set under security model "none" or "pool".
358 1b7f2c85 Iustin Pop
359 1b7f2c85 Iustin Pop
kvm\_flag
360 1b7f2c85 Iustin Pop
    Valid for the KVM hypervisor.
361 1b7f2c85 Iustin Pop
362 1b7f2c85 Iustin Pop
    If "enabled" the -enable-kvm flag is passed to kvm. If "disabled"
363 1b7f2c85 Iustin Pop
    -disable-kvm is passed. If unset no flag is passed, and the default
364 1b7f2c85 Iustin Pop
    running mode for your kvm binary will be used.
365 1b7f2c85 Iustin Pop
366 1b7f2c85 Iustin Pop
mem\_path
367 1b7f2c85 Iustin Pop
    Valid for the KVM hypervisor.
368 1b7f2c85 Iustin Pop
369 1b7f2c85 Iustin Pop
    This option passes the -mem-path argument to kvm with the path (on
370 1b7f2c85 Iustin Pop
    the node) to the mount point of the hugetlbfs file system, along
371 1b7f2c85 Iustin Pop
    with the -mem-prealloc argument too.
372 1b7f2c85 Iustin Pop
373 1b7f2c85 Iustin Pop
use\_chroot
374 1b7f2c85 Iustin Pop
    Valid for the KVM hypervisor.
375 1b7f2c85 Iustin Pop
376 1b7f2c85 Iustin Pop
    This boolean option determines wether to run the KVM instance in a
377 1b7f2c85 Iustin Pop
    chroot directory.
378 1b7f2c85 Iustin Pop
379 1b7f2c85 Iustin Pop
    If it is set to ``true``, an empty directory is created before
380 1b7f2c85 Iustin Pop
    starting the instance and its path is passed via the -chroot flag
381 1b7f2c85 Iustin Pop
    to kvm. The directory is removed when the instance is stopped.
382 1b7f2c85 Iustin Pop
383 1b7f2c85 Iustin Pop
    It is set to ``false`` by default.
384 1b7f2c85 Iustin Pop
385 1b7f2c85 Iustin Pop
migration\_downtime
386 1b7f2c85 Iustin Pop
    Valid for the KVM hypervisor.
387 1b7f2c85 Iustin Pop
388 1b7f2c85 Iustin Pop
    The maximum amount of time (in ms) a KVM instance is allowed to be
389 1b7f2c85 Iustin Pop
    frozen during a live migration, in order to copy dirty memory
390 1b7f2c85 Iustin Pop
    pages. Default value is 30ms, but you may need to increase this
391 1b7f2c85 Iustin Pop
    value for busy instances.
392 1b7f2c85 Iustin Pop
393 1b7f2c85 Iustin Pop
    This option is only effective with kvm versions >= 87 and qemu-kvm
394 1b7f2c85 Iustin Pop
    versions >= 0.11.0.
395 1b7f2c85 Iustin Pop
396 1b7f2c85 Iustin Pop
cpu\_mask
397 1b7f2c85 Iustin Pop
    Valid for the LXC hypervisor.
398 1b7f2c85 Iustin Pop
399 1b7f2c85 Iustin Pop
    The processes belonging to the given instance are only scheduled on
400 1b7f2c85 Iustin Pop
    the specified CPUs.
401 1b7f2c85 Iustin Pop
402 1b7f2c85 Iustin Pop
    The parameter format is a comma-separated list of CPU IDs or CPU ID
403 1b7f2c85 Iustin Pop
    ranges. The ranges are defined by a lower and higher boundary,
404 1b7f2c85 Iustin Pop
    separated by a dash. The boundaries are inclusive.
405 1b7f2c85 Iustin Pop
406 1b7f2c85 Iustin Pop
usb\_mouse
407 1b7f2c85 Iustin Pop
    Valid for the KVM hypervisor.
408 1b7f2c85 Iustin Pop
409 1b7f2c85 Iustin Pop
    This option specifies the usb mouse type to be used. It can be
410 1b7f2c85 Iustin Pop
    "mouse" or "tablet". When using VNC it's recommended to set it to
411 1b7f2c85 Iustin Pop
    "tablet".
412 1b7f2c85 Iustin Pop
413 1b7f2c85 Iustin Pop
414 1b7f2c85 Iustin Pop
The ``--iallocator`` option specifies the instance allocator plugin
415 1b7f2c85 Iustin Pop
to use. If you pass in this option the allocator will select nodes
416 1b7f2c85 Iustin Pop
for this instance automatically, so you don't need to pass them
417 1b7f2c85 Iustin Pop
with the ``-n`` option. For more information please refer to the
418 1b7f2c85 Iustin Pop
instance allocator documentation.
419 1b7f2c85 Iustin Pop
420 1b7f2c85 Iustin Pop
The ``-t`` options specifies the disk layout type for the instance.
421 1b7f2c85 Iustin Pop
The available choices are:
422 1b7f2c85 Iustin Pop
423 1b7f2c85 Iustin Pop
424 1b7f2c85 Iustin Pop
425 1b7f2c85 Iustin Pop
diskless
426 1b7f2c85 Iustin Pop
    This creates an instance with no disks. Its useful for testing only
427 1b7f2c85 Iustin Pop
    (or other special cases).
428 1b7f2c85 Iustin Pop
429 1b7f2c85 Iustin Pop
file
430 1b7f2c85 Iustin Pop
    Disk devices will be regular files.
431 1b7f2c85 Iustin Pop
432 1b7f2c85 Iustin Pop
plain
433 1b7f2c85 Iustin Pop
    Disk devices will be logical volumes.
434 1b7f2c85 Iustin Pop
435 1b7f2c85 Iustin Pop
drbd
436 1b7f2c85 Iustin Pop
    Disk devices will be drbd (version 8.x) on top of lvm volumes.
437 1b7f2c85 Iustin Pop
438 1b7f2c85 Iustin Pop
439 1b7f2c85 Iustin Pop
The optional second value of the ``--node`` is used for the drbd
440 1b7f2c85 Iustin Pop
template type and specifies the remote node.
441 1b7f2c85 Iustin Pop
442 1b7f2c85 Iustin Pop
If you do not want gnt-instance to wait for the disk mirror to be
443 1b7f2c85 Iustin Pop
synced, use the ``--no-wait-for-sync`` option.
444 1b7f2c85 Iustin Pop
445 1b7f2c85 Iustin Pop
The ``--file-storage-dir`` specifies the relative path under the
446 56956bcb Iustin Pop
cluster-wide file storage directory to store file-based disks. It is
447 56956bcb Iustin Pop
useful for having different subdirectories for different
448 1b7f2c85 Iustin Pop
instances. The full path of the directory where the disk files are
449 56956bcb Iustin Pop
stored will consist of cluster-wide file storage directory + optional
450 56956bcb Iustin Pop
subdirectory + instance name. Example:
451 56956bcb Iustin Pop
``@RPL_FILE_STORAGE_DIR@``*/mysubdir/instance1.example.com*. This
452 56956bcb Iustin Pop
option is only relevant for instances using the file storage backend.
453 1b7f2c85 Iustin Pop
454 1b7f2c85 Iustin Pop
The ``--file-driver`` specifies the driver to use for file-based
455 1b7f2c85 Iustin Pop
disks. Note that currently these drivers work with the xen
456 1b7f2c85 Iustin Pop
hypervisor only. This option is only relevant for instances using
457 1b7f2c85 Iustin Pop
the file storage backend. The available choices are:
458 1b7f2c85 Iustin Pop
459 1b7f2c85 Iustin Pop
460 1b7f2c85 Iustin Pop
461 1b7f2c85 Iustin Pop
loop
462 1b7f2c85 Iustin Pop
    Kernel loopback driver. This driver uses loopback devices to access
463 1b7f2c85 Iustin Pop
    the filesystem within the file. However, running I/O intensive
464 1b7f2c85 Iustin Pop
    applications in your instance using the loop driver might result in
465 1b7f2c85 Iustin Pop
    slowdowns. Furthermore, if you use the loopback driver consider
466 1b7f2c85 Iustin Pop
    increasing the maximum amount of loopback devices (on most systems
467 1b7f2c85 Iustin Pop
    it's 8) using the max\_loop param.
468 1b7f2c85 Iustin Pop
469 1b7f2c85 Iustin Pop
blktap
470 1b7f2c85 Iustin Pop
    The blktap driver (for Xen hypervisors). In order to be able to use
471 1b7f2c85 Iustin Pop
    the blktap driver you should check if the 'blktapctrl' user space
472 1b7f2c85 Iustin Pop
    disk agent is running (usually automatically started via xend).
473 1b7f2c85 Iustin Pop
    This user-level disk I/O interface has the advantage of better
474 1b7f2c85 Iustin Pop
    performance. Especially if you use a network file system (e.g. NFS)
475 1b7f2c85 Iustin Pop
    to store your instances this is the recommended choice.
476 1b7f2c85 Iustin Pop
477 1b7f2c85 Iustin Pop
478 1b7f2c85 Iustin Pop
The ``--submit`` option is used to send the job to the master
479 1b7f2c85 Iustin Pop
daemon but not wait for its completion. The job ID will be shown so
480 1b7f2c85 Iustin Pop
that it can be examined via **gnt-job info**.
481 1b7f2c85 Iustin Pop
482 1b7f2c85 Iustin Pop
Example::
483 1b7f2c85 Iustin Pop
484 1b7f2c85 Iustin Pop
    # gnt-instance add -t file --disk 0:size=30g -B memory=512 -o debian-etch \
485 1b7f2c85 Iustin Pop
      -n node1.example.com --file-storage-dir=mysubdir instance1.example.com
486 1b7f2c85 Iustin Pop
    # gnt-instance add -t plain --disk 0:size=30g -B memory=512 -o debian-etch \
487 1b7f2c85 Iustin Pop
      -n node1.example.com instance1.example.com
488 7af3534e Dmitry Chernyak
    # gnt-instance add -t plain --disk 0:size=30g --disk 1:size=100g,vg=san \
489 7af3534e Dmitry Chernyak
      -B memory=512 -o debian-etch -n node1.example.com instance1.example.com
490 1b7f2c85 Iustin Pop
    # gnt-instance add -t drbd --disk 0:size=30g -B memory=512 -o debian-etch \
491 1b7f2c85 Iustin Pop
      -n node1.example.com:node2.example.com instance2.example.com
492 1b7f2c85 Iustin Pop
493 1b7f2c85 Iustin Pop
494 1b7f2c85 Iustin Pop
BATCH-CREATE
495 1b7f2c85 Iustin Pop
^^^^^^^^^^^^
496 1b7f2c85 Iustin Pop
497 1b7f2c85 Iustin Pop
**batch-create** {instances\_file.json}
498 1b7f2c85 Iustin Pop
499 1b7f2c85 Iustin Pop
This command (similar to the Ganeti 1.2 **batcher** tool) submits
500 1b7f2c85 Iustin Pop
multiple instance creation jobs based on a definition file. The
501 1b7f2c85 Iustin Pop
instance configurations do not encompass all the possible options
502 1b7f2c85 Iustin Pop
for the **add** command, but only a subset.
503 1b7f2c85 Iustin Pop
504 1b7f2c85 Iustin Pop
The instance file should be a valid-formed JSON file, containing a
505 1b7f2c85 Iustin Pop
dictionary with instance name and instance parameters. The accepted
506 1b7f2c85 Iustin Pop
parameters are:
507 1b7f2c85 Iustin Pop
508 1b7f2c85 Iustin Pop
509 1b7f2c85 Iustin Pop
510 1b7f2c85 Iustin Pop
disk\_size
511 1b7f2c85 Iustin Pop
    The size of the disks of the instance.
512 1b7f2c85 Iustin Pop
513 1b7f2c85 Iustin Pop
disk\_template
514 1b7f2c85 Iustin Pop
    The disk template to use for the instance, the same as in the
515 1b7f2c85 Iustin Pop
    **add** command.
516 1b7f2c85 Iustin Pop
517 1b7f2c85 Iustin Pop
backend
518 1b7f2c85 Iustin Pop
    A dictionary of backend parameters.
519 1b7f2c85 Iustin Pop
520 1b7f2c85 Iustin Pop
hypervisor
521 1b7f2c85 Iustin Pop
    A dictionary with a single key (the hypervisor name), and as value
522 1b7f2c85 Iustin Pop
    the hypervisor options. If not passed, the default hypervisor and
523 1b7f2c85 Iustin Pop
    hypervisor options will be inherited.
524 1b7f2c85 Iustin Pop
525 1b7f2c85 Iustin Pop
mac, ip, mode, link
526 1b7f2c85 Iustin Pop
    Specifications for the one NIC that will be created for the
527 1b7f2c85 Iustin Pop
    instance. 'bridge' is also accepted as a backwards compatibile
528 1b7f2c85 Iustin Pop
    key.
529 1b7f2c85 Iustin Pop
530 1b7f2c85 Iustin Pop
nics
531 1b7f2c85 Iustin Pop
    List of nics that will be created for the instance. Each entry
532 1b7f2c85 Iustin Pop
    should be a dict, with mac, ip, mode and link as possible keys.
533 1b7f2c85 Iustin Pop
    Please don't provide the "mac, ip, mode, link" parent keys if you
534 1b7f2c85 Iustin Pop
    use this method for specifying nics.
535 1b7f2c85 Iustin Pop
536 1b7f2c85 Iustin Pop
primary\_node, secondary\_node
537 1b7f2c85 Iustin Pop
    The primary and optionally the secondary node to use for the
538 1b7f2c85 Iustin Pop
    instance (in case an iallocator script is not used).
539 1b7f2c85 Iustin Pop
540 1b7f2c85 Iustin Pop
iallocator
541 1b7f2c85 Iustin Pop
    Instead of specifying the nodes, an iallocator script can be used
542 1b7f2c85 Iustin Pop
    to automatically compute them.
543 1b7f2c85 Iustin Pop
544 1b7f2c85 Iustin Pop
start
545 1b7f2c85 Iustin Pop
    whether to start the instance
546 1b7f2c85 Iustin Pop
547 1b7f2c85 Iustin Pop
ip\_check
548 1b7f2c85 Iustin Pop
    Skip the check for already-in-use instance; see the description in
549 1b7f2c85 Iustin Pop
    the **add** command for details.
550 1b7f2c85 Iustin Pop
551 1b7f2c85 Iustin Pop
name\_check
552 1b7f2c85 Iustin Pop
    Skip the name check for instances; see the description in the
553 1b7f2c85 Iustin Pop
    **add** command for details.
554 1b7f2c85 Iustin Pop
555 1b7f2c85 Iustin Pop
file\_storage\_dir, file\_driver
556 1b7f2c85 Iustin Pop
    Configuration for the file disk type, see the **add** command for
557 1b7f2c85 Iustin Pop
    details.
558 1b7f2c85 Iustin Pop
559 1b7f2c85 Iustin Pop
560 1b7f2c85 Iustin Pop
A simple definition for one instance can be (with most of the
561 1b7f2c85 Iustin Pop
parameters taken from the cluster defaults)::
562 1b7f2c85 Iustin Pop
563 1b7f2c85 Iustin Pop
    {
564 1b7f2c85 Iustin Pop
      "instance3": {
565 1b7f2c85 Iustin Pop
        "template": "drbd",
566 1b7f2c85 Iustin Pop
        "os": "debootstrap",
567 1b7f2c85 Iustin Pop
        "disk_size": ["25G"],
568 1b7f2c85 Iustin Pop
        "iallocator": "dumb"
569 1b7f2c85 Iustin Pop
      },
570 1b7f2c85 Iustin Pop
      "instance5": {
571 1b7f2c85 Iustin Pop
        "template": "drbd",
572 1b7f2c85 Iustin Pop
        "os": "debootstrap",
573 1b7f2c85 Iustin Pop
        "disk_size": ["25G"],
574 1b7f2c85 Iustin Pop
        "iallocator": "dumb",
575 1b7f2c85 Iustin Pop
        "hypervisor": "xen-hvm",
576 1b7f2c85 Iustin Pop
        "hvparams": {"acpi": true},
577 1b7f2c85 Iustin Pop
        "backend": {"memory": 512}
578 1b7f2c85 Iustin Pop
      }
579 1b7f2c85 Iustin Pop
    }
580 1b7f2c85 Iustin Pop
581 1b7f2c85 Iustin Pop
The command will display the job id for each submitted instance, as
582 1b7f2c85 Iustin Pop
follows::
583 1b7f2c85 Iustin Pop
584 1b7f2c85 Iustin Pop
    # gnt-instance batch-create instances.json
585 1b7f2c85 Iustin Pop
    instance3: 11224
586 1b7f2c85 Iustin Pop
    instance5: 11225
587 1b7f2c85 Iustin Pop
588 1b7f2c85 Iustin Pop
REMOVE
589 1b7f2c85 Iustin Pop
^^^^^^
590 1b7f2c85 Iustin Pop
591 1b7f2c85 Iustin Pop
**remove** [--ignore-failures] [--shutdown-timeout=*N*] [--submit]
592 1b7f2c85 Iustin Pop
{*instance*}
593 1b7f2c85 Iustin Pop
594 1b7f2c85 Iustin Pop
Remove an instance. This will remove all data from the instance and
595 1b7f2c85 Iustin Pop
there is *no way back*. If you are not sure if you use an instance
596 1b7f2c85 Iustin Pop
again, use **shutdown** first and leave it in the shutdown state
597 1b7f2c85 Iustin Pop
for a while.
598 1b7f2c85 Iustin Pop
599 1b7f2c85 Iustin Pop
The ``--ignore-failures`` option will cause the removal to proceed
600 1b7f2c85 Iustin Pop
even in the presence of errors during the removal of the instance
601 1b7f2c85 Iustin Pop
(e.g. during the shutdown or the disk removal). If this option is
602 1b7f2c85 Iustin Pop
not given, the command will stop at the first error.
603 1b7f2c85 Iustin Pop
604 1b7f2c85 Iustin Pop
The ``--shutdown-timeout`` is used to specify how much time to wait
605 1b7f2c85 Iustin Pop
before forcing the shutdown (e.g. ``xm destroy`` in Xen, killing the
606 1b7f2c85 Iustin Pop
kvm process for KVM, etc.). By default two minutes are given to each
607 1b7f2c85 Iustin Pop
instance to stop.
608 1b7f2c85 Iustin Pop
609 1b7f2c85 Iustin Pop
The ``--submit`` option is used to send the job to the master
610 1b7f2c85 Iustin Pop
daemon but not wait for its completion. The job ID will be shown so
611 1b7f2c85 Iustin Pop
that it can be examined via **gnt-job info**.
612 1b7f2c85 Iustin Pop
613 1b7f2c85 Iustin Pop
Example::
614 1b7f2c85 Iustin Pop
615 1b7f2c85 Iustin Pop
    # gnt-instance remove instance1.example.com
616 1b7f2c85 Iustin Pop
617 1b7f2c85 Iustin Pop
618 1b7f2c85 Iustin Pop
LIST
619 1b7f2c85 Iustin Pop
^^^^
620 1b7f2c85 Iustin Pop
621 1b7f2c85 Iustin Pop
| **list**
622 1b7f2c85 Iustin Pop
| [--no-headers] [--separator=*SEPARATOR*] [--units=*UNITS*]
623 b82c5ff5 Michael Hanselmann
| [-o *[+]FIELD,...*] [instance...]
624 1b7f2c85 Iustin Pop
625 1b7f2c85 Iustin Pop
Shows the currently configured instances with memory usage, disk
626 1b7f2c85 Iustin Pop
usage, the node they are running on, and their run status.
627 1b7f2c85 Iustin Pop
628 1b7f2c85 Iustin Pop
The ``--no-headers`` option will skip the initial header line. The
629 1b7f2c85 Iustin Pop
``--separator`` option takes an argument which denotes what will be
630 1b7f2c85 Iustin Pop
used between the output fields. Both these options are to help
631 1b7f2c85 Iustin Pop
scripting.
632 1b7f2c85 Iustin Pop
633 1b7f2c85 Iustin Pop
The units used to display the numeric values in the output varies,
634 1b7f2c85 Iustin Pop
depending on the options given. By default, the values will be
635 1b7f2c85 Iustin Pop
formatted in the most appropriate unit. If the ``--separator``
636 1b7f2c85 Iustin Pop
option is given, then the values are shown in mebibytes to allow
637 1b7f2c85 Iustin Pop
parsing by scripts. In both cases, the ``--units`` option can be
638 1b7f2c85 Iustin Pop
used to enforce a given output unit.
639 1b7f2c85 Iustin Pop
640 1b7f2c85 Iustin Pop
The ``-o`` option takes a comma-separated list of output fields.
641 1b7f2c85 Iustin Pop
The available fields and their meaning are:
642 1b7f2c85 Iustin Pop
643 1b7f2c85 Iustin Pop
644 1b7f2c85 Iustin Pop
645 1b7f2c85 Iustin Pop
name
646 1b7f2c85 Iustin Pop
    the instance name
647 1b7f2c85 Iustin Pop
648 1b7f2c85 Iustin Pop
os
649 1b7f2c85 Iustin Pop
    the OS of the instance
650 1b7f2c85 Iustin Pop
651 1b7f2c85 Iustin Pop
pnode
652 1b7f2c85 Iustin Pop
    the primary node of the instance
653 1b7f2c85 Iustin Pop
654 1b7f2c85 Iustin Pop
snodes
655 1b7f2c85 Iustin Pop
    comma-separated list of secondary nodes for the instance; usually
656 1b7f2c85 Iustin Pop
    this will be just one node
657 1b7f2c85 Iustin Pop
658 1b7f2c85 Iustin Pop
admin\_state
659 1b7f2c85 Iustin Pop
    the desired state of the instance (either "yes" or "no" denoting
660 1b7f2c85 Iustin Pop
    the instance should run or not)
661 1b7f2c85 Iustin Pop
662 1b7f2c85 Iustin Pop
disk\_template
663 1b7f2c85 Iustin Pop
    the disk template of the instance
664 1b7f2c85 Iustin Pop
665 1b7f2c85 Iustin Pop
oper\_state
666 1b7f2c85 Iustin Pop
    the actual state of the instance; can be one of the values
667 1b7f2c85 Iustin Pop
    "running", "stopped", "(node down)"
668 1b7f2c85 Iustin Pop
669 1b7f2c85 Iustin Pop
status
670 1b7f2c85 Iustin Pop
    combined form of admin\_state and oper\_stat; this can be one of:
671 1b7f2c85 Iustin Pop
    ERROR\_nodedown if the node of the instance is down, ERROR\_down if
672 1b7f2c85 Iustin Pop
    the instance should run but is down, ERROR\_up if the instance
673 1b7f2c85 Iustin Pop
    should be stopped but is actually running, ADMIN\_down if the
674 1b7f2c85 Iustin Pop
    instance has been stopped (and is stopped) and running if the
675 1b7f2c85 Iustin Pop
    instance is set to be running (and is running)
676 1b7f2c85 Iustin Pop
677 1b7f2c85 Iustin Pop
oper\_ram
678 1b7f2c85 Iustin Pop
    the actual memory usage of the instance as seen by the hypervisor
679 1b7f2c85 Iustin Pop
680 1b7f2c85 Iustin Pop
oper\_vcpus
681 1b7f2c85 Iustin Pop
    the actual number of VCPUs the instance is using as seen by the
682 1b7f2c85 Iustin Pop
    hypervisor
683 1b7f2c85 Iustin Pop
684 1b7f2c85 Iustin Pop
ip
685 1b7f2c85 Iustin Pop
    the ip address Ganeti recognizes as associated with the first
686 1b7f2c85 Iustin Pop
    instance interface
687 1b7f2c85 Iustin Pop
688 1b7f2c85 Iustin Pop
mac
689 1b7f2c85 Iustin Pop
    the first instance interface MAC address
690 1b7f2c85 Iustin Pop
691 1b7f2c85 Iustin Pop
nic\_mode
692 1b7f2c85 Iustin Pop
    the mode of the first instance NIC (routed or bridged)
693 1b7f2c85 Iustin Pop
694 1b7f2c85 Iustin Pop
nic\_link
695 1b7f2c85 Iustin Pop
    the link of the first instance NIC
696 1b7f2c85 Iustin Pop
697 1b7f2c85 Iustin Pop
sda\_size
698 1b7f2c85 Iustin Pop
    the size of the instance's first disk
699 1b7f2c85 Iustin Pop
700 1b7f2c85 Iustin Pop
sdb\_size
701 1b7f2c85 Iustin Pop
    the size of the instance's second disk, if any
702 1b7f2c85 Iustin Pop
703 1b7f2c85 Iustin Pop
vcpus
704 1b7f2c85 Iustin Pop
    the number of VCPUs allocated to the instance
705 1b7f2c85 Iustin Pop
706 1b7f2c85 Iustin Pop
tags
707 1b7f2c85 Iustin Pop
    comma-separated list of the instances's tags
708 1b7f2c85 Iustin Pop
709 1b7f2c85 Iustin Pop
serial\_no
710 1b7f2c85 Iustin Pop
    the so called 'serial number' of the instance; this is a numeric
711 1b7f2c85 Iustin Pop
    field that is incremented each time the instance is modified, and
712 1b7f2c85 Iustin Pop
    it can be used to track modifications
713 1b7f2c85 Iustin Pop
714 1b7f2c85 Iustin Pop
ctime
715 1b7f2c85 Iustin Pop
    the creation time of the instance; note that this field contains
716 1b7f2c85 Iustin Pop
    spaces and as such it's harder to parse
717 1b7f2c85 Iustin Pop
718 1b7f2c85 Iustin Pop
    if this attribute is not present (e.g. when upgrading from older
719 1b7f2c85 Iustin Pop
    versions), then "N/A" will be shown instead
720 1b7f2c85 Iustin Pop
721 1b7f2c85 Iustin Pop
mtime
722 1b7f2c85 Iustin Pop
    the last modification time of the instance; note that this field
723 1b7f2c85 Iustin Pop
    contains spaces and as such it's harder to parse
724 1b7f2c85 Iustin Pop
725 1b7f2c85 Iustin Pop
    if this attribute is not present (e.g. when upgrading from older
726 1b7f2c85 Iustin Pop
    versions), then "N/A" will be shown instead
727 1b7f2c85 Iustin Pop
728 1b7f2c85 Iustin Pop
uuid
729 1b7f2c85 Iustin Pop
    Show the UUID of the instance (generated automatically by Ganeti)
730 1b7f2c85 Iustin Pop
731 1b7f2c85 Iustin Pop
network\_port
732 1b7f2c85 Iustin Pop
    If the instance has a network port assigned to it (e.g. for VNC
733 1b7f2c85 Iustin Pop
    connections), this will be shown, otherwise - will be displayed.
734 1b7f2c85 Iustin Pop
735 1b7f2c85 Iustin Pop
beparams
736 1b7f2c85 Iustin Pop
    A text format of the entire beparams for the instance. It's more
737 1b7f2c85 Iustin Pop
    useful to select individual fields from this dictionary, see
738 1b7f2c85 Iustin Pop
    below.
739 1b7f2c85 Iustin Pop
740 1b7f2c85 Iustin Pop
disk.count
741 1b7f2c85 Iustin Pop
    The number of instance disks.
742 1b7f2c85 Iustin Pop
743 1b7f2c85 Iustin Pop
disk.size/N
744 1b7f2c85 Iustin Pop
    The size of the instance's Nth disk. This is a more generic form of
745 1b7f2c85 Iustin Pop
    the sda\_size and sdb\_size fields.
746 1b7f2c85 Iustin Pop
747 1b7f2c85 Iustin Pop
disk.sizes
748 1b7f2c85 Iustin Pop
    A comma-separated list of the disk sizes for this instance.
749 1b7f2c85 Iustin Pop
750 1b7f2c85 Iustin Pop
disk\_usage
751 1b7f2c85 Iustin Pop
    The total disk space used by this instance on each of its nodes.
752 1b7f2c85 Iustin Pop
    This is not the instance-visible disk size, but the actual disk
753 1b7f2c85 Iustin Pop
    "cost" of the instance.
754 1b7f2c85 Iustin Pop
755 1b7f2c85 Iustin Pop
nic.mac/N
756 1b7f2c85 Iustin Pop
    The MAC of the Nth instance NIC.
757 1b7f2c85 Iustin Pop
758 1b7f2c85 Iustin Pop
nic.ip/N
759 1b7f2c85 Iustin Pop
    The IP address of the Nth instance NIC.
760 1b7f2c85 Iustin Pop
761 1b7f2c85 Iustin Pop
nic.mode/N
762 1b7f2c85 Iustin Pop
    The mode of the Nth instance NIC
763 1b7f2c85 Iustin Pop
764 1b7f2c85 Iustin Pop
nic.link/N
765 1b7f2c85 Iustin Pop
    The link of the Nth instance NIC
766 1b7f2c85 Iustin Pop
767 1b7f2c85 Iustin Pop
nic.macs
768 1b7f2c85 Iustin Pop
    A comma-separated list of all the MACs of the instance's NICs.
769 1b7f2c85 Iustin Pop
770 1b7f2c85 Iustin Pop
nic.ips
771 1b7f2c85 Iustin Pop
    A comma-separated list of all the IP addresses of the instance's
772 1b7f2c85 Iustin Pop
    NICs.
773 1b7f2c85 Iustin Pop
774 1b7f2c85 Iustin Pop
nic.modes
775 1b7f2c85 Iustin Pop
    A comma-separated list of all the modes of the instance's NICs.
776 1b7f2c85 Iustin Pop
777 1b7f2c85 Iustin Pop
nic.links
778 1b7f2c85 Iustin Pop
    A comma-separated list of all the link parameters of the instance's
779 1b7f2c85 Iustin Pop
    NICs.
780 1b7f2c85 Iustin Pop
781 1b7f2c85 Iustin Pop
nic.count
782 1b7f2c85 Iustin Pop
    The number of instance nics.
783 1b7f2c85 Iustin Pop
784 1b7f2c85 Iustin Pop
hv/*NAME*
785 1b7f2c85 Iustin Pop
    The value of the hypervisor parameter called *NAME*. For details of
786 1b7f2c85 Iustin Pop
    what hypervisor parameters exist and their meaning, see the **add**
787 1b7f2c85 Iustin Pop
    command.
788 1b7f2c85 Iustin Pop
789 1b7f2c85 Iustin Pop
be/memory
790 1b7f2c85 Iustin Pop
    The configured memory for the instance.
791 1b7f2c85 Iustin Pop
792 1b7f2c85 Iustin Pop
be/vcpus
793 1b7f2c85 Iustin Pop
    The configured number of VCPUs for the instance.
794 1b7f2c85 Iustin Pop
795 1b7f2c85 Iustin Pop
be/auto\_balance
796 1b7f2c85 Iustin Pop
    Whether the instance is considered in N+1 checks.
797 1b7f2c85 Iustin Pop
798 1b7f2c85 Iustin Pop
799 1b7f2c85 Iustin Pop
If the value of the option starts with the character ``+``, the new
800 1b7f2c85 Iustin Pop
field(s) will be added to the default list. This allows to quickly
801 1b7f2c85 Iustin Pop
see the default list plus a few other fields, instead of retyping
802 1b7f2c85 Iustin Pop
the entire list of fields.
803 1b7f2c85 Iustin Pop
804 1b7f2c85 Iustin Pop
There is a subtle grouping about the available output fields: all
805 1b7f2c85 Iustin Pop
fields except for ``oper_state``, ``oper_ram``, ``oper_vcpus`` and
806 1b7f2c85 Iustin Pop
``status`` are configuration value and not run-time values. So if
807 1b7f2c85 Iustin Pop
you don't select any of the these fields, the query will be
808 1b7f2c85 Iustin Pop
satisfied instantly from the cluster configuration, without having
809 1b7f2c85 Iustin Pop
to ask the remote nodes for the data. This can be helpful for big
810 1b7f2c85 Iustin Pop
clusters when you only want some data and it makes sense to specify
811 1b7f2c85 Iustin Pop
a reduced set of output fields.
812 1b7f2c85 Iustin Pop
813 1b7f2c85 Iustin Pop
The default output field list is: name, os, pnode, admin\_state,
814 1b7f2c85 Iustin Pop
oper\_state, oper\_ram.
815 1b7f2c85 Iustin Pop
816 b82c5ff5 Michael Hanselmann
817 b82c5ff5 Michael Hanselmann
LIST-FIELDS
818 b82c5ff5 Michael Hanselmann
~~~~~~~~~~
819 b82c5ff5 Michael Hanselmann
820 b82c5ff5 Michael Hanselmann
**list-fields** [field...]
821 b82c5ff5 Michael Hanselmann
822 b82c5ff5 Michael Hanselmann
Lists available fields for instances.
823 b82c5ff5 Michael Hanselmann
824 b82c5ff5 Michael Hanselmann
825 1b7f2c85 Iustin Pop
INFO
826 1b7f2c85 Iustin Pop
^^^^
827 1b7f2c85 Iustin Pop
828 1b7f2c85 Iustin Pop
**info** [-s \| --static] [--roman] {--all \| *instance*}
829 1b7f2c85 Iustin Pop
830 1b7f2c85 Iustin Pop
Show detailed information about the given instance(s). This is
831 1b7f2c85 Iustin Pop
different from **list** as it shows detailed data about the
832 1b7f2c85 Iustin Pop
instance's disks (especially useful for the drbd disk template).
833 1b7f2c85 Iustin Pop
834 1b7f2c85 Iustin Pop
If the option ``-s`` is used, only information available in the
835 1b7f2c85 Iustin Pop
configuration file is returned, without querying nodes, making the
836 1b7f2c85 Iustin Pop
operation faster.
837 1b7f2c85 Iustin Pop
838 1b7f2c85 Iustin Pop
Use the ``--all`` to get info about all instances, rather than
839 1b7f2c85 Iustin Pop
explicitly passing the ones you're interested in.
840 1b7f2c85 Iustin Pop
841 1b7f2c85 Iustin Pop
The ``--roman`` option can be used to cause envy among people who
842 1b7f2c85 Iustin Pop
like ancient cultures, but are stuck with non-latin-friendly
843 1b7f2c85 Iustin Pop
cluster virtualization technologies.
844 1b7f2c85 Iustin Pop
845 1b7f2c85 Iustin Pop
MODIFY
846 1b7f2c85 Iustin Pop
^^^^^^
847 1b7f2c85 Iustin Pop
848 1b7f2c85 Iustin Pop
| **modify**
849 1b7f2c85 Iustin Pop
| [-H *HYPERVISOR\_PARAMETERS*]
850 1b7f2c85 Iustin Pop
| [-B *BACKEND\_PARAMETERS*]
851 1b7f2c85 Iustin Pop
| [--net add*[:options]* \| --net remove \| --net *N:options*]
852 7af3534e Dmitry Chernyak
| [--disk add:size=*SIZE*[,vg=*VG*] \| --disk remove \|
853 7af3534e Dmitry Chernyak
|  --disk *N*:mode=*MODE*]
854 972a114f Iustin Pop
| [-t plain | -t drbd -n *new_secondary*]
855 cee32223 Michael Hanselmann
| [--os-type=*OS* [--force-variant]]
856 1b7f2c85 Iustin Pop
| [--submit]
857 1b7f2c85 Iustin Pop
| {*instance*}
858 1b7f2c85 Iustin Pop
859 1b7f2c85 Iustin Pop
Modifies the memory size, number of vcpus, ip address, MAC address
860 1b7f2c85 Iustin Pop
and/or nic parameters for an instance. It can also add and remove
861 1b7f2c85 Iustin Pop
disks and NICs to/from the instance. Note that you need to give at
862 1b7f2c85 Iustin Pop
least one of the arguments, otherwise the command complains.
863 1b7f2c85 Iustin Pop
864 1b7f2c85 Iustin Pop
The ``-H`` option specifies hypervisor options in the form of
865 1b7f2c85 Iustin Pop
name=value[,...]. For details which options can be specified, see
866 1b7f2c85 Iustin Pop
the **add** command.
867 1b7f2c85 Iustin Pop
868 1b7f2c85 Iustin Pop
The ``-t`` option will change the disk template of the instance.
869 972a114f Iustin Pop
Currently only conversions between the plain and drbd disk templates
870 972a114f Iustin Pop
are supported, and the instance must be stopped before attempting the
871 972a114f Iustin Pop
conversion. When changing from the plain to the drbd disk template, a
872 972a114f Iustin Pop
new secondary node must be specified via the ``-n`` option.
873 1b7f2c85 Iustin Pop
874 1b7f2c85 Iustin Pop
The ``--disk add:size=``*SIZE* option adds a disk to the instance. The
875 7af3534e Dmitry Chernyak
optional ``vg=``*VG* option specifies LVM volume group other than default
876 7af3534e Dmitry Chernyak
vg to create disk on. The ``--disk remove`` option will remove the last
877 7af3534e Dmitry Chernyak
disk of the instance. The ``--disk`` *N*``:mode=``*MODE* option will change
878 7af3534e Dmitry Chernyak
the mode of the Nth disk of the instance between read-only (``ro``) and
879 1b7f2c85 Iustin Pop
read-write (``rw``).
880 1b7f2c85 Iustin Pop
881 1b7f2c85 Iustin Pop
The ``--net add:``*options* option will add a new NIC to the
882 1b7f2c85 Iustin Pop
instance. The available options are the same as in the **add** command
883 1b7f2c85 Iustin Pop
(mac, ip, link, mode). The ``--net remove`` will remove the last NIC
884 1b7f2c85 Iustin Pop
of the instance, while the ``--net`` *N*:*options* option will
885 1b7f2c85 Iustin Pop
change the parameters of the Nth instance NIC.
886 1b7f2c85 Iustin Pop
887 cee32223 Michael Hanselmann
The option ``--os-type`` will change the OS name for the instance
888 1b7f2c85 Iustin Pop
(without reinstallation). In case an OS variant is specified that
889 1b7f2c85 Iustin Pop
is not found, then by default the modification is refused, unless
890 1b7f2c85 Iustin Pop
``--force-variant`` is passed. An invalid OS will also be refused,
891 1b7f2c85 Iustin Pop
unless the ``--force`` option is given.
892 1b7f2c85 Iustin Pop
893 1b7f2c85 Iustin Pop
The ``--submit`` option is used to send the job to the master
894 1b7f2c85 Iustin Pop
daemon but not wait for its completion. The job ID will be shown so
895 1b7f2c85 Iustin Pop
that it can be examined via **gnt-job info**.
896 1b7f2c85 Iustin Pop
897 1b7f2c85 Iustin Pop
All the changes take effect at the next restart. If the instance is
898 1b7f2c85 Iustin Pop
running, there is no effect on the instance.
899 1b7f2c85 Iustin Pop
900 1b7f2c85 Iustin Pop
REINSTALL
901 1b7f2c85 Iustin Pop
^^^^^^^^^
902 1b7f2c85 Iustin Pop
903 1b7f2c85 Iustin Pop
| **reinstall** [-o *os-type*] [--select-os] [-f *force*]
904 1b7f2c85 Iustin Pop
| [--force-multiple]
905 1b7f2c85 Iustin Pop
| [--instance \| --node \| --primary \| --secondary \| --all]
906 1b7f2c85 Iustin Pop
| [-O *OS\_PARAMETERS*] [--submit] {*instance*...}
907 1b7f2c85 Iustin Pop
908 1b7f2c85 Iustin Pop
Reinstalls the operating system on the given instance(s). The
909 1b7f2c85 Iustin Pop
instance(s) must be stopped when running this command. If the
910 1b7f2c85 Iustin Pop
``--os-type`` is specified, the operating system is changed.
911 1b7f2c85 Iustin Pop
912 1b7f2c85 Iustin Pop
The ``--select-os`` option switches to an interactive OS reinstall.
913 1b7f2c85 Iustin Pop
The user is prompted to select the OS template from the list of
914 1b7f2c85 Iustin Pop
available OS templates. OS parameters can be overridden using
915 1b7f2c85 Iustin Pop
``-O``.
916 1b7f2c85 Iustin Pop
917 1b7f2c85 Iustin Pop
Since this is a potentially dangerous command, the user will be
918 1b7f2c85 Iustin Pop
required to confirm this action, unless the ``-f`` flag is passed.
919 1b7f2c85 Iustin Pop
When multiple instances are selected (either by passing multiple
920 1b7f2c85 Iustin Pop
arguments or by using the ``--node``, ``--primary``,
921 1b7f2c85 Iustin Pop
``--secondary`` or ``--all`` options), the user must pass the
922 1b7f2c85 Iustin Pop
``--force-multiple`` options to skip the interactive confirmation.
923 1b7f2c85 Iustin Pop
924 1b7f2c85 Iustin Pop
The ``--submit`` option is used to send the job to the master
925 1b7f2c85 Iustin Pop
daemon but not wait for its completion. The job ID will be shown so
926 1b7f2c85 Iustin Pop
that it can be examined via **gnt-job info**.
927 1b7f2c85 Iustin Pop
928 1b7f2c85 Iustin Pop
RENAME
929 1b7f2c85 Iustin Pop
^^^^^^
930 1b7f2c85 Iustin Pop
931 1b7f2c85 Iustin Pop
| **rename** [--no-ip-check] [--no-name-check] [--submit]
932 1b7f2c85 Iustin Pop
| {*instance*} {*new\_name*}
933 1b7f2c85 Iustin Pop
934 1b7f2c85 Iustin Pop
Renames the given instance. The instance must be stopped when
935 1b7f2c85 Iustin Pop
running this command. The requirements for the new name are the
936 1b7f2c85 Iustin Pop
same as for adding an instance: the new name must be resolvable and
937 1b7f2c85 Iustin Pop
the IP it resolves to must not be reachable (in order to prevent
938 1b7f2c85 Iustin Pop
duplicate IPs the next time the instance is started). The IP test
939 1b7f2c85 Iustin Pop
can be skipped if the ``--no-ip-check`` option is passed.
940 1b7f2c85 Iustin Pop
941 1b7f2c85 Iustin Pop
The ``--no-name-check`` skips the check for the new instance name
942 1b7f2c85 Iustin Pop
via the resolver (e.g. in DNS or /etc/hosts, depending on your
943 1b7f2c85 Iustin Pop
setup). Since the name check is used to compute the IP address, if
944 1b7f2c85 Iustin Pop
you pass this option you must also pass the ``--no-ip-check``
945 1b7f2c85 Iustin Pop
option.
946 1b7f2c85 Iustin Pop
947 1b7f2c85 Iustin Pop
The ``--submit`` option is used to send the job to the master
948 1b7f2c85 Iustin Pop
daemon but not wait for its completion. The job ID will be shown so
949 1b7f2c85 Iustin Pop
that it can be examined via **gnt-job info**.
950 1b7f2c85 Iustin Pop
951 1b7f2c85 Iustin Pop
Starting/stopping/connecting to console
952 1b7f2c85 Iustin Pop
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
953 1b7f2c85 Iustin Pop
954 1b7f2c85 Iustin Pop
STARTUP
955 1b7f2c85 Iustin Pop
^^^^^^^
956 1b7f2c85 Iustin Pop
957 1b7f2c85 Iustin Pop
| **startup**
958 1b7f2c85 Iustin Pop
| [--force] [--ignore-offline]
959 1b7f2c85 Iustin Pop
| [--force-multiple]
960 1b7f2c85 Iustin Pop
| [--instance \| --node \| --primary \| --secondary \| --all \|
961 1b7f2c85 Iustin Pop
| --tags \| --node-tags \| --pri-node-tags \| --sec-node-tags]
962 1b7f2c85 Iustin Pop
| [-H ``key=value...``] [-B ``key=value...``]
963 1b7f2c85 Iustin Pop
| [--submit]
964 1b7f2c85 Iustin Pop
| {*name*...}
965 1b7f2c85 Iustin Pop
966 1b7f2c85 Iustin Pop
Starts one or more instances, depending on the following options.
967 1b7f2c85 Iustin Pop
The four available modes are:
968 1b7f2c85 Iustin Pop
969 1b7f2c85 Iustin Pop
970 1b7f2c85 Iustin Pop
--instance
971 1b7f2c85 Iustin Pop
    will start the instances given as arguments (at least one argument
972 1b7f2c85 Iustin Pop
    required); this is the default selection
973 1b7f2c85 Iustin Pop
974 1b7f2c85 Iustin Pop
--node
975 1b7f2c85 Iustin Pop
    will start the instances who have the given node as either primary
976 1b7f2c85 Iustin Pop
    or secondary
977 1b7f2c85 Iustin Pop
978 1b7f2c85 Iustin Pop
--primary
979 1b7f2c85 Iustin Pop
    will start all instances whose primary node is in the list of nodes
980 1b7f2c85 Iustin Pop
    passed as arguments (at least one node required)
981 1b7f2c85 Iustin Pop
982 1b7f2c85 Iustin Pop
--secondary
983 1b7f2c85 Iustin Pop
    will start all instances whose secondary node is in the list of
984 1b7f2c85 Iustin Pop
    nodes passed as arguments (at least one node required)
985 1b7f2c85 Iustin Pop
986 1b7f2c85 Iustin Pop
--all
987 1b7f2c85 Iustin Pop
    will start all instances in the cluster (no arguments accepted)
988 1b7f2c85 Iustin Pop
989 1b7f2c85 Iustin Pop
--tags
990 1b7f2c85 Iustin Pop
    will start all instances in the cluster with the tags given as
991 1b7f2c85 Iustin Pop
    arguments
992 1b7f2c85 Iustin Pop
993 1b7f2c85 Iustin Pop
--node-tags
994 1b7f2c85 Iustin Pop
    will start all instances in the cluster on nodes with the tags
995 1b7f2c85 Iustin Pop
    given as arguments
996 1b7f2c85 Iustin Pop
997 1b7f2c85 Iustin Pop
--pri-node-tags
998 1b7f2c85 Iustin Pop
    will start all instances in the cluster on primary nodes with the
999 1b7f2c85 Iustin Pop
    tags given as arguments
1000 1b7f2c85 Iustin Pop
1001 1b7f2c85 Iustin Pop
--sec-node-tags
1002 1b7f2c85 Iustin Pop
    will start all instances in the cluster on secondary nodes with the
1003 1b7f2c85 Iustin Pop
    tags given as arguments
1004 1b7f2c85 Iustin Pop
1005 1b7f2c85 Iustin Pop
1006 1b7f2c85 Iustin Pop
Note that although you can pass more than one selection option, the
1007 1b7f2c85 Iustin Pop
last one wins, so in order to guarantee the desired result, don't
1008 1b7f2c85 Iustin Pop
pass more than one such option.
1009 1b7f2c85 Iustin Pop
1010 1b7f2c85 Iustin Pop
Use ``--force`` to start even if secondary disks are failing.
1011 1b7f2c85 Iustin Pop
``--ignore-offline`` can be used to ignore offline primary nodes
1012 1b7f2c85 Iustin Pop
and mark the instance as started even if the primary is not
1013 1b7f2c85 Iustin Pop
available.
1014 1b7f2c85 Iustin Pop
1015 1b7f2c85 Iustin Pop
The ``--force-multiple`` will skip the interactive confirmation in
1016 1b7f2c85 Iustin Pop
the case the more than one instance will be affected.
1017 1b7f2c85 Iustin Pop
1018 1b7f2c85 Iustin Pop
The ``-H`` and ``-B`` options specify temporary hypervisor and
1019 1b7f2c85 Iustin Pop
backend parameters that can be used to start an instance with
1020 1b7f2c85 Iustin Pop
modified parameters. They can be useful for quick testing without
1021 1b7f2c85 Iustin Pop
having to modify an instance back and forth, e.g.::
1022 1b7f2c85 Iustin Pop
1023 1b7f2c85 Iustin Pop
    # gnt-instance start -H root_args="single" instance1
1024 1b7f2c85 Iustin Pop
    # gnt-instance start -B memory=2048 instance2
1025 1b7f2c85 Iustin Pop
1026 1b7f2c85 Iustin Pop
1027 1b7f2c85 Iustin Pop
The first form will start the instance instance1 in single-user
1028 1b7f2c85 Iustin Pop
mode, and the instance instance2 with 2GB of RAM (this time only,
1029 1b7f2c85 Iustin Pop
unless that is the actual instance memory size already). Note that
1030 1b7f2c85 Iustin Pop
the values override the instance parameters (and not extend them):
1031 1b7f2c85 Iustin Pop
an instance with "root\_args=ro" when started with -H
1032 1b7f2c85 Iustin Pop
root\_args=single will result in "single", not "ro single".
1033 1b7f2c85 Iustin Pop
The ``--submit`` option is used to send the job to the master
1034 1b7f2c85 Iustin Pop
daemon but not wait for its completion. The job ID will be shown so
1035 1b7f2c85 Iustin Pop
that it can be examined via **gnt-job info**.
1036 1b7f2c85 Iustin Pop
1037 1b7f2c85 Iustin Pop
Example::
1038 1b7f2c85 Iustin Pop
1039 1b7f2c85 Iustin Pop
    # gnt-instance start instance1.example.com
1040 1b7f2c85 Iustin Pop
    # gnt-instance start --node node1.example.com node2.example.com
1041 1b7f2c85 Iustin Pop
    # gnt-instance start --all
1042 1b7f2c85 Iustin Pop
1043 1b7f2c85 Iustin Pop
1044 1b7f2c85 Iustin Pop
SHUTDOWN
1045 1b7f2c85 Iustin Pop
^^^^^^^^
1046 1b7f2c85 Iustin Pop
1047 1b7f2c85 Iustin Pop
| **shutdown**
1048 1b7f2c85 Iustin Pop
| [--timeout=*N*]
1049 1b7f2c85 Iustin Pop
| [--force-multiple] [--ignore-offline]
1050 1b7f2c85 Iustin Pop
| [--instance \| --node \| --primary \| --secondary \| --all \|
1051 1b7f2c85 Iustin Pop
| --tags \| --node-tags \| --pri-node-tags \| --sec-node-tags]
1052 1b7f2c85 Iustin Pop
| [--submit]
1053 1b7f2c85 Iustin Pop
| {*name*...}
1054 1b7f2c85 Iustin Pop
1055 1b7f2c85 Iustin Pop
Stops one or more instances. If the instance cannot be cleanly
1056 1b7f2c85 Iustin Pop
stopped during a hardcoded interval (currently 2 minutes), it will
1057 1b7f2c85 Iustin Pop
forcibly stop the instance (equivalent to switching off the power
1058 1b7f2c85 Iustin Pop
on a physical machine).
1059 1b7f2c85 Iustin Pop
1060 1b7f2c85 Iustin Pop
The ``--timeout`` is used to specify how much time to wait before
1061 1b7f2c85 Iustin Pop
forcing the shutdown (e.g. ``xm destroy`` in Xen, killing the kvm
1062 1b7f2c85 Iustin Pop
process for KVM, etc.). By default two minutes are given to each
1063 1b7f2c85 Iustin Pop
instance to stop.
1064 1b7f2c85 Iustin Pop
1065 1b7f2c85 Iustin Pop
The ``--instance``, ``--node``, ``--primary``, ``--secondary``,
1066 1b7f2c85 Iustin Pop
``--all``, ``--tags``, ``--node-tags``, ``--pri-node-tags`` and
1067 1b7f2c85 Iustin Pop
``--sec-node-tags`` options are similar as for the **startup**
1068 1b7f2c85 Iustin Pop
command and they influence the actual instances being shutdown.
1069 1b7f2c85 Iustin Pop
1070 1b7f2c85 Iustin Pop
The ``--submit`` option is used to send the job to the master
1071 1b7f2c85 Iustin Pop
daemon but not wait for its completion. The job ID will be shown so
1072 1b7f2c85 Iustin Pop
that it can be examined via **gnt-job info**.
1073 1b7f2c85 Iustin Pop
1074 1b7f2c85 Iustin Pop
``--ignore-offline`` can be used to ignore offline primary nodes
1075 1b7f2c85 Iustin Pop
and force the instance to be marked as stopped. This option should
1076 1b7f2c85 Iustin Pop
be used with care as it can lead to an inconsistent cluster state.
1077 1b7f2c85 Iustin Pop
1078 1b7f2c85 Iustin Pop
Example::
1079 1b7f2c85 Iustin Pop
1080 1b7f2c85 Iustin Pop
    # gnt-instance shutdown instance1.example.com
1081 1b7f2c85 Iustin Pop
    # gnt-instance shutdown --all
1082 1b7f2c85 Iustin Pop
1083 1b7f2c85 Iustin Pop
1084 1b7f2c85 Iustin Pop
REBOOT
1085 1b7f2c85 Iustin Pop
^^^^^^
1086 1b7f2c85 Iustin Pop
1087 1b7f2c85 Iustin Pop
| **reboot**
1088 1b7f2c85 Iustin Pop
| [--type=*REBOOT-TYPE*]
1089 1b7f2c85 Iustin Pop
| [--ignore-secondaries]
1090 1b7f2c85 Iustin Pop
| [--shutdown-timeout=*N*]
1091 1b7f2c85 Iustin Pop
| [--force-multiple]
1092 1b7f2c85 Iustin Pop
| [--instance \| --node \| --primary \| --secondary \| --all \|
1093 1b7f2c85 Iustin Pop
| --tags \| --node-tags \| --pri-node-tags \| --sec-node-tags]
1094 1b7f2c85 Iustin Pop
| [--submit]
1095 1b7f2c85 Iustin Pop
| [*name*...]
1096 1b7f2c85 Iustin Pop
1097 1b7f2c85 Iustin Pop
Reboots one or more instances. The type of reboot depends on the
1098 1b7f2c85 Iustin Pop
value of ``--type``. A soft reboot does a hypervisor reboot, a hard
1099 1b7f2c85 Iustin Pop
reboot does a instance stop, recreates the hypervisor config for
1100 1b7f2c85 Iustin Pop
the instance and starts the instance. A full reboot does the
1101 1b7f2c85 Iustin Pop
equivalent of **gnt-instance shutdown && gnt-instance startup**.
1102 1b7f2c85 Iustin Pop
The default is hard reboot.
1103 1b7f2c85 Iustin Pop
1104 1b7f2c85 Iustin Pop
For the hard reboot the option ``--ignore-secondaries`` ignores
1105 1b7f2c85 Iustin Pop
errors for the secondary node while re-assembling the instance
1106 1b7f2c85 Iustin Pop
disks.
1107 1b7f2c85 Iustin Pop
1108 1b7f2c85 Iustin Pop
The ``--instance``, ``--node``, ``--primary``, ``--secondary``,
1109 1b7f2c85 Iustin Pop
``--all``, ``--tags``, ``--node-tags``, ``--pri-node-tags`` and
1110 1b7f2c85 Iustin Pop
``--sec-node-tags`` options are similar as for the **startup**
1111 1b7f2c85 Iustin Pop
command and they influence the actual instances being rebooted.
1112 1b7f2c85 Iustin Pop
1113 1b7f2c85 Iustin Pop
The ``--shutdown-timeout`` is used to specify how much time to wait
1114 1b7f2c85 Iustin Pop
before forcing the shutdown (xm destroy in xen, killing the kvm
1115 1b7f2c85 Iustin Pop
process, for kvm). By default two minutes are given to each
1116 1b7f2c85 Iustin Pop
instance to stop.
1117 1b7f2c85 Iustin Pop
1118 1b7f2c85 Iustin Pop
The ``--force-multiple`` will skip the interactive confirmation in
1119 1b7f2c85 Iustin Pop
the case the more than one instance will be affected.
1120 1b7f2c85 Iustin Pop
1121 1b7f2c85 Iustin Pop
Example::
1122 1b7f2c85 Iustin Pop
1123 1b7f2c85 Iustin Pop
    # gnt-instance reboot instance1.example.com
1124 1b7f2c85 Iustin Pop
    # gnt-instance reboot --type=full instance1.example.com
1125 1b7f2c85 Iustin Pop
1126 1b7f2c85 Iustin Pop
1127 1b7f2c85 Iustin Pop
CONSOLE
1128 1b7f2c85 Iustin Pop
^^^^^^^
1129 1b7f2c85 Iustin Pop
1130 1b7f2c85 Iustin Pop
**console** [--show-cmd] {*instance*}
1131 1b7f2c85 Iustin Pop
1132 1b7f2c85 Iustin Pop
Connects to the console of the given instance. If the instance is
1133 1b7f2c85 Iustin Pop
not up, an error is returned. Use the ``--show-cmd`` option to
1134 1b7f2c85 Iustin Pop
display the command instead of executing it.
1135 1b7f2c85 Iustin Pop
1136 1b7f2c85 Iustin Pop
For HVM instances, this will attempt to connect to the serial
1137 1b7f2c85 Iustin Pop
console of the instance. To connect to the virtualized "physical"
1138 1b7f2c85 Iustin Pop
console of a HVM instance, use a VNC client with the connection
1139 1b7f2c85 Iustin Pop
info from the **info** command.
1140 1b7f2c85 Iustin Pop
1141 1b7f2c85 Iustin Pop
Example::
1142 1b7f2c85 Iustin Pop
1143 1b7f2c85 Iustin Pop
    # gnt-instance console instance1.example.com
1144 1b7f2c85 Iustin Pop
1145 1b7f2c85 Iustin Pop
1146 1b7f2c85 Iustin Pop
Disk management
1147 1b7f2c85 Iustin Pop
~~~~~~~~~~~~~~~
1148 1b7f2c85 Iustin Pop
1149 1b7f2c85 Iustin Pop
REPLACE-DISKS
1150 1b7f2c85 Iustin Pop
^^^^^^^^^^^^^
1151 1b7f2c85 Iustin Pop
1152 1b7f2c85 Iustin Pop
**replace-disks** [--submit] [--early-release] {-p} [--disks *idx*]
1153 1b7f2c85 Iustin Pop
{*instance*}
1154 1b7f2c85 Iustin Pop
1155 1b7f2c85 Iustin Pop
**replace-disks** [--submit] [--early-release] {-s} [--disks *idx*]
1156 1b7f2c85 Iustin Pop
{*instance*}
1157 1b7f2c85 Iustin Pop
1158 1b7f2c85 Iustin Pop
**replace-disks** [--submit] [--early-release] {--iallocator *name*
1159 1b7f2c85 Iustin Pop
\| --new-secondary *NODE*} {*instance*}
1160 1b7f2c85 Iustin Pop
1161 1b7f2c85 Iustin Pop
**replace-disks** [--submit] [--early-release] {--auto}
1162 1b7f2c85 Iustin Pop
{*instance*}
1163 1b7f2c85 Iustin Pop
1164 1b7f2c85 Iustin Pop
This command is a generalized form for replacing disks. It is
1165 1b7f2c85 Iustin Pop
currently only valid for the mirrored (DRBD) disk template.
1166 1b7f2c85 Iustin Pop
1167 1b7f2c85 Iustin Pop
The first form (when passing the ``-p`` option) will replace the
1168 1b7f2c85 Iustin Pop
disks on the primary, while the second form (when passing the
1169 1b7f2c85 Iustin Pop
``-s`` option will replace the disks on the secondary node. For
1170 1b7f2c85 Iustin Pop
these two cases (as the node doesn't change), it is possible to
1171 1b7f2c85 Iustin Pop
only run the replace for a subset of the disks, using the option
1172 1b7f2c85 Iustin Pop
``--disks`` which takes a list of comma-delimited disk indices
1173 1b7f2c85 Iustin Pop
(zero-based), e.g. 0,2 to replace only the first and third disks.
1174 1b7f2c85 Iustin Pop
1175 1b7f2c85 Iustin Pop
The third form (when passing either the ``--iallocator`` or the
1176 1b7f2c85 Iustin Pop
``--new-secondary`` option) is designed to change secondary node of
1177 1b7f2c85 Iustin Pop
the instance. Specifying ``--iallocator`` makes the new secondary
1178 1b7f2c85 Iustin Pop
be selected automatically by the specified allocator plugin,
1179 1b7f2c85 Iustin Pop
otherwise the new secondary node will be the one chosen manually
1180 1b7f2c85 Iustin Pop
via the ``--new-secondary`` option.
1181 1b7f2c85 Iustin Pop
1182 1b7f2c85 Iustin Pop
The fourth form (when using ``--auto``) will automatically
1183 1b7f2c85 Iustin Pop
determine which disks of an instance are faulty and replace them
1184 1b7f2c85 Iustin Pop
within the same node. The ``--auto`` option works only when an
1185 1b7f2c85 Iustin Pop
instance has only faulty disks on either the primary or secondary
1186 1b7f2c85 Iustin Pop
node; it doesn't work when both sides have faulty disks.
1187 1b7f2c85 Iustin Pop
1188 1b7f2c85 Iustin Pop
The ``--submit`` option is used to send the job to the master
1189 1b7f2c85 Iustin Pop
daemon but not wait for its completion. The job ID will be shown so
1190 1b7f2c85 Iustin Pop
that it can be examined via **gnt-job info**.
1191 1b7f2c85 Iustin Pop
1192 1b7f2c85 Iustin Pop
The ``--early-release`` changes the code so that the old storage on
1193 1b7f2c85 Iustin Pop
secondary node(s) is removed early (before the resync is completed)
1194 1b7f2c85 Iustin Pop
and the internal Ganeti locks for the current (and new, if any)
1195 1b7f2c85 Iustin Pop
secondary node are also released, thus allowing more parallelism in
1196 1b7f2c85 Iustin Pop
the cluster operation. This should be used only when recovering
1197 1b7f2c85 Iustin Pop
from a disk failure on the current secondary (thus the old storage
1198 1b7f2c85 Iustin Pop
is already broken) or when the storage on the primary node is known
1199 1b7f2c85 Iustin Pop
to be fine (thus we won't need the old storage for potential
1200 1b7f2c85 Iustin Pop
recovery).
1201 1b7f2c85 Iustin Pop
1202 1b7f2c85 Iustin Pop
Note that it is not possible to select an offline or drained node
1203 1b7f2c85 Iustin Pop
as a new secondary.
1204 1b7f2c85 Iustin Pop
1205 1b7f2c85 Iustin Pop
ACTIVATE-DISKS
1206 1b7f2c85 Iustin Pop
^^^^^^^^^^^^^^
1207 1b7f2c85 Iustin Pop
1208 1b7f2c85 Iustin Pop
**activate-disks** [--submit] [--ignore-size] {*instance*}
1209 1b7f2c85 Iustin Pop
1210 1b7f2c85 Iustin Pop
Activates the block devices of the given instance. If successful,
1211 1b7f2c85 Iustin Pop
the command will show the location and name of the block devices::
1212 1b7f2c85 Iustin Pop
1213 1b7f2c85 Iustin Pop
    node1.example.com:disk/0:/dev/drbd0
1214 1b7f2c85 Iustin Pop
    node1.example.com:disk/1:/dev/drbd1
1215 1b7f2c85 Iustin Pop
1216 1b7f2c85 Iustin Pop
1217 1b7f2c85 Iustin Pop
In this example, *node1.example.com* is the name of the node on
1218 1b7f2c85 Iustin Pop
which the devices have been activated. The *disk/0* and *disk/1*
1219 1b7f2c85 Iustin Pop
are the Ganeti-names of the instance disks; how they are visible
1220 1b7f2c85 Iustin Pop
inside the instance is hypervisor-specific. */dev/drbd0* and
1221 1b7f2c85 Iustin Pop
*/dev/drbd1* are the actual block devices as visible on the node.
1222 1b7f2c85 Iustin Pop
The ``--submit`` option is used to send the job to the master
1223 1b7f2c85 Iustin Pop
daemon but not wait for its completion. The job ID will be shown so
1224 1b7f2c85 Iustin Pop
that it can be examined via **gnt-job info**.
1225 1b7f2c85 Iustin Pop
1226 1b7f2c85 Iustin Pop
The ``--ignore-size`` option can be used to activate disks ignoring
1227 1b7f2c85 Iustin Pop
the currently configured size in Ganeti. This can be used in cases
1228 1b7f2c85 Iustin Pop
where the configuration has gotten out of sync with the real-world
1229 1b7f2c85 Iustin Pop
(e.g. after a partially-failed grow-disk operation or due to
1230 1b7f2c85 Iustin Pop
rounding in LVM devices). This should not be used in normal cases,
1231 1b7f2c85 Iustin Pop
but only when activate-disks fails without it.
1232 1b7f2c85 Iustin Pop
1233 1b7f2c85 Iustin Pop
Note that it is safe to run this command while the instance is
1234 1b7f2c85 Iustin Pop
already running.
1235 1b7f2c85 Iustin Pop
1236 1b7f2c85 Iustin Pop
DEACTIVATE-DISKS
1237 1b7f2c85 Iustin Pop
^^^^^^^^^^^^^^^^
1238 1b7f2c85 Iustin Pop
1239 1b7f2c85 Iustin Pop
**deactivate-disks** [--submit] {*instance*}
1240 1b7f2c85 Iustin Pop
1241 1b7f2c85 Iustin Pop
De-activates the block devices of the given instance. Note that if
1242 1b7f2c85 Iustin Pop
you run this command for an instance with a drbd disk template,
1243 1b7f2c85 Iustin Pop
while it is running, it will not be able to shutdown the block
1244 1b7f2c85 Iustin Pop
devices on the primary node, but it will shutdown the block devices
1245 1b7f2c85 Iustin Pop
on the secondary nodes, thus breaking the replication.
1246 1b7f2c85 Iustin Pop
1247 1b7f2c85 Iustin Pop
The ``--submit`` option is used to send the job to the master
1248 1b7f2c85 Iustin Pop
daemon but not wait for its completion. The job ID will be shown so
1249 1b7f2c85 Iustin Pop
that it can be examined via **gnt-job info**.
1250 1b7f2c85 Iustin Pop
1251 1b7f2c85 Iustin Pop
GROW-DISK
1252 1b7f2c85 Iustin Pop
^^^^^^^^^
1253 1b7f2c85 Iustin Pop
1254 1b7f2c85 Iustin Pop
**grow-disk** [--no-wait-for-sync] [--submit] {*instance*} {*disk*}
1255 1b7f2c85 Iustin Pop
{*amount*}
1256 1b7f2c85 Iustin Pop
1257 1b7f2c85 Iustin Pop
Grows an instance's disk. This is only possible for instances
1258 1b7f2c85 Iustin Pop
having a plain or drbd disk template.
1259 1b7f2c85 Iustin Pop
1260 1b7f2c85 Iustin Pop
Note that this command only change the block device size; it will
1261 1b7f2c85 Iustin Pop
not grow the actual filesystems, partitions, etc. that live on that
1262 1b7f2c85 Iustin Pop
disk. Usually, you will need to:
1263 1b7f2c85 Iustin Pop
1264 1b7f2c85 Iustin Pop
1265 1b7f2c85 Iustin Pop
1266 1b7f2c85 Iustin Pop
1267 1b7f2c85 Iustin Pop
#. use **gnt-instance grow-disk**
1268 1b7f2c85 Iustin Pop
1269 1b7f2c85 Iustin Pop
#. reboot the instance (later, at a convenient time)
1270 1b7f2c85 Iustin Pop
1271 1b7f2c85 Iustin Pop
#. use a filesystem resizer, such as ext2online(8) or
1272 1b7f2c85 Iustin Pop
   xfs\_growfs(8) to resize the filesystem, or use fdisk(8) to change
1273 1b7f2c85 Iustin Pop
   the partition table on the disk
1274 1b7f2c85 Iustin Pop
1275 1b7f2c85 Iustin Pop
1276 1b7f2c85 Iustin Pop
The *disk* argument is the index of the instance disk to grow. The
1277 1b7f2c85 Iustin Pop
*amount* argument is given either as a number (and it represents
1278 1b7f2c85 Iustin Pop
the amount to increase the disk with in mebibytes) or can be given
1279 1b7f2c85 Iustin Pop
similar to the arguments in the create instance operation, with a
1280 1b7f2c85 Iustin Pop
suffix denoting the unit.
1281 1b7f2c85 Iustin Pop
1282 1b7f2c85 Iustin Pop
Note that the disk grow operation might complete on one node but
1283 1b7f2c85 Iustin Pop
fail on the other; this will leave the instance with
1284 1b7f2c85 Iustin Pop
different-sized LVs on the two nodes, but this will not create
1285 1b7f2c85 Iustin Pop
problems (except for unused space).
1286 1b7f2c85 Iustin Pop
1287 1b7f2c85 Iustin Pop
If you do not want gnt-instance to wait for the new disk region to
1288 1b7f2c85 Iustin Pop
be synced, use the ``--no-wait-for-sync`` option.
1289 1b7f2c85 Iustin Pop
1290 1b7f2c85 Iustin Pop
The ``--submit`` option is used to send the job to the master
1291 1b7f2c85 Iustin Pop
daemon but not wait for its completion. The job ID will be shown so
1292 1b7f2c85 Iustin Pop
that it can be examined via **gnt-job info**.
1293 1b7f2c85 Iustin Pop
1294 1b7f2c85 Iustin Pop
Example (increase the first disk for instance1 by 16GiB)::
1295 1b7f2c85 Iustin Pop
1296 1b7f2c85 Iustin Pop
    # gnt-instance grow-disk instance1.example.com 0 16g
1297 1b7f2c85 Iustin Pop
1298 1b7f2c85 Iustin Pop
1299 1b7f2c85 Iustin Pop
Also note that disk shrinking is not supported; use
1300 1b7f2c85 Iustin Pop
**gnt-backup export** and then **gnt-backup import** to reduce the
1301 1b7f2c85 Iustin Pop
disk size of an instance.
1302 1b7f2c85 Iustin Pop
1303 1b7f2c85 Iustin Pop
RECREATE-DISKS
1304 1b7f2c85 Iustin Pop
^^^^^^^^^^^^^^
1305 1b7f2c85 Iustin Pop
1306 1b7f2c85 Iustin Pop
**recreate-disks** [--submit] [--disks=``indices``] {*instance*}
1307 1b7f2c85 Iustin Pop
1308 1b7f2c85 Iustin Pop
Recreates the disks of the given instance, or only a subset of the
1309 1b7f2c85 Iustin Pop
disks (if the option ``disks`` is passed, which must be a
1310 1b7f2c85 Iustin Pop
comma-separated list of disk indices, starting from zero).
1311 1b7f2c85 Iustin Pop
1312 1b7f2c85 Iustin Pop
Note that this functionality should only be used for missing disks;
1313 1b7f2c85 Iustin Pop
if any of the given disks already exists, the operation will fail.
1314 1b7f2c85 Iustin Pop
While this is suboptimal, recreate-disks should hopefully not be
1315 1b7f2c85 Iustin Pop
needed in normal operation and as such the impact of this is low.
1316 1b7f2c85 Iustin Pop
1317 1b7f2c85 Iustin Pop
The ``--submit`` option is used to send the job to the master
1318 1b7f2c85 Iustin Pop
daemon but not wait for its completion. The job ID will be shown so
1319 1b7f2c85 Iustin Pop
that it can be examined via **gnt-job info**.
1320 1b7f2c85 Iustin Pop
1321 1b7f2c85 Iustin Pop
Recovery
1322 1b7f2c85 Iustin Pop
~~~~~~~~
1323 1b7f2c85 Iustin Pop
1324 1b7f2c85 Iustin Pop
FAILOVER
1325 1b7f2c85 Iustin Pop
^^^^^^^^
1326 1b7f2c85 Iustin Pop
1327 1b7f2c85 Iustin Pop
**failover** [-f] [--ignore-consistency] [--shutdown-timeout=*N*]
1328 1b7f2c85 Iustin Pop
[--submit] {*instance*}
1329 1b7f2c85 Iustin Pop
1330 1b7f2c85 Iustin Pop
Failover will fail the instance over its secondary node. This works
1331 1b7f2c85 Iustin Pop
only for instances having a drbd disk template.
1332 1b7f2c85 Iustin Pop
1333 1b7f2c85 Iustin Pop
Normally the failover will check the consistency of the disks
1334 1b7f2c85 Iustin Pop
before failing over the instance. If you are trying to migrate
1335 1b7f2c85 Iustin Pop
instances off a dead node, this will fail. Use the
1336 1b7f2c85 Iustin Pop
``--ignore-consistency`` option for this purpose. Note that this
1337 1b7f2c85 Iustin Pop
option can be dangerous as errors in shutting down the instance
1338 1b7f2c85 Iustin Pop
will be ignored, resulting in possibly having the instance running
1339 1b7f2c85 Iustin Pop
on two machines in parallel (on disconnected DRBD drives).
1340 1b7f2c85 Iustin Pop
1341 1b7f2c85 Iustin Pop
The ``--shutdown-timeout`` is used to specify how much time to wait
1342 1b7f2c85 Iustin Pop
before forcing the shutdown (xm destroy in xen, killing the kvm
1343 1b7f2c85 Iustin Pop
process, for kvm). By default two minutes are given to each
1344 1b7f2c85 Iustin Pop
instance to stop.
1345 1b7f2c85 Iustin Pop
1346 1b7f2c85 Iustin Pop
The ``--submit`` option is used to send the job to the master
1347 1b7f2c85 Iustin Pop
daemon but not wait for its completion. The job ID will be shown so
1348 1b7f2c85 Iustin Pop
that it can be examined via **gnt-job info**.
1349 1b7f2c85 Iustin Pop
1350 1b7f2c85 Iustin Pop
Example::
1351 1b7f2c85 Iustin Pop
1352 1b7f2c85 Iustin Pop
    # gnt-instance failover instance1.example.com
1353 1b7f2c85 Iustin Pop
1354 1b7f2c85 Iustin Pop
1355 1b7f2c85 Iustin Pop
MIGRATE
1356 1b7f2c85 Iustin Pop
^^^^^^^
1357 1b7f2c85 Iustin Pop
1358 1b7f2c85 Iustin Pop
**migrate** [-f] {--cleanup} {*instance*}
1359 1b7f2c85 Iustin Pop
1360 1b7f2c85 Iustin Pop
**migrate** [-f] [--non-live] [--migration-mode=live\|non-live]
1361 1b7f2c85 Iustin Pop
{*instance*}
1362 1b7f2c85 Iustin Pop
1363 1b7f2c85 Iustin Pop
Migrate will move the instance to its secondary node without
1364 1b7f2c85 Iustin Pop
shutdown. It only works for instances having the drbd8 disk
1365 1b7f2c85 Iustin Pop
template type.
1366 1b7f2c85 Iustin Pop
1367 1b7f2c85 Iustin Pop
The migration command needs a perfectly healthy instance, as we
1368 1b7f2c85 Iustin Pop
rely on the dual-master capability of drbd8 and the disks of the
1369 1b7f2c85 Iustin Pop
instance are not allowed to be degraded.
1370 1b7f2c85 Iustin Pop
1371 1b7f2c85 Iustin Pop
The ``--non-live`` and ``--migration-mode=non-live`` options will
1372 1b7f2c85 Iustin Pop
switch (for the hypervisors that support it) between a "fully live"
1373 1b7f2c85 Iustin Pop
(i.e. the interruption is as minimal as possible) migration and one
1374 1b7f2c85 Iustin Pop
in which the instance is frozen, its state saved and transported to
1375 1b7f2c85 Iustin Pop
the remote node, and then resumed there. This all depends on the
1376 1b7f2c85 Iustin Pop
hypervisor support for two different methods. In any case, it is
1377 1b7f2c85 Iustin Pop
not an error to pass this parameter (it will just be ignored if the
1378 1b7f2c85 Iustin Pop
hypervisor doesn't support it). The option
1379 1b7f2c85 Iustin Pop
``--migration-mode=live`` option will request a fully-live
1380 1b7f2c85 Iustin Pop
migration. The default, when neither option is passed, depends on
1381 1b7f2c85 Iustin Pop
the hypervisor parameters (and can be viewed with the
1382 1b7f2c85 Iustin Pop
**gnt-cluster info** command).
1383 1b7f2c85 Iustin Pop
1384 1b7f2c85 Iustin Pop
If the ``--cleanup`` option is passed, the operation changes from
1385 1b7f2c85 Iustin Pop
migration to attempting recovery from a failed previous migration.
1386 1b7f2c85 Iustin Pop
In this mode, Ganeti checks if the instance runs on the correct
1387 1b7f2c85 Iustin Pop
node (and updates its configuration if not) and ensures the
1388 1b7f2c85 Iustin Pop
instances's disks are configured correctly. In this mode, the
1389 1b7f2c85 Iustin Pop
``--non-live`` option is ignored.
1390 1b7f2c85 Iustin Pop
1391 1b7f2c85 Iustin Pop
The option ``-f`` will skip the prompting for confirmation.
1392 1b7f2c85 Iustin Pop
1393 1b7f2c85 Iustin Pop
Example (and expected output)::
1394 1b7f2c85 Iustin Pop
1395 1b7f2c85 Iustin Pop
    # gnt-instance migrate instance1
1396 1b7f2c85 Iustin Pop
    Migrate will happen to the instance instance1. Note that migration is
1397 1b7f2c85 Iustin Pop
    **experimental** in this version. This might impact the instance if
1398 1b7f2c85 Iustin Pop
    anything goes wrong. Continue?
1399 1b7f2c85 Iustin Pop
    y/[n]/?: y
1400 1b7f2c85 Iustin Pop
    * checking disk consistency between source and target
1401 1b7f2c85 Iustin Pop
    * ensuring the target is in secondary mode
1402 1b7f2c85 Iustin Pop
    * changing disks into dual-master mode
1403 1b7f2c85 Iustin Pop
     - INFO: Waiting for instance instance1 to sync disks.
1404 1b7f2c85 Iustin Pop
     - INFO: Instance instance1's disks are in sync.
1405 1b7f2c85 Iustin Pop
    * migrating instance to node2.example.com
1406 1b7f2c85 Iustin Pop
    * changing the instance's disks on source node to secondary
1407 1b7f2c85 Iustin Pop
     - INFO: Waiting for instance instance1 to sync disks.
1408 1b7f2c85 Iustin Pop
     - INFO: Instance instance1's disks are in sync.
1409 1b7f2c85 Iustin Pop
    * changing the instance's disks to single-master
1410 1b7f2c85 Iustin Pop
    #
1411 1b7f2c85 Iustin Pop
1412 1b7f2c85 Iustin Pop
1413 1b7f2c85 Iustin Pop
MOVE
1414 1b7f2c85 Iustin Pop
^^^^
1415 1b7f2c85 Iustin Pop
1416 1b7f2c85 Iustin Pop
**move** [-f] [-n *node*] [--shutdown-timeout=*N*] [--submit]
1417 1b7f2c85 Iustin Pop
{*instance*}
1418 1b7f2c85 Iustin Pop
1419 1b7f2c85 Iustin Pop
Move will move the instance to an arbitrary node in the cluster.
1420 1b7f2c85 Iustin Pop
This works only for instances having a plain or file disk
1421 1b7f2c85 Iustin Pop
template.
1422 1b7f2c85 Iustin Pop
1423 1b7f2c85 Iustin Pop
Note that since this operation is done via data copy, it will take
1424 1b7f2c85 Iustin Pop
a long time for big disks (similar to replace-disks for a drbd
1425 1b7f2c85 Iustin Pop
instance).
1426 1b7f2c85 Iustin Pop
1427 1b7f2c85 Iustin Pop
The ``--shutdown-timeout`` is used to specify how much time to wait
1428 1b7f2c85 Iustin Pop
before forcing the shutdown (e.g. ``xm destroy`` in XEN, killing the
1429 1b7f2c85 Iustin Pop
kvm process for KVM, etc.). By default two minutes are given to each
1430 1b7f2c85 Iustin Pop
instance to stop.
1431 1b7f2c85 Iustin Pop
1432 1b7f2c85 Iustin Pop
The ``--submit`` option is used to send the job to the master
1433 1b7f2c85 Iustin Pop
daemon but not wait for its completion. The job ID will be shown so
1434 1b7f2c85 Iustin Pop
that it can be examined via **gnt-job info**.
1435 1b7f2c85 Iustin Pop
1436 1b7f2c85 Iustin Pop
Example::
1437 1b7f2c85 Iustin Pop
1438 1b7f2c85 Iustin Pop
    # gnt-instance move -n node3.example.com instance1.example.com
1439 1b7f2c85 Iustin Pop
1440 1b7f2c85 Iustin Pop
1441 1b7f2c85 Iustin Pop
TAGS
1442 1b7f2c85 Iustin Pop
~~~~
1443 1b7f2c85 Iustin Pop
1444 1b7f2c85 Iustin Pop
ADD-TAGS
1445 1b7f2c85 Iustin Pop
^^^^^^^^
1446 1b7f2c85 Iustin Pop
1447 1b7f2c85 Iustin Pop
**add-tags** [--from *file*] {*instancename*} {*tag*...}
1448 1b7f2c85 Iustin Pop
1449 1b7f2c85 Iustin Pop
Add tags to the given instance. If any of the tags contains invalid
1450 1b7f2c85 Iustin Pop
characters, the entire operation will abort.
1451 1b7f2c85 Iustin Pop
1452 1b7f2c85 Iustin Pop
If the ``--from`` option is given, the list of tags will be
1453 1b7f2c85 Iustin Pop
extended with the contents of that file (each line becomes a tag).
1454 1b7f2c85 Iustin Pop
In this case, there is not need to pass tags on the command line
1455 1b7f2c85 Iustin Pop
(if you do, both sources will be used). A file name of - will be
1456 1b7f2c85 Iustin Pop
interpreted as stdin.
1457 1b7f2c85 Iustin Pop
1458 1b7f2c85 Iustin Pop
LIST-TAGS
1459 1b7f2c85 Iustin Pop
^^^^^^^^^
1460 1b7f2c85 Iustin Pop
1461 1b7f2c85 Iustin Pop
**list-tags** {*instancename*}
1462 1b7f2c85 Iustin Pop
1463 1b7f2c85 Iustin Pop
List the tags of the given instance.
1464 1b7f2c85 Iustin Pop
1465 1b7f2c85 Iustin Pop
REMOVE-TAGS
1466 1b7f2c85 Iustin Pop
^^^^^^^^^^^
1467 1b7f2c85 Iustin Pop
1468 1b7f2c85 Iustin Pop
**remove-tags** [--from *file*] {*instancename*} {*tag*...}
1469 1b7f2c85 Iustin Pop
1470 1b7f2c85 Iustin Pop
Remove tags from the given instance. If any of the tags are not
1471 1b7f2c85 Iustin Pop
existing on the node, the entire operation will abort.
1472 1b7f2c85 Iustin Pop
1473 1b7f2c85 Iustin Pop
If the ``--from`` option is given, the list of tags to be removed will
1474 1b7f2c85 Iustin Pop
be extended with the contents of that file (each line becomes a tag).
1475 1b7f2c85 Iustin Pop
In this case, there is not need to pass tags on the command line (if
1476 1b7f2c85 Iustin Pop
you do, tags from both sources will be removed). A file name of - will
1477 1b7f2c85 Iustin Pop
be interpreted as stdin.