Projet

Général

Profil

Openstack Installation TTNN » Historique » Version 44

Laurent GUERBY, 07/08/2014 14:32

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 29 Mehdi Abaakouk
97 29 Mehdi Abaakouk
ip addr add 91.224.148.0/32 dev lo
98 39 Mehdi Abaakouk
ip addr add fe80::31/64 dev br-net
99 29 Mehdi Abaakouk
ip route add 89.234.156.250/32 dev eth0.3131
100 29 Mehdi Abaakouk
ip route add 89.234.156.252/32 dev eth0.3131
101 29 Mehdi Abaakouk
ip route add 89.234.156.253/32 dev eth0.3131
102 29 Mehdi Abaakouk
103 29 Mehdi Abaakouk
104 29 Mehdi Abaakouk
exit 0
105 29 Mehdi Abaakouk
</pre>
106 29 Mehdi Abaakouk
107 30 Mehdi Abaakouk
Sur h7.tetaneutral.net le routage est le suivant
108 30 Mehdi Abaakouk
109 30 Mehdi Abaakouk
<pre>
110 30 Mehdi Abaakouk
ip route add 89.234.156.251/32 dev eth0.3131
111 30 Mehdi Abaakouk
ip route add 89.234.156.252/32 dev eth0.3131
112 30 Mehdi Abaakouk
ip route add 89.234.156.253/32 dev eth0.3131
113 30 Mehdi Abaakouk
ip route add 2a01:6600:8083:fb00::/56 dev eth0.3131
114 30 Mehdi Abaakouk
ip route add 2a01:6600:8083:fc00::/56 dev eth0.3131
115 30 Mehdi Abaakouk
ip route add 2a01:6600:8083:fd00::/56 dev eth0.3131
116 30 Mehdi Abaakouk
</pre>
117 30 Mehdi Abaakouk
118 30 Mehdi Abaakouk
Ainsi que ceci le temps de l'installation
119 30 Mehdi Abaakouk
120 30 Mehdi Abaakouk
<pre>
121 30 Mehdi Abaakouk
ip route add 89.234.156.249/32 via 89.234.156.251 # NOTE(sileht): temporairement pour le setup openstack
122 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
123 30 Mehdi Abaakouk
</pre>
124 30 Mehdi Abaakouk
125 4 Mehdi Abaakouk
h3. Preparation de la VM de management, le controlleur
126 4 Mehdi Abaakouk
127 6 Mehdi Abaakouk
h4. Installation des prérequis
128 4 Mehdi Abaakouk
129 4 Mehdi Abaakouk
<pre>
130 4 Mehdi Abaakouk
$ apt-get install libvirt-bin openstack-debian-images openvswitch-switch openvswitch-datapath-dkms virtinst
131 4 Mehdi Abaakouk
#NOTE(sileht): temporairement appliquer les patches de au-dessus à openstack-debian-images 
132 4 Mehdi Abaakouk
</pre>
133 4 Mehdi Abaakouk
134 6 Mehdi Abaakouk
h4. Preparation de l'image de la VM
135 1 Mehdi Abaakouk
136 1 Mehdi Abaakouk
<pre>
137 6 Mehdi Abaakouk
$ vim hook.sh
138 17 Mehdi Abaakouk
set -xv
139 16 Mehdi Abaakouk
140 1 Mehdi Abaakouk
echo "openstack" > $BODI_CHROOT_PATH/etc/hostname
141 20 Mehdi Abaakouk
142 16 Mehdi Abaakouk
cat > $BODI_CHROOT_PATH/etc/resolv.conf <<EOF
143 16 Mehdi Abaakouk
domain tetaneutral.net
144 16 Mehdi Abaakouk
search tetaneutral.net
145 16 Mehdi Abaakouk
nameserver 8.8.8.8
146 1 Mehdi Abaakouk
EOF
147 20 Mehdi Abaakouk
148 6 Mehdi Abaakouk
cat > $BODI_CHROOT_PATH/etc/network/interfaces <<EOF
149 6 Mehdi Abaakouk
auto lo
150 6 Mehdi Abaakouk
iface lo inet loopback
151 1 Mehdi Abaakouk
auto eth0
152 6 Mehdi Abaakouk
iface eth0 inet manual
153 20 Mehdi Abaakouk
  pre-up /sbin/sysctl -w net.ipv6.conf.eth0.accept_ra=0
154 20 Mehdi Abaakouk
  pre-up /sbin/sysctl -w net.ipv6.conf.eth0.autoconf=0
155 1 Mehdi Abaakouk
  up ip link set eth0 up
156 1 Mehdi Abaakouk
  up ip addr add 89.234.156.249/32 dev eth0
157 20 Mehdi Abaakouk
  up ip route add 91.224.148.0/32 dev eth0
158 20 Mehdi Abaakouk
  up ip route add default via 91.224.148.0
159 20 Mehdi Abaakouk
160 20 Mehdi Abaakouk
iface eth0 inet6 static
161 20 Mehdi Abaakouk
    pre-up /sbin/sysctl -w net.ipv6.conf.eth0.accept_ra=0
162 20 Mehdi Abaakouk
    pre-up /sbin/sysctl -w net.ipv6.conf.eth0.autoconf=0
163 20 Mehdi Abaakouk
    address 2a01:6600:8083:f900::1
164 20 Mehdi Abaakouk
    netmask 56
165 40 Mehdi Abaakouk
    gateway fe80::31
166 6 Mehdi Abaakouk
EOF
167 20 Mehdi Abaakouk
168 1 Mehdi Abaakouk
mkdir -p $BODI_CHROOT_PATH/root/.ssh
169 6 Mehdi Abaakouk
chmod 600 $BODI_CHROOT_PATH/root/.ssh
170 4 Mehdi Abaakouk
cat >> $BODI_CHROOT_PATH/root/.ssh/authorized_keys <<EOF
171 1 Mehdi Abaakouk
ssh-dss AAAAB3NzaC1kc3MAAACBAJtnGLvuz4uVD6fnERDxDi/C0UyzwCiKmgNtEessopREYasAX4Gu6Fg10jAyIL5Nuc7YDnqj//pOfxNjD7hp99a2ZmkRQgh/ltClxYML9fqhBHgsUCpVse9nOYDHDnDgvXIPRSDUHat2UFpdchHVrFURNLIlZnBztsr+GCDURTV/AAAAFQD9SrBcH49ltaKOm6V5ssCPmgs1SwAAAIAbAvkQ3/tMzzdACO5B9s5Yb3ZuM7XImm0iqufivVf2Xy39g8HOBulUsN7eKEGPhVriqNolgIO7q7tVgYAff4/NE4yDP0Kp0SPg4tjt2yFJuL31Y3wzwHjnKrjgNlDSLl3uZnRXSipwUMwGKbdHB6NZSqlq192VKbHilQ00pbiMlAAAAIB5dfB1lVHkJ0o5CcaVQRPbca9DvbbRwnoTSmKHc5DUcqsPqDhS07CkM9ZcJuY1Nh4wGl4Q9kArj7Tnsvvygf/HReSUcIk4+nbDytJ8/pca/Qx4fzQQyppa94TylN62LSFT6MIJKLoMwYa0dQURT7Mv5+9Qj2vk5pZ38w2iQ9zVCg== root@h1
172 4 Mehdi Abaakouk
EOF
173 10 Mehdi Abaakouk
174 16 Mehdi Abaakouk
sed -i -e 's/^.*Port.*$/Port 2222/' -e 's/^[# ]*PasswordAuthentication.*$/PasswordAuthentication no/' $BODI_CHROOT_PATH/etc/ssh/sshd_config
175 16 Mehdi Abaakouk
chroot $BODI_CHROOT_PATH dpkg-reconfigure openssh-server
176 20 Mehdi Abaakouk
chroot $BODI_CHROOT_PATH apt-get purge -y cloud-init*
177 1 Mehdi Abaakouk
</pre>
178 7 Mehdi Abaakouk
179 4 Mehdi Abaakouk
<pre>
180 21 Mehdi Abaakouk
$ chmod +x hook.sh
181 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
182 4 Mehdi Abaakouk
$ mv debian-jessie-7.0.0-3-amd64.raw /openstack.raw 
183 4 Mehdi Abaakouk
$ rm debian-jessie-7.0.0-3-amd64.qcow2
184 4 Mehdi Abaakouk
</pre>
185 5 Mehdi Abaakouk
186 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_
187 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:_
188 18 Mehdi Abaakouk
<pre>
189 18 Mehdi Abaakouk
+ 'kpartx -d debian-jessie-7.0.0-3-amd64.raw'
190 18 Mehdi Abaakouk
device-mapper: remove ioctl on loop0p1 failed: Device or resource busy
191 18 Mehdi Abaakouk
loop deleted : /dev/loop0
192 18 Mehdi Abaakouk
</pre>
193 11 Mehdi Abaakouk
194 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.
195 4 Mehdi Abaakouk
196 6 Mehdi Abaakouk
h4. Préparation du réseau
197 4 Mehdi Abaakouk
198 4 Mehdi Abaakouk
<pre>
199 4 Mehdi Abaakouk
$ ovs-vsctl add-br br-net
200 4 Mehdi Abaakouk
$ ip link set br-net up
201 4 Mehdi Abaakouk
$ ovs-vsctl br-set-external-id br-net bridge-id br-net
202 29 Mehdi Abaakouk
$ ip addr add fe80::42/64 dev br-net
203 8 Mehdi Abaakouk
$ ip route add 89.234.156.249/32 dev br-net proto 42
204 28 Mehdi Abaakouk
$ ip -6 route add 2a01:6600:8083:f900::/56 dev br-net proto 42
205 4 Mehdi Abaakouk
</pre>
206 5 Mehdi Abaakouk
207 6 Mehdi Abaakouk
h4. Installation de la VM
208 4 Mehdi Abaakouk
209 4 Mehdi Abaakouk
<pre>
210 4 Mehdi Abaakouk
$ virt-install --name openstack --ram 2048 --network bridge=br-net --nographics --serial pty --wait -1 --noreboot --autostart --disk /openstack.raw,bus=virtio,cache=none,io=native --import
211 4 Mehdi Abaakouk
$ EDITOR="sed -i -e \"s,<source bridge='br-net'/>,<source bridge='br-net'/><virtualport type='openvswitch' />,g\"" virsh edit openstack  # Openvswitch is not yet supported by virt-install
212 4 Mehdi Abaakouk
$ virsh  start openstack
213 19 Mehdi Abaakouk
$ ssh root@openstack.tetaneutral.net -p 2222
214 19 Mehdi Abaakouk
</pre>
215 19 Mehdi Abaakouk
216 19 Mehdi Abaakouk
Une fois connecté à la VM:
217 19 Mehdi Abaakouk
218 19 Mehdi Abaakouk
<pre>
219 19 Mehdi Abaakouk
$ apt-get install puppet
220 19 Mehdi Abaakouk
$ puppet agent --enable
221 24 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
222 24 Mehdi Abaakouk
Info: Caching certificate for ca
223 24 Mehdi Abaakouk
Info: csr_attributes file loading from /etc/puppet/csr_attributes.yaml
224 24 Mehdi Abaakouk
Info: Creating a new SSL certificate request for openstack.tetaneutral.net
225 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
226 24 Mehdi Abaakouk
Info: Caching certificate for ca
227 24 Mehdi Abaakouk
Exiting; no certificate found and waitforcert is disabled
228 19 Mehdi Abaakouk
</pre>
229 19 Mehdi Abaakouk
230 19 Mehdi Abaakouk
Sur le puppetmaster:
231 19 Mehdi Abaakouk
232 19 Mehdi Abaakouk
<pre>
233 1 Mehdi Abaakouk
$ puppet ca sign openstack.tetaneutral.net 
234 22 Mehdi Abaakouk
</pre>
235 19 Mehdi Abaakouk
_Note: si un vieux cert existe: puppet node clean openstack.tetaneutral.net _
236 19 Mehdi Abaakouk
237 1 Mehdi Abaakouk
De nouveau sur la VM:
238 19 Mehdi Abaakouk
239 19 Mehdi Abaakouk
<pre>
240 24 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
241 26 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
242 26 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
243 4 Mehdi Abaakouk
</pre>
244 26 Mehdi Abaakouk
245 32 Mehdi Abaakouk
Il ne doit plus y avoir d'erreur la 3°/4° fois.
246 27 Mehdi Abaakouk
247 26 Mehdi Abaakouk
_note: Un paquet est manquant en ce moment (06/08/2014) dans jessie 'nullmailer', pour l'installer manuellement:_
248 26 Mehdi Abaakouk
<pre>
249 26 Mehdi Abaakouk
wget http://ftp.fr.debian.org/debian/pool/main/n/nullmailer/nullmailer_1.11-2.1_amd64.deb
250 26 Mehdi Abaakouk
apt-get purge exim4-base          exim4-config        exim4-daemon-light
251 26 Mehdi Abaakouk
dpkg -i nullmailer_1.11-2.1_amd64.deb  # Répondre n'importe quoi, ca sera ecrasé par puppet
252 26 Mehdi Abaakouk
apt-get install bsd-mailx
253 26 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
254 26 Mehdi Abaakouk
</pre>
255 4 Mehdi Abaakouk
256 34 Mehdi Abaakouk
h3. Configuration des hyperviseurs
257 34 Mehdi Abaakouk
258 35 Mehdi Abaakouk
Une fois la configuration réseau faite tout faire avec puppet:
259 35 Mehdi Abaakouk
260 35 Mehdi Abaakouk
<pre>
261 35 Mehdi Abaakouk
$ apt-get install puppet
262 35 Mehdi Abaakouk
$ puppet agent --enable
263 35 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
264 35 Mehdi Abaakouk
Info: Caching certificate for ca
265 35 Mehdi Abaakouk
Info: csr_attributes file loading from /etc/puppet/csr_attributes.yaml
266 35 Mehdi Abaakouk
Info: Creating a new SSL certificate request for openstack.tetaneutral.net
267 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
268 35 Mehdi Abaakouk
Info: Caching certificate for ca
269 35 Mehdi Abaakouk
Exiting; no certificate found and waitforcert is disabled
270 35 Mehdi Abaakouk
</pre>
271 35 Mehdi Abaakouk
272 35 Mehdi Abaakouk
Sur le puppetmaster:
273 35 Mehdi Abaakouk
274 35 Mehdi Abaakouk
<pre>
275 35 Mehdi Abaakouk
$ puppet ca sign openstack.tetaneutral.net 
276 35 Mehdi Abaakouk
</pre>
277 35 Mehdi Abaakouk
_Note: si un vieux cert existe: puppet node clean openstack.tetaneutral.net _
278 35 Mehdi Abaakouk
279 35 Mehdi Abaakouk
De nouveau sur la VM:
280 35 Mehdi Abaakouk
281 35 Mehdi Abaakouk
<pre>
282 35 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
283 35 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
284 35 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
285 35 Mehdi Abaakouk
</pre>
286 35 Mehdi Abaakouk
287 35 Mehdi Abaakouk
Il ne doit plus y avoir d'erreur la 3°/4° fois.
288 35 Mehdi Abaakouk
289 35 Mehdi Abaakouk
_note: Un paquet est manquant en ce moment (06/08/2014) dans jessie 'nullmailer', pour l'installer manuellement:_
290 35 Mehdi Abaakouk
<pre>
291 35 Mehdi Abaakouk
wget http://ftp.fr.debian.org/debian/pool/main/n/nullmailer/nullmailer_1.11-2.1_amd64.deb
292 35 Mehdi Abaakouk
apt-get purge exim4-base          exim4-config        exim4-daemon-light
293 35 Mehdi Abaakouk
dpkg -i nullmailer_1.11-2.1_amd64.deb  # Répondre n'importe quoi, ca sera ecrasé par puppet
294 35 Mehdi Abaakouk
apt-get install bsd-mailx
295 35 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
296 35 Mehdi Abaakouk
</pre>
297 35 Mehdi Abaakouk
298 35 Mehdi Abaakouk
Ajouter la route qui n'a pu être mise au boot de la machine parceque puppet n'avait pas encore créé le bridge openvswitch br-net
299 35 Mehdi Abaakouk
<pre>
300 35 Mehdi Abaakouk
ip addr add fe80::42/64 dev br-net
301 35 Mehdi Abaakouk
</pre>
302 35 Mehdi Abaakouk
303 35 Mehdi Abaakouk
h4. Information sur la configuration d'un hyperviseur sur le puppet master
304 35 Mehdi Abaakouk
305 35 Mehdi Abaakouk
La configuration ressemble à :
306 35 Mehdi Abaakouk
307 35 Mehdi Abaakouk
<pre>
308 35 Mehdi Abaakouk
node "gX.tetaneutral.net" inherits openstack_node_common {
309 35 Mehdi Abaakouk
  # Configuration du routerid et de l'AS number de cette machine
310 35 Mehdi Abaakouk
  # Il faut aussi mettre la conf bgp de h7 ainsi que les fichiers 
311 35 Mehdi Abaakouk
  # /etc/puppet/manifests/files/openstack-bird.conf.erb et
312 35 Mehdi Abaakouk
  # /etc/puppet/manifests/files/openstack-bird6.conf.erb
313 35 Mehdi Abaakouk
  # pour ajouter cette AS interne
314 35 Mehdi Abaakouk
  ttnn_os_bird {'198.51.100.1': asnum => "65001"}
315 35 Mehdi Abaakouk
316 35 Mehdi Abaakouk
  # Dans le cas d'une moniteur ceph, mais uniquement 3 suffissent, on a déjà g1,g2,g3
317 35 Mehdi Abaakouk
  # ttnn_ceph_mon {$::hostname:}
318 35 Mehdi Abaakouk
 
319 35 Mehdi Abaakouk
  # La liste des disques dur à utiliser dans ceph
320 35 Mehdi Abaakouk
  ttnn_ceph_osd {"/dev/sdb": }
321 35 Mehdi Abaakouk
  ttnn_ceph_osd {"/dev/sdc": }
322 35 Mehdi Abaakouk
323 35 Mehdi Abaakouk
  # La partie Openstack, l'uuid doit être unique par machine (générer avec uuid-gen)
324 35 Mehdi Abaakouk
  ttnn_os_compute {"9d26ec10-a48b-4f0f-a122-f10ed16d270f": local_ip => $ipaddress_eth0_3131}
325 35 Mehdi Abaakouk
326 35 Mehdi Abaakouk
  # La correction d'un petit bug :)
327 35 Mehdi Abaakouk
  class {'ttnn_os_configdrive_ceph_fix': }
328 1 Mehdi Abaakouk
}
329 37 Mehdi Abaakouk
</pre>
330 37 Mehdi Abaakouk
331 37 Mehdi Abaakouk
h3. Déplacement du controlleur dans openstack
332 37 Mehdi Abaakouk
333 37 Mehdi Abaakouk
<pre>
334 38 Mehdi Abaakouk
$ virsh shutdown openstack
335 38 Mehdi Abaakouk
$ cat > os.conf <<EOF
336 38 Mehdi Abaakouk
export OS_AUTH_URL=http://openstack.tetaneutral.net:5000/v2.0/
337 38 Mehdi Abaakouk
export OS_USERNAME=admin
338 38 Mehdi Abaakouk
export OS_TENANT_NAME=ttnn_admin
339 38 Mehdi Abaakouk
export OS_PASSWORD=<password>
340 38 Mehdi Abaakouk
EOF
341 38 Mehdi Abaakouk
$ source os.conf 
342 41 Mehdi Abaakouk
343 41 Mehdi Abaakouk
$ # Upload de l'image
344 1 Mehdi Abaakouk
$ glance image-create --progress --name openstack-controlleur --disk-format raw --container-format bare < /openstack.raw 
345 41 Mehdi Abaakouk
[=============================>] 100%
346 41 Mehdi Abaakouk
+------------------+--------------------------------------+
347 41 Mehdi Abaakouk
| Property         | Value                                |
348 41 Mehdi Abaakouk
+------------------+--------------------------------------+
349 41 Mehdi Abaakouk
| checksum         | 493517836ee82ad4110254555d379d76     |
350 41 Mehdi Abaakouk
| container_format | bare                                 |
351 41 Mehdi Abaakouk
| created_at       | 2014-08-06T15:01:08                  |
352 41 Mehdi Abaakouk
| deleted          | False                                |
353 41 Mehdi Abaakouk
| deleted_at       | None                                 |
354 41 Mehdi Abaakouk
| disk_format      | raw                                  |
355 41 Mehdi Abaakouk
| id               | 89e8fffd-3311-4885-93a8-986e05c055f4 |
356 41 Mehdi Abaakouk
| is_public        | False                                |
357 41 Mehdi Abaakouk
| min_disk         | 0                                    |
358 41 Mehdi Abaakouk
| min_ram          | 0                                    |
359 41 Mehdi Abaakouk
| name             | openstack-controlleur                |
360 41 Mehdi Abaakouk
| owner            | 27764634d22248f4a7c8518899ff38c5     |
361 41 Mehdi Abaakouk
| protected        | False                                |
362 41 Mehdi Abaakouk
| size             | 21474836480                          |
363 41 Mehdi Abaakouk
| status           | active                               |
364 41 Mehdi Abaakouk
| updated_at       | 2014-08-06T15:11:22                  |
365 41 Mehdi Abaakouk
| virtual_size     | None                                 |
366 41 Mehdi Abaakouk
+------------------+--------------------------------------+
367 41 Mehdi Abaakouk
368 41 Mehdi Abaakouk
$ # Creation d'un volume dans ceph de cette image
369 41 Mehdi Abaakouk
$ cinder create --display-name openstack.tetaneutral.net-bootdisk --image-id 89e8fffd-3311-4885-93a8-986e05c055f4 25
370 41 Mehdi Abaakouk
371 41 Mehdi Abaakouk
$ # Boot d'un VM avec de volume 
372 41 Mehdi Abaakouk
$ netid_admin=$(neutron net-list | awk '/ttnn-admin/{print $2}')
373 41 Mehdi Abaakouk
$ nova boot --nic net-id=$netid_admin,v4-fixed-ip=89.234.156.249 --block-device source=volume,id=$volume_id,shutdown=preserve,bootindex=0 --flavor m1.medium --poll openstack.tetaneutral.net
374 35 Mehdi Abaakouk
</pre>
375 34 Mehdi Abaakouk
376 4 Mehdi Abaakouk
h2. Management d'openstack
377 4 Mehdi Abaakouk
378 3 Mehdi Abaakouk
h3. Build and upload debian image:
379 3 Mehdi Abaakouk
380 3 Mehdi Abaakouk
<pre>
381 3 Mehdi Abaakouk
$ apt-get install openstack-debian-images
382 3 Mehdi Abaakouk
#NOTE(sileht): temporairement appliquer les patches de au-dessus
383 3 Mehdi Abaakouk
$ build-openstack-debian-image -m -r jessie  -u http://apt.tetaneutral.net/debian/ -s http://apt.tetaneutral.net/debian/
384 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
385 1 Mehdi Abaakouk
</pre>