1 <!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
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">
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">
23 <holder>Google Inc.</holder>
31 <refmiscinfo>ganeti 1.2</refmiscinfo>
34 <refname>&dhpackage;</refname>
36 <refpurpose>ganeti instance administration</refpurpose>
40 <command>&dhpackage; </command>
42 <arg choice="req">command</arg>
43 <arg>arguments...</arg>
47 <title>DESCRIPTION</title>
50 The <command>&dhpackage;</command> is used for instance
51 administration in the ganeti system.
56 <title>COMMANDS</title>
59 <title>Creation/removal/querying</title>
64 <command>add</command>
65 <arg choice="req">-n <replaceable>node</replaceable></arg>
66 <arg>-s <replaceable>disksize</replaceable></arg>
67 <arg>-o <replaceable>os-type</replaceable></arg>
68 <arg>-m <replaceable>memsize</replaceable></arg>
69 <arg>-b <replaceable>bridge</replaceable></arg>
71 <arg choice="req">-t<group>
74 <arg>local_raid1</arg>
75 <arg>remote_raid1</arg>
78 <arg choice="req"><replaceable>instance</replaceable></arg>
81 Creates a new instance on the specified
82 host. <replaceable>instance</replaceable> must be in DNS and
83 resolve to a IP in the same network as the nodes in the
88 The <option>-s</option> option specifies the disk size for
89 the instance, in gigibytes (defaults to 20 GiB).
93 The <option>-o</option> options specifies the operating
94 system to be installed. The available operating systems can
95 be listed with <command>gnt-os list</command>.
99 The <option>-m</option> option specifies the memory size for
100 the instance, in megibytes (defaults to 128 MiB).
104 The <option>-b</option> option specifies the bridge to which the
105 instance will be connected. (defaults to the cluster-wide default
106 bridge specified at cluster intialization time).
110 The <option>-t</option> options specifies the disk layout type for
111 the instance. The available choices are:
114 <term>diskless</term>
117 This creates an instance with no disks. Its useful for
118 testing only (or other special cases).
125 <para>Disk devices will be logical volumes.</para>
129 <term>local_raid1</term>
132 Disk devices will be md raid1 arrays over two local
138 <term>remote_raid1</term>
141 Disk devices will be md raid1 arrays with one
142 component (so it's not actually raid1): a drbd device
143 between the instance's primary node and the node given
144 by the option <option>--secondary-node</option>.
152 The <option>--secondary-node</option> option is used with
153 the remote raid disk template type and specifies the remote
158 If you do not want gnt-instance to wait for the disk mirror
159 to be synced, use the <option>--no-wait-for-sync</option>
167 # gnt-instance add -t plain -s 30 -m 512 -n node1.example.com \
168 > instance1.example.com
169 # gnt-instance add -t remote_raid1 --secondary-node node3.example.com \
170 > -s 30 -m 512 -n node1.example.com instance2.example.com
177 <title>REMOVE</title>
180 <command>remove</command>
181 <arg choice="req"><replaceable>instance</replaceable></arg>
185 Remove an instance. This will remove all data from the
186 instance and there is <emphasis>no way back</emphasis>. If
187 you are not sure if you use an instance again, use
188 <command>shutdown</command> first and leave it in the
189 shutdown state for a while.
195 # gnt-instance remove instance1.example.com
204 <command>list</command>
205 <arg>--no-headers</arg>
206 <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
207 <arg>-o <replaceable>FIELD,...</replaceable></arg>
211 Shows the currently configured instances with memory usage,
212 disk usage, the node they are running on, and the CPU time,
213 counted in seconds, used by each instance since its latest
218 The <option>--no-headers</option> option will skip the
219 initial header line. The <option>--separator</option> option
220 takes an argument which denotes what will be used between
221 the output fields. Both these options are to help scripting.
225 The <option>-o</option> option takes a comma-separated list
226 of output fields. The available fields and their meaning
232 <simpara>the instance name</simpara>
238 <simpara>the OS of the instance</simpara>
244 <simpara>the primary node of the instance</simpara>
250 <simpara>comma-separated list of secondary-nodes for the
251 instance; usually this will be just one node</simpara>
255 <term>admin_state</term>
257 <simpara>the desired state of the instance (either "yes"
258 or "no" denoting the instance should run or
263 <term>admin_ram</term>
265 <simpara>the desired memory for the instance</simpara>
269 <term>disk_template</term>
271 <simpara>the disk template of the instance</simpara>
275 <term>oper_state</term>
277 <simpara>the actual state of the instance; can take of
278 the values "running", "stopped", "(node down)"</simpara>
282 <term>oper_ram</term>
284 <simpara>the actual memory usage of the instance as seen
285 by the hypervisor</simpara>
291 <simpara>the ip address ganeti recognizes as associated with
292 the instance interface</simpara>
298 <simpara>the instance interface MAC address</simpara>
304 <simpara>bridge the instance is connected to
312 There is a subtle grouping about the available output
313 fields: all fields except for <option>oper_state</option>
314 and <option>oper_ram</option> are configuration value and
315 not run-time values. So if you don't select any of the
316 <option>oper_*</option> fields, the query will be satisfied
317 instantly from the cluster configuration, without having to
318 ask the remote nodes for the data. This can be helpful for
319 big clusters when you only want some data and it makes sense
320 to specify a reduced set of output fields.
323 <para>The default output field list is:
324 <simplelist type="inline">
325 <member>name</member>
327 <member>pnode</member>
328 <member>admin_state</member>
329 <member>oper_state</member>
330 <member>oper_ram</member>
339 <command>info</command>
340 <arg rep="repeat"><replaceable>instance</replaceable></arg>
344 Show detailed information about the (given) instances. This
345 is different from <command>list</command> as it shows
346 detailed data about the instance's disks (especially useful
347 for remote raid templates).
352 <title>MODIFY</title>
355 <command>modify</command>
356 <arg choice="opt">-m <replaceable>memsize</replaceable></arg>
357 <arg choice="opt">-p <replaceable>vcpus</replaceable></arg>
358 <arg choice="opt">-i <replaceable>ip</replaceable></arg>
359 <arg choice="opt">-b <replaceable>bridge</replaceable></arg>
360 <arg choice="req"><replaceable>instance</replaceable></arg>
364 Modify the memory size, number of vcpus, ip address and/or bridge
369 The memory size is given in MiB. Note that you need to give
370 at least one of the arguments, otherwise the command
375 All the changes take effect at the next restart. If the
376 instance is running, there is no effect on the instance.
383 <title>Starting/stopping/connecting to console</title>
386 <title>STARTUP</title>
389 <command>startup</command>
390 <arg>--extra=<replaceable>PARAMS</replaceable></arg>
391 <arg choice="req"><replaceable>instance</replaceable></arg>
395 Starts an instance. The node where to start the instance is
396 taken from the configuration.
400 The <option>--extra</option> option is used to pass
401 additional argument to the instance's kernel for this start
402 only. Currently there is no way to specify a persistent set
403 of arguments (beside the one hardcoded). Note that this may
404 not apply to all virtualization types.
411 # gnt-instance start instance1.example.com
412 # gnt-instance start --extra single test1.example.com
418 <title>SHUTDOWN</title>
421 <command>shutdown</command>
422 <arg choice="req"><replaceable>instance</replaceable></arg>
426 Stops the instance. If the instance cannot be cleanly
427 stopped during a hardcoded interval (currently 2 minutes),
428 it will forcibly stop the instance (equivalent to switching
429 off the power on a physical machine).
435 # gnt-instance shutdown instance1.example.com
441 <title>CONSOLE</title>
443 <command>console</command>
444 <arg choice="req"><replaceable>instance</replaceable></arg>
448 Connects to the console of the given instance. If the instance
449 is not up, an error is returned.
455 # gnt-instance console instance1.example.com
463 <title>Disk management</title>
466 <title>REPLACE-DISKS</title>
469 <command>replace-disks</command>
470 <arg choice="req">--new-secondary <replaceable>NODE</replaceable></arg>
471 <arg choice="req"><replaceable>instance</replaceable></arg>
475 This command does a full add and replace for both disks of
476 an instance. It basically does an
477 <command>addmirror</command> and
478 <command>removemirror</command> for both disks of the
483 If you also want to replace the secondary node during this
484 process (for example to fix a broken secondary node), you
485 can do so using the <option>--new-secondary</option> option.
490 <title>ADD-MIRROR</title>
492 <command>add-mirror</command>
493 <arg choice="req">-b <replaceable>sdX</replaceable></arg>
494 <arg choice="req">-n <replaceable>node</replaceable></arg>
495 <arg choice="req"><replaceable>instance</replaceable></arg>
498 Adds a new mirror to the disk layout of the instance, if the
499 instance has a remote raid disk layout.
501 The new mirror member will be between the instance's primary
502 node and the node given with the <option>-n</option> option.
507 <title>REMOVE-MIRROR</title>
510 <command>removemirror</command>
511 <arg choice="req">-b <replaceable>sdX</replaceable></arg>
512 <arg choice="req">-p <replaceable>id</replaceable></arg>
513 <arg choice="req"><replaceable>instance</replaceable></arg>
516 Removes a mirror componenent from the disk layout of the
517 instance, if the instance has a remote raid disk layout.
521 You need to specifiy on which disk to act on using the
522 <option>-b</option> option (either <filename>sda</filename>
523 or <filename>sdb</filename>) and the mirror component, which
524 is identified by the <option>-p</option> option. You can
525 find the list of valid identifiers with the
526 <command>info</command> command.
530 <title>ACTIVATE-DISKS</title>
533 <command>activate-disks</command>
534 <arg choice="req"><replaceable>instance</replaceable></arg>
537 Activates the block devices of the given instance. If
538 successful, the command will show the location and name of
541 node1.example.com:sda:/dev/md0
542 node1.example.com:sdb:/dev/md1
545 In this example, <emphasis>node1.example.com</emphasis> is
546 the name of the node on which the devices have been
547 activated. The <emphasis>sda</emphasis> and
548 <emphasis>sdb</emphasis> are the names of the block devices
549 inside the instance. <emphasis>/dev/md0</emphasis> and
550 <emphasis>/dev/md1</emphasis> are the names of the block
551 devices as visible on the node.
555 Note that it is safe to run this command while the instance
561 <title>DEACTIVATE-DISKS</title>
564 <command>deactivate-disks</command>
565 <arg choice="req"><replaceable>instance</replaceable></arg>
568 De-activates the block devices of the given instance. Note
569 that if you run this command for a remote raid instance
570 type, while it is running, it will not be able to shutdown
571 the block devices on the primary node, but it will shutdown
572 the block devices on the secondary nodes, thus breaking the
581 <title>Recovery</title>
584 <title>FAILOVER</title>
587 <command>failover</command>
589 <arg>--ignore-consistency</arg>
590 <arg choice="req"><replaceable>instance</replaceable></arg>
594 Failover will fail the instance over its secondary
595 node. This works only for instances having a remote raid
600 Normally the failover will check the consistency of the
601 disks before failing over the instance. If you are trying to
602 migrate instances off a dead node, this will fail. Use the
603 <option>--ignore-consistency</option> option for this
610 # gnt-instance failover instance1.example.com
623 <!-- Keep this comment at the end of the file
628 sgml-minimize-attributes:nil
629 sgml-always-quote-attributes:t
632 sgml-parent-document:nil
633 sgml-default-dtd-file:nil
634 sgml-exposed-tags:nil
635 sgml-local-catalogs:nil
636 sgml-local-ecat-files:nil