Projet

Général

Profil

Openstack Installation TTNN » Historique » Version 39

Mehdi Abaakouk, 06/08/2014 16:08

1 1 Mehdi Abaakouk
h1. Openstack Installation TTNN
2 1 Mehdi Abaakouk
3 3 Mehdi Abaakouk
h2. Pending upstream fixes:
4 3 Mehdi Abaakouk
5 1 Mehdi Abaakouk
* build-debian-openstack-images, changes should be in next package version:
6 1 Mehdi Abaakouk
** Fix extlinux installation on jessie: http://anonscm.debian.org/cgit/openstack/openstack-debian-images.git/commit/?id=1a4ddceb99fb66f42f79e87a183d8e96952e5ac3
7 1 Mehdi Abaakouk
** Fix cloud-init setup with configdrive: http://anonscm.debian.org/cgit/openstack/openstack-debian-images.git/commit/?id=15cce87e2fa15b8952d69fb58711bfa88b21ef87
8 15 Mehdi Abaakouk
** Use Configdrive first for cloud-init: http://anonscm.debian.org/cgit/openstack/openstack-debian-images.git/commit/?id=1b1e1093d5ee525426382ad29b8219ab58f6656d
9 1 Mehdi Abaakouk
10 1 Mehdi Abaakouk
* nova: 
11 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
12 1 Mehdi Abaakouk
13 4 Mehdi Abaakouk
h2. Installation
14 4 Mehdi Abaakouk
15 4 Mehdi Abaakouk
Le setup installé est composé de :
16 4 Mehdi Abaakouk
17 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)
18 4 Mehdi Abaakouk
* 1 VM (controler node), qui contient tous les services de management d'openstack (nova, cinder, glance, neutron)
19 4 Mehdi Abaakouk
20 4 Mehdi Abaakouk
Les étapes d'installation sont les suivantes:
21 4 Mehdi Abaakouk
* Préparation manuelle de la VM de management sur un des hyperviseurs
22 4 Mehdi Abaakouk
* Installation de ceph et openstack sur toutes les machines avec puppet
23 4 Mehdi Abaakouk
* Déplacement de la VM de management d'openstack dans openstack.
24 4 Mehdi Abaakouk
25 33 Mehdi Abaakouk
h3. Information sur le puppet master:
26 33 Mehdi Abaakouk
27 33 Mehdi Abaakouk
La conf et modules puppet utilisé par tetaneutral.net ce trouve la:
28 33 Mehdi Abaakouk
29 33 Mehdi Abaakouk
> http://chiliproject.tetaneutral.net/projects/git-tetaneutral-net/repository/puppetmaster
30 33 Mehdi Abaakouk
> http://chiliproject.tetaneutral.net/projects/git-tetaneutral-net/repository/puppetmaster/revisions/master/entry/manifests/nodes/openstack.pp
31 33 Mehdi Abaakouk
32 33 Mehdi Abaakouk
Seulement c'est 3 classes sont spécifique à tetaneutral, le reste est réutilisable:
33 33 Mehdi Abaakouk
34 36 Mehdi Abaakouk
> class { 'ttnn::server': }
35 36 Mehdi Abaakouk
> class { 'backup::client': }
36 36 Mehdi Abaakouk
> class { 'sexymotd': }
37 33 Mehdi Abaakouk
38 33 Mehdi Abaakouk
Les modules qui sont nécessaire pour openstack pour le reste du fichier sont:
39 33 Mehdi Abaakouk
40 33 Mehdi Abaakouk
> https://github.com/puppetlabs/puppetlabs-apache.git 
41 33 Mehdi Abaakouk
> https://github.com/puppetlabs/puppetlabs-apt 
42 33 Mehdi Abaakouk
> https://github.com/stackforge/puppet-ceph.git 
43 33 Mehdi Abaakouk
> https://github.com/stackforge/puppet-cinder.git 
44 33 Mehdi Abaakouk
> https://github.com/puppetlabs/puppetlabs-concat.git 
45 33 Mehdi Abaakouk
> https://github.com/stackforge/puppet-glance.git 
46 33 Mehdi Abaakouk
> https://github.com/stackforge/puppet-horizon.git 
47 33 Mehdi Abaakouk
> https://github.com/puppetlabs/puppetlabs-inifile.git 
48 33 Mehdi Abaakouk
> https://github.com/stackforge/puppet-keystone.git 
49 33 Mehdi Abaakouk
> https://github.com/camptocamp/puppet-kmod.git 
50 33 Mehdi Abaakouk
> https://github.com/saz/puppet-memcached.git 
51 33 Mehdi Abaakouk
> https://github.com/puppetlabs/puppetlabs-mysql.git 
52 33 Mehdi Abaakouk
> https://github.com/stackforge/puppet-neutron.git 
53 33 Mehdi Abaakouk
> https://github.com/stackforge/puppet-nova.git 
54 33 Mehdi Abaakouk
> https://github.com/puppetlabs/puppetlabs-rabbitmq.git 
55 33 Mehdi Abaakouk
> https://github.com/nanliu/puppet-staging.git 
56 33 Mehdi Abaakouk
> https://github.com/puppetlabs/puppetlabs-stdlib.git 
57 33 Mehdi Abaakouk
> https://github.com/duritong/puppet-sysctl.git 
58 33 Mehdi Abaakouk
> https://github.com/puppetlabs/puppetlabs-vcsrepo.git 
59 33 Mehdi Abaakouk
> https://github.com/stackforge/puppet-vswitch.git 
60 36 Mehdi Abaakouk
> https://github.com/puppetlabs/puppetlabs-xinetd.git
61 33 Mehdi Abaakouk
62 33 Mehdi Abaakouk
h3. Préparation réseaux des hosts:
63 29 Mehdi Abaakouk
64 31 Mehdi Abaakouk
Voici le fichier rc.local d'un hyperviseur (g1)
65 29 Mehdi Abaakouk
66 29 Mehdi Abaakouk
<pre>
67 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
68 29 Mehdi Abaakouk
# https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt
69 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 ?
70 29 Mehdi Abaakouk
71 29 Mehdi Abaakouk
echo 1 > /proc/sys/net/ipv4/ip_forward
72 29 Mehdi Abaakouk
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
73 29 Mehdi Abaakouk
74 29 Mehdi Abaakouk
ip link set eth0 up
75 29 Mehdi Abaakouk
ip link add link eth0 name eth0.3131 type vlan id 3131
76 29 Mehdi Abaakouk
ip link set eth0.3131 up
77 29 Mehdi Abaakouk
ip addr add 89.234.156.251/32 dev eth0.3131
78 29 Mehdi Abaakouk
ip route add 91.224.149.0/24 dev eth0.3131
79 29 Mehdi Abaakouk
ip route add default via 91.224.149.254
80 29 Mehdi Abaakouk
81 29 Mehdi Abaakouk
ip addr add 2a01:6600:8083:fb00::1/56 dev eth0.3131
82 29 Mehdi Abaakouk
ip route add default via fe80::31 dev eth0.3131
83 29 Mehdi Abaakouk
84 29 Mehdi Abaakouk
ip link add link eth0 name eth0.3175 type vlan id 3175
85 29 Mehdi Abaakouk
ip link set eth0.3175 up
86 29 Mehdi Abaakouk
87 29 Mehdi Abaakouk
ip link add link eth0 name eth0.3195 type vlan id 3195
88 29 Mehdi Abaakouk
ip link set eth0.3195 up
89 29 Mehdi Abaakouk
90 29 Mehdi Abaakouk
ip addr add 91.224.148.0/32 dev lo
91 39 Mehdi Abaakouk
ip addr add fe80::31/64 dev br-net
92 29 Mehdi Abaakouk
ip route add 89.234.156.250/32 dev eth0.3131
93 29 Mehdi Abaakouk
ip route add 89.234.156.252/32 dev eth0.3131
94 29 Mehdi Abaakouk
ip route add 89.234.156.253/32 dev eth0.3131
95 29 Mehdi Abaakouk
96 29 Mehdi Abaakouk
97 29 Mehdi Abaakouk
exit 0
98 29 Mehdi Abaakouk
</pre>
99 29 Mehdi Abaakouk
100 30 Mehdi Abaakouk
Sur h7.tetaneutral.net le routage est le suivant
101 30 Mehdi Abaakouk
102 30 Mehdi Abaakouk
<pre>
103 30 Mehdi Abaakouk
ip route add 89.234.156.251/32 dev eth0.3131
104 30 Mehdi Abaakouk
ip route add 89.234.156.252/32 dev eth0.3131
105 30 Mehdi Abaakouk
ip route add 89.234.156.253/32 dev eth0.3131
106 30 Mehdi Abaakouk
ip route add 2a01:6600:8083:fb00::/56 dev eth0.3131
107 30 Mehdi Abaakouk
ip route add 2a01:6600:8083:fc00::/56 dev eth0.3131
108 30 Mehdi Abaakouk
ip route add 2a01:6600:8083:fd00::/56 dev eth0.3131
109 30 Mehdi Abaakouk
</pre>
110 30 Mehdi Abaakouk
111 30 Mehdi Abaakouk
Ainsi que ceci le temps de l'installation
112 30 Mehdi Abaakouk
113 30 Mehdi Abaakouk
<pre>
114 30 Mehdi Abaakouk
ip route add 89.234.156.249/32 via 89.234.156.251 # NOTE(sileht): temporairement pour le setup openstack
115 30 Mehdi Abaakouk
ip route add 2a01:6600:8083:f900::/56 via 2a01:6600:8083:fb00:: dev eth0.3131 # NOTE(sileht): temporairement pour le setup openstack
116 30 Mehdi Abaakouk
</pre>
117 30 Mehdi Abaakouk
118 4 Mehdi Abaakouk
h3. Preparation de la VM de management, le controlleur
119 4 Mehdi Abaakouk
120 6 Mehdi Abaakouk
h4. Installation des prérequis
121 4 Mehdi Abaakouk
122 4 Mehdi Abaakouk
<pre>
123 4 Mehdi Abaakouk
$ apt-get install libvirt-bin openstack-debian-images openvswitch-switch openvswitch-datapath-dkms virtinst
124 4 Mehdi Abaakouk
#NOTE(sileht): temporairement appliquer les patches de au-dessus à openstack-debian-images 
125 4 Mehdi Abaakouk
</pre>
126 4 Mehdi Abaakouk
127 6 Mehdi Abaakouk
h4. Preparation de l'image de la VM
128 1 Mehdi Abaakouk
129 1 Mehdi Abaakouk
<pre>
130 6 Mehdi Abaakouk
$ vim hook.sh
131 17 Mehdi Abaakouk
set -xv
132 16 Mehdi Abaakouk
133 1 Mehdi Abaakouk
echo "openstack" > $BODI_CHROOT_PATH/etc/hostname
134 20 Mehdi Abaakouk
135 16 Mehdi Abaakouk
cat > $BODI_CHROOT_PATH/etc/resolv.conf <<EOF
136 16 Mehdi Abaakouk
domain tetaneutral.net
137 16 Mehdi Abaakouk
search tetaneutral.net
138 16 Mehdi Abaakouk
nameserver 8.8.8.8
139 1 Mehdi Abaakouk
EOF
140 20 Mehdi Abaakouk
141 6 Mehdi Abaakouk
cat > $BODI_CHROOT_PATH/etc/network/interfaces <<EOF
142 6 Mehdi Abaakouk
auto lo
143 6 Mehdi Abaakouk
iface lo inet loopback
144 1 Mehdi Abaakouk
auto eth0
145 6 Mehdi Abaakouk
iface eth0 inet manual
146 20 Mehdi Abaakouk
  pre-up /sbin/sysctl -w net.ipv6.conf.eth0.accept_ra=0
147 20 Mehdi Abaakouk
  pre-up /sbin/sysctl -w net.ipv6.conf.eth0.autoconf=0
148 1 Mehdi Abaakouk
  up ip link set eth0 up
149 1 Mehdi Abaakouk
  up ip addr add 89.234.156.249/32 dev eth0
150 20 Mehdi Abaakouk
  up ip route add 91.224.148.0/32 dev eth0
151 20 Mehdi Abaakouk
  up ip route add default via 91.224.148.0
152 20 Mehdi Abaakouk
153 20 Mehdi Abaakouk
iface eth0 inet6 static
154 20 Mehdi Abaakouk
    pre-up /sbin/sysctl -w net.ipv6.conf.eth0.accept_ra=0
155 20 Mehdi Abaakouk
    pre-up /sbin/sysctl -w net.ipv6.conf.eth0.autoconf=0
156 20 Mehdi Abaakouk
    address 2a01:6600:8083:f900::1
157 20 Mehdi Abaakouk
    netmask 56
158 25 Mehdi Abaakouk
    gateway fe80::42
159 6 Mehdi Abaakouk
EOF
160 20 Mehdi Abaakouk
161 1 Mehdi Abaakouk
mkdir -p $BODI_CHROOT_PATH/root/.ssh
162 6 Mehdi Abaakouk
chmod 600 $BODI_CHROOT_PATH/root/.ssh
163 4 Mehdi Abaakouk
cat >> $BODI_CHROOT_PATH/root/.ssh/authorized_keys <<EOF
164 1 Mehdi Abaakouk
ssh-dss AAAAB3NzaC1kc3MAAACBAJtnGLvuz4uVD6fnERDxDi/C0UyzwCiKmgNtEessopREYasAX4Gu6Fg10jAyIL5Nuc7YDnqj//pOfxNjD7hp99a2ZmkRQgh/ltClxYML9fqhBHgsUCpVse9nOYDHDnDgvXIPRSDUHat2UFpdchHVrFURNLIlZnBztsr+GCDURTV/AAAAFQD9SrBcH49ltaKOm6V5ssCPmgs1SwAAAIAbAvkQ3/tMzzdACO5B9s5Yb3ZuM7XImm0iqufivVf2Xy39g8HOBulUsN7eKEGPhVriqNolgIO7q7tVgYAff4/NE4yDP0Kp0SPg4tjt2yFJuL31Y3wzwHjnKrjgNlDSLl3uZnRXSipwUMwGKbdHB6NZSqlq192VKbHilQ00pbiMlAAAAIB5dfB1lVHkJ0o5CcaVQRPbca9DvbbRwnoTSmKHc5DUcqsPqDhS07CkM9ZcJuY1Nh4wGl4Q9kArj7Tnsvvygf/HReSUcIk4+nbDytJ8/pca/Qx4fzQQyppa94TylN62LSFT6MIJKLoMwYa0dQURT7Mv5+9Qj2vk5pZ38w2iQ9zVCg== root@h1
165 4 Mehdi Abaakouk
EOF
166 10 Mehdi Abaakouk
167 16 Mehdi Abaakouk
sed -i -e 's/^.*Port.*$/Port 2222/' -e 's/^[# ]*PasswordAuthentication.*$/PasswordAuthentication no/' $BODI_CHROOT_PATH/etc/ssh/sshd_config
168 16 Mehdi Abaakouk
chroot $BODI_CHROOT_PATH dpkg-reconfigure openssh-server
169 20 Mehdi Abaakouk
chroot $BODI_CHROOT_PATH apt-get purge -y cloud-init*
170 1 Mehdi Abaakouk
</pre>
171 7 Mehdi Abaakouk
172 4 Mehdi Abaakouk
<pre>
173 21 Mehdi Abaakouk
$ chmod +x hook.sh
174 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
175 4 Mehdi Abaakouk
$ mv debian-jessie-7.0.0-3-amd64.raw /openstack.raw 
176 4 Mehdi Abaakouk
$ rm debian-jessie-7.0.0-3-amd64.qcow2
177 4 Mehdi Abaakouk
</pre>
178 5 Mehdi Abaakouk
179 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_
180 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:_
181 18 Mehdi Abaakouk
<pre>
182 18 Mehdi Abaakouk
+ 'kpartx -d debian-jessie-7.0.0-3-amd64.raw'
183 18 Mehdi Abaakouk
device-mapper: remove ioctl on loop0p1 failed: Device or resource busy
184 18 Mehdi Abaakouk
loop deleted : /dev/loop0
185 18 Mehdi Abaakouk
</pre>
186 11 Mehdi Abaakouk
187 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.
188 4 Mehdi Abaakouk
189 6 Mehdi Abaakouk
h4. Préparation du réseau
190 4 Mehdi Abaakouk
191 4 Mehdi Abaakouk
<pre>
192 4 Mehdi Abaakouk
$ ovs-vsctl add-br br-net
193 4 Mehdi Abaakouk
$ ip link set br-net up
194 4 Mehdi Abaakouk
$ ovs-vsctl br-set-external-id br-net bridge-id br-net
195 29 Mehdi Abaakouk
$ ip addr add fe80::42/64 dev br-net
196 8 Mehdi Abaakouk
$ ip route add 89.234.156.249/32 dev br-net proto 42
197 28 Mehdi Abaakouk
$ ip -6 route add 2a01:6600:8083:f900::/56 dev br-net proto 42
198 4 Mehdi Abaakouk
</pre>
199 5 Mehdi Abaakouk
200 6 Mehdi Abaakouk
h4. Installation de la VM
201 4 Mehdi Abaakouk
202 4 Mehdi Abaakouk
<pre>
203 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
204 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
205 4 Mehdi Abaakouk
$ virsh  start openstack
206 19 Mehdi Abaakouk
$ ssh root@openstack.tetaneutral.net -p 2222
207 19 Mehdi Abaakouk
</pre>
208 19 Mehdi Abaakouk
209 19 Mehdi Abaakouk
Une fois connecté à la VM:
210 19 Mehdi Abaakouk
211 19 Mehdi Abaakouk
<pre>
212 19 Mehdi Abaakouk
$ apt-get install puppet
213 19 Mehdi Abaakouk
$ puppet agent --enable
214 24 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
215 24 Mehdi Abaakouk
Info: Caching certificate for ca
216 24 Mehdi Abaakouk
Info: csr_attributes file loading from /etc/puppet/csr_attributes.yaml
217 24 Mehdi Abaakouk
Info: Creating a new SSL certificate request for openstack.tetaneutral.net
218 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
219 24 Mehdi Abaakouk
Info: Caching certificate for ca
220 24 Mehdi Abaakouk
Exiting; no certificate found and waitforcert is disabled
221 19 Mehdi Abaakouk
</pre>
222 19 Mehdi Abaakouk
223 19 Mehdi Abaakouk
Sur le puppetmaster:
224 19 Mehdi Abaakouk
225 19 Mehdi Abaakouk
<pre>
226 1 Mehdi Abaakouk
$ puppet ca sign openstack.tetaneutral.net 
227 22 Mehdi Abaakouk
</pre>
228 19 Mehdi Abaakouk
_Note: si un vieux cert existe: puppet node clean openstack.tetaneutral.net _
229 19 Mehdi Abaakouk
230 1 Mehdi Abaakouk
De nouveau sur la VM:
231 19 Mehdi Abaakouk
232 19 Mehdi Abaakouk
<pre>
233 24 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
234 26 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
235 26 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
236 4 Mehdi Abaakouk
</pre>
237 26 Mehdi Abaakouk
238 32 Mehdi Abaakouk
Il ne doit plus y avoir d'erreur la 3°/4° fois.
239 27 Mehdi Abaakouk
240 26 Mehdi Abaakouk
_note: Un paquet est manquant en ce moment (06/08/2014) dans jessie 'nullmailer', pour l'installer manuellement:_
241 26 Mehdi Abaakouk
<pre>
242 26 Mehdi Abaakouk
wget http://ftp.fr.debian.org/debian/pool/main/n/nullmailer/nullmailer_1.11-2.1_amd64.deb
243 26 Mehdi Abaakouk
apt-get purge exim4-base          exim4-config        exim4-daemon-light
244 26 Mehdi Abaakouk
dpkg -i nullmailer_1.11-2.1_amd64.deb  # Répondre n'importe quoi, ca sera ecrasé par puppet
245 26 Mehdi Abaakouk
apt-get install bsd-mailx
246 26 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
247 26 Mehdi Abaakouk
</pre>
248 4 Mehdi Abaakouk
249 34 Mehdi Abaakouk
h3. Configuration des hyperviseurs
250 34 Mehdi Abaakouk
251 35 Mehdi Abaakouk
Une fois la configuration réseau faite tout faire avec puppet:
252 35 Mehdi Abaakouk
253 35 Mehdi Abaakouk
<pre>
254 35 Mehdi Abaakouk
$ apt-get install puppet
255 35 Mehdi Abaakouk
$ puppet agent --enable
256 35 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
257 35 Mehdi Abaakouk
Info: Caching certificate for ca
258 35 Mehdi Abaakouk
Info: csr_attributes file loading from /etc/puppet/csr_attributes.yaml
259 35 Mehdi Abaakouk
Info: Creating a new SSL certificate request for openstack.tetaneutral.net
260 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
261 35 Mehdi Abaakouk
Info: Caching certificate for ca
262 35 Mehdi Abaakouk
Exiting; no certificate found and waitforcert is disabled
263 35 Mehdi Abaakouk
</pre>
264 35 Mehdi Abaakouk
265 35 Mehdi Abaakouk
Sur le puppetmaster:
266 35 Mehdi Abaakouk
267 35 Mehdi Abaakouk
<pre>
268 35 Mehdi Abaakouk
$ puppet ca sign openstack.tetaneutral.net 
269 35 Mehdi Abaakouk
</pre>
270 35 Mehdi Abaakouk
_Note: si un vieux cert existe: puppet node clean openstack.tetaneutral.net _
271 35 Mehdi Abaakouk
272 35 Mehdi Abaakouk
De nouveau sur la VM:
273 35 Mehdi Abaakouk
274 35 Mehdi Abaakouk
<pre>
275 35 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
276 35 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
277 35 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
278 35 Mehdi Abaakouk
</pre>
279 35 Mehdi Abaakouk
280 35 Mehdi Abaakouk
Il ne doit plus y avoir d'erreur la 3°/4° fois.
281 35 Mehdi Abaakouk
282 35 Mehdi Abaakouk
_note: Un paquet est manquant en ce moment (06/08/2014) dans jessie 'nullmailer', pour l'installer manuellement:_
283 35 Mehdi Abaakouk
<pre>
284 35 Mehdi Abaakouk
wget http://ftp.fr.debian.org/debian/pool/main/n/nullmailer/nullmailer_1.11-2.1_amd64.deb
285 35 Mehdi Abaakouk
apt-get purge exim4-base          exim4-config        exim4-daemon-light
286 35 Mehdi Abaakouk
dpkg -i nullmailer_1.11-2.1_amd64.deb  # Répondre n'importe quoi, ca sera ecrasé par puppet
287 35 Mehdi Abaakouk
apt-get install bsd-mailx
288 35 Mehdi Abaakouk
$ puppet agent -vt --server puppet.tetaneutral.net --certname openstack.tetaneutral.net --pluginsync 
289 35 Mehdi Abaakouk
</pre>
290 35 Mehdi Abaakouk
291 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
292 35 Mehdi Abaakouk
<pre>
293 35 Mehdi Abaakouk
ip addr add fe80::42/64 dev br-net
294 35 Mehdi Abaakouk
</pre>
295 35 Mehdi Abaakouk
296 35 Mehdi Abaakouk
h4. Information sur la configuration d'un hyperviseur sur le puppet master
297 35 Mehdi Abaakouk
298 35 Mehdi Abaakouk
La configuration ressemble à :
299 35 Mehdi Abaakouk
300 35 Mehdi Abaakouk
<pre>
301 35 Mehdi Abaakouk
node "gX.tetaneutral.net" inherits openstack_node_common {
302 35 Mehdi Abaakouk
  # Configuration du routerid et de l'AS number de cette machine
303 35 Mehdi Abaakouk
  # Il faut aussi mettre la conf bgp de h7 ainsi que les fichiers 
304 35 Mehdi Abaakouk
  # /etc/puppet/manifests/files/openstack-bird.conf.erb et
305 35 Mehdi Abaakouk
  # /etc/puppet/manifests/files/openstack-bird6.conf.erb
306 35 Mehdi Abaakouk
  # pour ajouter cette AS interne
307 35 Mehdi Abaakouk
  ttnn_os_bird {'198.51.100.1': asnum => "65001"}
308 35 Mehdi Abaakouk
309 35 Mehdi Abaakouk
  # Dans le cas d'une moniteur ceph, mais uniquement 3 suffissent, on a déjà g1,g2,g3
310 35 Mehdi Abaakouk
  # ttnn_ceph_mon {$::hostname:}
311 35 Mehdi Abaakouk
 
312 35 Mehdi Abaakouk
  # La liste des disques dur à utiliser dans ceph
313 35 Mehdi Abaakouk
  ttnn_ceph_osd {"/dev/sdb": }
314 35 Mehdi Abaakouk
  ttnn_ceph_osd {"/dev/sdc": }
315 35 Mehdi Abaakouk
316 35 Mehdi Abaakouk
  # La partie Openstack, l'uuid doit être unique par machine (générer avec uuid-gen)
317 35 Mehdi Abaakouk
  ttnn_os_compute {"9d26ec10-a48b-4f0f-a122-f10ed16d270f": local_ip => $ipaddress_eth0_3131}
318 35 Mehdi Abaakouk
319 35 Mehdi Abaakouk
  # La correction d'un petit bug :)
320 35 Mehdi Abaakouk
  class {'ttnn_os_configdrive_ceph_fix': }
321 1 Mehdi Abaakouk
}
322 37 Mehdi Abaakouk
</pre>
323 37 Mehdi Abaakouk
324 37 Mehdi Abaakouk
h3. Déplacement du controlleur dans openstack
325 37 Mehdi Abaakouk
326 37 Mehdi Abaakouk
<pre>
327 38 Mehdi Abaakouk
$ virsh shutdown openstack
328 38 Mehdi Abaakouk
$ cat > os.conf <<EOF
329 38 Mehdi Abaakouk
export OS_AUTH_URL=http://openstack.tetaneutral.net:5000/v2.0/
330 38 Mehdi Abaakouk
export OS_USERNAME=admin
331 38 Mehdi Abaakouk
export OS_TENANT_NAME=ttnn_admin
332 38 Mehdi Abaakouk
export OS_PASSWORD=<password>
333 38 Mehdi Abaakouk
EOF
334 38 Mehdi Abaakouk
$ source os.conf 
335 38 Mehdi Abaakouk
$ glance image-create --progress --name openstack-controlleur --disk-format raw --container-format bare < /openstack.raw 
336 38 Mehdi Abaakouk
$ cinder create --name openstack-controller-disk 25G
337 35 Mehdi Abaakouk
</pre>
338 34 Mehdi Abaakouk
339 4 Mehdi Abaakouk
h2. Management d'openstack
340 4 Mehdi Abaakouk
341 3 Mehdi Abaakouk
h3. Build and upload debian image:
342 3 Mehdi Abaakouk
343 3 Mehdi Abaakouk
<pre>
344 3 Mehdi Abaakouk
$ apt-get install openstack-debian-images
345 3 Mehdi Abaakouk
#NOTE(sileht): temporairement appliquer les patches de au-dessus
346 3 Mehdi Abaakouk
$ build-openstack-debian-image -m -r jessie  -u http://apt.tetaneutral.net/debian/ -s http://apt.tetaneutral.net/debian/
347 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
348 1 Mehdi Abaakouk
</pre>