Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.rst @ f0b1bafe

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