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