root / doc / install.sgml @ cd55576a
History | View | Annotate | Download (30.6 kB)
1 | f1a808df | Guido Trotter | <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.2//EN" [ |
---|---|---|---|
2 | f1a808df | Guido Trotter | ]> |
3 | f1a808df | Guido Trotter | <article class="specification"> |
4 | f1a808df | Guido Trotter | <articleinfo> |
5 | b212bf8b | Iustin Pop | <title>Ganeti installation tutorial</title> |
6 | f1a808df | Guido Trotter | </articleinfo> |
7 | f1a808df | Guido Trotter | <para>Documents Ganeti version 1.2</para> |
8 | f1a808df | Guido Trotter | |
9 | f1a808df | Guido Trotter | <sect1> |
10 | f1a808df | Guido Trotter | <title>Introduction</title> |
11 | f1a808df | Guido Trotter | |
12 | 5d6dd340 | Iustin Pop | <para> |
13 | 32ad0582 | Iustin Pop | Ganeti is a cluster virtualization management system based on |
14 | 32ad0582 | Iustin Pop | Xen. This document explains how to bootstrap a Ganeti node (Xen |
15 | 32ad0582 | Iustin Pop | <literal>dom0</literal>), create a running cluster and install |
16 | 32ad0582 | Iustin Pop | virtual instance (Xen <literal>domU</literal>). You need to |
17 | 32ad0582 | Iustin Pop | repeat most of the steps in this document for every node you |
18 | 32ad0582 | Iustin Pop | want to install, but of course we recommend creating some |
19 | 32ad0582 | Iustin Pop | semi-automatic procedure if you plan to deploy Ganeti on a |
20 | 32ad0582 | Iustin Pop | medium/large scale. |
21 | 32ad0582 | Iustin Pop | </para> |
22 | 32ad0582 | Iustin Pop | |
23 | 32ad0582 | Iustin Pop | <para> |
24 | 32ad0582 | Iustin Pop | A basic Ganeti terminology glossary is provided in the |
25 | 32ad0582 | Iustin Pop | introductory section of the <emphasis>Ganeti administrator's |
26 | 32ad0582 | Iustin Pop | guide</emphasis>. Please refer to that document if you are |
27 | 32ad0582 | Iustin Pop | uncertain about the terms we are using. |
28 | 32ad0582 | Iustin Pop | </para> |
29 | 32ad0582 | Iustin Pop | |
30 | 32ad0582 | Iustin Pop | <para> |
31 | 32ad0582 | Iustin Pop | Ganeti has been developed for Linux and is |
32 | 32ad0582 | Iustin Pop | distribution-agnostic. This documentation will use Debian Etch |
33 | 32ad0582 | Iustin Pop | as an example system but the examples can easily be translated |
34 | 32ad0582 | Iustin Pop | to any other distribution. You are expected to be familiar with |
35 | 32ad0582 | Iustin Pop | your distribution, its package management system, and Xen before |
36 | 32ad0582 | Iustin Pop | trying to use Ganeti. |
37 | f1a808df | Guido Trotter | </para> |
38 | f1a808df | Guido Trotter | |
39 | f1a808df | Guido Trotter | <para>This document is divided into two main sections: |
40 | f1a808df | Guido Trotter | |
41 | f1a808df | Guido Trotter | <itemizedlist> |
42 | f1a808df | Guido Trotter | <listitem> |
43 | 32ad0582 | Iustin Pop | <simpara>Installation of the base system and base |
44 | e3c826ec | Michael Hanselmann | components</simpara> |
45 | f1a808df | Guido Trotter | </listitem> |
46 | f1a808df | Guido Trotter | <listitem> |
47 | 5d6dd340 | Iustin Pop | <simpara>Configuration of the environment for |
48 | e3c826ec | Michael Hanselmann | Ganeti</simpara> |
49 | f1a808df | Guido Trotter | </listitem> |
50 | f1a808df | Guido Trotter | </itemizedlist> |
51 | f1a808df | Guido Trotter | |
52 | e3c826ec | Michael Hanselmann | Each of these is divided into sub-sections. While a full Ganeti system |
53 | e3c826ec | Michael Hanselmann | will need all of the steps specified, some are not strictly required for |
54 | e3c826ec | Michael Hanselmann | every environment. Which ones they are, and why, is specified in the |
55 | e3c826ec | Michael Hanselmann | corresponding sections. |
56 | f1a808df | Guido Trotter | </para> |
57 | f1a808df | Guido Trotter | |
58 | f1a808df | Guido Trotter | </sect1> |
59 | f1a808df | Guido Trotter | |
60 | f1a808df | Guido Trotter | <sect1> |
61 | 32ad0582 | Iustin Pop | <title>Installing the base system and base components</title> |
62 | 32ad0582 | Iustin Pop | |
63 | 32ad0582 | Iustin Pop | <sect2> |
64 | 32ad0582 | Iustin Pop | <title>Hardware requirements</title> |
65 | 32ad0582 | Iustin Pop | |
66 | 32ad0582 | Iustin Pop | <para> |
67 | e3c826ec | Michael Hanselmann | Any system supported by your Linux distribution is fine. 64-bit |
68 | e3c826ec | Michael Hanselmann | systems are better as they can support more memory. |
69 | 32ad0582 | Iustin Pop | </para> |
70 | 32ad0582 | Iustin Pop | |
71 | 32ad0582 | Iustin Pop | <para> |
72 | e3c826ec | Michael Hanselmann | Any disk drive recognized by Linux |
73 | e3c826ec | Michael Hanselmann | (<literal>IDE</literal>/<literal>SCSI</literal>/<literal>SATA</literal>/etc.) |
74 | e3c826ec | Michael Hanselmann | is supported in Ganeti. Note that no shared storage (e.g. |
75 | e3c826ec | Michael Hanselmann | <literal>SAN</literal>) is needed to get high-availability features. It |
76 | e3c826ec | Michael Hanselmann | is highly recommended to use more than one disk drive to improve speed. |
77 | e3c826ec | Michael Hanselmann | But Ganeti also works with one disk per machine. |
78 | 32ad0582 | Iustin Pop | </para> |
79 | f1a808df | Guido Trotter | |
80 | f1a808df | Guido Trotter | <sect2> |
81 | f1a808df | Guido Trotter | <title>Installing the base system</title> |
82 | f1a808df | Guido Trotter | |
83 | 0bac47cf | Iustin Pop | <para> |
84 | 0bac47cf | Iustin Pop | <emphasis role="strong">Mandatory</emphasis> on all nodes. |
85 | 0bac47cf | Iustin Pop | </para> |
86 | 0bac47cf | Iustin Pop | |
87 | 0bac47cf | Iustin Pop | <para> |
88 | 0bac47cf | Iustin Pop | It is advised to start with a clean, minimal install of the |
89 | 0bac47cf | Iustin Pop | operating system. The only requirement you need to be aware of |
90 | 0bac47cf | Iustin Pop | at this stage is to partition leaving enough space for a big |
91 | 16450d30 | Iustin Pop | (<emphasis role="strong">minimum |
92 | 16450d30 | Iustin Pop | <constant>20GiB</constant></emphasis>) LVM volume group which |
93 | 16450d30 | Iustin Pop | will then host your instance filesystems. The volume group |
94 | 16450d30 | Iustin Pop | name Ganeti 1.2 uses (by default) is |
95 | 32ad0582 | Iustin Pop | <emphasis>xenvg</emphasis>. |
96 | 0bac47cf | Iustin Pop | </para> |
97 | f1a808df | Guido Trotter | |
98 | 5d6dd340 | Iustin Pop | <para> |
99 | 16450d30 | Iustin Pop | While you can use an existing system, please note that the |
100 | 0bac47cf | Iustin Pop | Ganeti installation is intrusive in terms of changes to the |
101 | 0bac47cf | Iustin Pop | system configuration, and it's best to use a newly-installed |
102 | 0bac47cf | Iustin Pop | system without important data on it. |
103 | 0bac47cf | Iustin Pop | </para> |
104 | 0bac47cf | Iustin Pop | |
105 | 0bac47cf | Iustin Pop | <para> |
106 | 0bac47cf | Iustin Pop | Also, for best results, it's advised that the nodes have as |
107 | 0bac47cf | Iustin Pop | much as possible the same hardware and software |
108 | 0bac47cf | Iustin Pop | configuration. This will make administration much easier. |
109 | f1a808df | Guido Trotter | </para> |
110 | f1a808df | Guido Trotter | |
111 | 5a96795f | Iustin Pop | <sect3> |
112 | 5a96795f | Iustin Pop | <title>Hostname issues</title> |
113 | 5a96795f | Iustin Pop | <para> |
114 | 5a96795f | Iustin Pop | Note that Ganeti requires the hostnames of the systems |
115 | 5a96795f | Iustin Pop | (i.e. what the <computeroutput>hostname</computeroutput> |
116 | 5a96795f | Iustin Pop | command outputs to be a fully-qualified name, not a short |
117 | 5a96795f | Iustin Pop | name. In other words, you should use |
118 | 5a96795f | Iustin Pop | <literal>node1.example.com</literal> as a hostname and not |
119 | 5a96795f | Iustin Pop | just <literal>node1</literal>. |
120 | 5a96795f | Iustin Pop | </para> |
121 | 5a96795f | Iustin Pop | |
122 | 5a96795f | Iustin Pop | <formalpara> |
123 | 5a96795f | Iustin Pop | <title>Debian</title> |
124 | 5a96795f | Iustin Pop | <para> |
125 | 5a96795f | Iustin Pop | Note that Debian Etch configures the hostname differently |
126 | 5a96795f | Iustin Pop | than you need it for Ganeti. For example, this is what |
127 | 5a96795f | Iustin Pop | Etch puts in <filename>/etc/hosts</filename> in certain |
128 | 5a96795f | Iustin Pop | situations: |
129 | 5a96795f | Iustin Pop | <screen> |
130 | 5a96795f | Iustin Pop | 127.0.0.1 localhost |
131 | 5a96795f | Iustin Pop | 127.0.1.1 node1.example.com node1 |
132 | 5a96795f | Iustin Pop | </screen> |
133 | 5a96795f | Iustin Pop | |
134 | 5a96795f | Iustin Pop | but for Ganeti you need to have: |
135 | 5a96795f | Iustin Pop | <screen> |
136 | 5a96795f | Iustin Pop | 127.0.0.1 localhost |
137 | 5a96795f | Iustin Pop | 192.168.1.1 node1.example.com node1 |
138 | 5a96795f | Iustin Pop | </screen> |
139 | 5a96795f | Iustin Pop | replacing <literal>192.168.1.1</literal> with your node's |
140 | 5a96795f | Iustin Pop | address. Also, the file <filename>/etc/hostname</filename> |
141 | 5a96795f | Iustin Pop | which configures the hostname of the system should contain |
142 | 5a96795f | Iustin Pop | <literal>node1.example.com</literal> and not just |
143 | 5a96795f | Iustin Pop | <literal>node1</literal> (you need to run the command |
144 | 5a96795f | Iustin Pop | <computeroutput>/etc/init.d/hostname.sh |
145 | 5a96795f | Iustin Pop | start</computeroutput> after changing the file). |
146 | 5a96795f | Iustin Pop | </para> |
147 | 5a96795f | Iustin Pop | </formalpara> |
148 | 5a96795f | Iustin Pop | </sect3> |
149 | 5a96795f | Iustin Pop | |
150 | f1a808df | Guido Trotter | </sect2> |
151 | f1a808df | Guido Trotter | |
152 | f1a808df | Guido Trotter | <sect2> |
153 | f1a808df | Guido Trotter | <title>Installing Xen</title> |
154 | f1a808df | Guido Trotter | |
155 | 5d6dd340 | Iustin Pop | <para> |
156 | 0bac47cf | Iustin Pop | <emphasis role="strong">Mandatory</emphasis> on all nodes. |
157 | 32ad0582 | Iustin Pop | </para> |
158 | 32ad0582 | Iustin Pop | |
159 | 32ad0582 | Iustin Pop | <para> |
160 | 0bac47cf | Iustin Pop | While Ganeti is developed with the ability to modularly run on |
161 | 0bac47cf | Iustin Pop | different virtualization environments in mind the only one |
162 | 0bac47cf | Iustin Pop | currently useable on a live system is <ulink |
163 | 0bac47cf | Iustin Pop | url="http://xen.xensource.com/">Xen</ulink>. Supported |
164 | 0bac47cf | Iustin Pop | versions are: <simplelist type="inline"> |
165 | 0bac47cf | Iustin Pop | <member><literal>3.0.3</literal></member> |
166 | 0bac47cf | Iustin Pop | <member><literal>3.0.4</literal></member> |
167 | 0bac47cf | Iustin Pop | <member><literal>3.1</literal></member> </simplelist>. |
168 | f1a808df | Guido Trotter | </para> |
169 | f1a808df | Guido Trotter | |
170 | 5d6dd340 | Iustin Pop | <para> |
171 | 5d6dd340 | Iustin Pop | Please follow your distribution's recommended way to install |
172 | 5d6dd340 | Iustin Pop | and set up Xen, or install Xen from the upstream source, if |
173 | 5d6dd340 | Iustin Pop | you wish, following their manual. |
174 | f1a808df | Guido Trotter | </para> |
175 | f1a808df | Guido Trotter | |
176 | 5d6dd340 | Iustin Pop | <para> |
177 | 051f92ec | Michael Hanselmann | After installing Xen you need to reboot into your Xen-ified |
178 | 0bac47cf | Iustin Pop | dom0 system. On some distributions this might involve |
179 | 0bac47cf | Iustin Pop | configuring GRUB appropriately, whereas others will configure |
180 | 0bac47cf | Iustin Pop | it automatically when you install Xen from a package. |
181 | f1a808df | Guido Trotter | </para> |
182 | f1a808df | Guido Trotter | |
183 | 32ad0582 | Iustin Pop | <formalpara><title>Debian</title> |
184 | 32ad0582 | Iustin Pop | <para> |
185 | 32ad0582 | Iustin Pop | Under Debian Etch or Sarge+backports you can install the |
186 | 16450d30 | Iustin Pop | relevant <literal>xen-linux-system</literal> package, which |
187 | 727830bf | Iustin Pop | will pull in both the hypervisor and the relevant |
188 | 727830bf | Iustin Pop | kernel. Also, if you are installing a 32-bit Etch, you should |
189 | 958c8f40 | Guido Trotter | install the <computeroutput>libc6-xen</computeroutput> package |
190 | 727830bf | Iustin Pop | (run <computeroutput>apt-get install |
191 | 727830bf | Iustin Pop | libc6-xen</computeroutput>). |
192 | 32ad0582 | Iustin Pop | </para> |
193 | 32ad0582 | Iustin Pop | </formalpara> |
194 | 32ad0582 | Iustin Pop | |
195 | 16450d30 | Iustin Pop | <sect3> |
196 | 0a2a0d91 | Iustin Pop | <title>Xen settings</title> |
197 | 0a2a0d91 | Iustin Pop | |
198 | 0a2a0d91 | Iustin Pop | <para> |
199 | 0a2a0d91 | Iustin Pop | It's recommended that dom0 is restricted to a low amount of |
200 | 0a2a0d91 | Iustin Pop | memory (<constant>512MiB</constant> is reasonable) and that |
201 | 0a2a0d91 | Iustin Pop | memory ballooning is disabled in the file |
202 | 0a2a0d91 | Iustin Pop | <filename>/etc/xen/xend-config.sxp</filename> by setting the |
203 | 0a2a0d91 | Iustin Pop | value <literal>dom0-min-mem</literal> to |
204 | 0a2a0d91 | Iustin Pop | <constant>0</constant>, like this: |
205 | 0a2a0d91 | Iustin Pop | <computeroutput>(dom0-min-mem 0)</computeroutput> |
206 | 0a2a0d91 | Iustin Pop | </para> |
207 | 0a2a0d91 | Iustin Pop | |
208 | 0a2a0d91 | Iustin Pop | <para> |
209 | 0a2a0d91 | Iustin Pop | For optimum performance when running both CPU and I/O |
210 | 0a2a0d91 | Iustin Pop | intensive instances, it's also recommended that the dom0 is |
211 | 0a2a0d91 | Iustin Pop | restricted to one CPU only, for example by booting with the |
212 | 0a2a0d91 | Iustin Pop | kernel parameter <literal>nosmp</literal>. |
213 | 0a2a0d91 | Iustin Pop | </para> |
214 | 0a2a0d91 | Iustin Pop | |
215 | dfea906f | Michael Hanselmann | <para> |
216 | dfea906f | Michael Hanselmann | It is recommended that you disable xen's automatic save of virtual |
217 | dfea906f | Michael Hanselmann | machines at system shutdown and subsequent restore of them at reboot. |
218 | dfea906f | Michael Hanselmann | To obtain this make sure the variable |
219 | dfea906f | Michael Hanselmann | <literal>XENDOMAINS_SAVE</literal> in the file |
220 | dfea906f | Michael Hanselmann | <literal>/etc/default/xendomains</literal> is set to an empty value. |
221 | dfea906f | Michael Hanselmann | </para> |
222 | 1df40cb5 | Guido Trotter | |
223 | 0a2a0d91 | Iustin Pop | <formalpara> |
224 | 0a2a0d91 | Iustin Pop | <title>Debian</title> |
225 | 0a2a0d91 | Iustin Pop | <para> |
226 | ac232de3 | Iustin Pop | Besides the ballooning change which you need to set in |
227 | 0a2a0d91 | Iustin Pop | <filename>/etc/xen/xend-config.sxp</filename>, you need to |
228 | 0a2a0d91 | Iustin Pop | set the memory and nosmp parameters in the file |
229 | 0a2a0d91 | Iustin Pop | <filename>/boot/grub/menu.lst</filename>. You need to |
230 | 0a2a0d91 | Iustin Pop | modify the variable <literal>xenhopt</literal> to add |
231 | 0a2a0d91 | Iustin Pop | <userinput>dom0_mem=512M</userinput> like this: |
232 | 0a2a0d91 | Iustin Pop | <screen> |
233 | 0a2a0d91 | Iustin Pop | ## Xen hypervisor options to use with the default Xen boot option |
234 | 0a2a0d91 | Iustin Pop | # xenhopt=dom0_mem=512M |
235 | 0a2a0d91 | Iustin Pop | </screen> |
236 | 0a2a0d91 | Iustin Pop | and the <literal>xenkopt</literal> needs to include the |
237 | 0a2a0d91 | Iustin Pop | <userinput>nosmp</userinput> option like this: |
238 | 0a2a0d91 | Iustin Pop | <screen> |
239 | 0a2a0d91 | Iustin Pop | ## Xen Linux kernel options to use with the default Xen boot option |
240 | 0a2a0d91 | Iustin Pop | # xenkopt=nosmp |
241 | 0a2a0d91 | Iustin Pop | </screen> |
242 | 0a2a0d91 | Iustin Pop | |
243 | 0a2a0d91 | Iustin Pop | Any existing parameters can be left in place: it's ok to |
244 | 0a2a0d91 | Iustin Pop | have <computeroutput>xenkopt=console=tty0 |
245 | 0a2a0d91 | Iustin Pop | nosmp</computeroutput>, for example. After modifying the |
246 | 0a2a0d91 | Iustin Pop | files, you need to run: |
247 | 0a2a0d91 | Iustin Pop | <screen> |
248 | 0a2a0d91 | Iustin Pop | /sbin/update-grub |
249 | 0a2a0d91 | Iustin Pop | </screen> |
250 | 0a2a0d91 | Iustin Pop | </para> |
251 | 0a2a0d91 | Iustin Pop | </formalpara> |
252 | bf6fe28b | Alexander Schreiber | <para> |
253 | ca9c49d5 | Iustin Pop | If you want to test the HVM support |
254 | bf6fe28b | Alexander Schreiber | with Ganeti and want VNC access to the console of your |
255 | bf6fe28b | Alexander Schreiber | instances, set the following two entries in |
256 | bf6fe28b | Alexander Schreiber | <filename>/etc/xen/xend-config.sxp</filename>: |
257 | bf6fe28b | Alexander Schreiber | <screen> |
258 | bf6fe28b | Alexander Schreiber | (vnc-listen '0.0.0.0') |
259 | bf6fe28b | Alexander Schreiber | (vncpasswd '') |
260 | bf6fe28b | Alexander Schreiber | </screen> |
261 | bf6fe28b | Alexander Schreiber | You need to restart the Xen daemon for these settings to |
262 | bf6fe28b | Alexander Schreiber | take effect: |
263 | bf6fe28b | Alexander Schreiber | <screen> |
264 | bf6fe28b | Alexander Schreiber | /etc/init.d/xend restart |
265 | bf6fe28b | Alexander Schreiber | </screen> |
266 | bf6fe28b | Alexander Schreiber | </para> |
267 | 0a2a0d91 | Iustin Pop | |
268 | 0a2a0d91 | Iustin Pop | </sect3> |
269 | 0a2a0d91 | Iustin Pop | |
270 | 0a2a0d91 | Iustin Pop | <sect3> |
271 | 16450d30 | Iustin Pop | <title>Selecting the instance kernel</title> |
272 | 16450d30 | Iustin Pop | |
273 | 16450d30 | Iustin Pop | <para> |
274 | 051f92ec | Michael Hanselmann | After you have installed Xen, you need to tell Ganeti |
275 | 16450d30 | Iustin Pop | exactly what kernel to use for the instances it will |
276 | 16450d30 | Iustin Pop | create. This is done by creating a |
277 | 16450d30 | Iustin Pop | <emphasis>symlink</emphasis> from your actual kernel to |
278 | 16450d30 | Iustin Pop | <filename>/boot/vmlinuz-2.6-xenU</filename>, and one from |
279 | 16450d30 | Iustin Pop | your initrd to |
280 | 16450d30 | Iustin Pop | <filename>/boot/initrd-2.6-xenU</filename>. Note that if you |
281 | 16450d30 | Iustin Pop | don't use an initrd for the <literal>domU</literal> kernel, |
282 | 16450d30 | Iustin Pop | you don't need to create the initrd symlink. |
283 | 16450d30 | Iustin Pop | </para> |
284 | 16450d30 | Iustin Pop | |
285 | 16450d30 | Iustin Pop | <formalpara> |
286 | 16450d30 | Iustin Pop | <title>Debian</title> |
287 | 16450d30 | Iustin Pop | <para> |
288 | 16450d30 | Iustin Pop | After installation of the |
289 | 16450d30 | Iustin Pop | <literal>xen-linux-system</literal> package, you need to |
290 | 16450d30 | Iustin Pop | run (replace the exact version number with the one you |
291 | 16450d30 | Iustin Pop | have): |
292 | 16450d30 | Iustin Pop | <screen> |
293 | 16450d30 | Iustin Pop | cd /boot |
294 | 16450d30 | Iustin Pop | ln -s vmlinuz-2.6.18-5-xen-686 vmlinuz-2.6-xenU |
295 | 16450d30 | Iustin Pop | ln -s initrd.img-2.6.18-5-xen-686 initrd-2.6-xenU |
296 | 16450d30 | Iustin Pop | </screen> |
297 | 16450d30 | Iustin Pop | </para> |
298 | 16450d30 | Iustin Pop | </formalpara> |
299 | 16450d30 | Iustin Pop | </sect3> |
300 | 16450d30 | Iustin Pop | |
301 | f1a808df | Guido Trotter | </sect2> |
302 | f1a808df | Guido Trotter | |
303 | f1a808df | Guido Trotter | <sect2> |
304 | f1a808df | Guido Trotter | <title>Installing DRBD</title> |
305 | f1a808df | Guido Trotter | |
306 | 5d6dd340 | Iustin Pop | <para> |
307 | 0bac47cf | Iustin Pop | Recommended on all nodes: <ulink |
308 | 0bac47cf | Iustin Pop | url="http://www.drbd.org/">DRBD</ulink> is required if you |
309 | 0bac47cf | Iustin Pop | want to use the high availability (HA) features of Ganeti, but |
310 | 0bac47cf | Iustin Pop | optional if you don't require HA or only run Ganeti on |
311 | 0bac47cf | Iustin Pop | single-node clusters. You can upgrade a non-HA cluster to an |
312 | 32ad0582 | Iustin Pop | HA one later, but you might need to export and re-import all |
313 | 0bac47cf | Iustin Pop | your instances to take advantage of the new features. |
314 | 0bac47cf | Iustin Pop | </para> |
315 | 0bac47cf | Iustin Pop | |
316 | 0bac47cf | Iustin Pop | <para> |
317 | 808753d4 | Manuel Franceschini | Supported DRBD versions: <literal>8.0.x</literal>. |
318 | 808753d4 | Manuel Franceschini | It's recommended to have at least version <literal>8.0.7</literal>. |
319 | f1a808df | Guido Trotter | </para> |
320 | f1a808df | Guido Trotter | |
321 | 5d6dd340 | Iustin Pop | <para> |
322 | 5d6dd340 | Iustin Pop | Now the bad news: unless your distribution already provides it |
323 | 5d6dd340 | Iustin Pop | installing DRBD might involve recompiling your kernel or |
324 | 051f92ec | Michael Hanselmann | anyway fiddling with it. Hopefully at least the Xen-ified |
325 | 5d6dd340 | Iustin Pop | kernel source to start from will be provided. |
326 | f1a808df | Guido Trotter | </para> |
327 | f1a808df | Guido Trotter | |
328 | 5d6dd340 | Iustin Pop | <para> |
329 | 5d6dd340 | Iustin Pop | The good news is that you don't need to configure DRBD at all. |
330 | 5d6dd340 | Iustin Pop | Ganeti will do it for you for every instance you set up. If |
331 | 5d6dd340 | Iustin Pop | you have the DRBD utils installed and the module in your |
332 | 5d6dd340 | Iustin Pop | kernel you're fine. Please check that your system is |
333 | 727830bf | Iustin Pop | configured to load the module at every boot, and that it |
334 | 808753d4 | Manuel Franceschini | passes the following option to the module |
335 | 808753d4 | Manuel Franceschini | <computeroutput>minor_count=255</computeroutput>. This will |
336 | 808753d4 | Manuel Franceschini | allow you to use up to 128 instances per node (for most clusters |
337 | 808753d4 | Manuel Franceschini | <constant>128 </constant> should be enough, though). |
338 | f1a808df | Guido Trotter | </para> |
339 | f1a808df | Guido Trotter | |
340 | 32ad0582 | Iustin Pop | <formalpara><title>Debian</title> |
341 | 32ad0582 | Iustin Pop | <para> |
342 | 808753d4 | Manuel Franceschini | You can just install (build) the DRBD 8.0.x module with the |
343 | 851765bb | Iustin Pop | following commands (make sure you are running the Xen |
344 | 851765bb | Iustin Pop | kernel): |
345 | 32ad0582 | Iustin Pop | </para> |
346 | 32ad0582 | Iustin Pop | </formalpara> |
347 | 32ad0582 | Iustin Pop | |
348 | 32ad0582 | Iustin Pop | <screen> |
349 | 17dc2da0 | Iustin Pop | apt-get install -t etch-backports drbd8-source drbd8-utils |
350 | 6c4811dc | Iustin Pop | m-a update |
351 | 6c4811dc | Iustin Pop | m-a a-i drbd8 |
352 | 6c4811dc | Iustin Pop | echo drbd minor_count=128 >> /etc/modules |
353 | e7d2d69b | Iustin Pop | depmod -a |
354 | 6c4811dc | Iustin Pop | modprobe drbd minor_count=128 |
355 | 6c4811dc | Iustin Pop | </screen> |
356 | 32ad0582 | Iustin Pop | |
357 | 61bf23ec | Iustin Pop | <para> |
358 | 61bf23ec | Iustin Pop | It is also recommended that you comment out the default |
359 | 808753d4 | Manuel Franceschini | resources in the <filename>/etc/drbd.conf</filename> file, so |
360 | 61bf23ec | Iustin Pop | that the init script doesn't try to configure any drbd |
361 | 61bf23ec | Iustin Pop | devices. You can do this by prefixing all |
362 | 61bf23ec | Iustin Pop | <literal>resource</literal> lines in the file with the keyword |
363 | 61bf23ec | Iustin Pop | <literal>skip</literal>, like this: |
364 | 61bf23ec | Iustin Pop | </para> |
365 | 61bf23ec | Iustin Pop | |
366 | 61bf23ec | Iustin Pop | <screen> |
367 | 61bf23ec | Iustin Pop | skip resource r0 { |
368 | 61bf23ec | Iustin Pop | ... |
369 | 61bf23ec | Iustin Pop | } |
370 | 61bf23ec | Iustin Pop | |
371 | 61bf23ec | Iustin Pop | skip resource "r1" { |
372 | 61bf23ec | Iustin Pop | ... |
373 | 61bf23ec | Iustin Pop | } |
374 | 61bf23ec | Iustin Pop | </screen> |
375 | 61bf23ec | Iustin Pop | |
376 | f1a808df | Guido Trotter | </sect2> |
377 | f1a808df | Guido Trotter | |
378 | a7a19281 | Iustin Pop | <sect2> |
379 | a7a19281 | Iustin Pop | <title>Other required software</title> |
380 | a7a19281 | Iustin Pop | |
381 | a7a19281 | Iustin Pop | <para>Besides Xen and DRBD, you will need to install the |
382 | 0bac47cf | Iustin Pop | following (on all nodes):</para> |
383 | a7a19281 | Iustin Pop | |
384 | a7a19281 | Iustin Pop | <itemizedlist> |
385 | a7a19281 | Iustin Pop | <listitem> |
386 | a7a19281 | Iustin Pop | <simpara><ulink url="http://sourceware.org/lvm2/">LVM |
387 | a7a19281 | Iustin Pop | version 2</ulink></simpara> |
388 | a7a19281 | Iustin Pop | </listitem> |
389 | a7a19281 | Iustin Pop | <listitem> |
390 | a7a19281 | Iustin Pop | <simpara><ulink |
391 | a7a19281 | Iustin Pop | url="http://www.openssl.org/">OpenSSL</ulink></simpara> |
392 | a7a19281 | Iustin Pop | </listitem> |
393 | a7a19281 | Iustin Pop | <listitem> |
394 | a7a19281 | Iustin Pop | <simpara><ulink |
395 | a7a19281 | Iustin Pop | url="http://www.openssh.com/portable.html">OpenSSH</ulink></simpara> |
396 | a7a19281 | Iustin Pop | </listitem> |
397 | a7a19281 | Iustin Pop | <listitem> |
398 | a7a19281 | Iustin Pop | <simpara><ulink url="http://bridge.sourceforge.net/">Bridge |
399 | a7a19281 | Iustin Pop | utilities</ulink></simpara> |
400 | a7a19281 | Iustin Pop | </listitem> |
401 | a7a19281 | Iustin Pop | <listitem> |
402 | a7a19281 | Iustin Pop | <simpara><ulink |
403 | a7a19281 | Iustin Pop | url="http://developer.osdl.org/dev/iproute2">iproute2</ulink></simpara> |
404 | a7a19281 | Iustin Pop | </listitem> |
405 | a7a19281 | Iustin Pop | <listitem> |
406 | a7a19281 | Iustin Pop | <simpara><ulink |
407 | a7a19281 | Iustin Pop | url="ftp://ftp.inr.ac.ru/ip-routing/iputils-current.tar.gz">arping</ulink> |
408 | a7a19281 | Iustin Pop | (part of iputils package)</simpara> |
409 | a7a19281 | Iustin Pop | </listitem> |
410 | a7a19281 | Iustin Pop | <listitem> |
411 | a7a19281 | Iustin Pop | <simpara><ulink url="http://www.python.org">Python 2.4</ulink></simpara> |
412 | a7a19281 | Iustin Pop | </listitem> |
413 | a7a19281 | Iustin Pop | <listitem> |
414 | a7a19281 | Iustin Pop | <simpara><ulink |
415 | a7a19281 | Iustin Pop | url="http://pyopenssl.sourceforge.net/">Python OpenSSL |
416 | a7a19281 | Iustin Pop | bindings</ulink></simpara> |
417 | 319856a9 | Michael Hanselmann | </listitem> |
418 | 319856a9 | Michael Hanselmann | <listitem> |
419 | 319856a9 | Michael Hanselmann | <simpara><ulink |
420 | 319856a9 | Michael Hanselmann | url="http://www.undefined.org/python/#simplejson">simplejson Python |
421 | 319856a9 | Michael Hanselmann | module</ulink></simpara> |
422 | a2cfdea2 | Iustin Pop | </listitem> |
423 | a2cfdea2 | Iustin Pop | <listitem> |
424 | a2cfdea2 | Iustin Pop | <simpara><ulink |
425 | a2cfdea2 | Iustin Pop | url="http://pyparsing.wikispaces.com/">pyparsing Python |
426 | a2cfdea2 | Iustin Pop | module</ulink></simpara> |
427 | a7a19281 | Iustin Pop | </listitem> |
428 | a7a19281 | Iustin Pop | </itemizedlist> |
429 | a7a19281 | Iustin Pop | |
430 | 32ad0582 | Iustin Pop | <para> |
431 | 32ad0582 | Iustin Pop | These programs are supplied as part of most Linux |
432 | 32ad0582 | Iustin Pop | distributions, so usually they can be installed via apt or |
433 | 32ad0582 | Iustin Pop | similar methods. Also many of them will already be installed |
434 | 32ad0582 | Iustin Pop | on a standard machine. |
435 | 32ad0582 | Iustin Pop | </para> |
436 | 32ad0582 | Iustin Pop | |
437 | 32ad0582 | Iustin Pop | |
438 | 32ad0582 | Iustin Pop | <formalpara><title>Debian</title> |
439 | 32ad0582 | Iustin Pop | |
440 | 32ad0582 | Iustin Pop | <para>You can use this command line to install all of them:</para> |
441 | a7a19281 | Iustin Pop | |
442 | 32ad0582 | Iustin Pop | </formalpara> |
443 | a7a19281 | Iustin Pop | <screen> |
444 | a7a19281 | Iustin Pop | # apt-get install lvm2 ssh bridge-utils iproute iputils-arping \ |
445 | 808753d4 | Manuel Franceschini | python2.4 python-pyopenssl openssl python-pyparsing python-simplejson |
446 | a7a19281 | Iustin Pop | </screen> |
447 | 5cd0d9c0 | Iustin Pop | |
448 | a7a19281 | Iustin Pop | </sect2> |
449 | a7a19281 | Iustin Pop | |
450 | f1a808df | Guido Trotter | </sect1> |
451 | f1a808df | Guido Trotter | |
452 | f1a808df | Guido Trotter | |
453 | f1a808df | Guido Trotter | <sect1> |
454 | f1a808df | Guido Trotter | <title>Setting up the environment for Ganeti</title> |
455 | f1a808df | Guido Trotter | |
456 | f1a808df | Guido Trotter | <sect2> |
457 | f1a808df | Guido Trotter | <title>Configuring the network</title> |
458 | f1a808df | Guido Trotter | |
459 | 0bac47cf | Iustin Pop | <para><emphasis role="strong">Mandatory</emphasis> on all nodes.</para> |
460 | 0bac47cf | Iustin Pop | |
461 | 32ad0582 | Iustin Pop | <para> |
462 | 32ad0582 | Iustin Pop | Ganeti relies on Xen running in "bridge mode", which means the |
463 | 32ad0582 | Iustin Pop | instances network interfaces will be attached to a software bridge |
464 | 32ad0582 | Iustin Pop | running in dom0. Xen by default creates such a bridge at startup, but |
465 | 32ad0582 | Iustin Pop | your distribution might have a different way to do things. |
466 | f1a808df | Guido Trotter | </para> |
467 | f1a808df | Guido Trotter | |
468 | f1a808df | Guido Trotter | <para> |
469 | 32ad0582 | Iustin Pop | Beware that the default name Ganeti uses is |
470 | 32ad0582 | Iustin Pop | <hardware>xen-br0</hardware> (which was used in Xen 2.0) |
471 | 32ad0582 | Iustin Pop | while Xen 3.0 uses <hardware>xenbr0</hardware> by |
472 | 32ad0582 | Iustin Pop | default. The default bridge your Ganeti cluster will use for new |
473 | 32ad0582 | Iustin Pop | instances can be specified at cluster initialization time. |
474 | 32ad0582 | Iustin Pop | </para> |
475 | 5d6dd340 | Iustin Pop | |
476 | 32ad0582 | Iustin Pop | <formalpara><title>Debian</title> |
477 | 32ad0582 | Iustin Pop | <para> |
478 | 051f92ec | Michael Hanselmann | The recommended Debian way to configure the Xen bridge is to |
479 | 32ad0582 | Iustin Pop | edit your <filename>/etc/network/interfaces</filename> file |
480 | 32ad0582 | Iustin Pop | and substitute your normal Ethernet stanza with the |
481 | 32ad0582 | Iustin Pop | following snippet: |
482 | 32ad0582 | Iustin Pop | |
483 | 32ad0582 | Iustin Pop | <screen> |
484 | 32ad0582 | Iustin Pop | auto xen-br0 |
485 | 32ad0582 | Iustin Pop | iface xen-br0 inet static |
486 | 5d6dd340 | Iustin Pop | address <replaceable>YOUR_IP_ADDRESS</replaceable> |
487 | 5d6dd340 | Iustin Pop | netmask <replaceable>YOUR_NETMASK</replaceable> |
488 | 5d6dd340 | Iustin Pop | network <replaceable>YOUR_NETWORK</replaceable> |
489 | 5d6dd340 | Iustin Pop | broadcast <replaceable>YOUR_BROADCAST_ADDRESS</replaceable> |
490 | 5d6dd340 | Iustin Pop | gateway <replaceable>YOUR_GATEWAY</replaceable> |
491 | 32ad0582 | Iustin Pop | bridge_ports eth0 |
492 | f1a808df | Guido Trotter | bridge_stp off |
493 | f1a808df | Guido Trotter | bridge_fd 0 |
494 | 32ad0582 | Iustin Pop | </screen> |
495 | 32ad0582 | Iustin Pop | </para> |
496 | 32ad0582 | Iustin Pop | </formalpara> |
497 | 32ad0582 | Iustin Pop | |
498 | 32ad0582 | Iustin Pop | <para> |
499 | 32ad0582 | Iustin Pop | The following commands need to be executed on the local console |
500 | 32ad0582 | Iustin Pop | </para> |
501 | 32ad0582 | Iustin Pop | <screen> |
502 | 32ad0582 | Iustin Pop | ifdown eth0 |
503 | 32ad0582 | Iustin Pop | ifup xen-br0 |
504 | 32ad0582 | Iustin Pop | </screen> |
505 | 32ad0582 | Iustin Pop | |
506 | 32ad0582 | Iustin Pop | <para> |
507 | 32ad0582 | Iustin Pop | To check if the bridge is setup, use <command>ip</command> |
508 | 32ad0582 | Iustin Pop | and <command>brctl show</command>: |
509 | 32ad0582 | Iustin Pop | <para> |
510 | 32ad0582 | Iustin Pop | |
511 | 32ad0582 | Iustin Pop | <screen> |
512 | 32ad0582 | Iustin Pop | # ip a show xen-br0 |
513 | 32ad0582 | Iustin Pop | 9: xen-br0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc noqueue |
514 | 32ad0582 | Iustin Pop | link/ether 00:20:fc:1e:d5:5d brd ff:ff:ff:ff:ff:ff |
515 | 32ad0582 | Iustin Pop | inet 10.1.1.200/24 brd 10.1.1.255 scope global xen-br0 |
516 | 32ad0582 | Iustin Pop | inet6 fe80::220:fcff:fe1e:d55d/64 scope link |
517 | 32ad0582 | Iustin Pop | valid_lft forever preferred_lft forever |
518 | 32ad0582 | Iustin Pop | |
519 | 32ad0582 | Iustin Pop | # brctl show xen-br0 |
520 | 32ad0582 | Iustin Pop | bridge name bridge id STP enabled interfaces |
521 | 32ad0582 | Iustin Pop | xen-br0 8000.0020fc1ed55d no eth0 |
522 | 5d6dd340 | Iustin Pop | </screen> |
523 | f1a808df | Guido Trotter | |
524 | f1a808df | Guido Trotter | |
525 | f1a808df | Guido Trotter | </sect2> |
526 | f1a808df | Guido Trotter | |
527 | f1a808df | Guido Trotter | <sect2> |
528 | f1a808df | Guido Trotter | <title>Configuring LVM</title> |
529 | f1a808df | Guido Trotter | |
530 | 32ad0582 | Iustin Pop | |
531 | 0bac47cf | Iustin Pop | <para><emphasis role="strong">Mandatory</emphasis> on all nodes.</para> |
532 | 0bac47cf | Iustin Pop | |
533 | 16450d30 | Iustin Pop | <note> |
534 | 16450d30 | Iustin Pop | <simpara>The volume group is required to be at least |
535 | 16450d30 | Iustin Pop | <constant>20GiB</constant>.</simpara> |
536 | 16450d30 | Iustin Pop | </note> |
537 | f1a808df | Guido Trotter | <para> |
538 | 5d6dd340 | Iustin Pop | If you haven't configured your LVM volume group at install |
539 | 5d6dd340 | Iustin Pop | time you need to do it before trying to initialize the Ganeti |
540 | 5d6dd340 | Iustin Pop | cluster. This is done by formatting the devices/partitions you |
541 | 5d6dd340 | Iustin Pop | want to use for it and then adding them to the relevant volume |
542 | 5d6dd340 | Iustin Pop | group: |
543 | 5d6dd340 | Iustin Pop | |
544 | 5d6dd340 | Iustin Pop | <screen> |
545 | 32ad0582 | Iustin Pop | pvcreate /dev/sda3 |
546 | 32ad0582 | Iustin Pop | vgcreate xenvg /dev/sda3 |
547 | 32ad0582 | Iustin Pop | </screen> |
548 | 32ad0582 | Iustin Pop | or |
549 | 32ad0582 | Iustin Pop | <screen> |
550 | 32ad0582 | Iustin Pop | pvcreate /dev/sdb1 |
551 | f1a808df | Guido Trotter | pvcreate /dev/sdc1 |
552 | 32ad0582 | Iustin Pop | vgcreate xenvg /dev/sdb1 /dev/sdc1 |
553 | 5d6dd340 | Iustin Pop | </screen> |
554 | 32ad0582 | Iustin Pop | </para> |
555 | f1a808df | Guido Trotter | |
556 | f1a808df | Guido Trotter | <para> |
557 | 5d6dd340 | Iustin Pop | If you want to add a device later you can do so with the |
558 | 53b78ba4 | Guido Trotter | <citerefentry><refentrytitle>vgextend</refentrytitle> |
559 | 5d6dd340 | Iustin Pop | <manvolnum>8</manvolnum></citerefentry> command: |
560 | 5d6dd340 | Iustin Pop | </para> |
561 | 5d6dd340 | Iustin Pop | |
562 | 5d6dd340 | Iustin Pop | <screen> |
563 | 32ad0582 | Iustin Pop | pvcreate /dev/sdd1 |
564 | 32ad0582 | Iustin Pop | vgextend xenvg /dev/sdd1 |
565 | 5d6dd340 | Iustin Pop | </screen> |
566 | 89624642 | Iustin Pop | |
567 | 89624642 | Iustin Pop | <formalpara> |
568 | 89624642 | Iustin Pop | <title>Optional</title> |
569 | 89624642 | Iustin Pop | <para> |
570 | 89624642 | Iustin Pop | It is recommended to configure LVM not to scan the DRBD |
571 | 89624642 | Iustin Pop | devices for physical volumes. This can be accomplished by |
572 | 89624642 | Iustin Pop | editing <filename>/etc/lvm/lvm.conf</filename> and adding |
573 | 89624642 | Iustin Pop | the <literal>/dev/drbd[0-9]+</literal> regular expression to |
574 | 89624642 | Iustin Pop | the <literal>filter</literal> variable, like this: |
575 | 89624642 | Iustin Pop | <screen> |
576 | 89624642 | Iustin Pop | filter = [ "r|/dev/cdrom|", "r|/dev/drbd[0-9]+|" ] |
577 | 89624642 | Iustin Pop | </screen> |
578 | 89624642 | Iustin Pop | </para> |
579 | 89624642 | Iustin Pop | </formalpara> |
580 | 89624642 | Iustin Pop | |
581 | f1a808df | Guido Trotter | </sect2> |
582 | f1a808df | Guido Trotter | |
583 | f1a808df | Guido Trotter | <sect2> |
584 | f1a808df | Guido Trotter | <title>Installing Ganeti</title> |
585 | f1a808df | Guido Trotter | |
586 | 0bac47cf | Iustin Pop | <para><emphasis role="strong">Mandatory</emphasis> on all nodes.</para> |
587 | 0bac47cf | Iustin Pop | |
588 | 1005b0c1 | Iustin Pop | <para> |
589 | 32ad0582 | Iustin Pop | It's now time to install the Ganeti software itself. Download |
590 | 32ad0582 | Iustin Pop | the source from <ulink |
591 | 32ad0582 | Iustin Pop | url="http://code.google.com/p/ganeti/"></ulink>. |
592 | 1005b0c1 | Iustin Pop | </para> |
593 | f1a808df | Guido Trotter | |
594 | 5d6dd340 | Iustin Pop | <screen> |
595 | e30c295e | Michael Hanselmann | tar xvzf ganeti-@GANETI_VERSION@.tar.gz |
596 | e30c295e | Michael Hanselmann | cd ganeti-@GANETI_VERSION@ |
597 | bd205d0e | Michael Hanselmann | ./configure --localstatedir=/var --sysconfdir=/etc |
598 | f1a808df | Guido Trotter | make |
599 | f1a808df | Guido Trotter | make install |
600 | 1005b0c1 | Iustin Pop | mkdir /srv/ganeti/ /srv/ganeti/os /srv/ganeti/export |
601 | 5d6dd340 | Iustin Pop | </screen> |
602 | f1a808df | Guido Trotter | |
603 | 1005b0c1 | Iustin Pop | <para> |
604 | 32ad0582 | Iustin Pop | You also need to copy the file |
605 | bd205d0e | Michael Hanselmann | <filename>doc/examples/ganeti.initd</filename> |
606 | 32ad0582 | Iustin Pop | from the source archive to |
607 | 32ad0582 | Iustin Pop | <filename>/etc/init.d/ganeti</filename> and register it with |
608 | 1005b0c1 | Iustin Pop | your distribution's startup scripts, for example in Debian: |
609 | f1a808df | Guido Trotter | </para> |
610 | 1005b0c1 | Iustin Pop | <screen>update-rc.d ganeti defaults 20 80</screen> |
611 | f1a808df | Guido Trotter | |
612 | 727830bf | Iustin Pop | <para> |
613 | 727830bf | Iustin Pop | In order to automatically restart failed instances, you need |
614 | 727830bf | Iustin Pop | to setup a cron job run the |
615 | 727830bf | Iustin Pop | <computeroutput>ganeti-watcher</computeroutput> program. A |
616 | 727830bf | Iustin Pop | sample cron file is provided in the source at |
617 | bd205d0e | Michael Hanselmann | <filename>doc/examples/ganeti.cron</filename> and you can |
618 | 727830bf | Iustin Pop | copy that (eventually altering the path) to |
619 | 727830bf | Iustin Pop | <filename>/etc/cron.d/ganeti</filename> |
620 | 727830bf | Iustin Pop | </para> |
621 | 727830bf | Iustin Pop | |
622 | f1a808df | Guido Trotter | </sect2> |
623 | f1a808df | Guido Trotter | |
624 | f1a808df | Guido Trotter | <sect2> |
625 | f1a808df | Guido Trotter | <title>Installing the Operating System support packages</title> |
626 | f1a808df | Guido Trotter | |
627 | 0bac47cf | Iustin Pop | <para><emphasis role="strong">Mandatory</emphasis> on all nodes.</para> |
628 | 0bac47cf | Iustin Pop | |
629 | a7a19281 | Iustin Pop | <para> |
630 | 32ad0582 | Iustin Pop | To be able to install instances you need to have an Operating |
631 | 32ad0582 | Iustin Pop | System installation script. An example for Debian Etch is |
632 | 32ad0582 | Iustin Pop | provided on the project web site. Download it from <ulink |
633 | 32ad0582 | Iustin Pop | url="http://code.google.com/p/ganeti/"></ulink> and follow the |
634 | 32ad0582 | Iustin Pop | instructions in the <filename>README</filename> file. Here is |
635 | 5736852e | Iustin Pop | the installation procedure (replace <constant>0.2</constant> |
636 | 5736852e | Iustin Pop | with the latest version that is compatible with your ganeti |
637 | 5736852e | Iustin Pop | version): |
638 | a7a19281 | Iustin Pop | </para> |
639 | a7a19281 | Iustin Pop | |
640 | 32ad0582 | Iustin Pop | <screen> |
641 | 32ad0582 | Iustin Pop | cd /srv/ganeti/os |
642 | 31b9055c | Iustin Pop | tar xvf ganeti-instance-debian-etch-0.4.tar |
643 | 31b9055c | Iustin Pop | mv ganeti-instance-debian-etch-0.4 debian-etch |
644 | 32ad0582 | Iustin Pop | </screen> |
645 | 32ad0582 | Iustin Pop | |
646 | a7a19281 | Iustin Pop | <para> |
647 | 16450d30 | Iustin Pop | In order to use this OS definition, you need to have internet |
648 | 116b0c88 | Iustin Pop | access from your nodes and have the <citerefentry> |
649 | 16450d30 | Iustin Pop | <refentrytitle>debootstrap</refentrytitle> |
650 | 116b0c88 | Iustin Pop | <manvolnum>8</manvolnum></citerefentry>, <citerefentry> |
651 | 116b0c88 | Iustin Pop | <refentrytitle>dump</refentrytitle><manvolnum>8</manvolnum> |
652 | 116b0c88 | Iustin Pop | </citerefentry> and <citerefentry> |
653 | 116b0c88 | Iustin Pop | <refentrytitle>restore</refentrytitle> |
654 | 116b0c88 | Iustin Pop | <manvolnum>8</manvolnum> </citerefentry> commands installed on |
655 | 116b0c88 | Iustin Pop | all nodes. |
656 | 16450d30 | Iustin Pop | </para> |
657 | 16450d30 | Iustin Pop | <formalpara> |
658 | 16450d30 | Iustin Pop | <title>Debian</title> |
659 | 16450d30 | Iustin Pop | <para> |
660 | 116b0c88 | Iustin Pop | Use this command on all nodes to install the required |
661 | 116b0c88 | Iustin Pop | packages: |
662 | 16450d30 | Iustin Pop | |
663 | 116b0c88 | Iustin Pop | <screen>apt-get install debootstrap dump</screen> |
664 | 16450d30 | Iustin Pop | </para> |
665 | 16450d30 | Iustin Pop | </formalpara> |
666 | 16450d30 | Iustin Pop | |
667 | 16450d30 | Iustin Pop | <para> |
668 | 32ad0582 | Iustin Pop | Alternatively, you can create your own OS definitions. See the |
669 | 0bac47cf | Iustin Pop | manpage |
670 | a7a19281 | Iustin Pop | <citerefentry> |
671 | a7a19281 | Iustin Pop | <refentrytitle>ganeti-os-interface</refentrytitle> |
672 | a7a19281 | Iustin Pop | <manvolnum>8</manvolnum> |
673 | a7a19281 | Iustin Pop | </citerefentry>. |
674 | f1a808df | Guido Trotter | </para> |
675 | f1a808df | Guido Trotter | |
676 | f1a808df | Guido Trotter | </sect2> |
677 | f1a808df | Guido Trotter | |
678 | f1a808df | Guido Trotter | <sect2> |
679 | f1a808df | Guido Trotter | <title>Initializing the cluster</title> |
680 | f1a808df | Guido Trotter | |
681 | 5d6dd340 | Iustin Pop | <para><emphasis role="strong">Mandatory:</emphasis> only on one |
682 | 5d6dd340 | Iustin Pop | node per cluster.</para> |
683 | f1a808df | Guido Trotter | |
684 | f1a808df | Guido Trotter | |
685 | f1a808df | Guido Trotter | <para>The last step is to initialize the cluster. After you've repeated |
686 | 32ad0582 | Iustin Pop | the above process on all of your nodes, choose one as the master, and execute: |
687 | 5d6dd340 | Iustin Pop | </para> |
688 | f1a808df | Guido Trotter | |
689 | 5d6dd340 | Iustin Pop | <screen> |
690 | 5d6dd340 | Iustin Pop | gnt-cluster init <replaceable>CLUSTERNAME</replaceable> |
691 | 5d6dd340 | Iustin Pop | </screen> |
692 | f1a808df | Guido Trotter | |
693 | 5d6dd340 | Iustin Pop | <para> |
694 | 0bac47cf | Iustin Pop | The <replaceable>CLUSTERNAME</replaceable> is a hostname, |
695 | 0bac47cf | Iustin Pop | which must be resolvable (e.g. it must exist in DNS or in |
696 | 0bac47cf | Iustin Pop | <filename>/etc/hosts</filename>) by all the nodes in the |
697 | 0bac47cf | Iustin Pop | cluster. You must choose a name different from any of the |
698 | 0bac47cf | Iustin Pop | nodes names for a multi-node cluster. In general the best |
699 | 0bac47cf | Iustin Pop | choice is to have a unique name for a cluster, even if it |
700 | 0bac47cf | Iustin Pop | consists of only one machine, as you will be able to expand it |
701 | 56db8a84 | Alexander Schreiber | later without any problems. Please note that the hostname used |
702 | 56db8a84 | Alexander Schreiber | for this must resolve to an IP address reserved exclusively |
703 | 56db8a84 | Alexander Schreiber | for this purpose. |
704 | 0bac47cf | Iustin Pop | </para> |
705 | 0bac47cf | Iustin Pop | |
706 | 0bac47cf | Iustin Pop | <para> |
707 | 32ad0582 | Iustin Pop | If the bridge name you are using is not |
708 | 32ad0582 | Iustin Pop | <literal>xen-br0</literal>, use the <option>-b |
709 | 32ad0582 | Iustin Pop | <replaceable>BRIDGENAME</replaceable></option> option to |
710 | 32ad0582 | Iustin Pop | specify the bridge name. In this case, you should also use the |
711 | 32ad0582 | Iustin Pop | <option>--master-netdev |
712 | 32ad0582 | Iustin Pop | <replaceable>BRIDGENAME</replaceable></option> option with the |
713 | 32ad0582 | Iustin Pop | same <replaceable>BRIDGENAME</replaceable> argument. |
714 | 1005b0c1 | Iustin Pop | </para> |
715 | 1005b0c1 | Iustin Pop | |
716 | 1005b0c1 | Iustin Pop | <para> |
717 | 32ad0582 | Iustin Pop | You can use a different name than <literal>xenvg</literal> for |
718 | 32ad0582 | Iustin Pop | the volume group (but note that the name must be identical on |
719 | 32ad0582 | Iustin Pop | all nodes). In this case you need to specify it by passing the |
720 | 32ad0582 | Iustin Pop | <option>-g <replaceable>VGNAME</replaceable></option> option |
721 | 32ad0582 | Iustin Pop | to <computeroutput>gnt-cluster init</computeroutput>. |
722 | f1a808df | Guido Trotter | </para> |
723 | f1a808df | Guido Trotter | |
724 | 5d6dd340 | Iustin Pop | <para> |
725 | bf6fe28b | Alexander Schreiber | To set up the cluster as an HVM cluster, use the |
726 | bf6fe28b | Alexander Schreiber | <option>--hypervisor=xen-hvm3.1</option> option to use |
727 | bf6fe28b | Alexander Schreiber | the Xen 3.1 HVM hypervisor. Note that with the |
728 | ca9c49d5 | Iustin Pop | HVM support, you will only be able to create |
729 | bf6fe28b | Alexander Schreiber | HVM instances in a cluster set to this hypervisor type. Mixed |
730 | bf6fe28b | Alexander Schreiber | PVM/HVM clusters are not supported by the Ganeti 1.2 |
731 | ca9c49d5 | Iustin Pop | HVM support. You will also need to create the VNC |
732 | bf6fe28b | Alexander Schreiber | cluster password file |
733 | bf6fe28b | Alexander Schreiber | <filename>/etc/ganeti/vnc-cluster-password</filename> |
734 | bf6fe28b | Alexander Schreiber | which contains one line with the default VNC password for the |
735 | ca9c49d5 | Iustin Pop | cluster. |
736 | bf6fe28b | Alexander Schreiber | </para> |
737 | bf6fe28b | Alexander Schreiber | |
738 | bf6fe28b | Alexander Schreiber | <para> |
739 | 32ad0582 | Iustin Pop | You can also invoke the command with the |
740 | 32ad0582 | Iustin Pop | <option>--help</option> option in order to see all the |
741 | 32ad0582 | Iustin Pop | possibilities. |
742 | f1a808df | Guido Trotter | </para> |
743 | 32ad0582 | Iustin Pop | |
744 | f1a808df | Guido Trotter | </sect2> |
745 | f1a808df | Guido Trotter | |
746 | f1a808df | Guido Trotter | <sect2> |
747 | 32ad0582 | Iustin Pop | <title>Joining the nodes to the cluster</title> |
748 | f1a808df | Guido Trotter | |
749 | 5d6dd340 | Iustin Pop | <para> |
750 | 5d6dd340 | Iustin Pop | <emphasis role="strong">Mandatory:</emphasis> for all the |
751 | 5d6dd340 | Iustin Pop | other nodes. |
752 | f1a808df | Guido Trotter | </para> |
753 | f1a808df | Guido Trotter | |
754 | f1a808df | Guido Trotter | <para> |
755 | 0bac47cf | Iustin Pop | After you have initialized your cluster you need to join the |
756 | 0bac47cf | Iustin Pop | other nodes to it. You can do so by executing the following |
757 | 0bac47cf | Iustin Pop | command on the master node: |
758 | 32ad0582 | Iustin Pop | </para> |
759 | 5d6dd340 | Iustin Pop | <screen> |
760 | 5d6dd340 | Iustin Pop | gnt-node add <replaceable>NODENAME</replaceable> |
761 | 5d6dd340 | Iustin Pop | </screen> |
762 | 32ad0582 | Iustin Pop | </sect2> |
763 | f1a808df | Guido Trotter | |
764 | 32ad0582 | Iustin Pop | <sect2> |
765 | 32ad0582 | Iustin Pop | <title>Separate replication network</title> |
766 | 32ad0582 | Iustin Pop | |
767 | 32ad0582 | Iustin Pop | <para><emphasis role="strong">Optional</emphasis></para> |
768 | 32ad0582 | Iustin Pop | <para> |
769 | 32ad0582 | Iustin Pop | Ganeti uses DRBD to mirror the disk of the virtual instances |
770 | 32ad0582 | Iustin Pop | between nodes. To use a dedicated network interface for this |
771 | 32ad0582 | Iustin Pop | (in order to improve performance or to enhance security) you |
772 | 32ad0582 | Iustin Pop | need to configure an additional interface for each node. Use |
773 | 32ad0582 | Iustin Pop | the <option>-s</option> option with |
774 | 32ad0582 | Iustin Pop | <computeroutput>gnt-cluster init</computeroutput> and |
775 | 32ad0582 | Iustin Pop | <computeroutput>gnt-node add</computeroutput> to specify the |
776 | ac232de3 | Iustin Pop | IP address of this secondary interface to use for each |
777 | 32ad0582 | Iustin Pop | node. Note that if you specified this option at cluster setup |
778 | 32ad0582 | Iustin Pop | time, you must afterwards use it for every node add operation. |
779 | f1a808df | Guido Trotter | </para> |
780 | f1a808df | Guido Trotter | </sect2> |
781 | f1a808df | Guido Trotter | |
782 | 32ad0582 | Iustin Pop | <sect2> |
783 | 32ad0582 | Iustin Pop | <title>Testing the setup</title> |
784 | f1a808df | Guido Trotter | |
785 | 32ad0582 | Iustin Pop | <para> |
786 | 32ad0582 | Iustin Pop | Execute the <computeroutput>gnt-node list</computeroutput> |
787 | 32ad0582 | Iustin Pop | command to see all nodes in the cluster: |
788 | 32ad0582 | Iustin Pop | <screen> |
789 | 32ad0582 | Iustin Pop | # gnt-node list |
790 | 32ad0582 | Iustin Pop | Node DTotal DFree MTotal MNode MFree Pinst Sinst |
791 | 32ad0582 | Iustin Pop | node1.example.com 197404 197404 2047 1896 125 0 0 |
792 | 32ad0582 | Iustin Pop | </screen> |
793 | f1a808df | Guido Trotter | </para> |
794 | 32ad0582 | Iustin Pop | </sect2> |
795 | f1a808df | Guido Trotter | |
796 | 32ad0582 | Iustin Pop | <sect1> |
797 | 32ad0582 | Iustin Pop | <title>Setting up and managing virtual instances</title> |
798 | 32ad0582 | Iustin Pop | <sect2> |
799 | 32ad0582 | Iustin Pop | <title>Setting up virtual instances</title> |
800 | 32ad0582 | Iustin Pop | <para> |
801 | 32ad0582 | Iustin Pop | This step shows how to setup a virtual instance with either |
802 | 32ad0582 | Iustin Pop | non-mirrored disks (<computeroutput>plain</computeroutput>) or |
803 | 32ad0582 | Iustin Pop | with network mirrored disks |
804 | 808753d4 | Manuel Franceschini | (<computeroutput>drbd</computeroutput>). All |
805 | 6c4811dc | Iustin Pop | commands need to be executed on the Ganeti master node (the |
806 | 6c4811dc | Iustin Pop | one on which <computeroutput>gnt-cluster init</computeroutput> |
807 | 6c4811dc | Iustin Pop | was run). Verify that the OS scripts are present on all |
808 | 6c4811dc | Iustin Pop | cluster nodes with <computeroutput>gnt-os |
809 | 6c4811dc | Iustin Pop | list</computeroutput>. |
810 | 32ad0582 | Iustin Pop | </para> |
811 | 32ad0582 | Iustin Pop | <para> |
812 | 32ad0582 | Iustin Pop | To create a virtual instance, you need a hostname which is |
813 | 32ad0582 | Iustin Pop | resolvable (DNS or <filename>/etc/hosts</filename> on all |
814 | 32ad0582 | Iustin Pop | nodes). The following command will create a non-mirrored |
815 | 32ad0582 | Iustin Pop | instance for you: |
816 | 32ad0582 | Iustin Pop | </para> |
817 | 32ad0582 | Iustin Pop | <screen> |
818 | 32ad0582 | Iustin Pop | gnt-instance add --node=node1 -o debian-etch -t plain inst1.example.com |
819 | 32ad0582 | Iustin Pop | * creating instance disks... |
820 | 32ad0582 | Iustin Pop | adding instance inst1.example.com to cluster config |
821 | 32ad0582 | Iustin Pop | Waiting for instance inst1.example.com to sync disks. |
822 | 32ad0582 | Iustin Pop | Instance inst1.example.com's disks are in sync. |
823 | 32ad0582 | Iustin Pop | creating os for instance inst1.example.com on node node1.example.com |
824 | 32ad0582 | Iustin Pop | * running the instance OS create scripts... |
825 | 32ad0582 | Iustin Pop | </screen> |
826 | 32ad0582 | Iustin Pop | |
827 | 32ad0582 | Iustin Pop | <para> |
828 | 32ad0582 | Iustin Pop | The above instance will have no network interface enabled. |
829 | 32ad0582 | Iustin Pop | You can access it over the virtual console with |
830 | 32ad0582 | Iustin Pop | <computeroutput>gnt-instance console |
831 | 32ad0582 | Iustin Pop | <literal>inst1</literal></computeroutput>. There is no |
832 | 32ad0582 | Iustin Pop | password for root. As this is a Debian instance, you can |
833 | ac232de3 | Iustin Pop | modify the <filename>/etc/network/interfaces</filename> file |
834 | 32ad0582 | Iustin Pop | to setup the network interface (<literal>eth0</literal> is the |
835 | 32ad0582 | Iustin Pop | name of the interface provided to the instance). |
836 | 32ad0582 | Iustin Pop | </para> |
837 | f1a808df | Guido Trotter | |
838 | 32ad0582 | Iustin Pop | <para> |
839 | 32ad0582 | Iustin Pop | To create a network mirrored instance, change the argument to |
840 | 32ad0582 | Iustin Pop | the <option>-t</option> option from <literal>plain</literal> |
841 | 808753d4 | Manuel Franceschini | to <literal>drbd</literal> and specify the node on |
842 | 4677a909 | Michael Hanselmann | which the mirror should reside with the second value of the |
843 | 4677a909 | Michael Hanselmann | <option>--node</option> option, like this: |
844 | 32ad0582 | Iustin Pop | </para> |
845 | 32ad0582 | Iustin Pop | |
846 | 32ad0582 | Iustin Pop | <screen> |
847 | 808753d4 | Manuel Franceschini | # gnt-instance add -t drbd -n node1:node2 -o debian-etch instance2 |
848 | 32ad0582 | Iustin Pop | * creating instance disks... |
849 | 32ad0582 | Iustin Pop | adding instance instance2 to cluster config |
850 | 32ad0582 | Iustin Pop | Waiting for instance instance1 to sync disks. |
851 | 32ad0582 | Iustin Pop | - device sdb: 3.50% done, 304 estimated seconds remaining |
852 | 32ad0582 | Iustin Pop | - device sdb: 21.70% done, 270 estimated seconds remaining |
853 | 32ad0582 | Iustin Pop | - device sdb: 39.80% done, 247 estimated seconds remaining |
854 | 32ad0582 | Iustin Pop | - device sdb: 58.10% done, 121 estimated seconds remaining |
855 | 32ad0582 | Iustin Pop | - device sdb: 76.30% done, 72 estimated seconds remaining |
856 | 32ad0582 | Iustin Pop | - device sdb: 94.80% done, 18 estimated seconds remaining |
857 | 32ad0582 | Iustin Pop | Instance instance2's disks are in sync. |
858 | 4677a909 | Michael Hanselmann | creating os for instance instance2 on node node1.example.com |
859 | 32ad0582 | Iustin Pop | * running the instance OS create scripts... |
860 | 32ad0582 | Iustin Pop | * starting instance... |
861 | 32ad0582 | Iustin Pop | </screen> |
862 | 32ad0582 | Iustin Pop | |
863 | 32ad0582 | Iustin Pop | </sect2> |
864 | 32ad0582 | Iustin Pop | |
865 | 32ad0582 | Iustin Pop | <sect2> |
866 | 32ad0582 | Iustin Pop | <title>Managing virtual instances</title> |
867 | 32ad0582 | Iustin Pop | <para> |
868 | 32ad0582 | Iustin Pop | All commands need to be executed on the Ganeti master node |
869 | 32ad0582 | Iustin Pop | </para> |
870 | 32ad0582 | Iustin Pop | |
871 | 32ad0582 | Iustin Pop | <para> |
872 | 32ad0582 | Iustin Pop | To access the console of an instance, use |
873 | 32ad0582 | Iustin Pop | <computeroutput>gnt-instance console |
874 | 32ad0582 | Iustin Pop | <replaceable>INSTANCENAME</replaceable></computeroutput>. |
875 | 32ad0582 | Iustin Pop | </para> |
876 | 32ad0582 | Iustin Pop | |
877 | 32ad0582 | Iustin Pop | <para> |
878 | 32ad0582 | Iustin Pop | To shutdown an instance, use <computeroutput>gnt-instance |
879 | 32ad0582 | Iustin Pop | shutdown |
880 | 32ad0582 | Iustin Pop | <replaceable>INSTANCENAME</replaceable></computeroutput>. To |
881 | 32ad0582 | Iustin Pop | startup an instance, use <computeroutput>gnt-instance startup |
882 | 32ad0582 | Iustin Pop | <replaceable>INSTANCENAME</replaceable></computeroutput>. |
883 | 32ad0582 | Iustin Pop | </para> |
884 | 32ad0582 | Iustin Pop | |
885 | 32ad0582 | Iustin Pop | <para> |
886 | 32ad0582 | Iustin Pop | To failover an instance to its secondary node (only possible |
887 | 808753d4 | Manuel Franceschini | with <literal>drbd</literal> disk templates), use |
888 | 808753d4 | Manuel Franceschini | <computeroutput>gnt-instance failover |
889 | 32ad0582 | Iustin Pop | <replaceable>INSTANCENAME</replaceable></computeroutput>. |
890 | 32ad0582 | Iustin Pop | </para> |
891 | 32ad0582 | Iustin Pop | |
892 | 32ad0582 | Iustin Pop | <para> |
893 | 32ad0582 | Iustin Pop | For more instance and cluster administration details, see the |
894 | 32ad0582 | Iustin Pop | <emphasis>Ganeti administrator's guide</emphasis>. |
895 | 32ad0582 | Iustin Pop | </para> |
896 | 32ad0582 | Iustin Pop | |
897 | 32ad0582 | Iustin Pop | </sect2> |
898 | 32ad0582 | Iustin Pop | |
899 | 32ad0582 | Iustin Pop | </sect1> |
900 | f1a808df | Guido Trotter | |
901 | f1a808df | Guido Trotter | </article> |