Project

General

Profile

Openstack Installation TTNN » History » Version 6

Version 5 (Mehdi Abaakouk, 08/06/2014 10:19 AM) → Version 6/252 (Mehdi Abaakouk, 08/06/2014 10:42 AM)

h1. Openstack Installation TTNN

h2. Pending upstream fixes:

* build-debian-openstack-images, changes should be in next package version:
** Fix extlinux installation on jessie: http://anonscm.debian.org/cgit/openstack/openstack-debian-images.git/commit/?id=1a4ddceb99fb66f42f79e87a183d8e96952e5ac3
** Fix cloud-init setup with configdrive: http://anonscm.debian.org/cgit/openstack/openstack-debian-images.git/commit/?id=15cce87e2fa15b8952d69fb58711bfa88b21ef87

* nova:
** 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

h2. Installation

Le setup installé est composé de :

* 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)
* 1 VM (controler node), qui contient tous les services de management d'openstack (nova, cinder, glance, neutron)

Les étapes d'installation sont les suivantes:
* Préparation manuelle de la VM de management sur un des hyperviseurs
* Installation de ceph et openstack sur toutes les machines avec puppet
* Déplacement de la VM de management d'openstack dans openstack.

h3. Preparation de la VM de management, le controlleur

h4. Installation *Installation des prérequis prérequis*

<pre>
$ apt-get install libvirt-bin openstack-debian-images openvswitch-switch openvswitch-datapath-dkms virtinst
#NOTE(sileht): temporairement appliquer les patches de au-dessus à openstack-debian-images
</pre>

h4. Preparation *Preparation de l'image de la VM VM*

<pre>
$ vim cat > hook.sh

<<GEOF
cp mgmt-rc.local \$BODI_CHROOT_PATH/etc/rc.local
mkdir -p \$BODI_CHROOT_PATH/root/.ssh
chmod 600 \$BODI_CHROOT_PATH/root/.ssh
cat > $BODI_CHROOT_PATH/etc/network/interfaces >> \$BODI_CHROOT_PATH/root/.ssh/authorized_keys <<EOF
auto lo ssh-dss AAAAB3NzaC1kc3MAAACBAJtnGLvuz4uVD6fnERDxDi/C0UyzwCiKmgNtEessopREYasAX4Gu6Fg10jAyIL5Nuc7YDnqj//pOfxNjD7hp99a2ZmkRQgh/ltClxYML9fqhBHgsUCpVse9nOYDHDnDgvXIPRSDUHat2UFpdchHVrFURNLIlZnBztsr+GCDURTV/AAAAFQD9SrBcH49ltaKOm6V5ssCPmgs1SwAAAIAbAvkQ3/tMzzdACO5B9s5Yb3ZuM7XImm0iqufivVf2Xy39g8HOBulUsN7eKEGPhVriqNolgIO7q7tVgYAff4/NE4yDP0Kp0SPg4tjt2yFJuL31Y3wzwHjnKrjgNlDSLl3uZnRXSipwUMwGKbdHB6NZSqlq192VKbHilQ00pbiMlAAAAIB5dfB1lVHkJ0o5CcaVQRPbca9DvbbRwnoTSmKHc5DUcqsPqDhS07CkM9ZcJuY1Nh4wGl4Q9kArj7Tnsvvygf/HReSUcIk4+nbDytJ8/pca/Qx4fzQQyppa94TylN62LSFT6MIJKLoMwYa0dQURT7Mv5+9Qj2vk5pZ38w2iQ9zVCg== root@h1
iface lo inet loopback EOF
auto eth0 GEOF
iface eth0 inet manual
up
$ chmod +x hook.sh

$ cat > mgmt-rc.local <<EOF
#!/bin/sh

for i in /proc/sys/net/ipv6/conf/*; do for j in autoconf accept_ra; do
echo 0 > /proc/sys/net/ipv6/conf/autoconf
up
\$i/\$j; done;done
# https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt
for i in /proc/sys/net/ipv4/conf/*/arp_announce; do
echo 0 2 > /proc/sys/net/ipv6/conf/accept_ra
up
\$i;done

ip link set eth0 up
up

ip addr add 89.234.156.249/32 dev eth0
up

ip route add 89.234.156.251/32 dev eth0
up

ip route add default via 89.234.156.251
EOF
chroot $BODI_CHROOT_PATH apt-get purge -y cloud-init*
mkdir -p $BODI_CHROOT_PATH/root/.ssh
chmod 600 $BODI_CHROOT_PATH/root/.ssh
cat >> $BODI_CHROOT_PATH/root/.ssh/authorized_keys <<EOF
ssh-dss AAAAB3NzaC1kc3MAAACBAJtnGLvuz4uVD6fnERDxDi/C0UyzwCiKmgNtEessopREYasAX4Gu6Fg10jAyIL5Nuc7YDnqj//pOfxNjD7hp99a2ZmkRQgh/ltClxYML9fqhBHgsUCpVse9nOYDHDnDgvXIPRSDUHat2UFpdchHVrFURNLIlZnBztsr+GCDURTV/AAAAFQD9SrBcH49ltaKOm6V5ssCPmgs1SwAAAIAbAvkQ3/tMzzdACO5B9s5Yb3ZuM7XImm0iqufivVf2Xy39g8HOBulUsN7eKEGPhVriqNolgIO7q7tVgYAff4/NE4yDP0Kp0SPg4tjt2yFJuL31Y3wzwHjnKrjgNlDSLl3uZnRXSipwUMwGKbdHB6NZSqlq192VKbHilQ00pbiMlAAAAIB5dfB1lVHkJ0o5CcaVQRPbca9DvbbRwnoTSmKHc5DUcqsPqDhS07CkM9ZcJuY1Nh4wGl4Q9kArj7Tnsvvygf/HReSUcIk4+nbDytJ8/pca/Qx4fzQQyppa94TylN62LSFT6MIJKLoMwYa0dQURT7Mv5+9Qj2vk5pZ38w2iQ9zVCg== root@h1
EOF

$ chmod +x hook.sh
EOF


$ build-openstack-debian-image --image-size 20 --release jessie -u http://apt.tetaneutral.net/debian/ -s http://apt.tetaneutral.net/debian/ --extra-packages puppet --hook-script $(pwd)/hook.sh
$ mv debian-jessie-7.0.0-3-amd64.raw /openstack.raw
$ rm debian-jessie-7.0.0-3-amd64.qcow2
</pre>

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.

h4. Préparation *Préparation du réseau réseau*

<pre>
$ ovs-vsctl add-br br-net
$ ip link set br-net up
$ ovs-vsctl br-set-external-id br-net bridge-id br-net
$ ip route 89.234.156.249/32 dev br-net proto 42
</pre>

h4. Installation *Installation de la VM VM*

<pre>
$ 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
$ 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
$ virsh start openstack
</pre>

h2. Management d'openstack

h3. Build and upload debian image:

<pre>
$ apt-get install openstack-debian-images
#NOTE(sileht): temporairement appliquer les patches de au-dessus
$ build-openstack-debian-image -m -r jessie -u http://apt.tetaneutral.net/debian/ -s http://apt.tetaneutral.net/debian/
$ 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
</pre>