root / man / gnt-instance.sgml @ 00f98619
History | View | Annotate | Download (34.2 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>May 16, 2007</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 |
<holder>Google Inc.</holder> |
24 |
</copyright> |
25 |
&dhdate; |
26 |
</refentryinfo> |
27 |
<refmeta> |
28 |
&dhucpackage; |
29 |
|
30 |
&dhsection; |
31 |
<refmiscinfo>ganeti 1.2</refmiscinfo> |
32 |
</refmeta> |
33 |
<refnamediv> |
34 |
<refname>&dhpackage;</refname> |
35 |
|
36 |
<refpurpose>ganeti instance administration</refpurpose> |
37 |
</refnamediv> |
38 |
<refsynopsisdiv> |
39 |
<cmdsynopsis> |
40 |
<command>&dhpackage; </command> |
41 |
|
42 |
<arg choice="req">command</arg> |
43 |
<arg>arguments...</arg> |
44 |
</cmdsynopsis> |
45 |
</refsynopsisdiv> |
46 |
<refsect1> |
47 |
<title>DESCRIPTION</title> |
48 |
|
49 |
<para> |
50 |
The <command>&dhpackage;</command> is used for instance |
51 |
administration in the ganeti system. |
52 |
</para> |
53 |
|
54 |
</refsect1> |
55 |
<refsect1> |
56 |
<title>COMMANDS</title> |
57 |
|
58 |
<refsect2> |
59 |
<title>Creation/removal/querying</title> |
60 |
|
61 |
<refsect3> |
62 |
<title>ADD</title> |
63 |
<cmdsynopsis> |
64 |
<command>add</command> |
65 |
<arg>-s <replaceable>disksize</replaceable></arg> |
66 |
<arg>--swap-size <replaceable>disksize</replaceable></arg> |
67 |
<arg>-m <replaceable>memsize</replaceable></arg> |
68 |
<sbr> |
69 |
<arg>-o <replaceable>os-type</replaceable></arg> |
70 |
<arg>-b <replaceable>bridge</replaceable></arg> |
71 |
<arg>--mac <replaceable>MAC-address</replaceable></arg> |
72 |
<sbr> |
73 |
<arg>--kernel <group choice="req"> |
74 |
<arg>default</arg> |
75 |
<arg><replaceable>kernel_path</replaceable></arg> |
76 |
</group></arg> |
77 |
<sbr> |
78 |
<arg>--initrd <group choice="req"> |
79 |
<arg>default</arg> |
80 |
<arg>none</arg> |
81 |
<arg><replaceable>initrd_path</replaceable></arg> |
82 |
</group> </arg> |
83 |
<sbr> |
84 |
<arg choice="req">-t<group> |
85 |
<arg>diskless</arg> |
86 |
<arg>plain</arg> |
87 |
<arg>local_raid1</arg> |
88 |
<arg>remote_raid1</arg> |
89 |
<arg>drbd</arg> |
90 |
</group> |
91 |
</arg> |
92 |
<sbr> |
93 |
<arg choice="req">-n <replaceable>node<optional>:secondary-node</optional></replaceable></arg> |
94 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
95 |
</cmdsynopsis> |
96 |
|
97 |
<para> |
98 |
Creates a new instance on the specified |
99 |
host. <replaceable>instance</replaceable> must be in DNS and |
100 |
resolve to a IP in the same network as the nodes in the |
101 |
cluster. |
102 |
</para> |
103 |
|
104 |
<para> |
105 |
The <option>-s</option> option specifies the disk size for |
106 |
the instance, in mebibytes (defaults to |
107 |
<constant>20480MiB</constant> = |
108 |
<constant>20GiB</constant>). You can also use one of the |
109 |
suffixes <literal>m</literal>, <literal>g</literal> or |
110 |
<literal>t</literal> to specificy the exact the units used; |
111 |
these suffixes map to mebibytes, gibibytes and tebibytes. |
112 |
</para> |
113 |
|
114 |
<para> |
115 |
The <option>--swap-size</option> option specifies the swap |
116 |
disk size (in mebibytes) for the instance (the one presented |
117 |
as <filename class="devicefile">/dev/sdb</filename>). The |
118 |
default is <constant>4096MiB</constant>. As for the disk |
119 |
size, you can specify other suffixes. |
120 |
</para> |
121 |
|
122 |
<para> |
123 |
The <option>-m</option> option specifies the memory size for |
124 |
the instance, in mebibytes (defaults to 128 MiB). Again, you |
125 |
can use other suffixes (e.g. <userinput>2g</userinput>). |
126 |
</para> |
127 |
|
128 |
<para> |
129 |
The <option>-o</option> options specifies the operating |
130 |
system to be installed. The available operating systems can |
131 |
be listed with <command>gnt-os list</command>. |
132 |
</para> |
133 |
|
134 |
<para> |
135 |
The <option>-b</option> option specifies the bridge to which the |
136 |
instance will be connected. (defaults to the cluster-wide default |
137 |
bridge specified at cluster initialization time). |
138 |
</para> |
139 |
|
140 |
<para> |
141 |
The <option>--mac</option> option specifies the MAC address |
142 |
of the ethernet interface for the instance. If this option |
143 |
is not specified, a new MAC address is generated randomly with |
144 |
the configured MAC prefix. The randomly generated MAC |
145 |
address is guaranteed to be unique among the instances of |
146 |
this cluster. |
147 |
</para> |
148 |
|
149 |
<para> |
150 |
The <option>--kernel</option> options allows the instance to |
151 |
use a custom kernel (if a filename is passed) or to use the |
152 |
default kernel (<filename>@CUSTOM_XEN_KERNEL@</filename>), if the |
153 |
string <constant>default</constant> is passed. |
154 |
</para> |
155 |
|
156 |
<para> |
157 |
The <option>--initrd</option> option is similar: it allows |
158 |
the instance to use a custom initrd (if a filename is |
159 |
passed) or to use the default initrd |
160 |
(<filename>@CUSTOM_XEN_INITRD@</filename>), if the string |
161 |
<constant>default</constant> is passed, or to disable the |
162 |
use of an initrd, if the string <constant>none</constant> is |
163 |
passed. Note that in the case the instance is set to use the |
164 |
default initrd and it doesn't exist, it will be silently |
165 |
ignored; if the instance is set to use a custom initrd and |
166 |
it doesn't exist, this will be treated as an error and will |
167 |
prevent the startup of the instance. |
168 |
</para> |
169 |
|
170 |
<para> |
171 |
The <option>-t</option> options specifies the disk layout type for |
172 |
the instance. The available choices are: |
173 |
<variablelist> |
174 |
<varlistentry> |
175 |
<term>diskless</term> |
176 |
<listitem> |
177 |
<para> |
178 |
This creates an instance with no disks. Its useful for |
179 |
testing only (or other special cases). |
180 |
</para> |
181 |
</listitem> |
182 |
</varlistentry> |
183 |
<varlistentry> |
184 |
<term>plain</term> |
185 |
<listitem> |
186 |
<para>Disk devices will be logical volumes.</para> |
187 |
</listitem> |
188 |
</varlistentry> |
189 |
<varlistentry> |
190 |
<term>local_raid1</term> |
191 |
<listitem> |
192 |
<para> |
193 |
Disk devices will be md raid1 arrays over two local |
194 |
logical volumes. |
195 |
</para> |
196 |
</listitem> |
197 |
</varlistentry> |
198 |
<varlistentry> |
199 |
<term>remote_raid1</term> |
200 |
<listitem> |
201 |
<para> |
202 |
Disk devices will be md raid1 arrays with one |
203 |
component (so it's not actually raid1): a drbd |
204 |
(0.7.x) device between the instance's primary node |
205 |
and the node given by the second value of the |
206 |
<option>--node</option> option. |
207 |
</para> |
208 |
</listitem> |
209 |
</varlistentry> |
210 |
<varlistentry> |
211 |
<term>drbd</term> |
212 |
<listitem> |
213 |
<para> |
214 |
Disk devices will be drbd (version 8.x) on top of |
215 |
lvm volumes. They are equivalent in functionality to |
216 |
<replaceable>remote_raid1</replaceable>, but are |
217 |
recommended for new instances (if you have drbd 8.x |
218 |
installed). |
219 |
</para> |
220 |
</listitem> |
221 |
</varlistentry> |
222 |
</variablelist> |
223 |
</para> |
224 |
|
225 |
<para> |
226 |
The optional second value of the <option>--node</option> is used for |
227 |
the remote raid template type and specifies the remote node. |
228 |
</para> |
229 |
|
230 |
<para> |
231 |
If you do not want gnt-instance to wait for the disk mirror |
232 |
to be synced, use the <option>--no-wait-for-sync</option> |
233 |
option. |
234 |
</para> |
235 |
|
236 |
<para> |
237 |
Example: |
238 |
<screen> |
239 |
# gnt-instance add -t plain -s 30g -m 512 -o debian-etch \ |
240 |
-n node1.example.com instance1.example.com |
241 |
# gnt-instance add -t remote_raid1 -s 30g -m 512 -o debian-etch \ |
242 |
-n node1.example.com:node2.example.com instance2.example.com |
243 |
</screen> |
244 |
</para> |
245 |
</refsect3> |
246 |
|
247 |
<refsect3> |
248 |
<title>REMOVE</title> |
249 |
|
250 |
<cmdsynopsis> |
251 |
<command>remove</command> |
252 |
<arg>--ignore-failures</arg> |
253 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
254 |
</cmdsynopsis> |
255 |
|
256 |
<para> |
257 |
Remove an instance. This will remove all data from the |
258 |
instance and there is <emphasis>no way back</emphasis>. If |
259 |
you are not sure if you use an instance again, use |
260 |
<command>shutdown</command> first and leave it in the |
261 |
shutdown state for a while. |
262 |
|
263 |
</para> |
264 |
|
265 |
<para> |
266 |
The <option>--ignore-failures</option> option will cause the |
267 |
removal to proceed even in the presence of errors during the |
268 |
removal of the instance (e.g. during the shutdown or the |
269 |
disk removal). If this option is not given, the command will |
270 |
stop at the first error. |
271 |
</para> |
272 |
|
273 |
<para> |
274 |
Example: |
275 |
<screen> |
276 |
# gnt-instance remove instance1.example.com |
277 |
</screen> |
278 |
</para> |
279 |
</refsect3> |
280 |
|
281 |
<refsect3> |
282 |
<title>LIST</title> |
283 |
|
284 |
<cmdsynopsis> |
285 |
<command>list</command> |
286 |
<arg>--no-headers</arg> |
287 |
<arg>--separator=<replaceable>SEPARATOR</replaceable></arg> |
288 |
<arg>-o <replaceable>FIELD,...</replaceable></arg> |
289 |
</cmdsynopsis> |
290 |
|
291 |
<para> |
292 |
Shows the currently configured instances with memory usage, |
293 |
disk usage, the node they are running on, and the CPU time, |
294 |
counted in seconds, used by each instance since its latest |
295 |
restart. |
296 |
</para> |
297 |
|
298 |
<para> |
299 |
The <option>--no-headers</option> option will skip the |
300 |
initial header line. The <option>--separator</option> option |
301 |
takes an argument which denotes what will be used between |
302 |
the output fields. Both these options are to help scripting. |
303 |
</para> |
304 |
|
305 |
<para> |
306 |
The <option>-o</option> option takes a comma-separated list |
307 |
of output fields. The available fields and their meaning |
308 |
are: |
309 |
<variablelist> |
310 |
<varlistentry> |
311 |
<term>name</term> |
312 |
<listitem> |
313 |
<simpara>the instance name</simpara> |
314 |
</listitem> |
315 |
</varlistentry> |
316 |
<varlistentry> |
317 |
<term>os</term> |
318 |
<listitem> |
319 |
<simpara>the OS of the instance</simpara> |
320 |
</listitem> |
321 |
</varlistentry> |
322 |
<varlistentry> |
323 |
<term>pnode</term> |
324 |
<listitem> |
325 |
<simpara>the primary node of the instance</simpara> |
326 |
</listitem> |
327 |
</varlistentry> |
328 |
<varlistentry> |
329 |
<term>snodes</term> |
330 |
<listitem> |
331 |
<simpara>comma-separated list of secondary nodes for the |
332 |
instance; usually this will be just one node</simpara> |
333 |
</listitem> |
334 |
</varlistentry> |
335 |
<varlistentry> |
336 |
<term>admin_state</term> |
337 |
<listitem> |
338 |
<simpara>the desired state of the instance (either "yes" |
339 |
or "no" denoting the instance should run or |
340 |
not)</simpara> |
341 |
</listitem> |
342 |
</varlistentry> |
343 |
<varlistentry> |
344 |
<term>admin_ram</term> |
345 |
<listitem> |
346 |
<simpara>the desired memory for the instance</simpara> |
347 |
</listitem> |
348 |
</varlistentry> |
349 |
<varlistentry> |
350 |
<term>disk_template</term> |
351 |
<listitem> |
352 |
<simpara>the disk template of the instance</simpara> |
353 |
</listitem> |
354 |
</varlistentry> |
355 |
<varlistentry> |
356 |
<term>oper_state</term> |
357 |
<listitem> |
358 |
<simpara>the actual state of the instance; can take of |
359 |
the values "running", "stopped", "(node down)"</simpara> |
360 |
</listitem> |
361 |
</varlistentry> |
362 |
<varlistentry> |
363 |
<term>oper_ram</term> |
364 |
<listitem> |
365 |
<simpara>the actual memory usage of the instance as seen |
366 |
by the hypervisor</simpara> |
367 |
</listitem> |
368 |
</varlistentry> |
369 |
<varlistentry> |
370 |
<term>ip</term> |
371 |
<listitem> |
372 |
<simpara>the ip address ganeti recognizes as associated with |
373 |
the instance interface</simpara> |
374 |
</listitem> |
375 |
</varlistentry> |
376 |
<varlistentry> |
377 |
<term>mac</term> |
378 |
<listitem> |
379 |
<simpara>the instance interface MAC address</simpara> |
380 |
</listitem> |
381 |
</varlistentry> |
382 |
<varlistentry> |
383 |
<term>bridge</term> |
384 |
<listitem> |
385 |
<simpara>bridge the instance is connected to |
386 |
</simpara> |
387 |
</listitem> |
388 |
</varlistentry> |
389 |
</variablelist> |
390 |
</para> |
391 |
|
392 |
<para> |
393 |
There is a subtle grouping about the available output |
394 |
fields: all fields except for <option>oper_state</option> |
395 |
and <option>oper_ram</option> are configuration value and |
396 |
not run-time values. So if you don't select any of the |
397 |
<option>oper_*</option> fields, the query will be satisfied |
398 |
instantly from the cluster configuration, without having to |
399 |
ask the remote nodes for the data. This can be helpful for |
400 |
big clusters when you only want some data and it makes sense |
401 |
to specify a reduced set of output fields. |
402 |
</para> |
403 |
|
404 |
<para>The default output field list is: |
405 |
<simplelist type="inline"> |
406 |
<member>name</member> |
407 |
<member>os</member> |
408 |
<member>pnode</member> |
409 |
<member>admin_state</member> |
410 |
<member>oper_state</member> |
411 |
<member>oper_ram</member> |
412 |
</simplelist>. |
413 |
</para> |
414 |
</refsect3> |
415 |
|
416 |
<refsect3> |
417 |
<title>INFO</title> |
418 |
|
419 |
<cmdsynopsis> |
420 |
<command>info</command> |
421 |
<arg rep="repeat"><replaceable>instance</replaceable></arg> |
422 |
</cmdsynopsis> |
423 |
|
424 |
<para> |
425 |
Show detailed information about the (given) instances. This |
426 |
is different from <command>list</command> as it shows |
427 |
detailed data about the instance's disks (especially useful |
428 |
for remote raid templates). |
429 |
</para> |
430 |
</refsect3> |
431 |
|
432 |
<refsect3> |
433 |
<title>MODIFY</title> |
434 |
|
435 |
<cmdsynopsis> |
436 |
<command>modify</command> |
437 |
<arg choice="opt">-m <replaceable>memsize</replaceable></arg> |
438 |
<arg choice="opt">-p <replaceable>vcpus</replaceable></arg> |
439 |
<arg choice="opt">-i <replaceable>ip</replaceable></arg> |
440 |
<arg choice="opt">-b <replaceable>bridge</replaceable></arg> |
441 |
<arg choice="opt">--mac <replaceable>MAC-address</replaceable></arg> |
442 |
<sbr> |
443 |
<arg>--kernel <group choice="req"> |
444 |
<arg>default</arg> |
445 |
<arg><replaceable>kernel_path</replaceable></arg> |
446 |
</group></arg> |
447 |
<sbr> |
448 |
<arg>--initrd <group choice="req"> |
449 |
<arg>default</arg> |
450 |
<arg>none</arg> |
451 |
<arg><replaceable>initrd_path</replaceable></arg> |
452 |
</group> </arg> |
453 |
<sbr> |
454 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
455 |
</cmdsynopsis> |
456 |
|
457 |
<para> |
458 |
Modify the memory size, number of vcpus, ip address, MAC |
459 |
address and/or bridge for an instance. |
460 |
</para> |
461 |
|
462 |
<para> |
463 |
The memory size is given in MiB. Note that you need to give |
464 |
at least one of the arguments, otherwise the command |
465 |
complains. |
466 |
</para> |
467 |
|
468 |
<para> |
469 |
The <option>--kernel</option> and <option>--initrd</option> |
470 |
options are described in the <command>add</command> command. |
471 |
</para> |
472 |
|
473 |
<para> |
474 |
All the changes take effect at the next restart. If the |
475 |
instance is running, there is no effect on the instance. |
476 |
</para> |
477 |
</refsect3> |
478 |
|
479 |
<refsect3> |
480 |
<title>REINSTALL</title> |
481 |
|
482 |
<cmdsynopsis> |
483 |
<command>reinstall</command> |
484 |
<arg choice="opt">-o <replaceable>os-type</replaceable></arg> |
485 |
<arg choice="opt">-f <replaceable>force</replaceable></arg> |
486 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
487 |
</cmdsynopsis> |
488 |
|
489 |
<para> |
490 |
Reinstalls the operating system on the given instance. The instance |
491 |
must be stopped when running this command. If the |
492 |
<option>--os-type</option> is specified, the operating system is |
493 |
changed. |
494 |
</para> |
495 |
</refsect3> |
496 |
|
497 |
<refsect3> |
498 |
<title>RENAME</title> |
499 |
|
500 |
<cmdsynopsis> |
501 |
<command>rename</command> |
502 |
<arg>--no-ip-check</arg> |
503 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
504 |
<arg choice="req"><replaceable>new_name</replaceable></arg> |
505 |
</cmdsynopsis> |
506 |
|
507 |
<para> |
508 |
Renames the given instance. The instance must be stopped |
509 |
when running this command. The requirements for the new name |
510 |
are the same as for adding an instance: the new name must be |
511 |
resolvable and the IP it resolves to must not be reachable |
512 |
(in order to prevent duplicate IPs the next time the |
513 |
instance is started). The IP test can be skipped if the |
514 |
<option>--no-ip-check</option> option is passed. |
515 |
</para> |
516 |
</refsect3> |
517 |
|
518 |
</refsect2> |
519 |
|
520 |
<refsect2> |
521 |
<title>Starting/stopping/connecting to console</title> |
522 |
|
523 |
<refsect3> |
524 |
<title>STARTUP</title> |
525 |
|
526 |
<cmdsynopsis> |
527 |
<command>startup</command> |
528 |
<arg>--extra=<replaceable>PARAMS</replaceable></arg> |
529 |
<arg>--force</arg> |
530 |
<sbr> |
531 |
<group choice="opt"> |
532 |
<arg>--instance</arg> |
533 |
<arg>--node</arg> |
534 |
<arg>--primary</arg> |
535 |
<arg>--secondary</arg> |
536 |
<arg>--all</arg> |
537 |
</group> |
538 |
<sbr> |
539 |
<arg choice="opt" |
540 |
rep="repeat"><replaceable>name</replaceable></arg> |
541 |
</cmdsynopsis> |
542 |
|
543 |
<para> |
544 |
Starts one or more instances, depending on the following |
545 |
options. The four available modes are: |
546 |
<variablelist> |
547 |
<varlistentry> |
548 |
<term><option>--instance</option></term> |
549 |
<listitem> |
550 |
<simpara>will start the instances given as arguments |
551 |
(at least one argument required); this is the default |
552 |
selection</simpara> |
553 |
</listitem> |
554 |
</varlistentry> |
555 |
<varlistentry> |
556 |
<term>--node</term> |
557 |
<listitem> |
558 |
<simpara>will start the instances who have the given |
559 |
node as either primary or secondary</simpara> |
560 |
</listitem> |
561 |
</varlistentry> |
562 |
<varlistentry> |
563 |
<term><option>--primary</option></term> |
564 |
<listitem> |
565 |
<simpara>will start all instances whose primary node |
566 |
is in the list of nodes passed as arguments (at least |
567 |
one node required)</simpara> |
568 |
</listitem> |
569 |
</varlistentry> |
570 |
<varlistentry> |
571 |
<term><option>--secondary</option></term> |
572 |
<listitem> |
573 |
<simpara>will start all instances whose secondary node |
574 |
is in the list of nodes passed as arguments (at least |
575 |
one node required)</simpara> |
576 |
</listitem> |
577 |
</varlistentry> |
578 |
<varlistentry> |
579 |
<term>--all</term> |
580 |
<listitem> |
581 |
<simpara>will start all instances in the cluster (no |
582 |
arguments accepted)</simpara> |
583 |
</listitem> |
584 |
</varlistentry> |
585 |
</variablelist> |
586 |
</para> |
587 |
|
588 |
<para> |
589 |
Note that although you can pass more than one selection |
590 |
option, the last one wins, so in order to guarantee the |
591 |
desired result, don't pass more than one such option. |
592 |
</para> |
593 |
|
594 |
<para> |
595 |
The <option>--extra</option> option is used to pass |
596 |
additional argument to the instance's kernel for this start |
597 |
only. Currently there is no way to specify a persistent set |
598 |
of arguments (beside the one hardcoded). Note that this may |
599 |
not apply to all virtualization types. |
600 |
</para> |
601 |
|
602 |
<para> |
603 |
Use <option>--force</option> to start even if secondary disks are |
604 |
failing. |
605 |
</para> |
606 |
|
607 |
<para> |
608 |
Example: |
609 |
<screen> |
610 |
# gnt-instance start instance1.example.com |
611 |
# gnt-instance start --extra single test1.example.com |
612 |
# gnt-instance start --node node1.example.com node2.example.com |
613 |
# gnt-instance start --all |
614 |
</screen> |
615 |
</para> |
616 |
</refsect3> |
617 |
|
618 |
<refsect3> |
619 |
<title>SHUTDOWN</title> |
620 |
|
621 |
<cmdsynopsis> |
622 |
<command>shutdown</command> |
623 |
<sbr> |
624 |
<group choice="opt"> |
625 |
<arg>--instance</arg> |
626 |
<arg>--node</arg> |
627 |
<arg>--primary</arg> |
628 |
<arg>--secondary</arg> |
629 |
<arg>--all</arg> |
630 |
</group> |
631 |
<sbr> |
632 |
|
633 |
<arg choice="opt" |
634 |
rep="repeat"><replaceable>name</replaceable></arg> |
635 |
</cmdsynopsis> |
636 |
|
637 |
<para> |
638 |
Stops one or more instances. If the instance cannot be |
639 |
cleanly stopped during a hardcoded interval (currently 2 |
640 |
minutes), it will forcibly stop the instance (equivalent to |
641 |
switching off the power on a physical machine). |
642 |
</para> |
643 |
|
644 |
<para> |
645 |
The <option>--instance</option>, <option>--node</option>, |
646 |
<option>--primary</option>, <option>--secondary</option> and |
647 |
<option>--all</option> options are similar as for the |
648 |
<command>startup</command> command and they influence the |
649 |
actual instances being shutdown. |
650 |
</para> |
651 |
|
652 |
<para> |
653 |
Example: |
654 |
<screen> |
655 |
# gnt-instance shutdown instance1.example.com |
656 |
# gnt-instance shutdown --all |
657 |
</screen> |
658 |
</para> |
659 |
</refsect3> |
660 |
|
661 |
<refsect3> |
662 |
<title>REBOOT</title> |
663 |
|
664 |
<cmdsynopsis> |
665 |
<command>reboot</command> |
666 |
<sbr> |
667 |
<arg>--extra=<replaceable>PARAMS</replaceable></arg> |
668 |
<sbr> |
669 |
<arg>--type=<replaceable>REBOOT-TYPE</replaceable></arg> |
670 |
<sbr> |
671 |
<arg>--ignore-secondaries</arg> |
672 |
<sbr> |
673 |
<arg>--force-multiple</arg> |
674 |
<sbr> |
675 |
<group choice="opt"> |
676 |
<arg>--instance</arg> |
677 |
<arg>--node</arg> |
678 |
<arg>--primary</arg> |
679 |
<arg>--secondary</arg> |
680 |
<arg>--all</arg> |
681 |
</group> |
682 |
<sbr> |
683 |
|
684 |
<arg choice="opt" |
685 |
rep="repeat"><replaceable>name</replaceable></arg> |
686 |
</cmdsynopsis> |
687 |
|
688 |
<para> |
689 |
Reboots one or more instances. The type of reboot depends on |
690 |
the value of <option>--type</option>. A soft reboot does a |
691 |
hypervisor reboot, a hard reboot does a instance stop, |
692 |
recreates the hypervisor config for the instance and |
693 |
starts the instance. A full reboot does the equivalent |
694 |
of <command>gnt-instance shutdown && gnt-instance |
695 |
startup</command>. The default is soft reboot. |
696 |
</para> |
697 |
|
698 |
<para> |
699 |
For the hard reboot the option |
700 |
<option>--ignore-secondaries</option> ignores errors for the |
701 |
secondary node while re-assembling the instance disks. |
702 |
</para> |
703 |
|
704 |
<para> |
705 |
The <option>--instance</option>, <option>--node</option>, |
706 |
<option>--primary</option>, <option>--secondary</option> and |
707 |
<option>--all</option> options are similar as for the |
708 |
<command>startup</command> command and they influence the |
709 |
actual instances being rebooted. |
710 |
</para> |
711 |
|
712 |
<para> |
713 |
Use the <option>--force-multiple</option> option to keep |
714 |
gnt-instance from asking for confirmation when more than one |
715 |
instance is affected. |
716 |
</para> |
717 |
|
718 |
<para> |
719 |
Example: |
720 |
<screen> |
721 |
# gnt-instance reboot instance1.example.com |
722 |
# gnt-instance reboot --type=full instance1.example.com |
723 |
</screen> |
724 |
</para> |
725 |
</refsect3> |
726 |
|
727 |
<refsect3> |
728 |
<title>CONSOLE</title> |
729 |
<cmdsynopsis> |
730 |
<command>console</command> |
731 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
732 |
</cmdsynopsis> |
733 |
|
734 |
<para> |
735 |
Connects to the console of the given instance. If the instance |
736 |
is not up, an error is returned. |
737 |
</para> |
738 |
|
739 |
<para> |
740 |
Example: |
741 |
<screen> |
742 |
# gnt-instance console instance1.example.com |
743 |
</screen> |
744 |
</para> |
745 |
</refsect3> |
746 |
|
747 |
</refsect2> |
748 |
|
749 |
<refsect2> |
750 |
<title>Disk management</title> |
751 |
|
752 |
<refsect3> |
753 |
<title>REPLACE-DISKS</title> |
754 |
|
755 |
<cmdsynopsis> |
756 |
<command>replace-disks</command> |
757 |
<arg choice="opt">--new-secondary <replaceable>NODE</replaceable></arg> |
758 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
759 |
</cmdsynopsis> |
760 |
|
761 |
<cmdsynopsis> |
762 |
<command>replace-disks</command> |
763 |
<arg choice="req">-s</arg> |
764 |
<arg choice="req">--new-secondary <replaceable>NODE</replaceable></arg> |
765 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
766 |
</cmdsynopsis> |
767 |
|
768 |
<cmdsynopsis> |
769 |
<command>replace-disks</command> |
770 |
<group> |
771 |
<arg choice="req">-s</arg> |
772 |
<arg choice="req">-p</arg> |
773 |
</group> |
774 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
775 |
</cmdsynopsis> |
776 |
|
777 |
<para> |
778 |
This command is a generalized form for adding and replacing |
779 |
disks. |
780 |
</para> |
781 |
|
782 |
<para> |
783 |
The first form is usable with the |
784 |
<literal>remote_raid1</literal> disk template. This will |
785 |
replace the disks on both the primary and secondary node, |
786 |
and optionally will change the secondary node to a new one |
787 |
if you pass the <option>--new-secondary</option> option. |
788 |
</para> |
789 |
|
790 |
<para> |
791 |
The second and third forms are usable with the |
792 |
<literal>drbd</literal> disk template. The second form will |
793 |
do a secondary replacement, but as opposed to the |
794 |
<literal>remote_raid1</literal> will not replace the disks |
795 |
on the primary, therefore it will execute faster. The third |
796 |
form will replace the disks on either the primary |
797 |
(<option>-p</option>) or the secondary (<option>-s</option>) |
798 |
node of the instance only, without changing the node. |
799 |
</para> |
800 |
|
801 |
</refsect3> |
802 |
|
803 |
<refsect3> |
804 |
<title>ADD-MIRROR</title> |
805 |
<cmdsynopsis> |
806 |
<command>add-mirror</command> |
807 |
<arg choice="req">-b <replaceable>sdX</replaceable></arg> |
808 |
<arg choice="req">-n <replaceable>node</replaceable></arg> |
809 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
810 |
</cmdsynopsis> |
811 |
<para> |
812 |
Adds a new mirror to the disk layout of the instance, if the |
813 |
instance has a remote raid disk layout. |
814 |
|
815 |
The new mirror member will be between the instance's primary |
816 |
node and the node given with the <option>-n</option> option. |
817 |
</para> |
818 |
</refsect3> |
819 |
|
820 |
<refsect3> |
821 |
<title>REMOVE-MIRROR</title> |
822 |
|
823 |
<cmdsynopsis> |
824 |
<command>removemirror</command> |
825 |
<arg choice="req">-b <replaceable>sdX</replaceable></arg> |
826 |
<arg choice="req">-p <replaceable>id</replaceable></arg> |
827 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
828 |
</cmdsynopsis> |
829 |
<para> |
830 |
Removes a mirror componenent from the disk layout of the |
831 |
instance, if the instance has a remote raid disk layout. |
832 |
</para> |
833 |
|
834 |
<para> |
835 |
You need to specifiy on which disk to act on using the |
836 |
<option>-b</option> option (either <filename>sda</filename> |
837 |
or <filename>sdb</filename>) and the mirror component, which |
838 |
is identified by the <option>-p</option> option. You can |
839 |
find the list of valid identifiers with the |
840 |
<command>info</command> command. |
841 |
</para> |
842 |
|
843 |
<refsect3> |
844 |
<title>ACTIVATE-DISKS</title> |
845 |
|
846 |
<cmdsynopsis> |
847 |
<command>activate-disks</command> |
848 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
849 |
</cmdsynopsis> |
850 |
<para> |
851 |
Activates the block devices of the given instance. If |
852 |
successful, the command will show the location and name of |
853 |
the block devices: |
854 |
<screen> |
855 |
node1.example.com:sda:/dev/md0 |
856 |
node1.example.com:sdb:/dev/md1 |
857 |
</screen> |
858 |
|
859 |
In this example, <emphasis>node1.example.com</emphasis> is |
860 |
the name of the node on which the devices have been |
861 |
activated. The <emphasis>sda</emphasis> and |
862 |
<emphasis>sdb</emphasis> are the names of the block devices |
863 |
inside the instance. <emphasis>/dev/md0</emphasis> and |
864 |
<emphasis>/dev/md1</emphasis> are the names of the block |
865 |
devices as visible on the node. |
866 |
</para> |
867 |
|
868 |
<para> |
869 |
Note that it is safe to run this command while the instance |
870 |
is already running. |
871 |
</para> |
872 |
</refsect3> |
873 |
|
874 |
<refsect3> |
875 |
<title>DEACTIVATE-DISKS</title> |
876 |
|
877 |
<cmdsynopsis> |
878 |
<command>deactivate-disks</command> |
879 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
880 |
</cmdsynopsis> |
881 |
<para> |
882 |
De-activates the block devices of the given instance. Note |
883 |
that if you run this command for a remote raid instance |
884 |
type, while it is running, it will not be able to shutdown |
885 |
the block devices on the primary node, but it will shutdown |
886 |
the block devices on the secondary nodes, thus breaking the |
887 |
replication. |
888 |
</para> |
889 |
|
890 |
</refsect3> |
891 |
|
892 |
</refsect2> |
893 |
|
894 |
<refsect2> |
895 |
<title>Recovery</title> |
896 |
|
897 |
<refsect3> |
898 |
<title>FAILOVER</title> |
899 |
|
900 |
<cmdsynopsis> |
901 |
<command>failover</command> |
902 |
<arg>-f</arg> |
903 |
<arg>--ignore-consistency</arg> |
904 |
<arg choice="req"><replaceable>instance</replaceable></arg> |
905 |
</cmdsynopsis> |
906 |
|
907 |
<para> |
908 |
Failover will fail the instance over its secondary |
909 |
node. This works only for instances having a remote raid |
910 |
disk layout. |
911 |
</para> |
912 |
|
913 |
<para> |
914 |
Normally the failover will check the consistency of the |
915 |
disks before failing over the instance. If you are trying to |
916 |
migrate instances off a dead node, this will fail. Use the |
917 |
<option>--ignore-consistency</option> option for this |
918 |
purpose. Note that this option can be dangerous as errors in |
919 |
shutting down the instance will be ignored, resulting in |
920 |
possibly having the instance running on two machines in |
921 |
parallel (on disconnected DRBD drives). |
922 |
</para> |
923 |
|
924 |
<para> |
925 |
Example: |
926 |
<screen> |
927 |
# gnt-instance failover instance1.example.com |
928 |
</screen> |
929 |
</para> |
930 |
</refsect3> |
931 |
|
932 |
</refsect2> |
933 |
|
934 |
<refsect2> |
935 |
<title>TAGS</title> |
936 |
|
937 |
<refsect3> |
938 |
<title>ADD-TAGS</title> |
939 |
|
940 |
<cmdsynopsis> |
941 |
<command>add-tags</command> |
942 |
<arg choice="opt">--from <replaceable>file</replaceable></arg> |
943 |
<arg choice="req"><replaceable>instancename</replaceable></arg> |
944 |
<arg choice="req" |
945 |
rep="repeat"><replaceable>tag</replaceable></arg> |
946 |
</cmdsynopsis> |
947 |
|
948 |
<para> |
949 |
Add tags to the given instance. If any of the tags contains |
950 |
invalid characters, the entire operation will abort. |
951 |
</para> |
952 |
<para> |
953 |
If the <option>--from</option> option is given, the list of |
954 |
tags will be extended with the contents of that file (each |
955 |
line becomes a tag). In this case, there is not need to pass |
956 |
tags on the command line (if you do, both sources will be |
957 |
used). A file name of - will be interpreted as stdin. |
958 |
</para> |
959 |
</refsect3> |
960 |
|
961 |
<refsect3> |
962 |
<title>LIST-TAGS</title> |
963 |
|
964 |
<cmdsynopsis> |
965 |
<command>list-tags</command> |
966 |
<arg choice="req"><replaceable>instancename</replaceable></arg> |
967 |
</cmdsynopsis> |
968 |
|
969 |
<para>List the tags of the given instance.</para> |
970 |
</refsect3> |
971 |
|
972 |
<refsect3> |
973 |
<title>REMOVE-TAGS</title> |
974 |
<cmdsynopsis> |
975 |
<command>remove-tags</command> |
976 |
<arg choice="opt">--from <replaceable>file</replaceable></arg> |
977 |
<arg choice="req"><replaceable>instancename</replaceable></arg> |
978 |
<arg choice="req" |
979 |
rep="repeat"><replaceable>tag</replaceable></arg> |
980 |
</cmdsynopsis> |
981 |
|
982 |
<para> |
983 |
Remove tags from the given instance. If any of the tags are |
984 |
not existing on the node, the entire operation will abort. |
985 |
</para> |
986 |
|
987 |
<para> |
988 |
If the <option>--from</option> option is given, the list of |
989 |
tags will be extended with the contents of that file (each |
990 |
line becomes a tag). In this case, there is not need to pass |
991 |
tags on the command line (if you do, both sources will be |
992 |
used). A file name of - will be interpreted as stdin. |
993 |
</para> |
994 |
</refsect3> |
995 |
|
996 |
</refsect2> |
997 |
|
998 |
</refsect1> |
999 |
|
1000 |
&footer; |
1001 |
|
1002 |
</refentry> |
1003 |
|
1004 |
<!-- Keep this comment at the end of the file |
1005 |
Local variables: |
1006 |
mode: sgml |
1007 |
sgml-omittag:t |
1008 |
sgml-shorttag:t |
1009 |
sgml-minimize-attributes:nil |
1010 |
sgml-always-quote-attributes:t |
1011 |
sgml-indent-step:2 |
1012 |
sgml-indent-data:t |
1013 |
sgml-parent-document:nil |
1014 |
sgml-default-dtd-file:nil |
1015 |
sgml-exposed-tags:nil |
1016 |
sgml-local-catalogs:nil |
1017 |
sgml-local-ecat-files:nil |
1018 |
End: |
1019 |
--> |