start documenting ganeti install
[mirror/dsa-wiki.git] / input / howto / install-ganeti.creole
1 == How To Install Ganeti Clusters and Instances ==
2
3 === How To Install Ganeti Clusters ===
4
5 Suppose that you have two identical hosts running squeeze, foo.debian.org and
6 bar.debian.org, that will be used as nodes in a ganeti cluster.
7
8 ==== install required packages ====
9
10 On each node, install the required packages:
11
12 {{{
13     apt-get install fai-client ssed extlinux
14     apt-get install -t squeeze-backports drbd8-utils ganeti2 ganeti-instance-debootstrap ganeti-htools
15 }}}
16
17 ==== configure kernel modules ====
18
19 On each node, ensure that required kernel modules are loaded at boot:
20
21 {{{
22     ainsl /etc/modules 'drbd minor_count=255 usermode_helper=/bin/true'
23     ainsl /etc/modules 'hmac'
24     ainsl /etc/modules 'tun'
25 }}}
26
27 ==== configure networking ====
28
29 Determine a hostname for the cluster (foobar.debian.org) and assign an A record.
30
31 On each node, ensure that all nodes and the cluster itself are listed in
32 {{{/etc/hosts}}}.
33
34 On each node, create a bridge interface: br0.
35
36 ==== create storage ====
37
38 On each node, configure lvm to ignore drbd devices and to prefer
39 {{{/dev/cciss}}} devices names to {{{/dev/block}}} device names
40 ([[http://code.google.com/p/ganeti/issues/detail?id=93|why?]]):
41
42 {{{
43     ssed -i \
44       -e 's#^\(\s*filter\s\).*#\1= [ "a|.*|", "r|/dev/drbd[0-9]+|" ]#'
45       -e 's#^\(\s*preferred_names\s\).*#\1= [ "^/dev/dm-*/", "^/dev/cciss/" ]#' \
46       /etc/lvm/lvm.conf
47 }}}
48
49 On each node, create a volume group:
50
51 {{{
52     vgcreate vg_ganeti /dev/cciss/c0d0p3
53 }}}
54
55 ==== create kvmU symbolic links ====
56
57 {{{
58     ln -s -T /boot/vmlinuz-2.6.32-5-amd64 /boot/vmlinuz-2.6-kvmU
59     ln -s -T /boot/initrd.img-2.6.32-5-amd64 /boot/initrd.img-2.6-kvmU
60 }}}
61
62 ==== instantiate the cluster ====
63
64 On the master node (foo) only:
65
66 {{{
67     gnt-cluster init \
68       --master-netdev br0 \
69       --vg-name vg_ganeti \
70       --secondary-ip 192.168.2.213 \
71       --enabled-hypervisors kvm \
72       --nic-parameters link=br0 \
73       --mac-prefix 00:16:37 \
74       --no-ssh-init \
75       --no-etc-hosts \
76       --hypervisor-parameters kvm:initrd_path=/boot/initrd.img-2.6-kvmU \
77       foobar.debian.org
78 }}}
79
80 ==== add slave nodes ===
81
82 For each slave node (bar), on the master node (foo):
83
84 {{{
85     gnt-node add \
86       --secondary-ip 192.168.2.217 \
87       --no-ssh-key-check \
88       --no-node-setup \
89       bar.debian.org
90 }}}
91
92 ==== verify cluster ====
93
94 On the master node (foo):
95
96 {{{
97     gnt-cluster verify
98 }}}
99
100 === How To Install Ganeti Instances ===
101
102 Suppose that the first guest on will be qux.debian.org.
103
104 ==== define the instance ====
105
106 # add qux.debian.org entry in LDAP to establish A record
107 # ask hosting partner to establish PTR record as appropriate
108 # add qux.debian.org entry in puppet
109 # add qux.debian.org entry in nagios
110
111 ==== create the instance ====
112
113 On the master node (foo):
114
115 {{{
116     gnt-instance add \
117       --node foo:bar \
118       --disk-template drbd \
119       --os-size 4GiB \
120       --os-type debootstrap+dsa \
121       --hypervisor-parameters kvm:initrd_path=,kernel_path= \
122       --net 0:ip=1.2.3.4 \
123       qux.debian.org
124 }}}
125