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