Statistics
| Branch: | Tag: | Revision:

root / man / gnt-instance.rst @ 56956bcb

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