1 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.2//EN" [
3 <article class="specification">
5 <title>Ganeti administrator's guide</title>
7 <para>Documents Ganeti version 1.3</para>
9 <title>Introduction</title>
11 <para>Ganeti is a virtualization cluster management software. You are
12 expected to be a system administrator familiar with your Linux distribution
13 and the Xen virtualization environment before using it.
16 <para>The various components of Ganeti all have man pages and interactive
17 help. This manual though will help you getting familiar with the system by
18 explaining the most common operations, grouped by related use.
21 <para>After a terminology glossary and a section on the prerequisites
22 needed to use this manual, the rest of this document is divided in three
23 main sections, which group different features of Ganeti:
26 <simpara>Instance Management</simpara>
29 <simpara>High Availability Features</simpara>
32 <simpara>Debugging Features</simpara>
38 <title>Ganeti terminology</title>
41 This section provides a small introduction to Ganeti terminology, which
42 might be useful to read the rest of the document.
46 <glossterm>Cluster</glossterm>
49 A set of machines (nodes) that cooperate to offer a
50 coherent highly available virtualization service.
55 <glossterm>Node</glossterm>
58 A physical machine which is member of a cluster.
59 Nodes are the basic cluster infrastructure, and are
65 <glossterm>Master node</glossterm>
68 The node which controls the Cluster, from which all
69 Ganeti commands must be given.
74 <glossterm>Instance</glossterm>
77 A virtual machine which runs on a cluster. It can be a
78 fault tolerant highly available entity.
83 <glossterm>Pool</glossterm>
86 A pool is a set of clusters sharing the same network.
91 <glossterm>Meta-Cluster</glossterm>
94 Anything that concerns more than one cluster.
103 <title>Prerequisites</title>
106 You need to have your Ganeti cluster installed and configured before
107 you try any of the commands in this document. Please follow the
108 <emphasis>Ganeti installation tutorial</emphasis> for instructions on
116 <title>Managing Instances</title>
119 <title>Adding/Removing an instance</title>
122 Adding a new virtual instance to your Ganeti cluster is really easy.
125 <synopsis>gnt-instance add -n <replaceable>TARGET_NODE</replaceable> -o <replaceable>OS_TYPE</replaceable> -t <replaceable>DISK_TEMPLATE</replaceable> <replaceable>INSTANCE_NAME</replaceable></synopsis>
127 The instance name must be resolvable (e.g. exist in DNS) and
128 of course map to an address in the same subnet as the cluster
129 itself. Options you can give to this command include:
133 <simpara>The disk size (<option>-s</option>)</simpara>
136 <simpara>The swap size (<option>--swap-size</option>)</simpara>
139 <simpara>The memory size (<option>-m</option>)</simpara>
142 <simpara>The number of virtual CPUs (<option>-p</option>)</simpara>
145 <simpara>The instance ip address (<option>-i</option>) (use the value
146 <literal>auto</literal> to make Ganeti record the address from
150 <simpara>The bridge to connect the instance to (<option>-b</option>),
151 if you don't want to use the default one</simpara>
156 <para>There are four types of disk template you can choose from:</para>
160 <term>diskless</term>
162 <para>The instance has no disks. Only used for special purpouse
163 operating systems or for testing.</para>
170 <para>The instance will use LVM devices as backend for its disks.
171 No redundancy is provided.</para>
178 <simpara><emphasis role="strong">Note:</emphasis> This is only
179 valid for multi-node clusters using drbd 8.0.x</simpara>
181 A mirror is set between the local node and a remote one, which
182 must be specified with the second value of the --node option. Use
183 this option to obtain a highly available instance that can be
184 failed over to a remote node should the primary one fail.
192 For example if you want to create an highly available instance use the
194 <synopsis>gnt-instance add -n <replaceable>TARGET_NODE</replaceable><optional>:<replaceable>SECONDARY_NODE</replaceable></optional> -o <replaceable>OS_TYPE</replaceable> -t drbd \
195 <replaceable>INSTANCE_NAME</replaceable></synopsis>
198 To know which operating systems your cluster supports you can use
199 <synopsis>gnt-os list</synopsis>
203 Removing an instance is even easier than creating one. This operation
204 is non-reversible and destroys all the contents of your instance. Use
207 <synopsis>gnt-instance remove <replaceable>INSTANCE_NAME</replaceable></synopsis>
212 <title>Starting/Stopping an instance</title>
215 Instances are automatically started at instance creation time. To
216 manually start one which is currently stopped you can run:
218 <synopsis>gnt-instance startup <replaceable>INSTANCE_NAME</replaceable></synopsis>
220 While the command to stop one is:
222 <synopsis>gnt-instance shutdown <replaceable>INSTANCE_NAME</replaceable></synopsis>
224 The command to see all the instances configured and their status is:
226 <synopsis>gnt-instance list</synopsis>
231 Do not use the xen commands to stop instances. If you run for
232 example xm shutdown or xm destroy on an instance Ganeti will
233 automatically restart it (via the
234 <citerefentry><refentrytitle>ganeti-watcher</refentrytitle>
235 <manvolnum>8</manvolnum></citerefentry>)
241 <title>Exporting/Importing an instance</title>
244 You can create a snapshot of an instance disk and Ganeti
245 configuration, which then you can backup, or import into
246 another cluster. The way to export an instance is:
248 <synopsis>gnt-backup export -n <replaceable>TARGET_NODE</replaceable> <replaceable>INSTANCE_NAME</replaceable></synopsis>
250 The target node can be any node in the cluster with enough
251 space under <filename class="directory">/srv/ganeti</filename>
252 to hold the instance image. Use the
253 <option>--noshutdown</option> option to snapshot an instance
254 without rebooting it. Any previous snapshot of the same
255 instance existing cluster-wide under <filename
256 class="directory">/srv/ganeti</filename> will be removed by
257 this operation: if you want to keep them move them out of the
258 Ganeti exports directory.
262 Importing an instance is similar to creating a new one. The command is:
264 <synopsis>gnt-backup import -n <replaceable>TARGET_NODE</replaceable> -t <replaceable>DISK_TEMPLATE</replaceable> --src-node=<replaceable>NODE</replaceable> --src-dir=DIR INSTANCE_NAME</synopsis>
266 Most of the options available for the command
267 <emphasis>gnt-instance add</emphasis> are supported here too.
276 <title>High availability features</title>
279 <simpara>This section only applies to multi-node clusters.</simpara>
283 <title>Failing over an instance</title>
286 If an instance is built in highly available mode you can at
287 any time fail it over to its secondary node, even if the
288 primary has somehow failed and it's not up anymore. Doing it
289 is really easy, on the master node you can just run:
291 <synopsis>gnt-instance failover <replaceable>INSTANCE_NAME</replaceable></synopsis>
293 That's it. After the command completes the secondary node is
294 now the primary, and vice versa.
299 <title>Replacing an instance disks</title>
302 So what if instead the secondary node for an instance has
303 failed, or you plan to remove a node from your cluster, and
304 you failed over all its instances, but it's still secondary
305 for some? The solution here is to replace the instance disks,
306 changing the secondary node:
307 <synopsis>gnt-instance replace-disks <option>-s</option> <option>--new-secondary <replaceable>NODE</replaceable></option> <replaceable>INSTANCE_NAME</replaceable></synopsis>
309 This process is a bit long, but involves no instance
310 downtime, and at the end of it the instance has changed its
311 secondary node, to which it can if necessary be failed over.
315 <title>Failing over the master node</title>
318 This is all good as long as the Ganeti Master Node is
319 up. Should it go down, or should you wish to decommission it,
320 just run on any other node the command:
322 <synopsis>gnt-cluster masterfailover</synopsis>
324 and the node you ran it on is now the new master.
328 <title>Adding/Removing nodes</title>
331 And of course, now that you know how to move instances around,
332 it's easy to free up a node, and then you can remove it from
335 <synopsis>gnt-node remove <replaceable>NODE_NAME</replaceable></synopsis>
337 and maybe add a new one:
339 <synopsis>gnt-node add <optional><option>--secondary-ip=<replaceable>ADDRESS</replaceable></option></optional> <replaceable>NODE_NAME</replaceable>
347 <title>Debugging Features</title>
350 At some point you might need to do some debugging operations on
351 your cluster or on your instances. This section will help you
352 with the most used debugging functionalities.
356 <title>Accessing an instance's disks</title>
359 From an instance's primary node you have access to its
360 disks. Never ever mount the underlying logical volume manually
361 on a fault tolerant instance, or you risk breaking
362 replication. The correct way to access them is to run the
365 <synopsis>gnt-instance activate-disks <replaceable>INSTANCE_NAME</replaceable></synopsis>
367 And then access the device that gets created. After you've
368 finished you can deactivate them with the deactivate-disks
369 command, which works in the same way.
374 <title>Accessing an instance's console</title>
377 The command to access a running instance's console is:
379 <synopsis>gnt-instance console <replaceable>INSTANCE_NAME</replaceable></synopsis>
381 Use the console normally and then type
382 <userinput>^]</userinput> when done, to exit.
387 <title>Instance OS definitions Debugging</title>
390 Should you have any problems with operating systems support
391 the command to ran to see a complete status for all your nodes
394 <synopsis>gnt-os diagnose</synopsis>
401 <title>Cluster-wide debugging</title>
404 The gnt-cluster command offers several options to run tests or
405 execute cluster-wide operations. For example:
411 gnt-cluster getmaster
415 See the man page <citerefentry>
416 <refentrytitle>gnt-cluster</refentrytitle>
417 <manvolnum>8</manvolnum> </citerefentry> to know more about