Projet

Général

Profil

Openstack Installation TTNN » Historique » Version 69

Mehdi Abaakouk, 08/08/2014 11:02

1 43 Laurent GUERBY
{{>toc}}
2 43 Laurent GUERBY
3 1 Mehdi Abaakouk
h1. Openstack Installation TTNN
4 1 Mehdi Abaakouk
5 44 Laurent GUERBY
h2. Liens
6 44 Laurent GUERBY
7 44 Laurent GUERBY
* http://ceph.com/docs/master/rados/operations/cache-tiering/
8 44 Laurent GUERBY
* http://ceph.com/docs/master/rados/operations/crush-map/
9 44 Laurent GUERBY
10 3 Mehdi Abaakouk
h2. Pending upstream fixes:
11 3 Mehdi Abaakouk
12 1 Mehdi Abaakouk
* build-debian-openstack-images, changes should be in next package version:
13 1 Mehdi Abaakouk
** Fix extlinux installation on jessie: http://anonscm.debian.org/cgit/openstack/openstack-debian-images.git/commit/?id=1a4ddceb99fb66f42f79e87a183d8e96952e5ac3
14 1 Mehdi Abaakouk
** Fix cloud-init setup with configdrive: http://anonscm.debian.org/cgit/openstack/openstack-debian-images.git/commit/?id=15cce87e2fa15b8952d69fb58711bfa88b21ef87
15 15 Mehdi Abaakouk
** Use Configdrive first for cloud-init: http://anonscm.debian.org/cgit/openstack/openstack-debian-images.git/commit/?id=1b1e1093d5ee525426382ad29b8219ab58f6656d
16 1 Mehdi Abaakouk
17 1 Mehdi Abaakouk
* nova: 
18 15 Mehdi Abaakouk
** Fix live-migration avec ceph and configdrive:: https://review.openstack.org/#/c/112014/, si la solution est mergé upstream, j'appliquerai le patch au package debian
19 1 Mehdi Abaakouk
20 4 Mehdi Abaakouk
h2. Installation
21 4 Mehdi Abaakouk
22 4 Mehdi Abaakouk
Le setup installé est composé de :
23 4 Mehdi Abaakouk
24 4 Mehdi Abaakouk
* 3 hyperviseurs (compute node) qui contiendront 1 ceph-mon, N ceph-osd, nova-compute (qui lance les VM), neutron-openvswitch-agent (qui configure le réseau des vms)
25 4 Mehdi Abaakouk
* 1 VM (controler node), qui contient tous les services de management d'openstack (nova, cinder, glance, neutron)
26 4 Mehdi Abaakouk
27 4 Mehdi Abaakouk
Les étapes d'installation sont les suivantes:
28 4 Mehdi Abaakouk
* Préparation manuelle de la VM de management sur un des hyperviseurs
29 4 Mehdi Abaakouk
* Installation de ceph et openstack sur toutes les machines avec puppet
30 4 Mehdi Abaakouk
* Déplacement de la VM de management d'openstack dans openstack.
31 4 Mehdi Abaakouk
32 33 Mehdi Abaakouk
h3. Information sur le puppet master:
33 33 Mehdi Abaakouk
34 33 Mehdi Abaakouk
La conf et modules puppet utilisé par tetaneutral.net ce trouve la:
35 33 Mehdi Abaakouk
36 33 Mehdi Abaakouk
> http://chiliproject.tetaneutral.net/projects/git-tetaneutral-net/repository/puppetmaster
37 33 Mehdi Abaakouk
> http://chiliproject.tetaneutral.net/projects/git-tetaneutral-net/repository/puppetmaster/revisions/master/entry/manifests/nodes/openstack.pp
38 33 Mehdi Abaakouk
39 33 Mehdi Abaakouk
Seulement c'est 3 classes sont spécifique à tetaneutral, le reste est réutilisable:
40 33 Mehdi Abaakouk
41 36 Mehdi Abaakouk
> class { 'ttnn::server': }
42 36 Mehdi Abaakouk
> class { 'backup::client': }
43 36 Mehdi Abaakouk
> class { 'sexymotd': }
44 33 Mehdi Abaakouk
45 33 Mehdi Abaakouk
Les modules qui sont nécessaire pour openstack pour le reste du fichier sont:
46 33 Mehdi Abaakouk
47 33 Mehdi Abaakouk
> https://github.com/puppetlabs/puppetlabs-apache.git 
48 33 Mehdi Abaakouk
> https://github.com/puppetlabs/puppetlabs-apt 
49 33 Mehdi Abaakouk
> https://github.com/stackforge/puppet-ceph.git 
50 33 Mehdi Abaakouk
> https://github.com/stackforge/puppet-cinder.git 
51 33 Mehdi Abaakouk
> https://github.com/puppetlabs/puppetlabs-concat.git 
52 33 Mehdi Abaakouk
> https://github.com/stackforge/puppet-glance.git 
53 33 Mehdi Abaakouk
> https://github.com/stackforge/puppet-horizon.git 
54 33 Mehdi Abaakouk
> https://github.com/puppetlabs/puppetlabs-inifile.git 
55 33 Mehdi Abaakouk
> https://github.com/stackforge/puppet-keystone.git 
56 33 Mehdi Abaakouk
> https://github.com/camptocamp/puppet-kmod.git 
57 33 Mehdi Abaakouk
> https://github.com/saz/puppet-memcached.git 
58 33 Mehdi Abaakouk
> https://github.com/puppetlabs/puppetlabs-mysql.git 
59 33 Mehdi Abaakouk
> https://github.com/stackforge/puppet-neutron.git 
60 33 Mehdi Abaakouk
> https://github.com/stackforge/puppet-nova.git 
61 33 Mehdi Abaakouk
> https://github.com/puppetlabs/puppetlabs-rabbitmq.git 
62 33 Mehdi Abaakouk
> https://github.com/nanliu/puppet-staging.git 
63 33 Mehdi Abaakouk
> https://github.com/puppetlabs/puppetlabs-stdlib.git 
64 33 Mehdi Abaakouk
> https://github.com/duritong/puppet-sysctl.git 
65 33 Mehdi Abaakouk
> https://github.com/puppetlabs/puppetlabs-vcsrepo.git 
66 33 Mehdi Abaakouk
> https://github.com/stackforge/puppet-vswitch.git 
67 36 Mehdi Abaakouk
> https://github.com/puppetlabs/puppetlabs-xinetd.git
68 33 Mehdi Abaakouk
69 33 Mehdi Abaakouk
h3. Préparation réseaux des hosts:
70 29 Mehdi Abaakouk
71 31 Mehdi Abaakouk
Voici le fichier rc.local d'un hyperviseur (g1)
72 29 Mehdi Abaakouk
73 29 Mehdi Abaakouk
<pre>
74 29 Mehdi Abaakouk
for i in /proc/sys/net/ipv6/conf/*; do for j in autoconf accept_ra; do echo 0 > $i/$j; done;done
75 29 Mehdi Abaakouk
# https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt
76 31 Mehdi Abaakouk
for i in /proc/sys/net/ipv4/conf/*/arp_announce; do echo 2 > $i;done           # NOTE(sileht) Est ce que c'est vraiment utilise quand on aura le switch 10G entre les machines ?
77 29 Mehdi Abaakouk
78 29 Mehdi Abaakouk
echo 1 > /proc/sys/net/ipv4/ip_forward
79 29 Mehdi Abaakouk
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
80 29 Mehdi Abaakouk
81 29 Mehdi Abaakouk
ip link set eth0 up
82 29 Mehdi Abaakouk
ip link add link eth0 name eth0.3131 type vlan id 3131
83 29 Mehdi Abaakouk
ip link set eth0.3131 up
84 29 Mehdi Abaakouk
ip addr add 89.234.156.251/32 dev eth0.3131
85 29 Mehdi Abaakouk
ip route add 91.224.149.0/24 dev eth0.3131
86 29 Mehdi Abaakouk
ip route add default via 91.224.149.254
87 29 Mehdi Abaakouk
88 29 Mehdi Abaakouk
ip addr add 2a01:6600:8083:fb00::1/56 dev eth0.3131
89 29 Mehdi Abaakouk
ip route add default via fe80::31 dev eth0.3131
90 29 Mehdi Abaakouk
91 29 Mehdi Abaakouk
ip link add link eth0 name eth0.3175 type vlan id 3175
92 29 Mehdi Abaakouk
ip link set eth0.3175 up
93 29 Mehdi Abaakouk
94 29 Mehdi Abaakouk
ip link add link eth0 name eth0.3195 type vlan id 3195
95 29 Mehdi Abaakouk
ip link set eth0.3195 up
96 45 Mehdi Abaakouk
ip addr add 192.168.3.101/24 dev br-admin
97 29 Mehdi Abaakouk
98 29 Mehdi Abaakouk
ip addr add 91.224.148.0/32 dev lo
99 39 Mehdi Abaakouk
ip addr add fe80::31/64 dev br-net
100 29 Mehdi Abaakouk
ip route add 89.234.156.250/32 dev eth0.3131
101 29 Mehdi Abaakouk
ip route add 89.234.156.252/32 dev eth0.3131
102 29 Mehdi Abaakouk
ip route add 89.234.156.253/32 dev eth0.3131
103 29 Mehdi Abaakouk
104 29 Mehdi Abaakouk
105 29 Mehdi Abaakouk
exit 0
106 29 Mehdi Abaakouk
</pre>
107 29 Mehdi Abaakouk
108 55 Mehdi Abaakouk
_note: Les bridges openvswitch sont mémorisés et recréés automatiquement par le service openvswitch-switch_
109 54 Mehdi Abaakouk
110 30 Mehdi Abaakouk
Sur h7.tetaneutral.net le routage est le suivant
111 30 Mehdi Abaakouk
112 30 Mehdi Abaakouk
<pre>
113 30 Mehdi Abaakouk
ip route add 89.234.156.251/32 dev eth0.3131
114 30 Mehdi Abaakouk
ip route add 89.234.156.252/32 dev eth0.3131
115 30 Mehdi Abaakouk
ip route add 89.234.156.253/32 dev eth0.3131
116 30 Mehdi Abaakouk
ip route add 2a01:6600:8083:fb00::/56 dev eth0.3131
117 30 Mehdi Abaakouk
ip route add 2a01:6600:8083:fc00::/56 dev eth0.3131
118 30 Mehdi Abaakouk
ip route add 2a01:6600:8083:fd00::/56 dev eth0.3131
119 30 Mehdi Abaakouk
</pre>
120 30 Mehdi Abaakouk
121 30 Mehdi Abaakouk
Ainsi que ceci le temps de l'installation
122 30 Mehdi Abaakouk
123 30 Mehdi Abaakouk
<pre>
124 30 Mehdi Abaakouk
ip route add 89.234.156.249/32 via 89.234.156.251 # NOTE(sileht): temporairement pour le setup openstack
125 42 Laurent GUERBY
ip route add 2a01:6600:8083:f900::/56 via 2a01:6600:8083:fb00::1 dev eth0.3131 # NOTE(sileht): temporairement pour le setup openstack
126 30 Mehdi Abaakouk
</pre>
127 30 Mehdi Abaakouk
128 4 Mehdi Abaakouk
h3. Preparation de la VM de management, le controlleur
129 4 Mehdi Abaakouk
130 6 Mehdi Abaakouk
h4. Installation des prérequis
131 4 Mehdi Abaakouk
132 4 Mehdi Abaakouk
<pre>
133 57 Mehdi Abaakouk
$ apt-get install libvirt-bin openstack-debian-images virtinst
134 4 Mehdi Abaakouk
#NOTE(sileht): temporairement appliquer les patches de au-dessus à openstack-debian-images 
135 4 Mehdi Abaakouk
</pre>
136 4 Mehdi Abaakouk
137 6 Mehdi Abaakouk
h4. Preparation de l'image de la VM
138 1 Mehdi Abaakouk
139 1 Mehdi Abaakouk
<pre>
140 6 Mehdi Abaakouk
$ vim hook.sh
141 17 Mehdi Abaakouk
set -xv
142 16 Mehdi Abaakouk
143 1 Mehdi Abaakouk
echo "openstack" > $BODI_CHROOT_PATH/etc/hostname
144 20 Mehdi Abaakouk
145 16 Mehdi Abaakouk
cat > $BODI_CHROOT_PATH/etc/resolv.conf <<EOF
146 16 Mehdi Abaakouk
domain tetaneutral.net
147 16 Mehdi Abaakouk
search tetaneutral.net
148 16 Mehdi Abaakouk
nameserver 8.8.8.8
149 1 Mehdi Abaakouk
EOF
150 20 Mehdi Abaakouk
151 6 Mehdi Abaakouk
cat > $BODI_CHROOT_PATH/etc/network/interfaces <<EOF
152 6 Mehdi Abaakouk
auto lo
153 6 Mehdi Abaakouk
iface lo inet loopback
154 1 Mehdi Abaakouk
auto eth0
155 6 Mehdi Abaakouk
iface eth0 inet manual
156 20 Mehdi Abaakouk
  pre-up /sbin/sysctl -w net.ipv6.conf.eth0.accept_ra=0
157 20 Mehdi Abaakouk
  pre-up /sbin/sysctl -w net.ipv6.conf.eth0.autoconf=0
158 1 Mehdi Abaakouk
  up ip link set eth0 up
159 1 Mehdi Abaakouk
  up ip addr add 89.234.156.249/32 dev eth0
160 20 Mehdi Abaakouk
  up ip route add 91.224.148.0/32 dev eth0
161 20 Mehdi Abaakouk
  up ip route add default via 91.224.148.0
162 20 Mehdi Abaakouk
163 20 Mehdi Abaakouk
iface eth0 inet6 static
164 20 Mehdi Abaakouk
    pre-up /sbin/sysctl -w net.ipv6.conf.eth0.accept_ra=0
165 20 Mehdi Abaakouk
    pre-up /sbin/sysctl -w net.ipv6.conf.eth0.autoconf=0
166 20 Mehdi Abaakouk
    address 2a01:6600:8083:f900::1
167 20 Mehdi Abaakouk
    netmask 56
168 40 Mehdi Abaakouk
    gateway fe80::31
169 46 Mehdi Abaakouk
170 46 Mehdi Abaakouk
auto eth1
171 46 Mehdi Abaakouk
iface eth1 inet static
172 46 Mehdi Abaakouk
  pre-up /sbin/sysctl -w net.ipv6.conf.eth1.accept_ra=0
173 46 Mehdi Abaakouk
  pre-up /sbin/sysctl -w net.ipv6.conf.eth1.autoconf=0
174 46 Mehdi Abaakouk
  address 192.168.3.100
175 46 Mehdi Abaakouk
  netmask 255.255.255.0
176 6 Mehdi Abaakouk
EOF
177 20 Mehdi Abaakouk
178 1 Mehdi Abaakouk
mkdir -p $BODI_CHROOT_PATH/root/.ssh
179 6 Mehdi Abaakouk
chmod 600 $BODI_CHROOT_PATH/root/.ssh
180 4 Mehdi Abaakouk
cat >> $BODI_CHROOT_PATH/root/.ssh/authorized_keys <<EOF
181 1 Mehdi Abaakouk
ssh-dss AAAAB3NzaC1kc3MAAACBAJtnGLvuz4uVD6fnERDxDi/C0UyzwCiKmgNtEessopREYasAX4Gu6Fg10jAyIL5Nuc7YDnqj//pOfxNjD7hp99a2ZmkRQgh/ltClxYML9fqhBHgsUCpVse9nOYDHDnDgvXIPRSDUHat2UFpdchHVrFURNLIlZnBztsr+GCDURTV/AAAAFQD9SrBcH49ltaKOm6V5ssCPmgs1SwAAAIAbAvkQ3/tMzzdACO5B9s5Yb3ZuM7XImm0iqufivVf2Xy39g8HOBulUsN7eKEGPhVriqNolgIO7q7tVgYAff4/NE4yDP0Kp0SPg4tjt2yFJuL31Y3wzwHjnKrjgNlDSLl3uZnRXSipwUMwGKbdHB6NZSqlq192VKbHilQ00pbiMlAAAAIB5dfB1lVHkJ0o5CcaVQRPbca9DvbbRwnoTSmKHc5DUcqsPqDhS07CkM9ZcJuY1Nh4wGl4Q9kArj7Tnsvvygf/HReSUcIk4+nbDytJ8/pca/Qx4fzQQyppa94TylN62LSFT6MIJKLoMwYa0dQURT7Mv5+9Qj2vk5pZ38w2iQ9zVCg== root@h1
182 4 Mehdi Abaakouk
EOF
183 10 Mehdi Abaakouk
184 16 Mehdi Abaakouk
sed -i -e 's/^.*Port.*$/Port 2222/' -e 's/^[# ]*PasswordAuthentication.*$/PasswordAuthentication no/' $BODI_CHROOT_PATH/etc/ssh/sshd_config
185 16 Mehdi Abaakouk
chroot $BODI_CHROOT_PATH dpkg-reconfigure openssh-server
186 20 Mehdi Abaakouk
chroot $BODI_CHROOT_PATH apt-get purge -y cloud-init*
187 1 Mehdi Abaakouk
</pre>
188 7 Mehdi Abaakouk
189 4 Mehdi Abaakouk
<pre>
190 21 Mehdi Abaakouk
$ chmod +x hook.sh
191 12 Mehdi Abaakouk
$ build-openstack-debian-image --image-size 20  --release jessie -u http://apt.tetaneutral.net/debian/ -s http://apt.tetaneutral.net/debian/ --hook-script $(pwd)/hook.sh
192 4 Mehdi Abaakouk
$ mv debian-jessie-7.0.0-3-amd64.raw /openstack.raw 
193 4 Mehdi Abaakouk
$ rm debian-jessie-7.0.0-3-amd64.qcow2
194 4 Mehdi Abaakouk
</pre>
195 5 Mehdi Abaakouk
196 13 Mehdi Abaakouk
_note: la derniere commande lancée par le script doit être 'qemu-img convert -c -f raw .... , sinon l'image de bootera pas_
197 18 Mehdi Abaakouk
_note(jessie): si l'erreur est celle ci-dessous, relancer manuellement 'kpartx -d debian-jessie-7.0.0-3-amd64.raw' jusqu'a ce que l'erreur disparaissent et le .raw est utilisable:_
198 18 Mehdi Abaakouk
<pre>
199 18 Mehdi Abaakouk
+ 'kpartx -d debian-jessie-7.0.0-3-amd64.raw'
200 18 Mehdi Abaakouk
device-mapper: remove ioctl on loop0p1 failed: Device or resource busy
201 18 Mehdi Abaakouk
loop deleted : /dev/loop0
202 18 Mehdi Abaakouk
</pre>
203 59 Mehdi Abaakouk
_note: si parted freeze -> lancer /etc/init.d/udev restart_
204 59 Mehdi Abaakouk
205 11 Mehdi Abaakouk
206 4 Mehdi Abaakouk
On garde l'image raw qui sera importable dans ceph plus tard et on la mets à la racine pour qui l'utilisateur libvirt puisse y accéder.
207 4 Mehdi Abaakouk
208 6 Mehdi Abaakouk
h4. Préparation du réseau
209 4 Mehdi Abaakouk
210 4 Mehdi Abaakouk
<pre>
211 8 Mehdi Abaakouk
$ ip route add 89.234.156.249/32 dev br-net proto 42
212 28 Mehdi Abaakouk
$ ip -6 route add 2a01:6600:8083:f900::/56 dev br-net proto 42
213 67 Mehdi Abaakouk
$ modprobe vhost-net
214 4 Mehdi Abaakouk
</pre>
215 5 Mehdi Abaakouk
216 6 Mehdi Abaakouk
h4. Installation de la VM
217 4 Mehdi Abaakouk
218 4 Mehdi Abaakouk
<pre>
219 60 Mehdi Abaakouk
$ virt-install --name openstack --ram 2048 --network bridge=br-net,model=virtio --network bridge=br-admin,model=virtio --nographics --serial pty --wait -1 --noreboot --autostart --disk /openstack.raw,bus=virtio,cache=none,io=native --import
220 4 Mehdi Abaakouk
$ virsh  start openstack
221 19 Mehdi Abaakouk
$ ssh root@openstack.tetaneutral.net -p 2222
222 19 Mehdi Abaakouk
</pre>
223 19 Mehdi Abaakouk
224 19 Mehdi Abaakouk
Une fois connecté à la VM:
225 19 Mehdi Abaakouk
226 19 Mehdi Abaakouk
<pre>
227 19 Mehdi Abaakouk
$ apt-get install puppet
228 19 Mehdi Abaakouk
$ puppet agent --enable
229 24 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
230 24 Mehdi Abaakouk
Info: Caching certificate for ca
231 24 Mehdi Abaakouk
Info: csr_attributes file loading from /etc/puppet/csr_attributes.yaml
232 24 Mehdi Abaakouk
Info: Creating a new SSL certificate request for openstack.tetaneutral.net
233 24 Mehdi Abaakouk
Info: Certificate Request fingerprint (SHA256): AE:72:47:40:A0:E2:F4:59:BA:39:FA:3D:C2:A7:C9:1B:9F:87:A5:B7:65:3A:F9:D4:DE:AF:E2:A3:02:41:0F:2E
234 24 Mehdi Abaakouk
Info: Caching certificate for ca
235 24 Mehdi Abaakouk
Exiting; no certificate found and waitforcert is disabled
236 19 Mehdi Abaakouk
</pre>
237 19 Mehdi Abaakouk
238 19 Mehdi Abaakouk
Sur le puppetmaster:
239 19 Mehdi Abaakouk
240 19 Mehdi Abaakouk
<pre>
241 1 Mehdi Abaakouk
$ puppet ca sign openstack.tetaneutral.net 
242 22 Mehdi Abaakouk
</pre>
243 61 Mehdi Abaakouk
_note: si un vieux cert existe: puppet node clean openstack.tetaneutral.net_
244 19 Mehdi Abaakouk
245 1 Mehdi Abaakouk
De nouveau sur la VM:
246 19 Mehdi Abaakouk
247 19 Mehdi Abaakouk
<pre>
248 24 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
249 26 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
250 26 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
251 4 Mehdi Abaakouk
</pre>
252 26 Mehdi Abaakouk
253 32 Mehdi Abaakouk
Il ne doit plus y avoir d'erreur la 3°/4° fois.
254 27 Mehdi Abaakouk
255 26 Mehdi Abaakouk
_note: Un paquet est manquant en ce moment (06/08/2014) dans jessie 'nullmailer', pour l'installer manuellement:_
256 26 Mehdi Abaakouk
<pre>
257 26 Mehdi Abaakouk
wget http://ftp.fr.debian.org/debian/pool/main/n/nullmailer/nullmailer_1.11-2.1_amd64.deb
258 26 Mehdi Abaakouk
apt-get purge exim4-base          exim4-config        exim4-daemon-light
259 26 Mehdi Abaakouk
dpkg -i nullmailer_1.11-2.1_amd64.deb  # Répondre n'importe quoi, ca sera ecrasé par puppet
260 26 Mehdi Abaakouk
apt-get install bsd-mailx
261 26 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
262 26 Mehdi Abaakouk
</pre>
263 4 Mehdi Abaakouk
264 34 Mehdi Abaakouk
h3. Configuration des hyperviseurs
265 34 Mehdi Abaakouk
266 35 Mehdi Abaakouk
Une fois la configuration réseau faite tout faire avec puppet:
267 35 Mehdi Abaakouk
268 35 Mehdi Abaakouk
<pre>
269 35 Mehdi Abaakouk
$ apt-get install puppet
270 35 Mehdi Abaakouk
$ puppet agent --enable
271 35 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
272 35 Mehdi Abaakouk
Info: Caching certificate for ca
273 35 Mehdi Abaakouk
Info: csr_attributes file loading from /etc/puppet/csr_attributes.yaml
274 35 Mehdi Abaakouk
Info: Creating a new SSL certificate request for openstack.tetaneutral.net
275 35 Mehdi Abaakouk
Info: Certificate Request fingerprint (SHA256): AE:72:47:40:A0:E2:F4:59:BA:39:FA:3D:C2:A7:C9:1B:9F:87:A5:B7:65:3A:F9:D4:DE:AF:E2:A3:02:41:0F:2E
276 35 Mehdi Abaakouk
Info: Caching certificate for ca
277 35 Mehdi Abaakouk
Exiting; no certificate found and waitforcert is disabled
278 35 Mehdi Abaakouk
</pre>
279 35 Mehdi Abaakouk
280 35 Mehdi Abaakouk
Sur le puppetmaster:
281 35 Mehdi Abaakouk
282 35 Mehdi Abaakouk
<pre>
283 35 Mehdi Abaakouk
$ puppet ca sign openstack.tetaneutral.net 
284 35 Mehdi Abaakouk
</pre>
285 64 Mehdi Abaakouk
_note: si un vieux cert existe: puppet ca revoke openstack.tetaneutral.net ; puppet cert clean openstack.tetaneutral.net; puppet node clean openstack.tetaneutral.net_
286 35 Mehdi Abaakouk
287 35 Mehdi Abaakouk
De nouveau sur la VM:
288 35 Mehdi Abaakouk
289 35 Mehdi Abaakouk
<pre>
290 35 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
291 35 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
292 35 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
293 35 Mehdi Abaakouk
</pre>
294 35 Mehdi Abaakouk
295 35 Mehdi Abaakouk
Il ne doit plus y avoir d'erreur la 3°/4° fois.
296 35 Mehdi Abaakouk
297 35 Mehdi Abaakouk
_note: Un paquet est manquant en ce moment (06/08/2014) dans jessie 'nullmailer', pour l'installer manuellement:_
298 35 Mehdi Abaakouk
<pre>
299 35 Mehdi Abaakouk
wget http://ftp.fr.debian.org/debian/pool/main/n/nullmailer/nullmailer_1.11-2.1_amd64.deb
300 35 Mehdi Abaakouk
apt-get purge exim4-base          exim4-config        exim4-daemon-light
301 35 Mehdi Abaakouk
dpkg -i nullmailer_1.11-2.1_amd64.deb  # Répondre n'importe quoi, ca sera ecrasé par puppet
302 35 Mehdi Abaakouk
apt-get install bsd-mailx
303 35 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
304 35 Mehdi Abaakouk
</pre>
305 35 Mehdi Abaakouk
306 35 Mehdi Abaakouk
307 35 Mehdi Abaakouk
h4. Information sur la configuration d'un hyperviseur sur le puppet master
308 35 Mehdi Abaakouk
309 35 Mehdi Abaakouk
La configuration ressemble à :
310 35 Mehdi Abaakouk
311 35 Mehdi Abaakouk
<pre>
312 35 Mehdi Abaakouk
node "gX.tetaneutral.net" inherits openstack_node_common {
313 35 Mehdi Abaakouk
  # Configuration du routerid et de l'AS number de cette machine
314 35 Mehdi Abaakouk
  # Il faut aussi mettre la conf bgp de h7 ainsi que les fichiers 
315 35 Mehdi Abaakouk
  # /etc/puppet/manifests/files/openstack-bird.conf.erb et
316 35 Mehdi Abaakouk
  # /etc/puppet/manifests/files/openstack-bird6.conf.erb
317 35 Mehdi Abaakouk
  # pour ajouter cette AS interne
318 35 Mehdi Abaakouk
  ttnn_os_bird {'198.51.100.1': asnum => "65001"}
319 35 Mehdi Abaakouk
320 35 Mehdi Abaakouk
  # Dans le cas d'une moniteur ceph, mais uniquement 3 suffissent, on a déjà g1,g2,g3
321 35 Mehdi Abaakouk
  # ttnn_ceph_mon {$::hostname:}
322 35 Mehdi Abaakouk
 
323 35 Mehdi Abaakouk
  # La liste des disques dur à utiliser dans ceph
324 35 Mehdi Abaakouk
  ttnn_ceph_osd {"/dev/sdb": }
325 35 Mehdi Abaakouk
  ttnn_ceph_osd {"/dev/sdc": }
326 35 Mehdi Abaakouk
327 35 Mehdi Abaakouk
  # La partie Openstack, l'uuid doit être unique par machine (générer avec uuid-gen)
328 49 Mehdi Abaakouk
  ttnn_os_compute {"9d26ec10-a48b-4f0f-a122-f10ed16d270f": }
329 35 Mehdi Abaakouk
330 35 Mehdi Abaakouk
  # La correction d'un petit bug :)
331 35 Mehdi Abaakouk
  class {'ttnn_os_configdrive_ceph_fix': }
332 1 Mehdi Abaakouk
}
333 37 Mehdi Abaakouk
</pre>
334 37 Mehdi Abaakouk
335 37 Mehdi Abaakouk
h3. Déplacement du controlleur dans openstack
336 37 Mehdi Abaakouk
337 37 Mehdi Abaakouk
<pre>
338 38 Mehdi Abaakouk
$ virsh shutdown openstack
339 66 Mehdi Abaakouk
$ cp /openstack.raw  /openstack-to-upload.raw 
340 66 Mehdi Abaakouk
$ virsh start openstack
341 38 Mehdi Abaakouk
$ cat > os.conf <<EOF
342 38 Mehdi Abaakouk
export OS_AUTH_URL=http://openstack.tetaneutral.net:5000/v2.0/
343 38 Mehdi Abaakouk
export OS_USERNAME=admin
344 38 Mehdi Abaakouk
export OS_TENANT_NAME=ttnn_admin
345 38 Mehdi Abaakouk
export OS_PASSWORD=<password>
346 38 Mehdi Abaakouk
EOF
347 38 Mehdi Abaakouk
$ source os.conf 
348 41 Mehdi Abaakouk
349 1 Mehdi Abaakouk
$ # Upload de l'image
350 66 Mehdi Abaakouk
$ glance image-create --progress --name openstack-controlleur --disk-format raw --container-format bare < /openstack-to-upload.raw 
351 41 Mehdi Abaakouk
[=============================>] 100%
352 41 Mehdi Abaakouk
+------------------+--------------------------------------+
353 41 Mehdi Abaakouk
| Property         | Value                                |
354 41 Mehdi Abaakouk
+------------------+--------------------------------------+
355 41 Mehdi Abaakouk
| checksum         | 493517836ee82ad4110254555d379d76     |
356 41 Mehdi Abaakouk
| container_format | bare                                 |
357 41 Mehdi Abaakouk
| created_at       | 2014-08-06T15:01:08                  |
358 41 Mehdi Abaakouk
| deleted          | False                                |
359 41 Mehdi Abaakouk
| deleted_at       | None                                 |
360 41 Mehdi Abaakouk
| disk_format      | raw                                  |
361 41 Mehdi Abaakouk
| id               | 89e8fffd-3311-4885-93a8-986e05c055f4 |
362 41 Mehdi Abaakouk
| is_public        | False                                |
363 41 Mehdi Abaakouk
| min_disk         | 0                                    |
364 41 Mehdi Abaakouk
| min_ram          | 0                                    |
365 41 Mehdi Abaakouk
| name             | openstack-controlleur                |
366 41 Mehdi Abaakouk
| owner            | 27764634d22248f4a7c8518899ff38c5     |
367 41 Mehdi Abaakouk
| protected        | False                                |
368 41 Mehdi Abaakouk
| size             | 21474836480                          |
369 41 Mehdi Abaakouk
| status           | active                               |
370 41 Mehdi Abaakouk
| updated_at       | 2014-08-06T15:11:22                  |
371 41 Mehdi Abaakouk
| virtual_size     | None                                 |
372 41 Mehdi Abaakouk
+------------------+--------------------------------------+
373 41 Mehdi Abaakouk
374 41 Mehdi Abaakouk
$ # Creation d'un volume dans ceph de cette image
375 1 Mehdi Abaakouk
$ cinder create --display-name openstack.tetaneutral.net-bootdisk --image-id 89e8fffd-3311-4885-93a8-986e05c055f4 25
376 66 Mehdi Abaakouk
</pre>
377 1 Mehdi Abaakouk
378 66 Mehdi Abaakouk
Into the old controlleur VM
379 66 Mehdi Abaakouk
380 66 Mehdi Abaakouk
<pre>
381 66 Mehdi Abaakouk
382 66 Mehdi Abaakouk
</pre>
383 66 Mehdi Abaakouk
384 66 Mehdi Abaakouk
385 66 Mehdi Abaakouk
<pre>
386 41 Mehdi Abaakouk
$ # Boot d'un VM avec de volume 
387 52 Mehdi Abaakouk
$ netid_net=$(neutron net-list | awk '/ttnn-net/{print $2}')
388 1 Mehdi Abaakouk
$ netid_admin=$(neutron net-list | awk '/ttnn-admin/{print $2}')
389 52 Mehdi Abaakouk
$ nova boot --nic net-id=$netid_net,v4-fixed-ip=89.234.156.249 --nic net-id=$netid_admin,v4-fixed-ip=192.168.3.100 --block-device source=volume,id=$volume_id,shutdown=preserve,bootindex=0 --flavor m1.medium --poll openstack.tetaneutral.net
390 1 Mehdi Abaakouk
</pre>
391 66 Mehdi Abaakouk
392 68 Mehdi Abaakouk
h2. Preparation du Pool SSD pour ceph
393 68 Mehdi Abaakouk
394 68 Mehdi Abaakouk
395 68 Mehdi Abaakouk
h3. Cas particulier du SSD ou ce trouve l'OS
396 68 Mehdi Abaakouk
397 68 Mehdi Abaakouk
En général avec ceph, on donne un disque, ceph créé 2 partitions une pour le journal de l'OSD, l'autre pour les datas
398 68 Mehdi Abaakouk
mais pour le SSD de tetaneutral qui a aussi l'OS, voici la méthode
399 68 Mehdi Abaakouk
400 68 Mehdi Abaakouk
Création manuelle de la partition de data ceph /dev/sda2 ici
401 68 Mehdi Abaakouk
402 68 Mehdi Abaakouk
<pre>
403 68 Mehdi Abaakouk
$ fdisk /dev/sda
404 68 Mehdi Abaakouk
405 68 Mehdi Abaakouk
n
406 68 Mehdi Abaakouk
p
407 68 Mehdi Abaakouk
<enter>
408 68 Mehdi Abaakouk
<enter>
409 68 Mehdi Abaakouk
<enter>
410 68 Mehdi Abaakouk
<enter>
411 68 Mehdi Abaakouk
w
412 68 Mehdi Abaakouk
413 68 Mehdi Abaakouk
$ partprobe
414 68 Mehdi Abaakouk
</pre>
415 68 Mehdi Abaakouk
416 68 Mehdi Abaakouk
On ajoute dans la configuration puppet de l'hyperviseur ceci, avec le journal sur la partition de l'OS:
417 68 Mehdi Abaakouk
418 68 Mehdi Abaakouk
<pre>
419 68 Mehdi Abaakouk
ttnn_ceph_osd {"/dev/sda2": journal => "/var/lib/ceph/ssd-sda2-journal"}
420 68 Mehdi Abaakouk
</pre>
421 68 Mehdi Abaakouk
422 34 Mehdi Abaakouk
423 69 Mehdi Abaakouk
h3. Configuration de la crushmap de ceph:
424 69 Mehdi Abaakouk
425 69 Mehdi Abaakouk
REF: http://ceph.com/docs/master/rados/operations/crush-map/#getcrushmap
426 69 Mehdi Abaakouk
427 69 Mehdi Abaakouk
<pre>
428 69 Mehdi Abaakouk
$ ceph osd getcrushmap -o compiled-crushmap
429 69 Mehdi Abaakouk
$ crushtool -d compiled-crushmap -o crushmap.txt
430 69 Mehdi Abaakouk
# EDIT crushmap.txt
431 69 Mehdi Abaakouk
$ crushtool -c crushmap.txt -o compiled-crushmap 
432 69 Mehdi Abaakouk
$ ceph osd setcrushmap -i compiled-crushmap
433 69 Mehdi Abaakouk
</pre>
434 69 Mehdi Abaakouk
435 69 Mehdi Abaakouk
h3. Definition de la crushmap de ttnn
436 69 Mehdi Abaakouk
437 69 Mehdi Abaakouk
438 69 Mehdi Abaakouk
439 69 Mehdi Abaakouk
440 69 Mehdi Abaakouk
441 69 Mehdi Abaakouk
442 69 Mehdi Abaakouk
443 4 Mehdi Abaakouk
h2. Management d'openstack
444 4 Mehdi Abaakouk
445 3 Mehdi Abaakouk
h3. Build and upload debian image:
446 3 Mehdi Abaakouk
447 3 Mehdi Abaakouk
<pre>
448 3 Mehdi Abaakouk
$ apt-get install openstack-debian-images
449 3 Mehdi Abaakouk
#NOTE(sileht): temporairement appliquer les patches de au-dessus
450 3 Mehdi Abaakouk
$ build-openstack-debian-image -m -r jessie  -u http://apt.tetaneutral.net/debian/ -s http://apt.tetaneutral.net/debian/
451 3 Mehdi Abaakouk
$ glance image-create --file debian-jessie-7.0.0-3-amd64.raw --is-public True --human-readable --progress --disk-format raw --container-format bare --name debian-jessie-amd64
452 1 Mehdi Abaakouk
</pre>