root / man / gnt-instance.sgml @ ac620f3a
History | View | Annotate | Download (86.9 kB)
1 |
<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [ |
---|---|
2 |
|
3 |
<!-- Fill in your name for FIRSTNAME and SURNAME. --> |
4 |
<!-- Please adjust the date whenever revising the manpage. --> |
5 |
<!ENTITY dhdate "<date>January 22, 2010</date>"> |
6 |
<!-- SECTION should be 1-8, maybe w/ subsection other parameters are |
7 |
allowed: see man(7), man(1). --> |
8 |
<!ENTITY dhsection "<manvolnum>8</manvolnum>"> |
9 |
<!ENTITY dhucpackage "<refentrytitle>gnt-instance</refentrytitle>"> |
10 |
<!ENTITY dhpackage "gnt-instance"> |
11 |
|
12 |
<!ENTITY debian "<productname>Debian</productname>"> |
13 |
<!ENTITY gnu "<acronym>GNU</acronym>"> |
14 |
<!ENTITY gpl "&gnu; <acronym>GPL</acronym>"> |
15 |
<!ENTITY footer SYSTEM "footer.sgml"> |
16 |
]> |
17 |
|
18 |
<refentry> |
19 |
<refentryinfo> |
20 |
<copyright> |
21 |
<year>2006</year> |
22 |
<year>2007</year> |
23 |
<year>2008</year> |
24 |
<year>2009</year> |
25 |
<year>2010</year> |
26 |
<holder>Google Inc.</holder> |
27 |
</copyright> |
28 |
&dhdate; |
29 |
</refentryinfo> |
30 |
<refmeta> |
31 |
&dhucpackage; |
32 |
|
33 |
&dhsection; |
34 |
<refmiscinfo>ganeti 2.0</refmiscinfo> |
35 |
</refmeta> |
36 |
<refnamediv> |
37 |
<refname>&dhpackage;</refname> |
38 |
|
39 |
<refpurpose>ganeti instance administration</refpurpose> |
40 |
</refnamediv> |
41 |
<refsynopsisdiv> |
42 |
<cmdsynopsis> |
43 |
<command>&dhpackage; </command> |
44 |
|
45 |
<arg choice="req">command</arg> |
46 |
<arg>arguments...</arg> |
47 |
</cmdsynopsis> |
48 |
</refsynopsisdiv> |
49 |
<refsect1> |
50 |
<title>DESCRIPTION</title> |
51 |
|
52 |
<para> |
53 |
The <command>&dhpackage;</command> is used for instance |
54 |
administration in the ganeti system. |
55 |
</para> |
56 |
|
57 |
</refsect1> |
58 |
<refsect1> |
59 |
<title>COMMANDS</title> |
60 |
|
61 |
<refsect2> |
62 |
<title>Creation/removal/querying</title> |
63 |
|
64 |
<refsect3> |
65 |
<title>ADD</title> |
66 |
<cmdsynopsis> |
67 |
<command>add</command> |
68 |
<sbr> |
69 |
<arg choice="req">-t<group choice="req"> |
70 |
<arg>diskless</arg> |
71 |
<arg>file</arg> |
72 |
<arg>plain</arg> |
73 |
<arg>drbd</arg> |
74 |
</group></arg> |
75 |
<sbr> |
76 |
|
77 |
<group choice="req"> |
78 |
<arg rep="repeat">--disk=<replaceable>N</replaceable>:size=<replaceable>VAL</replaceable><arg>,mode=<replaceable>ro|rw</replaceable></arg></arg> |
79 |
<arg>-s <replaceable>SIZE</replaceable></arg> |
80 |
</group> |
81 |
<sbr> |
82 |
<arg>--no-ip-check</arg> |
83 |
<arg>--no-name-check</arg> |
84 |
<arg>--no-start</arg> |
85 |
<sbr> |
86 |
<group> |
87 |
<arg rep="repeat">--net=<replaceable>N</replaceable><arg rep="repeat">:options</arg></arg> |
88 |
<arg>--no-nics</arg> |
89 |
</group> |
90 |
<sbr> |
91 |
<arg>-B <replaceable>BEPARAMS</replaceable></arg> |
92 |
<sbr> |
93 |
|
94 |
<arg>-H <replaceable>HYPERVISOR</replaceable><arg>:<arg choice="plain" rep="repeat">option=<replaceable>value</replaceable></arg></arg></arg> |
95 |
<sbr> |
96 |
|
97 |
<arg>--file-storage-dir <replaceable>dir_path</replaceable></arg> |
98 |
<arg>--file-driver<group choice="req"> |
99 |
<arg>loop</arg> |
100 |
<arg>blktap</arg> |
101 |
</group></arg> |
102 |
<sbr> |
103 |
|
104 |
<group choice="req"> |
105 |
<arg>-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg> |
106 |
<arg>--iallocator <replaceable>name</replaceable></arg> |
107 |
</group> |
108 |
<sbr> |
109 |
|
110 |
<arg choice="req">-o <replaceable>os-type</replaceable></arg> |
111 |
<sbr> |
112 |
<arg>--submit</arg> |
113 |
<sbr> |
114 |
|
115 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
116 |
</cmdsynopsis> |
117 |
|
118 |
<para> |
119 |
Creates a new instance on the specified host. The |
120 |
<replaceable>instance</replaceable> argument must be in DNS, |
121 |
but depending on the bridge/routing setup, need not be in |
122 |
the same network as the nodes in the cluster. |
123 |
</para> |
124 |
|
125 |
<para> |
126 |
The <option>disk</option> option specifies the parameters |
127 |
for the disks of the instance. The numbering of disks starts |
128 |
at zero, and at least one disk needs to be passed. For each |
129 |
disk, at least the size needs to be given, and optionally |
130 |
the access mode (read-only or the default of read-write) can |
131 |
also be specified. The size is interpreted (when no unit is |
132 |
given) in mebibytes. You can also use one of the suffixes |
133 |
<literal>m</literal>, <literal>g</literal> or |
134 |
<literal>t</literal> to specificy the exact the units used; |
135 |
these suffixes map to mebibytes, gibibytes and tebibytes. |
136 |
</para> |
137 |
|
138 |
<para> |
139 |
Alternatively, a single-disk instance can be created via the |
140 |
<option>-s</option> option which takes a single argument, |
141 |
the size of the disk. This is similar to the Ganeti 1.2 |
142 |
version (but will only create one disk). |
143 |
</para> |
144 |
|
145 |
<para> |
146 |
The minimum disk specification is therefore |
147 |
<userinput>--disk 0:size=20G</userinput> (or <userinput>-s |
148 |
20G</userinput> when using the <option>-s</option> option), |
149 |
and a three-disk instance can be specified as |
150 |
<userinput>--disk 0:size=20G --disk 1:size=4G --disk |
151 |
2:size=100G</userinput>. |
152 |
</para> |
153 |
|
154 |
<para> |
155 |
The <option>--no-ip-check</option> skips the checks that are |
156 |
done to see if the instance's IP is not already alive |
157 |
(i.e. reachable from the master node). |
158 |
</para> |
159 |
|
160 |
<para> |
161 |
The <option>--no-name-check</option> skips the check for the |
162 |
instance name via the resolver (e.g. in DNS or /etc/hosts, |
163 |
depending on your setup). Since the name check is used to |
164 |
compute the IP address, if you pass this option you must |
165 |
also pass the <option>--no-ip-check</option> option. |
166 |
</para> |
167 |
|
168 |
<para> |
169 |
If you don't wat the instance to automatically start after |
170 |
creation, this is possible via the |
171 |
<option>--no-start</option> option. This will leave the |
172 |
instance down until a subsequent <command>gnt-instance |
173 |
start</command> command. |
174 |
</para> |
175 |
|
176 |
<para> |
177 |
The NICs of the instances can be specified via the |
178 |
<option>--net</option> option. By default, one NIC is |
179 |
created for the instance, with a random MAC, and set |
180 |
up according the the cluster level nic parameters. |
181 |
Each NIC can take these parameters (all optional): |
182 |
<variablelist> |
183 |
<varlistentry> |
184 |
<term>mac</term> |
185 |
<listitem> |
186 |
<simpara>either a value or <constant>GENERATE</constant> |
187 |
to generate a new unique MAC</simpara> |
188 |
</listitem> |
189 |
</varlistentry> |
190 |
<varlistentry> |
191 |
<term>ip</term> |
192 |
<listitem> |
193 |
<simpara>specifies the IP address assigned to the |
194 |
instance from the Ganeti side (this is not necessarily |
195 |
what the instance will use, but what the node expects |
196 |
the instance to use)</simpara> |
197 |
</listitem> |
198 |
</varlistentry> |
199 |
<varlistentry> |
200 |
<term>mode</term> |
201 |
<listitem> |
202 |
<simpara>specifies the connection mode for this nic: |
203 |
routed or bridged.</simpara> |
204 |
</listitem> |
205 |
</varlistentry> |
206 |
<varlistentry> |
207 |
<term>link</term> |
208 |
<listitem> |
209 |
<simpara>in bridged mode specifies the bridge to attach |
210 |
this NIC to, in routed mode it's intended to |
211 |
differentiate between different routing tables/instance |
212 |
groups (but the meaning is dependent on the network |
213 |
script, see gnt-cluster(8) for more details)</simpara> |
214 |
</listitem> |
215 |
</varlistentry> |
216 |
</variablelist> |
217 |
Of these "mode" and "link" are nic parameters, and inherit their |
218 |
default at cluster level. |
219 |
</para> |
220 |
|
221 |
<para> |
222 |
Alternatively, if no network is desired for the instance, you |
223 |
can prevent the default of one NIC with the |
224 |
<option>--no-nics</option> option. |
225 |
</para> |
226 |
|
227 |
<para> |
228 |
The <option>-o</option> options specifies the operating |
229 |
system to be installed. The available operating systems can |
230 |
be listed with <command>gnt-os list</command>. |
231 |
</para> |
232 |
|
233 |
<para> |
234 |
The <option>-B</option> option specifies the backend |
235 |
parameters for the instance. If no such parameters are |
236 |
specified, the values are inherited from the cluster. Possible |
237 |
parameters are: |
238 |
<variablelist> |
239 |
<varlistentry> |
240 |
<term>memory</term> |
241 |
<listitem> |
242 |
<simpara>the memory size of the instance; as usual, |
243 |
suffixes can be used to denote the unit, otherwise the |
244 |
value is taken in mebibites</simpara> |
245 |
</listitem> |
246 |
</varlistentry> |
247 |
<varlistentry> |
248 |
<term>vcpus</term> |
249 |
<listitem> |
250 |
<simpara>the number of VCPUs to assign to the instance |
251 |
(if this value makes sense for the hypervisor)</simpara> |
252 |
</listitem> |
253 |
</varlistentry> |
254 |
<varlistentry> |
255 |
<term>auto_balance</term> |
256 |
<listitem> |
257 |
<simpara>whether the instance is considered in the N+1 |
258 |
cluster checks (enough redundancy in the cluster to |
259 |
survive a node failure)</simpara> |
260 |
</listitem> |
261 |
</varlistentry> |
262 |
</variablelist> |
263 |
</para> |
264 |
|
265 |
<para> |
266 |
The <option>-H</option> option specified the hypervisor to |
267 |
use for the instance (must be one of the enabled hypervisors |
268 |
on the cluster) and optionally custom parameters for this |
269 |
instance. If not other options are used (i.e. the invocation |
270 |
is just <userinput>-H |
271 |
<replaceable>NAME</replaceable></userinput>) the instance |
272 |
will inherit the cluster options. The defaults below show |
273 |
the cluster defaults at cluster creation time. |
274 |
</para> |
275 |
|
276 |
<para> |
277 |
The possible hypervisor options are as follows: |
278 |
<variablelist> |
279 |
<varlistentry> |
280 |
<term>boot_order</term> |
281 |
<listitem> |
282 |
<simpara>Valid for the Xen HVM and KVM |
283 |
hypervisors.</simpara> |
284 |
|
285 |
<simpara>A string value denoting the boot order. This |
286 |
has different meaning for the Xen HVM hypervisor and |
287 |
for the KVM one.</simpara> |
288 |
|
289 |
<simpara> |
290 |
For Xen HVM, The boot order is a string of letters |
291 |
listing the boot devices, with valid device letters |
292 |
being: |
293 |
</simpara> |
294 |
<variablelist> |
295 |
<varlistentry> |
296 |
<term>a</term> |
297 |
<listitem> |
298 |
<para> |
299 |
floppy drive |
300 |
</para> |
301 |
</listitem> |
302 |
</varlistentry> |
303 |
<varlistentry> |
304 |
<term>c</term> |
305 |
<listitem> |
306 |
<para> |
307 |
hard disk |
308 |
</para> |
309 |
</listitem> |
310 |
</varlistentry> |
311 |
<varlistentry> |
312 |
<term>d</term> |
313 |
<listitem> |
314 |
<para> |
315 |
CDROM drive |
316 |
</para> |
317 |
</listitem> |
318 |
</varlistentry> |
319 |
<varlistentry> |
320 |
<term>n</term> |
321 |
<listitem> |
322 |
<para> |
323 |
network boot (PXE) |
324 |
</para> |
325 |
</listitem> |
326 |
</varlistentry> |
327 |
</variablelist> |
328 |
<simpara> |
329 |
The default is not to set an HVM boot order which is |
330 |
interpreted as 'dc'. |
331 |
</simpara> |
332 |
|
333 |
<simpara> |
334 |
For KVM the boot order is either 'cdrom' 'disk' or |
335 |
'network'. Please note that older versions of KVM |
336 |
couldn't netboot from virtio interfaces. This has |
337 |
been fixed in more recent versions and is confirmed |
338 |
to work at least with qemu-kvm 0.11.1. |
339 |
</simpara> |
340 |
|
341 |
</listitem> |
342 |
</varlistentry> |
343 |
<varlistentry> |
344 |
<term>cdrom_image_path</term> |
345 |
<listitem> |
346 |
<simpara>Valid for the Xen HVM and KVM hypervisors.</simpara> |
347 |
|
348 |
<simpara>The path to a CDROM image to attach to the |
349 |
instance.</simpara> |
350 |
|
351 |
</listitem> |
352 |
</varlistentry> |
353 |
<varlistentry> |
354 |
<term>nic_type</term> |
355 |
<listitem> |
356 |
<simpara>Valid for the Xen HVM and KVM hypervisors.</simpara> |
357 |
|
358 |
<para> |
359 |
This parameter determines the way the network cards |
360 |
are presented to the instance. The possible options are: |
361 |
<simplelist> |
362 |
<member>rtl8139 (default for Xen HVM) (HVM & KVM)</member> |
363 |
<member>ne2k_isa (HVM & KVM)</member> |
364 |
<member>ne2k_pci (HVM & KVM)</member> |
365 |
<member>i82551 (KVM)</member> |
366 |
<member>i82557b (KVM)</member> |
367 |
<member>i82559er (KVM)</member> |
368 |
<member>pcnet (KVM)</member> |
369 |
<member>e1000 (KVM)</member> |
370 |
<member>paravirtual (default for KVM) (HVM & KVM)</member> |
371 |
</simplelist> |
372 |
</para> |
373 |
</listitem> |
374 |
</varlistentry> |
375 |
<varlistentry> |
376 |
<term>disk_type</term> |
377 |
<listitem> |
378 |
<simpara>Valid for the Xen HVM and KVM hypervisors.</simpara> |
379 |
|
380 |
<para> |
381 |
This parameter determines the way the disks are |
382 |
presented to the instance. The possible options are: |
383 |
<simplelist> |
384 |
<member>ioemu (default for HVM & KVM) (HVM & KVM)</member> |
385 |
<member>ide (HVM & KVM)</member> |
386 |
<member>scsi (KVM)</member> |
387 |
<member>sd (KVM)</member> |
388 |
<member>mtd (KVM)</member> |
389 |
<member>pflash (KVM)</member> |
390 |
</simplelist> |
391 |
</para> |
392 |
</listitem> |
393 |
</varlistentry> |
394 |
<varlistentry> |
395 |
<term>vnc_bind_address</term> |
396 |
<listitem> |
397 |
<simpara>Valid for the Xen HVM and KVM hypervisors.</simpara> |
398 |
|
399 |
<para>Specifies the address that the VNC listener for |
400 |
this instance should bind to. Valid values are IPv4 |
401 |
addresses. Use the address 0.0.0.0 to bind to all |
402 |
available interfaces (this is the default) or specify |
403 |
the address of one of the interfaces on the node to |
404 |
restrict listening to that interface.</para> |
405 |
</listitem> |
406 |
</varlistentry> |
407 |
|
408 |
<varlistentry> |
409 |
<term>vnc_tls</term> |
410 |
<listitem> |
411 |
<simpara>Valid for the KVM hypervisor.</simpara> |
412 |
|
413 |
<simpara>A boolean option that controls whether the |
414 |
VNC connection is secured with TLS.</simpara> |
415 |
</listitem> |
416 |
</varlistentry> |
417 |
|
418 |
<varlistentry> |
419 |
<term>vnc_x509_path</term> |
420 |
<listitem> |
421 |
<simpara>Valid for the KVM hypervisor.</simpara> |
422 |
|
423 |
<para>If <option>vnc_tls</option> is enabled, this |
424 |
options specifies the path to the x509 certificate to |
425 |
use.</para> |
426 |
</listitem> |
427 |
</varlistentry> |
428 |
|
429 |
<varlistentry> |
430 |
<term>vnc_x509_verify</term> |
431 |
<listitem> |
432 |
<simpara>Valid for the KVM hypervisor.</simpara> |
433 |
</listitem> |
434 |
</varlistentry> |
435 |
|
436 |
<varlistentry> |
437 |
<term>acpi</term> |
438 |
<listitem> |
439 |
<simpara>Valid for the Xen HVM and KVM hypervisors.</simpara> |
440 |
|
441 |
<para> |
442 |
A boolean option that specifies if the hypervisor |
443 |
should enable ACPI support for this instance. By |
444 |
default, ACPI is disabled. |
445 |
</para> |
446 |
</listitem> |
447 |
</varlistentry> |
448 |
|
449 |
<varlistentry> |
450 |
<term>pae</term> |
451 |
<listitem> |
452 |
<simpara>Valid for the Xen HVM and KVM hypervisors.</simpara> |
453 |
|
454 |
<para> |
455 |
A boolean option that specifies if the hypervisor |
456 |
should enabled PAE support for this instance. The |
457 |
default is false, disabling PAE support. |
458 |
</para> |
459 |
</listitem> |
460 |
</varlistentry> |
461 |
|
462 |
<varlistentry> |
463 |
<term>use_localtime</term> |
464 |
<listitem> |
465 |
<simpara>Valid for the Xen HVM and KVM hypervisors.</simpara> |
466 |
|
467 |
<para> |
468 |
A boolean option that specifies if the instance |
469 |
should be started with its clock set to the |
470 |
localtime of the machine (when true) or to the UTC |
471 |
(When false). The default is false, which is useful |
472 |
for Linux/Unix machines; for Windows OSes, it is |
473 |
recommended to enable this parameter. |
474 |
</para> |
475 |
</listitem> |
476 |
</varlistentry> |
477 |
|
478 |
<varlistentry> |
479 |
<term>kernel_path</term> |
480 |
<listitem> |
481 |
<simpara>Valid for the Xen PVM and KVM hypervisors.</simpara> |
482 |
|
483 |
<para> |
484 |
This option specifies the path (on the node) to the |
485 |
kernel to boot the instance with. Xen PVM instances |
486 |
always require this, while for KVM if this option is |
487 |
empty, it will cause the machine to load the kernel |
488 |
from its disks. |
489 |
</para> |
490 |
</listitem> |
491 |
</varlistentry> |
492 |
|
493 |
<varlistentry> |
494 |
<term>kernel_args</term> |
495 |
<listitem> |
496 |
<simpara>Valid for the Xen PVM and KVM hypervisors.</simpara> |
497 |
|
498 |
<para> |
499 |
This options specifies extra arguments to the kernel |
500 |
that will be loaded. device. This is always used |
501 |
for Xen PVM, while for KVM it is only used if the |
502 |
<option>kernel_path</option> option is also |
503 |
specified. |
504 |
</para> |
505 |
|
506 |
<para> |
507 |
The default setting for this value is simply |
508 |
<constant>"ro"</constant>, which mounts the root |
509 |
disk (initially) in read-only one. For example, |
510 |
setting this to <userinput>single</userinput> will |
511 |
cause the instance to start in single-user mode. |
512 |
</para> |
513 |
</listitem> |
514 |
</varlistentry> |
515 |
|
516 |
<varlistentry> |
517 |
<term>initrd_path</term> |
518 |
<listitem> |
519 |
<simpara>Valid for the Xen PVM and KVM hypervisors.</simpara> |
520 |
|
521 |
<para> |
522 |
This option specifies the path (on the node) to the |
523 |
initrd to boot the instance with. Xen PVM instances |
524 |
can use this always, while for KVM if this option is |
525 |
only used if the <option>kernel_path</option> option |
526 |
is also specified. You can pass here either an |
527 |
absolute filename (the path to the initrd) if you |
528 |
want to use an initrd, or use the format |
529 |
<userinput>no_initrd_path</userinput> for no initrd. |
530 |
</para> |
531 |
</listitem> |
532 |
</varlistentry> |
533 |
|
534 |
<varlistentry> |
535 |
<term>root_path</term> |
536 |
<listitem> |
537 |
<simpara>Valid for the Xen PVM and KVM hypervisors.</simpara> |
538 |
|
539 |
<para> |
540 |
This options specifies the name of the root |
541 |
device. This is always needed for Xen PVM, while for |
542 |
KVM it is only used if the |
543 |
<option>kernel_path</option> option is also |
544 |
specified. |
545 |
</para> |
546 |
</listitem> |
547 |
</varlistentry> |
548 |
|
549 |
<varlistentry> |
550 |
<term>serial_console</term> |
551 |
<listitem> |
552 |
<simpara>Valid for the KVM hypervisor.</simpara> |
553 |
|
554 |
<simpara>This boolean option specifies whether to |
555 |
emulate a serial console for the instance.</simpara> |
556 |
</listitem> |
557 |
</varlistentry> |
558 |
|
559 |
<varlistentry> |
560 |
<term>disk_cache</term> |
561 |
<listitem> |
562 |
<simpara>Valid for the KVM hypervisor.</simpara> |
563 |
|
564 |
<simpara>The disk cache mode. It can be either |
565 |
<userinput>default</userinput> to not pass any cache |
566 |
option to KVM, or one of the KVM cache modes: none |
567 |
(for direct I/O), writethrough (to use the host cache |
568 |
but report completion to the guest only when the host |
569 |
has commited the changes to disk) or writeback (to use |
570 |
the host cache and report completion as soon as the |
571 |
data is in the host cache). Note that there are |
572 |
special considerations for the cache mode depending on |
573 |
version of KVM used and disk type (always raw file |
574 |
under Ganeti), please refer to the KVM documentation |
575 |
for more details. |
576 |
</simpara> |
577 |
</listitem> |
578 |
</varlistentry> |
579 |
|
580 |
</variablelist> |
581 |
|
582 |
</para> |
583 |
|
584 |
<para> |
585 |
The <option>--iallocator</option> option specifies the instance |
586 |
allocator plugin to use. If you pass in this option the allocator |
587 |
will select nodes for this instance automatically, so you don't need |
588 |
to pass them with the <option>-n</option> option. For more |
589 |
information please refer to the instance allocator documentation. |
590 |
</para> |
591 |
|
592 |
<para> |
593 |
The <option>-t</option> options specifies the disk layout type for |
594 |
the instance. The available choices are: |
595 |
<variablelist> |
596 |
<varlistentry> |
597 |
<term>diskless</term> |
598 |
<listitem> |
599 |
<para> |
600 |
This creates an instance with no disks. Its useful for |
601 |
testing only (or other special cases). |
602 |
</para> |
603 |
</listitem> |
604 |
</varlistentry> |
605 |
<varlistentry> |
606 |
<term>file</term> |
607 |
<listitem> |
608 |
<para>Disk devices will be regular files.</para> |
609 |
</listitem> |
610 |
</varlistentry> |
611 |
<varlistentry> |
612 |
<term>plain</term> |
613 |
<listitem> |
614 |
<para>Disk devices will be logical volumes.</para> |
615 |
</listitem> |
616 |
</varlistentry> |
617 |
<varlistentry> |
618 |
<term>drbd</term> |
619 |
<listitem> |
620 |
<para> |
621 |
Disk devices will be drbd (version 8.x) on top of |
622 |
lvm volumes. |
623 |
</para> |
624 |
</listitem> |
625 |
</varlistentry> |
626 |
</variablelist> |
627 |
</para> |
628 |
|
629 |
<para> |
630 |
The optional second value of the <option>--node</option> is used for |
631 |
the drbd template type and specifies the remote node. |
632 |
</para> |
633 |
|
634 |
<para> |
635 |
If you do not want gnt-instance to wait for the disk mirror |
636 |
to be synced, use the <option>--no-wait-for-sync</option> |
637 |
option. |
638 |
</para> |
639 |
|
640 |
<para> |
641 |
The <option>--file-storage-dir</option> specifies the relative path |
642 |
under the cluster-wide file storage directory to store file-based |
643 |
disks. It is useful for having different subdirectories for |
644 |
different instances. The full path of the directory where the disk |
645 |
files are stored will consist of cluster-wide file storage directory |
646 |
+ optional subdirectory + instance name. Example: |
647 |
/srv/ganeti/file-storage/mysubdir/instance1.example.com. This option |
648 |
is only relevant for instances using the file storage backend. |
649 |
</para> |
650 |
|
651 |
<para> |
652 |
The <option>--file-driver</option> specifies the driver to use for |
653 |
file-based disks. Note that currently these drivers work with the |
654 |
xen hypervisor only. This option is only relevant for instances using |
655 |
the file storage backend. The available choices are: |
656 |
<variablelist> |
657 |
<varlistentry> |
658 |
<term>loop</term> |
659 |
<listitem> |
660 |
<para> |
661 |
Kernel loopback driver. This driver uses loopback |
662 |
devices to access the filesystem within the |
663 |
file. However, running I/O intensive applications in |
664 |
your instance using the loop driver might result in |
665 |
slowdowns. Furthermore, if you use the loopback |
666 |
driver consider increasing the maximum amount of |
667 |
loopback devices (on most systems it's 8) using the |
668 |
max_loop param. |
669 |
</para> |
670 |
</listitem> |
671 |
</varlistentry> |
672 |
<varlistentry> |
673 |
<term>blktap</term> |
674 |
<listitem> |
675 |
<para>The blktap driver (for Xen hypervisors). In |
676 |
order to be able to use the blktap driver you should |
677 |
check if the 'blktapctrl' user space disk agent is |
678 |
running (usually automatically started via xend). This |
679 |
user-level disk I/O interface has the advantage of |
680 |
better performance. Especially if you use a network |
681 |
file system (e.g. NFS) to store your instances this is |
682 |
the recommended choice. |
683 |
</para> |
684 |
</listitem> |
685 |
</varlistentry> |
686 |
</variablelist> |
687 |
</para> |
688 |
|
689 |
<para> |
690 |
The <option>--submit</option> option is used to send the job to |
691 |
the master daemon but not wait for its completion. The job |
692 |
ID will be shown so that it can be examined via |
693 |
<command>gnt-job info</command>. |
694 |
</para> |
695 |
|
696 |
<para> |
697 |
Example: |
698 |
<screen> |
699 |
# gnt-instance add -t file --disk 0:size=30g -B memory=512 -o debian-etch \ |
700 |
-n node1.example.com --file-storage-dir=mysubdir instance1.example.com |
701 |
# gnt-instance add -t plain --disk 0:size=30g -B memory=512 -o debian-etch \ |
702 |
-n node1.example.com instance1.example.com |
703 |
# gnt-instance add -t drbd --disk 0:size=30g -B memory=512 -o debian-etch \ |
704 |
-n node1.example.com:node2.example.com instance2.example.com |
705 |
</screen> |
706 |
</para> |
707 |
</refsect3> |
708 |
|
709 |
<refsect3> |
710 |
<title>BATCH-CREATE</title> |
711 |
<cmdsynopsis> |
712 |
<command>batch-create</command> |
713 |
<arg choice="req">instances_file.json</arg> |
714 |
</cmdsynopsis> |
715 |
|
716 |
<para> |
717 |
This command (similar to the Ganeti 1.2 |
718 |
<command>batcher</command> tool) submits multiple instance |
719 |
creation jobs based on a definition file. The instance |
720 |
configurations do not encompass all the possible options for |
721 |
the <command>add</command> command, but only a subset. |
722 |
</para> |
723 |
|
724 |
<para> |
725 |
The instance file should be a valid-formed JSON file, |
726 |
containing a dictionary with instance name and instance |
727 |
parameters. The accepted parameters are: |
728 |
|
729 |
<variablelist> |
730 |
<varlistentry> |
731 |
<term>disk_size</term> |
732 |
<listitem> |
733 |
<simpara>The size of the disks of the instance.</simpara> |
734 |
</listitem> |
735 |
</varlistentry> |
736 |
<varlistentry> |
737 |
<term>disk_templace</term> |
738 |
<listitem> |
739 |
<simpara>The disk template to use for the instance, |
740 |
the same as in the <command>add</command> |
741 |
command.</simpara> |
742 |
</listitem> |
743 |
</varlistentry> |
744 |
<varlistentry> |
745 |
<term>backend</term> |
746 |
<listitem> |
747 |
<simpara>A dictionary of backend parameters.</simpara> |
748 |
</listitem> |
749 |
</varlistentry> |
750 |
<varlistentry> |
751 |
<term>hypervisor</term> |
752 |
<listitem> |
753 |
<simpara>A dictionary with a single key (the |
754 |
hypervisor name), and as value the hypervisor |
755 |
options. If not passed, the default hypervisor and |
756 |
hypervisor options will be inherited.</simpara> |
757 |
</listitem> |
758 |
</varlistentry> |
759 |
<varlistentry> |
760 |
<term>mac, ip, mode, link</term> |
761 |
<listitem> |
762 |
<simpara>Specifications for the one NIC that will be |
763 |
created for the instance. 'bridge' is also accepted |
764 |
as a backwards compatibile key.</simpara> |
765 |
</listitem> |
766 |
</varlistentry> |
767 |
<varlistentry> |
768 |
<term>nics</term> |
769 |
<listitem> |
770 |
<simpara>List of nics that will be created for the |
771 |
instance. Each entry should be a dict, with mac, ip, mode |
772 |
and link as possible keys. Please don't provide the "mac, |
773 |
ip, mode, link" parent keys if you use this method for |
774 |
specifying nics.</simpara> |
775 |
</listitem> |
776 |
</varlistentry> |
777 |
<varlistentry> |
778 |
<term>primary_node, secondary_node</term> |
779 |
<listitem> |
780 |
<simpara>The primary and optionally the secondary node |
781 |
to use for the instance (in case an iallocator script |
782 |
is not used).</simpara> |
783 |
</listitem> |
784 |
</varlistentry> |
785 |
<varlistentry> |
786 |
<term>iallocator</term> |
787 |
<listitem> |
788 |
<simpara>Instead of specifying the nodes, an |
789 |
iallocator script can be used to automatically compute |
790 |
them.</simpara> |
791 |
</listitem> |
792 |
</varlistentry> |
793 |
<varlistentry> |
794 |
<term>start</term> |
795 |
<listitem> |
796 |
<simpara>whether to start the instance</simpara> |
797 |
</listitem> |
798 |
</varlistentry> |
799 |
<varlistentry> |
800 |
<term>ip_check</term> |
801 |
<listitem> |
802 |
<simpara>Skip the check for already-in-use instance; |
803 |
see the description in the <command>add</command> |
804 |
command for details.</simpara> |
805 |
</listitem> |
806 |
</varlistentry> |
807 |
<varlistentry> |
808 |
<term>name_check</term> |
809 |
<listitem> |
810 |
<simpara>Skip the name check for instances; |
811 |
see the description in the <command>add</command> |
812 |
command for details.</simpara> |
813 |
</listitem> |
814 |
</varlistentry> |
815 |
<varlistentry> |
816 |
<term>file_storage_dir, file_driver</term> |
817 |
<listitem> |
818 |
<simpara>Configuration for the <literal>file</literal> |
819 |
disk type, see the <command>add</command> command for |
820 |
details.</simpara> |
821 |
</listitem> |
822 |
</varlistentry> |
823 |
</variablelist> |
824 |
</para> |
825 |
|
826 |
<para> |
827 |
A simple definition for one instance can be (with most of |
828 |
the parameters taken from the cluster defaults): |
829 |
<screen> |
830 |
{ |
831 |
"instance3": { |
832 |
"template": "drbd", |
833 |
"os": "debootstrap", |
834 |
"disk_size": ["25G"], |
835 |
"iallocator": "dumb" |
836 |
}, |
837 |
"instance5": { |
838 |
"template": "drbd", |
839 |
"os": "debootstrap", |
840 |
"disk_size": ["25G"], |
841 |
"iallocator": "dumb", |
842 |
"hypervisor": "xen-hvm", |
843 |
"hvparams": {"acpi": true}, |
844 |
"backend": {"memory": 512} |
845 |
} |
846 |
} |
847 |
</screen> |
848 |
</para> |
849 |
|
850 |
<para> |
851 |
The command will display the job id for each submitted instance, as follows: |
852 |
<screen> |
853 |
# gnt-instance batch-create instances.json |
854 |
instance3: 11224 |
855 |
instance5: 11225 |
856 |
</screen> |
857 |
</para> |
858 |
|
859 |
</refsect3> |
860 |
|
861 |
<refsect3> |
862 |
<title>REMOVE</title> |
863 |
|
864 |
<cmdsynopsis> |
865 |
<command>remove</command> |
866 |
<arg>--ignore-failures</arg> |
867 |
<arg>--shutdown-timeout=<replaceable>N</replaceable></arg> |
868 |
<arg>--submit</arg> |
869 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
870 |
</cmdsynopsis> |
871 |
|
872 |
<para> |
873 |
Remove an instance. This will remove all data from the |
874 |
instance and there is <emphasis>no way back</emphasis>. If |
875 |
you are not sure if you use an instance again, use |
876 |
<command>shutdown</command> first and leave it in the |
877 |
shutdown state for a while. |
878 |
|
879 |
</para> |
880 |
|
881 |
<para> |
882 |
The <option>--ignore-failures</option> option will cause the |
883 |
removal to proceed even in the presence of errors during the |
884 |
removal of the instance (e.g. during the shutdown or the |
885 |
disk removal). If this option is not given, the command will |
886 |
stop at the first error. |
887 |
</para> |
888 |
|
889 |
<para> |
890 |
The <option>--shutdown-timeout</option> is used to specify how |
891 |
much time to wait before forcing the shutdown (xm destroy in xen, |
892 |
killing the kvm process, for kvm). By default two minutes are |
893 |
given to each instance to stop. |
894 |
</para> |
895 |
|
896 |
<para> |
897 |
The <option>--submit</option> option is used to send the job to |
898 |
the master daemon but not wait for its completion. The job |
899 |
ID will be shown so that it can be examined via |
900 |
<command>gnt-job info</command>. |
901 |
</para> |
902 |
|
903 |
<para> |
904 |
Example: |
905 |
<screen> |
906 |
# gnt-instance remove instance1.example.com |
907 |
</screen> |
908 |
</para> |
909 |
</refsect3> |
910 |
|
911 |
<refsect3> |
912 |
<title>LIST</title> |
913 |
|
914 |
<cmdsynopsis> |
915 |
<command>list</command> |
916 |
<arg>--no-headers</arg> |
917 |
<arg>--separator=<replaceable>SEPARATOR</replaceable></arg> |
918 |
<arg>-o <replaceable>[+]FIELD,...</replaceable></arg> |
919 |
<arg rep="repeat">instance</arg> |
920 |
</cmdsynopsis> |
921 |
|
922 |
<para> |
923 |
Shows the currently configured instances with memory usage, |
924 |
disk usage, the node they are running on, and their run |
925 |
status. |
926 |
</para> |
927 |
|
928 |
<para> |
929 |
The <option>--no-headers</option> option will skip the |
930 |
initial header line. The <option>--separator</option> option |
931 |
takes an argument which denotes what will be used between |
932 |
the output fields. Both these options are to help scripting. |
933 |
</para> |
934 |
|
935 |
<para> |
936 |
The <option>-o</option> option takes a comma-separated list |
937 |
of output fields. The available fields and their meaning |
938 |
are: |
939 |
<variablelist> |
940 |
<varlistentry> |
941 |
<term>name</term> |
942 |
<listitem> |
943 |
<simpara>the instance name</simpara> |
944 |
</listitem> |
945 |
</varlistentry> |
946 |
<varlistentry> |
947 |
<term>os</term> |
948 |
<listitem> |
949 |
<simpara>the OS of the instance</simpara> |
950 |
</listitem> |
951 |
</varlistentry> |
952 |
<varlistentry> |
953 |
<term>pnode</term> |
954 |
<listitem> |
955 |
<simpara>the primary node of the instance</simpara> |
956 |
</listitem> |
957 |
</varlistentry> |
958 |
<varlistentry> |
959 |
<term>snodes</term> |
960 |
<listitem> |
961 |
<simpara>comma-separated list of secondary nodes for the |
962 |
instance; usually this will be just one node</simpara> |
963 |
</listitem> |
964 |
</varlistentry> |
965 |
<varlistentry> |
966 |
<term>admin_state</term> |
967 |
<listitem> |
968 |
<simpara>the desired state of the instance (either "yes" |
969 |
or "no" denoting the instance should run or |
970 |
not)</simpara> |
971 |
</listitem> |
972 |
</varlistentry> |
973 |
<varlistentry> |
974 |
<term>disk_template</term> |
975 |
<listitem> |
976 |
<simpara>the disk template of the instance</simpara> |
977 |
</listitem> |
978 |
</varlistentry> |
979 |
<varlistentry> |
980 |
<term>oper_state</term> |
981 |
<listitem> |
982 |
<simpara>the actual state of the instance; can be |
983 |
one of the values "running", "stopped", "(node |
984 |
down)"</simpara> |
985 |
</listitem> |
986 |
</varlistentry> |
987 |
<varlistentry> |
988 |
<term>status</term> |
989 |
<listitem> |
990 |
<simpara>combined form of admin_state and oper_stat; |
991 |
this can be one of: |
992 |
<computeroutput>ERROR_nodedown</computeroutput> if the |
993 |
node of the instance is down, |
994 |
<computeroutput>ERROR_down</computeroutput> if the |
995 |
instance should run but is down, |
996 |
<computeroutput>ERROR_up</computeroutput> if the |
997 |
instance should be stopped but is actually running, |
998 |
<computeroutput>ADMIN_down</computeroutput> if the |
999 |
instance has been stopped (and is stopped) and |
1000 |
<computeroutput>running</computeroutput> if the |
1001 |
instance is set to be running (and is |
1002 |
running)</simpara> |
1003 |
</listitem> |
1004 |
</varlistentry> |
1005 |
<varlistentry> |
1006 |
<term>oper_ram</term> |
1007 |
<listitem> |
1008 |
<simpara>the actual memory usage of the instance as seen |
1009 |
by the hypervisor</simpara> |
1010 |
</listitem> |
1011 |
</varlistentry> |
1012 |
<varlistentry> |
1013 |
<term>ip</term> |
1014 |
<listitem> |
1015 |
<simpara>the ip address ganeti recognizes as associated with |
1016 |
the first instance interface</simpara> |
1017 |
</listitem> |
1018 |
</varlistentry> |
1019 |
<varlistentry> |
1020 |
<term>mac</term> |
1021 |
<listitem> |
1022 |
<simpara>the first instance interface MAC address</simpara> |
1023 |
</listitem> |
1024 |
</varlistentry> |
1025 |
|
1026 |
<varlistentry> |
1027 |
<term>nic_mode</term> |
1028 |
<listitem> |
1029 |
<simpara>the mode of the first instance NIC |
1030 |
(routed or bridged)</simpara> |
1031 |
</listitem> |
1032 |
</varlistentry> |
1033 |
<varlistentry> |
1034 |
<term>nic_link</term> |
1035 |
<listitem> |
1036 |
<simpara>the link of the first instance NIC |
1037 |
</simpara> |
1038 |
</listitem> |
1039 |
</varlistentry> |
1040 |
<varlistentry> |
1041 |
<term>sda_size</term> |
1042 |
<listitem> |
1043 |
<simpara>the size of the instance's first disk</simpara> |
1044 |
</listitem> |
1045 |
</varlistentry> |
1046 |
<varlistentry> |
1047 |
<term>sdb_size</term> |
1048 |
<listitem> |
1049 |
<simpara>the size of the instance's second disk, if |
1050 |
any</simpara> |
1051 |
</listitem> |
1052 |
</varlistentry> |
1053 |
<varlistentry> |
1054 |
<term>vcpus</term> |
1055 |
<listitem> |
1056 |
<simpara>the number of VCPUs allocated to the |
1057 |
instance</simpara> |
1058 |
</listitem> |
1059 |
</varlistentry> |
1060 |
<varlistentry> |
1061 |
<term>tags</term> |
1062 |
<listitem> |
1063 |
<simpara>comma-separated list of the instances's |
1064 |
tags</simpara> |
1065 |
</listitem> |
1066 |
</varlistentry> |
1067 |
<varlistentry> |
1068 |
<term>serial_no</term> |
1069 |
<listitem> |
1070 |
<simpara>the so called 'serial number' of the |
1071 |
instance; this is a numeric field that is incremented |
1072 |
each time the instance is modified, and it can be used |
1073 |
to track modifications</simpara> |
1074 |
</listitem> |
1075 |
</varlistentry> |
1076 |
<varlistentry> |
1077 |
<term>ctime</term> |
1078 |
<listitem> |
1079 |
<para> |
1080 |
the creation time of the instance; note that this |
1081 |
field contains spaces and as such it's harder to |
1082 |
parse |
1083 |
</para> |
1084 |
<para> |
1085 |
if this attribute is not present (e.g. when |
1086 |
upgrading from older versions), then "N/A" will be |
1087 |
shown instead |
1088 |
</para> |
1089 |
</listitem> |
1090 |
</varlistentry> |
1091 |
<varlistentry> |
1092 |
<term>mtime</term> |
1093 |
<listitem> |
1094 |
<para> |
1095 |
the last modification time of the instance; note |
1096 |
that this field contains spaces and as such it's |
1097 |
harder to parse |
1098 |
</para> |
1099 |
<para> |
1100 |
if this attribute is not present (e.g. when |
1101 |
upgrading from older versions), then "N/A" will be |
1102 |
shown instead |
1103 |
</para> |
1104 |
</listitem> |
1105 |
</varlistentry> |
1106 |
|
1107 |
<varlistentry> |
1108 |
<term>uuid</term> |
1109 |
<listitem> |
1110 |
<simpara>Show the UUID of the instance (generated |
1111 |
automatically by Ganeti)</simpara> |
1112 |
</listitem> |
1113 |
</varlistentry> |
1114 |
|
1115 |
<varlistentry> |
1116 |
<term>network_port</term> |
1117 |
<listitem> |
1118 |
<simpara>If the instance has a network port assigned |
1119 |
to it (e.g. for VNC connections), this will be shown, |
1120 |
otherwise <literal>-</literal> will be |
1121 |
displayed.</simpara> |
1122 |
</listitem> |
1123 |
</varlistentry> |
1124 |
<varlistentry> |
1125 |
<term>beparams</term> |
1126 |
<listitem> |
1127 |
<simpara>A text format of the entire beparams for the |
1128 |
instance. It's more useful to select individual fields |
1129 |
from this dictionary, see below.</simpara> |
1130 |
</listitem> |
1131 |
</varlistentry> |
1132 |
<varlistentry> |
1133 |
<term>disk.count</term> |
1134 |
<listitem> |
1135 |
<simpara>The number of instance disks.</simpara> |
1136 |
</listitem> |
1137 |
</varlistentry> |
1138 |
<varlistentry> |
1139 |
<term>disk.size/N</term> |
1140 |
<listitem> |
1141 |
<simpara>The size of the instance's Nth disk. This is |
1142 |
a more generic form of the <literal>sda_size</literal> |
1143 |
and <literal>sdb_size</literal> fields.</simpara> |
1144 |
</listitem> |
1145 |
</varlistentry> |
1146 |
<varlistentry> |
1147 |
<term>disk.sizes</term> |
1148 |
<listitem> |
1149 |
<simpara>A comma-separated list of the disk sizes for |
1150 |
this instance.</simpara> |
1151 |
</listitem> |
1152 |
</varlistentry> |
1153 |
<varlistentry> |
1154 |
<term>disk_usage</term> |
1155 |
<listitem> |
1156 |
<simpara>The total disk space used by this instance on |
1157 |
each of its nodes. This is not the instance-visible |
1158 |
disk size, but the actual disk "cost" of the |
1159 |
instance.</simpara> |
1160 |
</listitem> |
1161 |
</varlistentry> |
1162 |
<varlistentry> |
1163 |
<term>nic.mac/N</term> |
1164 |
<listitem> |
1165 |
<simpara>The MAC of the Nth instance NIC.</simpara> |
1166 |
</listitem> |
1167 |
</varlistentry> |
1168 |
<varlistentry> |
1169 |
<term>nic.ip/N</term> |
1170 |
<listitem> |
1171 |
<simpara>The IP address of the Nth instance NIC.</simpara> |
1172 |
</listitem> |
1173 |
</varlistentry> |
1174 |
<varlistentry> |
1175 |
<term>nic.mode/N</term> |
1176 |
<listitem> |
1177 |
<simpara>The mode of the Nth instance NIC</simpara> |
1178 |
</listitem> |
1179 |
</varlistentry> |
1180 |
<varlistentry> |
1181 |
<term>nic.link/N</term> |
1182 |
<listitem> |
1183 |
<simpara>The link of the Nth instance NIC</simpara> |
1184 |
</listitem> |
1185 |
</varlistentry> |
1186 |
<varlistentry> |
1187 |
<term>nic.macs</term> |
1188 |
<listitem> |
1189 |
<simpara>A comma-separated list of all the MACs of the |
1190 |
instance's NICs.</simpara> |
1191 |
</listitem> |
1192 |
</varlistentry> |
1193 |
<varlistentry> |
1194 |
<term>nic.ips</term> |
1195 |
<listitem> |
1196 |
<simpara>A comma-separated list of all the IP |
1197 |
addresses of the instance's NICs.</simpara> |
1198 |
</listitem> |
1199 |
</varlistentry> |
1200 |
<varlistentry> |
1201 |
<term>nic.modes</term> |
1202 |
<listitem> |
1203 |
<simpara>A comma-separated list of all the modes of the |
1204 |
instance's NICs.</simpara> |
1205 |
</listitem> |
1206 |
</varlistentry> |
1207 |
<varlistentry> |
1208 |
<term>nic.links</term> |
1209 |
<listitem> |
1210 |
<simpara>A comma-separated list of all the link parameters |
1211 |
of the instance's NICs.</simpara> |
1212 |
</listitem> |
1213 |
</varlistentry> |
1214 |
<varlistentry> |
1215 |
<term>nic.count</term> |
1216 |
<listitem> |
1217 |
<simpara>The number of instance nics.</simpara> |
1218 |
</listitem> |
1219 |
</varlistentry> |
1220 |
<varlistentry> |
1221 |
<term>hv/<replaceable>NAME</replaceable></term> |
1222 |
<listitem> |
1223 |
<simpara>The value of the hypervisor parameter called |
1224 |
<replaceable>NAME</replaceable>. For details of what |
1225 |
hypervisor parameters exist and their meaning, see the |
1226 |
<command>add</command> command.</simpara> |
1227 |
</listitem> |
1228 |
</varlistentry> |
1229 |
<varlistentry> |
1230 |
<term>be/memory</term> |
1231 |
<listitem> |
1232 |
<simpara>The configured memory for the instance.</simpara> |
1233 |
</listitem> |
1234 |
</varlistentry> |
1235 |
<varlistentry> |
1236 |
<term>be/vcpus</term> |
1237 |
<listitem> |
1238 |
<simpara>The configured number of VCPUs for the |
1239 |
instance.</simpara> |
1240 |
</listitem> |
1241 |
</varlistentry> |
1242 |
<varlistentry> |
1243 |
<term>be/auto_balance</term> |
1244 |
<listitem> |
1245 |
<simpara>Whether the instance is considered in N+1 |
1246 |
checks.</simpara> |
1247 |
</listitem> |
1248 |
</varlistentry> |
1249 |
</variablelist> |
1250 |
</para> |
1251 |
|
1252 |
<para> |
1253 |
If the value of the option starts with the character |
1254 |
<constant>+</constant>, the new field(s) will be added to the |
1255 |
default list. This allows to quickly see the default list |
1256 |
plus a few other fields, instead of retyping the entire list |
1257 |
of fields. |
1258 |
</para> |
1259 |
|
1260 |
<para> |
1261 |
There is a subtle grouping about the available output |
1262 |
fields: all fields except for <option>oper_state</option>, |
1263 |
<option>oper_ram</option> and <option>status</option> are |
1264 |
configuration value and not run-time values. So if you don't |
1265 |
select any of the these fields, the query will be satisfied |
1266 |
instantly from the cluster configuration, without having to |
1267 |
ask the remote nodes for the data. This can be helpful for |
1268 |
big clusters when you only want some data and it makes sense |
1269 |
to specify a reduced set of output fields. |
1270 |
</para> |
1271 |
|
1272 |
<para>The default output field list is: |
1273 |
<simplelist type="inline"> |
1274 |
<member>name</member> |
1275 |
<member>os</member> |
1276 |
<member>pnode</member> |
1277 |
<member>admin_state</member> |
1278 |
<member>oper_state</member> |
1279 |
<member>oper_ram</member> |
1280 |
</simplelist>. |
1281 |
</para> |
1282 |
</refsect3> |
1283 |
|
1284 |
<refsect3> |
1285 |
<title>INFO</title> |
1286 |
|
1287 |
<cmdsynopsis> |
1288 |
<command>info</command> |
1289 |
<group> |
1290 |
<arg>-s</arg> |
1291 |
<arg>--static</arg> |
1292 |
</group> |
1293 |
<group choice="req"> |
1294 |
<arg>--all</arg> |
1295 |
<arg rep="repeat"><replaceable>instance</replaceable></arg> |
1296 |
</group> |
1297 |
</cmdsynopsis> |
1298 |
|
1299 |
<para> |
1300 |
Show detailed information about the given instance(s). This is |
1301 |
different from <command>list</command> as it shows detailed data |
1302 |
about the instance's disks (especially useful for the drbd disk |
1303 |
template). |
1304 |
</para> |
1305 |
|
1306 |
<para> |
1307 |
If the option <option>-s</option> is used, only information |
1308 |
available in the configuration file is returned, without |
1309 |
querying nodes, making the operation faster. |
1310 |
</para> |
1311 |
|
1312 |
<para> |
1313 |
Use the <option>--all</option> to get info about all instances, |
1314 |
rather than explicitly passing the ones you're interested in. |
1315 |
</para> |
1316 |
</refsect3> |
1317 |
|
1318 |
<refsect3> |
1319 |
<title>MODIFY</title> |
1320 |
|
1321 |
<cmdsynopsis> |
1322 |
<command>modify</command> |
1323 |
<sbr> |
1324 |
<arg choice="opt">-H <replaceable>HYPERVISOR_PARAMETERS</replaceable></arg> |
1325 |
<sbr> |
1326 |
<arg choice="opt">-B <replaceable>BACKEND_PARAMETERS</replaceable></arg> |
1327 |
<sbr> |
1328 |
<group> |
1329 |
<arg>--net add<replaceable><optional>:options</optional></replaceable></arg> |
1330 |
<arg>--net remove</arg> |
1331 |
<arg>--net <replaceable>N:options</replaceable></arg> |
1332 |
</group> |
1333 |
<sbr> |
1334 |
<group> |
1335 |
<arg>--disk add:size=<replaceable>SIZE</replaceable></arg> |
1336 |
<arg>--disk remove</arg> |
1337 |
<arg>--disk <replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></arg> |
1338 |
</group> |
1339 |
|
1340 |
<sbr> |
1341 |
<arg>--submit</arg> |
1342 |
<sbr> |
1343 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
1344 |
</cmdsynopsis> |
1345 |
|
1346 |
<para> |
1347 |
Modifies the memory size, number of vcpus, ip address, MAC |
1348 |
address and/or nic parameters for an instance. It can also |
1349 |
add and remove disks and NICs to/from the instance. Note |
1350 |
that you need to give at least one of the arguments, otherwise |
1351 |
the command complains. |
1352 |
</para> |
1353 |
|
1354 |
<para> |
1355 |
The <option>-H</option> option specifies hypervisor options |
1356 |
in the form of <userinput>name=value[,...]</userinput>. For details which options can be specified, see the <command>add</command> command. |
1357 |
</para> |
1358 |
|
1359 |
<para> |
1360 |
The <option>--disk |
1361 |
add:size=<replaceable>SIZE</replaceable></option> option |
1362 |
adds a disk to the instance. The <option>--disk |
1363 |
remove</option> will remove the last disk of the |
1364 |
instance. The <option>--disk |
1365 |
<replaceable>N</replaceable>:mode=<replaceable>MODE</replaceable></option> |
1366 |
option will change the mode of the Nth disk of the instance |
1367 |
between read-only (<literal>ro</literal>) and read-write |
1368 |
(<literal>rw</literal>). |
1369 |
</para> |
1370 |
|
1371 |
<para> |
1372 |
The <option>--net |
1373 |
add:<replaceable>options</replaceable></option> option will |
1374 |
add a new NIC to the instance. The available options are the |
1375 |
same as in the <command>add</command> command (mac, ip, link, |
1376 |
mode). The <option>--net remove</option> will remove the |
1377 |
last NIC of the instance, while the <option>--net |
1378 |
<replaceable>N</replaceable>:<replaceable>options</replaceable></option> |
1379 |
option will change the parameters of the Nth instance NIC. |
1380 |
</para> |
1381 |
|
1382 |
<para> |
1383 |
The <option>--submit</option> option is used to send the job to |
1384 |
the master daemon but not wait for its completion. The job |
1385 |
ID will be shown so that it can be examined via |
1386 |
<command>gnt-job info</command>. |
1387 |
</para> |
1388 |
|
1389 |
<para> |
1390 |
All the changes take effect at the next restart. If the |
1391 |
instance is running, there is no effect on the instance. |
1392 |
</para> |
1393 |
</refsect3> |
1394 |
|
1395 |
<refsect3> |
1396 |
<title>REINSTALL</title> |
1397 |
|
1398 |
<cmdsynopsis> |
1399 |
<command>reinstall</command> |
1400 |
<arg choice="opt">-o <replaceable>os-type</replaceable></arg> |
1401 |
<arg>--select-os</arg> |
1402 |
<arg choice="opt">-f <replaceable>force</replaceable></arg> |
1403 |
<arg>--force-multiple</arg> |
1404 |
<sbr> |
1405 |
<group choice="opt"> |
1406 |
<arg>--instance</arg> |
1407 |
<arg>--node</arg> |
1408 |
<arg>--primary</arg> |
1409 |
<arg>--secondary</arg> |
1410 |
<arg>--all</arg> |
1411 |
</group> |
1412 |
<arg>--submit</arg> |
1413 |
<arg choice="opt" rep="repeat"><replaceable>instance</replaceable></arg> |
1414 |
</cmdsynopsis> |
1415 |
|
1416 |
<para> |
1417 |
Reinstalls the operating system on the given instance(s). The |
1418 |
instance(s) must be stopped when running this command. If the |
1419 |
<option>--os-type</option> is specified, the operating |
1420 |
system is changed. |
1421 |
</para> |
1422 |
|
1423 |
<para> |
1424 |
The <option>--select-os</option> option switches to an |
1425 |
interactive OS reinstall. The user is prompted to select the OS |
1426 |
template from the list of available OS templates. |
1427 |
</para> |
1428 |
|
1429 |
<para> |
1430 |
Since this is a potentially dangerous command, the user will |
1431 |
be required to confirm this action, unless the |
1432 |
<option>-f</option> flag is passed. When multiple instances |
1433 |
are selected (either by passing multiple arguments or by |
1434 |
using the <option>--node</option>, |
1435 |
<option>--primary</option>, <option>--secondary</option> or |
1436 |
<option>--all</option> options), the user must pass both the |
1437 |
<option>--force</option> and |
1438 |
<option>--force-multiple</option> options to skip the |
1439 |
interactive confirmation. |
1440 |
</para> |
1441 |
|
1442 |
<para> |
1443 |
The <option>--submit</option> option is used to send the job to |
1444 |
the master daemon but not wait for its completion. The job |
1445 |
ID will be shown so that it can be examined via |
1446 |
<command>gnt-job info</command>. |
1447 |
</para> |
1448 |
|
1449 |
|
1450 |
</refsect3> |
1451 |
|
1452 |
<refsect3> |
1453 |
<title>RENAME</title> |
1454 |
|
1455 |
<cmdsynopsis> |
1456 |
<command>rename</command> |
1457 |
<arg>--no-ip-check</arg> |
1458 |
<arg>--submit</arg> |
1459 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
1460 |
<arg choice="req"><replaceable>new_name</replaceable></arg> |
1461 |
</cmdsynopsis> |
1462 |
|
1463 |
<para> |
1464 |
Renames the given instance. The instance must be stopped |
1465 |
when running this command. The requirements for the new name |
1466 |
are the same as for adding an instance: the new name must be |
1467 |
resolvable and the IP it resolves to must not be reachable |
1468 |
(in order to prevent duplicate IPs the next time the |
1469 |
instance is started). The IP test can be skipped if the |
1470 |
<option>--no-ip-check</option> option is passed. |
1471 |
</para> |
1472 |
|
1473 |
<para> |
1474 |
The <option>--submit</option> option is used to send the job to |
1475 |
the master daemon but not wait for its completion. The job |
1476 |
ID will be shown so that it can be examined via |
1477 |
<command>gnt-job info</command>. |
1478 |
</para> |
1479 |
|
1480 |
</refsect3> |
1481 |
|
1482 |
</refsect2> |
1483 |
|
1484 |
<refsect2> |
1485 |
<title>Starting/stopping/connecting to console</title> |
1486 |
|
1487 |
<refsect3> |
1488 |
<title>STARTUP</title> |
1489 |
|
1490 |
<cmdsynopsis> |
1491 |
<command>startup</command> |
1492 |
<sbr> |
1493 |
<arg>--force</arg> |
1494 |
<sbr> |
1495 |
<arg>--force-multiple</arg> |
1496 |
<sbr> |
1497 |
<group choice="opt"> |
1498 |
<arg>--instance</arg> |
1499 |
<arg>--node</arg> |
1500 |
<arg>--primary</arg> |
1501 |
<arg>--secondary</arg> |
1502 |
<arg>--all</arg> |
1503 |
<arg>--tags</arg> |
1504 |
<arg>--node-tags</arg> |
1505 |
<arg>--pri-node-tags</arg> |
1506 |
<arg>--sec-node-tags</arg> |
1507 |
</group> |
1508 |
<sbr> |
1509 |
<arg>-H <option>key=value...</option></arg> |
1510 |
<arg>-B <option>key=value...</option></arg> |
1511 |
<sbr> |
1512 |
<arg>--submit</arg> |
1513 |
<sbr> |
1514 |
<arg choice="opt" |
1515 |
rep="repeat"><replaceable>name</replaceable></arg> |
1516 |
</cmdsynopsis> |
1517 |
|
1518 |
<para> |
1519 |
Starts one or more instances, depending on the following |
1520 |
options. The four available modes are: |
1521 |
<variablelist> |
1522 |
<varlistentry> |
1523 |
<term><option>--instance</option></term> |
1524 |
<listitem> |
1525 |
<simpara>will start the instances given as arguments |
1526 |
(at least one argument required); this is the default |
1527 |
selection</simpara> |
1528 |
</listitem> |
1529 |
</varlistentry> |
1530 |
<varlistentry> |
1531 |
<term>--node</term> |
1532 |
<listitem> |
1533 |
<simpara>will start the instances who have the given |
1534 |
node as either primary or secondary</simpara> |
1535 |
</listitem> |
1536 |
</varlistentry> |
1537 |
<varlistentry> |
1538 |
<term><option>--primary</option></term> |
1539 |
<listitem> |
1540 |
<simpara>will start all instances whose primary node |
1541 |
is in the list of nodes passed as arguments (at least |
1542 |
one node required)</simpara> |
1543 |
</listitem> |
1544 |
</varlistentry> |
1545 |
<varlistentry> |
1546 |
<term><option>--secondary</option></term> |
1547 |
<listitem> |
1548 |
<simpara>will start all instances whose secondary node |
1549 |
is in the list of nodes passed as arguments (at least |
1550 |
one node required)</simpara> |
1551 |
</listitem> |
1552 |
</varlistentry> |
1553 |
<varlistentry> |
1554 |
<term>--all</term> |
1555 |
<listitem> |
1556 |
<simpara>will start all instances in the cluster (no |
1557 |
arguments accepted)</simpara> |
1558 |
</listitem> |
1559 |
</varlistentry> |
1560 |
<varlistentry> |
1561 |
<term>--tags</term> |
1562 |
<listitem> |
1563 |
<simpara>will start all instances in the cluster with |
1564 |
the tags given as arguments</simpara> |
1565 |
</listitem> |
1566 |
</varlistentry> |
1567 |
<varlistentry> |
1568 |
<term>--node-tags</term> |
1569 |
<listitem> |
1570 |
<simpara>will start all instances in the cluster on |
1571 |
nodes with the tags given as arguments</simpara> |
1572 |
</listitem> |
1573 |
</varlistentry> |
1574 |
<varlistentry> |
1575 |
<term>--pri-node-tags</term> |
1576 |
<listitem> |
1577 |
<simpara>will start all instances in the cluster on |
1578 |
primary nodes with the tags given as |
1579 |
arguments</simpara> |
1580 |
</listitem> |
1581 |
</varlistentry> |
1582 |
<varlistentry> |
1583 |
<term>--sec-node-tags</term> |
1584 |
<listitem> |
1585 |
<simpara>will start all instances in the cluster on |
1586 |
secondary nodes with the tags given as |
1587 |
arguments</simpara> |
1588 |
</listitem> |
1589 |
</varlistentry> |
1590 |
</variablelist> |
1591 |
</para> |
1592 |
|
1593 |
<para> |
1594 |
Note that although you can pass more than one selection |
1595 |
option, the last one wins, so in order to guarantee the |
1596 |
desired result, don't pass more than one such option. |
1597 |
</para> |
1598 |
|
1599 |
<para> |
1600 |
Use <option>--force</option> to start even if secondary disks are |
1601 |
failing. |
1602 |
</para> |
1603 |
|
1604 |
<para> |
1605 |
The <option>--force-multiple</option> will skip the |
1606 |
interactive confirmation in the case the more than one |
1607 |
instance will be affected. |
1608 |
</para> |
1609 |
|
1610 |
<para> |
1611 |
The <option>-H</option> and <option>-B</option> options |
1612 |
specify temporary hypervisor and backend parameters that can |
1613 |
be used to start an instance with modified parameters. They |
1614 |
can be useful for quick testing without having to modify an |
1615 |
instance back and forth, e.g.: |
1616 |
<screen> |
1617 |
# gnt-instance start -H root_args="single" instance1 |
1618 |
# gnt-instance start -B memory=2048 instance2 |
1619 |
</screen> |
1620 |
The first form will start the instance |
1621 |
<userinput>instance1</userinput> in single-user mode, and |
1622 |
the instance <userinput>instance2</userinput> with 2GB of |
1623 |
RAM (this time only, unless that is the actual instance |
1624 |
memory size already). Note that the values override the |
1625 |
instance parameters (and not extend them): an instance with |
1626 |
"root_args=ro" when started with <userinput>-H |
1627 |
root_args=single</userinput> will result in "single", not |
1628 |
"ro single". |
1629 |
</para> |
1630 |
|
1631 |
<para> |
1632 |
The <option>--submit</option> option is used to send the job to |
1633 |
the master daemon but not wait for its completion. The job |
1634 |
ID will be shown so that it can be examined via |
1635 |
<command>gnt-job info</command>. |
1636 |
</para> |
1637 |
|
1638 |
<para> |
1639 |
Example: |
1640 |
<screen> |
1641 |
# gnt-instance start instance1.example.com |
1642 |
# gnt-instance start --node node1.example.com node2.example.com |
1643 |
# gnt-instance start --all |
1644 |
</screen> |
1645 |
</para> |
1646 |
</refsect3> |
1647 |
|
1648 |
<refsect3> |
1649 |
<title>SHUTDOWN</title> |
1650 |
|
1651 |
<cmdsynopsis> |
1652 |
<command>shutdown</command> |
1653 |
<sbr> |
1654 |
<arg>--timeout=<replaceable>N</replaceable></arg> |
1655 |
<sbr> |
1656 |
<arg>--force-multiple</arg> |
1657 |
<sbr> |
1658 |
<group choice="opt"> |
1659 |
<arg>--instance</arg> |
1660 |
<arg>--node</arg> |
1661 |
<arg>--primary</arg> |
1662 |
<arg>--secondary</arg> |
1663 |
<arg>--all</arg> |
1664 |
<arg>--tags</arg> |
1665 |
<arg>--node-tags</arg> |
1666 |
<arg>--pri-node-tags</arg> |
1667 |
<arg>--sec-node-tags</arg> |
1668 |
</group> |
1669 |
<sbr> |
1670 |
<arg>--submit</arg> |
1671 |
<sbr> |
1672 |
<arg choice="opt" |
1673 |
rep="repeat"><replaceable>name</replaceable></arg> |
1674 |
</cmdsynopsis> |
1675 |
|
1676 |
<para> |
1677 |
Stops one or more instances. If the instance cannot be |
1678 |
cleanly stopped during a hardcoded interval (currently 2 |
1679 |
minutes), it will forcibly stop the instance (equivalent to |
1680 |
switching off the power on a physical machine). |
1681 |
</para> |
1682 |
|
1683 |
<para> |
1684 |
The <option>--timeout</option> is used to specify how much time to |
1685 |
wait before forcing the shutdown (xm destroy in xen, killing the kvm |
1686 |
process, for kvm). By default two minutes are given to each instance |
1687 |
to stop. |
1688 |
</para> |
1689 |
|
1690 |
<para> |
1691 |
The <option>--instance</option>, <option>--node</option>, |
1692 |
<option>--primary</option>, <option>--secondary</option>, |
1693 |
<option>--all</option>, <option>--tags</option>, |
1694 |
<option>--node-tags</option>, <option>--pri-node-tags</option> and |
1695 |
<option>--sec-node-tags</option> options are similar as for the |
1696 |
<command>startup</command> command and they influence the |
1697 |
actual instances being shutdown. |
1698 |
</para> |
1699 |
|
1700 |
<para> |
1701 |
The <option>--submit</option> option is used to send the job to |
1702 |
the master daemon but not wait for its completion. The job |
1703 |
ID will be shown so that it can be examined via |
1704 |
<command>gnt-job info</command>. |
1705 |
</para> |
1706 |
|
1707 |
|
1708 |
<para> |
1709 |
Example: |
1710 |
<screen> |
1711 |
# gnt-instance shutdown instance1.example.com |
1712 |
# gnt-instance shutdown --all |
1713 |
</screen> |
1714 |
</para> |
1715 |
</refsect3> |
1716 |
|
1717 |
<refsect3> |
1718 |
<title>REBOOT</title> |
1719 |
|
1720 |
<cmdsynopsis> |
1721 |
<command>reboot</command> |
1722 |
<sbr> |
1723 |
<arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg> |
1724 |
<sbr> |
1725 |
<arg>--ignore-secondaries</arg> |
1726 |
<sbr> |
1727 |
<arg>--shutdown-timeout=<replaceable>N</replaceable></arg> |
1728 |
<sbr> |
1729 |
<arg>--force-multiple</arg> |
1730 |
<sbr> |
1731 |
<group choice="opt"> |
1732 |
<arg>--instance</arg> |
1733 |
<arg>--node</arg> |
1734 |
<arg>--primary</arg> |
1735 |
<arg>--secondary</arg> |
1736 |
<arg>--all</arg> |
1737 |
<arg>--tags</arg> |
1738 |
<arg>--node-tags</arg> |
1739 |
<arg>--pri-node-tags</arg> |
1740 |
<arg>--sec-node-tags</arg> |
1741 |
</group> |
1742 |
<sbr> |
1743 |
<arg>--submit</arg> |
1744 |
<sbr> |
1745 |
<arg choice="opt" |
1746 |
rep="repeat"><replaceable>name</replaceable></arg> |
1747 |
</cmdsynopsis> |
1748 |
|
1749 |
<para> |
1750 |
Reboots one or more instances. The type of reboot depends on |
1751 |
the value of <option>--type</option>. A soft reboot does a |
1752 |
hypervisor reboot, a hard reboot does a instance stop, |
1753 |
recreates the hypervisor config for the instance and |
1754 |
starts the instance. A full reboot does the equivalent |
1755 |
of <command>gnt-instance shutdown && gnt-instance |
1756 |
startup</command>. The default is hard reboot. |
1757 |
</para> |
1758 |
|
1759 |
<para> |
1760 |
For the hard reboot the option |
1761 |
<option>--ignore-secondaries</option> ignores errors for the |
1762 |
secondary node while re-assembling the instance disks. |
1763 |
</para> |
1764 |
|
1765 |
<para> |
1766 |
The <option>--instance</option>, <option>--node</option>, |
1767 |
<option>--primary</option>, <option>--secondary</option>, |
1768 |
<option>--all</option>, <option>--tags</option>, |
1769 |
<option>--node-tags</option>, <option>--pri-node-tags</option> and |
1770 |
<option>--sec-node-tags</option> options are similar as for the |
1771 |
<command>startup</command> command and they influence the |
1772 |
actual instances being rebooted. |
1773 |
</para> |
1774 |
|
1775 |
<para> |
1776 |
The <option>--shutdown-timeout</option> is used to specify how |
1777 |
much time to wait before forcing the shutdown (xm destroy in xen, |
1778 |
killing the kvm process, for kvm). By default two minutes are |
1779 |
given to each instance to stop. |
1780 |
</para> |
1781 |
|
1782 |
<para> |
1783 |
The <option>--force-multiple</option> will skip the |
1784 |
interactive confirmation in the case the more than one |
1785 |
instance will be affected. |
1786 |
</para> |
1787 |
|
1788 |
<para> |
1789 |
Example: |
1790 |
<screen> |
1791 |
# gnt-instance reboot instance1.example.com |
1792 |
# gnt-instance reboot --type=full instance1.example.com |
1793 |
</screen> |
1794 |
</para> |
1795 |
</refsect3> |
1796 |
|
1797 |
<refsect3> |
1798 |
<title>CONSOLE</title> |
1799 |
<cmdsynopsis> |
1800 |
<command>console</command> |
1801 |
<arg choice="opt">--show-cmd</arg> |
1802 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
1803 |
</cmdsynopsis> |
1804 |
|
1805 |
<para> |
1806 |
Connects to the console of the given instance. If the |
1807 |
instance is not up, an error is returned. Use the |
1808 |
<option>--show-cmd</option> option to display the command |
1809 |
instead of executing it. |
1810 |
</para> |
1811 |
|
1812 |
<para> |
1813 |
For HVM instances, this will attempt to connect to the |
1814 |
serial console of the instance. To connect to the |
1815 |
virtualized "physical" console of a HVM instance, use a VNC |
1816 |
client with the connection info from the |
1817 |
<command>info</command> command. |
1818 |
</para> |
1819 |
|
1820 |
<para> |
1821 |
Example: |
1822 |
<screen> |
1823 |
# gnt-instance console instance1.example.com |
1824 |
</screen> |
1825 |
</para> |
1826 |
</refsect3> |
1827 |
|
1828 |
</refsect2> |
1829 |
|
1830 |
<refsect2> |
1831 |
<title>Disk management</title> |
1832 |
|
1833 |
<refsect3> |
1834 |
<title>REPLACE-DISKS</title> |
1835 |
|
1836 |
<cmdsynopsis> |
1837 |
<command>replace-disks</command> |
1838 |
<arg>--submit</arg> |
1839 |
<arg>--early-release</arg> |
1840 |
<arg choice="req">-p</arg> |
1841 |
<arg>--disks <replaceable>idx</replaceable></arg> |
1842 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
1843 |
</cmdsynopsis> |
1844 |
|
1845 |
<cmdsynopsis> |
1846 |
<command>replace-disks</command> |
1847 |
<arg>--submit</arg> |
1848 |
<arg>--early-release</arg> |
1849 |
<arg choice="req">-s</arg> |
1850 |
<arg>--disks <replaceable>idx</replaceable></arg> |
1851 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
1852 |
</cmdsynopsis> |
1853 |
|
1854 |
<cmdsynopsis> |
1855 |
<command>replace-disks</command> |
1856 |
<arg>--submit</arg> |
1857 |
<arg>--early-release</arg> |
1858 |
<group choice="req"> |
1859 |
<arg>--iallocator <replaceable>name</replaceable></arg> |
1860 |
<arg>--new-secondary <replaceable>NODE</replaceable></arg> |
1861 |
</group> |
1862 |
|
1863 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
1864 |
</cmdsynopsis> |
1865 |
|
1866 |
<cmdsynopsis> |
1867 |
<command>replace-disks</command> |
1868 |
<arg>--submit</arg> |
1869 |
<arg>--early-release</arg> |
1870 |
<arg choice="req">--auto</arg> |
1871 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
1872 |
</cmdsynopsis> |
1873 |
|
1874 |
<para> |
1875 |
This command is a generalized form for replacing disks. It |
1876 |
is currently only valid for the mirrored (DRBD) disk |
1877 |
template. |
1878 |
</para> |
1879 |
|
1880 |
<para> |
1881 |
The first form (when passing the <option>-p</option> option) |
1882 |
will replace the disks on the primary, while the second form |
1883 |
(when passing the <option>-s</option> option will replace |
1884 |
the disks on the secondary node. For these two cases (as the |
1885 |
node doesn't change), it is possible to only run the replace |
1886 |
for a subset of the disks, using the option |
1887 |
<option>--disks</option> which takes a list of |
1888 |
comma-delimited disk indices (zero-based), |
1889 |
e.g. <userinput>0,2</userinput> to replace only the first |
1890 |
and third disks. |
1891 |
</para> |
1892 |
|
1893 |
<para> |
1894 |
The third form (when passing either the |
1895 |
<option>--iallocator</option> or the |
1896 |
<option>--new-secondary</option> option) is designed to |
1897 |
change secondary node of the instance. Specifying |
1898 |
<option>--iallocator</option> makes the new secondary be |
1899 |
selected automatically by the specified allocator plugin, |
1900 |
otherwise the new secondary node will be the one chosen |
1901 |
manually via the <option>--new-secondary</option> option. |
1902 |
</para> |
1903 |
|
1904 |
<para> |
1905 |
The fourth form (when using <option>--auto</option>) will |
1906 |
automatically determine which disks of an instance are faulty and |
1907 |
replace them within the same node. The <option>--auto</option> |
1908 |
option works only when an instance has only faulty disks on |
1909 |
either the primary or secondary node; it doesn't work when |
1910 |
both sides have faulty disks. |
1911 |
</para> |
1912 |
|
1913 |
<para> |
1914 |
The <option>--submit</option> option is used to send the job to |
1915 |
the master daemon but not wait for its completion. The job |
1916 |
ID will be shown so that it can be examined via |
1917 |
<command>gnt-job info</command>. |
1918 |
</para> |
1919 |
|
1920 |
<para> |
1921 |
The <option>--early-release</option> changes the code so |
1922 |
that the old storage on secondary node(s) is removed early |
1923 |
(before the resync is completed) and the internal Ganeti |
1924 |
locks for the current (and new, if any) secondary node are |
1925 |
also released, thus allowing more parallelism in the cluster |
1926 |
operation. This should be used only when recovering from a |
1927 |
disk failure on the current secondary (thus the old storage |
1928 |
is already broken) or when the storage on the primary node |
1929 |
is known to be fine (thus we won't need the old storage for |
1930 |
potential recovery). |
1931 |
</para> |
1932 |
|
1933 |
<para> |
1934 |
Note that it is not possible to select an offline or drained |
1935 |
node as a new secondary. |
1936 |
</para> |
1937 |
|
1938 |
</refsect3> |
1939 |
|
1940 |
<refsect3> |
1941 |
<title>ACTIVATE-DISKS</title> |
1942 |
|
1943 |
<cmdsynopsis> |
1944 |
<command>activate-disks</command> |
1945 |
<arg>--submit</arg> |
1946 |
<arg>--ignore-size</arg> |
1947 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
1948 |
</cmdsynopsis> |
1949 |
<para> |
1950 |
Activates the block devices of the given instance. If |
1951 |
successful, the command will show the location and name of |
1952 |
the block devices: |
1953 |
<screen> |
1954 |
node1.example.com:disk/0:/dev/drbd0 |
1955 |
node1.example.com:disk/1:/dev/drbd1 |
1956 |
</screen> |
1957 |
|
1958 |
In this example, <emphasis>node1.example.com</emphasis> is |
1959 |
the name of the node on which the devices have been |
1960 |
activated. The <emphasis>disk/0</emphasis> and |
1961 |
<emphasis>disk/1</emphasis> are the Ganeti-names of the |
1962 |
instance disks; how they are visible inside the instance is |
1963 |
hypervisor-specific. <emphasis>/dev/drbd0</emphasis> and |
1964 |
<emphasis>/dev/drbd1</emphasis> are the actual block devices |
1965 |
as visible on the node. |
1966 |
</para> |
1967 |
|
1968 |
<para> |
1969 |
The <option>--submit</option> option is used to send the job to |
1970 |
the master daemon but not wait for its completion. The job |
1971 |
ID will be shown so that it can be examined via |
1972 |
<command>gnt-job info</command>. |
1973 |
</para> |
1974 |
|
1975 |
<para> |
1976 |
The <option>--ignore-size</option> option can be used to |
1977 |
activate disks ignoring the currently configured size in |
1978 |
Ganeti. This can be used in cases where the configuration |
1979 |
has gotten out of sync with the real-world (e.g. after a |
1980 |
partially-failed grow-disk operation or due to rounding in |
1981 |
LVM devices). This should not be used in normal cases, but |
1982 |
only when activate-disks fails without it. |
1983 |
</para> |
1984 |
|
1985 |
<para> |
1986 |
Note that it is safe to run this command while the instance |
1987 |
is already running. |
1988 |
</para> |
1989 |
</refsect3> |
1990 |
|
1991 |
<refsect3> |
1992 |
<title>DEACTIVATE-DISKS</title> |
1993 |
|
1994 |
<cmdsynopsis> |
1995 |
<command>deactivate-disks</command> |
1996 |
<arg>--submit</arg> |
1997 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
1998 |
</cmdsynopsis> |
1999 |
<para> |
2000 |
De-activates the block devices of the given instance. Note |
2001 |
that if you run this command for an instance with a drbd |
2002 |
disk template, while it is running, it will not be able to |
2003 |
shutdown the block devices on the primary node, but it will |
2004 |
shutdown the block devices on the secondary nodes, thus |
2005 |
breaking the replication. |
2006 |
</para> |
2007 |
|
2008 |
<para> |
2009 |
The <option>--submit</option> option is used to send the job to |
2010 |
the master daemon but not wait for its completion. The job |
2011 |
ID will be shown so that it can be examined via |
2012 |
<command>gnt-job info</command>. |
2013 |
</para> |
2014 |
|
2015 |
</refsect3> |
2016 |
|
2017 |
<refsect3> |
2018 |
<title>GROW-DISK</title> |
2019 |
<cmdsynopsis> |
2020 |
<command>grow-disk</command> |
2021 |
<arg>--no-wait-for-sync</arg> |
2022 |
<arg>--submit</arg> |
2023 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
2024 |
<arg choice="req"><replaceable>disk</replaceable></arg> |
2025 |
<arg choice="req"><replaceable>amount</replaceable></arg> |
2026 |
</cmdsynopsis> |
2027 |
|
2028 |
<para> |
2029 |
Grows an instance's disk. This is only possible for |
2030 |
instances having a <literal>plain</literal> or |
2031 |
<literal>drbd</literal> disk template. |
2032 |
</para> |
2033 |
|
2034 |
<para> |
2035 |
Note that this command only change the block device size; it |
2036 |
will not grow the actual filesystems, partitions, etc. that |
2037 |
live on that disk. Usually, you will need to: |
2038 |
<orderedlist> |
2039 |
<listitem> |
2040 |
<simpara>use <command>gnt-instance grow-disk</command></simpara> |
2041 |
</listitem> |
2042 |
<listitem> |
2043 |
<simpara>reboot the instance (later, at a convenient |
2044 |
time)</simpara> |
2045 |
</listitem> |
2046 |
<listitem> |
2047 |
<simpara>use a filesystem resizer, such as |
2048 |
<citerefentry> <refentrytitle>ext2online</refentrytitle> |
2049 |
<manvolnum>8</manvolnum> </citerefentry> or |
2050 |
<citerefentry> <refentrytitle>xfs_growfs</refentrytitle> |
2051 |
<manvolnum>8</manvolnum> </citerefentry> to resize the |
2052 |
filesystem, or use <citerefentry> |
2053 |
<refentrytitle>fdisk</refentrytitle> |
2054 |
<manvolnum>8</manvolnum> </citerefentry> to change the |
2055 |
partition table on the disk |
2056 |
</simpara> |
2057 |
</listitem> |
2058 |
</orderedlist> |
2059 |
</para> |
2060 |
|
2061 |
|
2062 |
<para> |
2063 |
The <replaceable>disk</replaceable> argument is the index of |
2064 |
the instance disk to grow. The |
2065 |
<replaceable>amount</replaceable> argument is given either |
2066 |
as a number (and it represents the amount to increase the |
2067 |
disk with in mebibytes) or can be given similar to the |
2068 |
arguments in the create instance operation, with a suffix |
2069 |
denoting the unit. |
2070 |
</para> |
2071 |
|
2072 |
<para> |
2073 |
Note that the disk grow operation might complete on one node |
2074 |
but fail on the other; this will leave the instance with |
2075 |
different-sized LVs on the two nodes, but this will not |
2076 |
create problems (except for unused space). |
2077 |
</para> |
2078 |
|
2079 |
<para> |
2080 |
If you do not want gnt-instance to wait for the new disk |
2081 |
region to be synced, use the |
2082 |
<option>--no-wait-for-sync</option> option. |
2083 |
</para> |
2084 |
|
2085 |
<para> |
2086 |
The <option>--submit</option> option is used to send the job to |
2087 |
the master daemon but not wait for its completion. The job |
2088 |
ID will be shown so that it can be examined via |
2089 |
<command>gnt-job info</command>. |
2090 |
</para> |
2091 |
|
2092 |
|
2093 |
<para>Example (increase the first disk for instance1 by 16GiB): |
2094 |
<screen> |
2095 |
# gnt-instance grow-disk instance1.example.com 0 16g |
2096 |
</screen> |
2097 |
</para> |
2098 |
|
2099 |
<para> |
2100 |
Also note that disk shrinking is not supported; use |
2101 |
<command>gnt-backup export</command> and then |
2102 |
<command>gnt-backup import</command> to reduce the disk size |
2103 |
of an instance. |
2104 |
</para> |
2105 |
</refsect3> |
2106 |
|
2107 |
<refsect3> |
2108 |
<title>RECREATE-DISKS</title> |
2109 |
|
2110 |
<cmdsynopsis> |
2111 |
<command>recreate-disks</command> |
2112 |
<arg>--submit</arg> |
2113 |
<arg>--disks=<option>indices</option></arg> |
2114 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
2115 |
</cmdsynopsis> |
2116 |
<para> |
2117 |
Recreates the disks of the given instance, or only a subset |
2118 |
of the disks (if the option <option>disks</option> is |
2119 |
passed, which must be a comma-separated list of disk |
2120 |
indices, starting from zero). |
2121 |
</para> |
2122 |
|
2123 |
<para> |
2124 |
Note that this functionality should only be used for missing |
2125 |
disks; if any of the given disks already exists, the |
2126 |
operation will fail. While this is suboptimal, |
2127 |
recreate-disks should hopefully not be needed in normal |
2128 |
operation and as such the impact of this is low. |
2129 |
</para> |
2130 |
|
2131 |
<para> |
2132 |
The <option>--submit</option> option is used to send the job to |
2133 |
the master daemon but not wait for its completion. The job |
2134 |
ID will be shown so that it can be examined via |
2135 |
<command>gnt-job info</command>. |
2136 |
</para> |
2137 |
|
2138 |
</refsect3> |
2139 |
|
2140 |
</refsect2> |
2141 |
|
2142 |
<refsect2> |
2143 |
<title>Recovery</title> |
2144 |
|
2145 |
<refsect3> |
2146 |
<title>FAILOVER</title> |
2147 |
|
2148 |
<cmdsynopsis> |
2149 |
<command>failover</command> |
2150 |
<arg>-f</arg> |
2151 |
<arg>--ignore-consistency</arg> |
2152 |
<arg>--shutdown-timeout=<replaceable>N</replaceable></arg> |
2153 |
<arg>--submit</arg> |
2154 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
2155 |
</cmdsynopsis> |
2156 |
|
2157 |
<para> |
2158 |
Failover will fail the instance over its secondary |
2159 |
node. This works only for instances having a drbd disk |
2160 |
template. |
2161 |
</para> |
2162 |
|
2163 |
<para> |
2164 |
Normally the failover will check the consistency of the |
2165 |
disks before failing over the instance. If you are trying to |
2166 |
migrate instances off a dead node, this will fail. Use the |
2167 |
<option>--ignore-consistency</option> option for this |
2168 |
purpose. Note that this option can be dangerous as errors in |
2169 |
shutting down the instance will be ignored, resulting in |
2170 |
possibly having the instance running on two machines in |
2171 |
parallel (on disconnected DRBD drives). |
2172 |
</para> |
2173 |
|
2174 |
<para> |
2175 |
The <option>--shutdown-timeout</option> is used to specify how |
2176 |
much time to wait before forcing the shutdown (xm destroy in xen, |
2177 |
killing the kvm process, for kvm). By default two minutes are |
2178 |
given to each instance to stop. |
2179 |
</para> |
2180 |
|
2181 |
<para> |
2182 |
The <option>--submit</option> option is used to send the job to |
2183 |
the master daemon but not wait for its completion. The job |
2184 |
ID will be shown so that it can be examined via |
2185 |
<command>gnt-job info</command>. |
2186 |
</para> |
2187 |
|
2188 |
<para> |
2189 |
Example: |
2190 |
<screen> |
2191 |
# gnt-instance failover instance1.example.com |
2192 |
</screen> |
2193 |
</para> |
2194 |
</refsect3> |
2195 |
|
2196 |
<refsect3> |
2197 |
<title>MIGRATE</title> |
2198 |
|
2199 |
<cmdsynopsis> |
2200 |
<command>migrate</command> |
2201 |
<arg>-f</arg> |
2202 |
<arg choice="req">--cleanup</arg> |
2203 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
2204 |
</cmdsynopsis> |
2205 |
|
2206 |
<cmdsynopsis> |
2207 |
<command>migrate</command> |
2208 |
<arg>-f</arg> |
2209 |
<arg>--non-live</arg> |
2210 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
2211 |
</cmdsynopsis> |
2212 |
|
2213 |
<para> |
2214 |
Migrate will move the instance to its secondary node without |
2215 |
shutdown. It only works for instances having the drbd8 disk |
2216 |
template type. |
2217 |
</para> |
2218 |
|
2219 |
<para> |
2220 |
The migration command needs a perfectly healthy instance, as |
2221 |
we rely on the dual-master capability of drbd8 and the disks |
2222 |
of the instance are not allowed to be degraded. |
2223 |
</para> |
2224 |
|
2225 |
<para> |
2226 |
The <option>--non-live</option> option will switch (for the |
2227 |
hypervisors that support it) between a "fully live" |
2228 |
(i.e. the interruption is as minimal as possible) migration |
2229 |
and one in which the instance is frozen, its state saved and |
2230 |
transported to the remote node, and then resumed there. This |
2231 |
all depends on the hypervisor support for two different |
2232 |
methods. In any case, it is not an error to pass this |
2233 |
parameter (it will just be ignored if the hypervisor doesn't |
2234 |
support it). |
2235 |
</para> |
2236 |
|
2237 |
<para> |
2238 |
If the <option>--cleanup</option> option is passed, the |
2239 |
operation changes from migration to attempting recovery from |
2240 |
a failed previous migration. In this mode, ganeti checks if |
2241 |
the instance runs on the correct node (and updates its |
2242 |
configuration if not) and ensures the instances's disks are |
2243 |
configured correctly. In this mode, the |
2244 |
<option>--non-live</option> option is ignored. |
2245 |
</para> |
2246 |
|
2247 |
<para> |
2248 |
The option <option>-f</option> will skip the prompting for |
2249 |
confirmation. |
2250 |
</para> |
2251 |
<para> |
2252 |
Example (and expected output): |
2253 |
<screen> |
2254 |
# gnt-instance migrate instance1 |
2255 |
Migrate will happen to the instance instance1. Note that migration is |
2256 |
**experimental** in this version. This might impact the instance if |
2257 |
anything goes wrong. Continue? |
2258 |
y/[n]/?: y |
2259 |
* checking disk consistency between source and target |
2260 |
* ensuring the target is in secondary mode |
2261 |
* changing disks into dual-master mode |
2262 |
- INFO: Waiting for instance instance1 to sync disks. |
2263 |
- INFO: Instance instance1's disks are in sync. |
2264 |
* migrating instance to node2.example.com |
2265 |
* changing the instance's disks on source node to secondary |
2266 |
- INFO: Waiting for instance instance1 to sync disks. |
2267 |
- INFO: Instance instance1's disks are in sync. |
2268 |
* changing the instance's disks to single-master |
2269 |
# |
2270 |
</screen> |
2271 |
</para> |
2272 |
</refsect3> |
2273 |
|
2274 |
<refsect3> |
2275 |
<title>MOVE</title> |
2276 |
|
2277 |
<cmdsynopsis> |
2278 |
<command>move</command> |
2279 |
<arg>-f</arg> |
2280 |
<arg>-n <replaceable>node</replaceable></arg> |
2281 |
<arg>--shutdown-timeout=<replaceable>N</replaceable></arg> |
2282 |
<arg>--submit</arg> |
2283 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
2284 |
</cmdsynopsis> |
2285 |
|
2286 |
<para> |
2287 |
Move will move the instance to an arbitrary node in the |
2288 |
cluster. This works only for instances having a plain or |
2289 |
file disk template. |
2290 |
</para> |
2291 |
|
2292 |
<para> |
2293 |
Note that since this operation is done via data copy, it |
2294 |
will take a long time for big disks (similar to |
2295 |
replace-disks for a drbd instance). |
2296 |
</para> |
2297 |
|
2298 |
<para> |
2299 |
The <option>--shutdown-timeout</option> is used to specify how |
2300 |
much time to wait before forcing the shutdown (xm destroy in xen, |
2301 |
killing the kvm process, for kvm). By default two minutes are |
2302 |
given to each instance to stop. |
2303 |
</para> |
2304 |
|
2305 |
<para> |
2306 |
The <option>--submit</option> option is used to send the job to |
2307 |
the master daemon but not wait for its completion. The job |
2308 |
ID will be shown so that it can be examined via |
2309 |
<command>gnt-job info</command>. |
2310 |
</para> |
2311 |
|
2312 |
<para> |
2313 |
Example: |
2314 |
<screen> |
2315 |
# gnt-instance move -n node3.example.com instance1.example.com |
2316 |
</screen> |
2317 |
</para> |
2318 |
</refsect3> |
2319 |
|
2320 |
</refsect2> |
2321 |
|
2322 |
<refsect2> |
2323 |
<title>TAGS</title> |
2324 |
|
2325 |
<refsect3> |
2326 |
<title>ADD-TAGS</title> |
2327 |
|
2328 |
<cmdsynopsis> |
2329 |
<command>add-tags</command> |
2330 |
<arg choice="opt">--from <replaceable>file</replaceable></arg> |
2331 |
<arg choice="req"><replaceable>instancename</replaceable></arg> |
2332 |
<arg choice="req" |
2333 |
rep="repeat"><replaceable>tag</replaceable></arg> |
2334 |
</cmdsynopsis> |
2335 |
|
2336 |
<para> |
2337 |
Add tags to the given instance. If any of the tags contains |
2338 |
invalid characters, the entire operation will abort. |
2339 |
</para> |
2340 |
<para> |
2341 |
If the <option>--from</option> option is given, the list of |
2342 |
tags will be extended with the contents of that file (each |
2343 |
line becomes a tag). In this case, there is not need to pass |
2344 |
tags on the command line (if you do, both sources will be |
2345 |
used). A file name of - will be interpreted as stdin. |
2346 |
</para> |
2347 |
</refsect3> |
2348 |
|
2349 |
<refsect3> |
2350 |
<title>LIST-TAGS</title> |
2351 |
|
2352 |
<cmdsynopsis> |
2353 |
<command>list-tags</command> |
2354 |
<arg choice="req"><replaceable>instancename</replaceable></arg> |
2355 |
</cmdsynopsis> |
2356 |
|
2357 |
<para>List the tags of the given instance.</para> |
2358 |
</refsect3> |
2359 |
|
2360 |
<refsect3> |
2361 |
<title>REMOVE-TAGS</title> |
2362 |
<cmdsynopsis> |
2363 |
<command>remove-tags</command> |
2364 |
<arg choice="opt">--from <replaceable>file</replaceable></arg> |
2365 |
<arg choice="req"><replaceable>instancename</replaceable></arg> |
2366 |
<arg choice="req" |
2367 |
rep="repeat"><replaceable>tag</replaceable></arg> |
2368 |
</cmdsynopsis> |
2369 |
|
2370 |
<para> |
2371 |
Remove tags from the given instance. If any of the tags are |
2372 |
not existing on the node, the entire operation will abort. |
2373 |
</para> |
2374 |
|
2375 |
<para> |
2376 |
If the <option>--from</option> option is given, the list of |
2377 |
tags will be extended with the contents of that file (each |
2378 |
line becomes a tag). In this case, there is not need to pass |
2379 |
tags on the command line (if you do, both sources will be |
2380 |
used). A file name of - will be interpreted as stdin. |
2381 |
</para> |
2382 |
</refsect3> |
2383 |
|
2384 |
</refsect2> |
2385 |
|
2386 |
</refsect1> |
2387 |
|
2388 |
&footer; |
2389 |
|
2390 |
</refentry> |
2391 |
|
2392 |
<!-- Keep this comment at the end of the file |
2393 |
Local variables: |
2394 |
mode: sgml |
2395 |
sgml-omittag:t |
2396 |
sgml-shorttag:t |
2397 |
sgml-minimize-attributes:nil |
2398 |
sgml-always-quote-attributes:t |
2399 |
sgml-indent-step:2 |
2400 |
sgml-indent-data:t |
2401 |
sgml-parent-document:nil |
2402 |
sgml-default-dtd-file:nil |
2403 |
sgml-exposed-tags:nil |
2404 |
sgml-local-catalogs:nil |
2405 |
sgml-local-ecat-files:nil |
2406 |
End: |
2407 |
--> |