Openstack Installation TTNN » Historique » Version 17
Mehdi Abaakouk, 06/08/2014 13:21
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 | 4 | Mehdi Abaakouk | h3. Preparation de la VM de management, le controlleur |
26 | 4 | Mehdi Abaakouk | |
27 | 6 | Mehdi Abaakouk | h4. Installation des prérequis |
28 | 4 | Mehdi Abaakouk | |
29 | 4 | Mehdi Abaakouk | <pre> |
30 | 4 | Mehdi Abaakouk | $ apt-get install libvirt-bin openstack-debian-images openvswitch-switch openvswitch-datapath-dkms virtinst |
31 | 4 | Mehdi Abaakouk | #NOTE(sileht): temporairement appliquer les patches de au-dessus à openstack-debian-images |
32 | 4 | Mehdi Abaakouk | </pre> |
33 | 4 | Mehdi Abaakouk | |
34 | 6 | Mehdi Abaakouk | h4. Preparation de l'image de la VM |
35 | 1 | Mehdi Abaakouk | |
36 | 1 | Mehdi Abaakouk | <pre> |
37 | 6 | Mehdi Abaakouk | $ vim hook.sh |
38 | 9 | Mehdi Abaakouk | |
39 | 17 | Mehdi Abaakouk | set -xv |
40 | 16 | Mehdi Abaakouk | |
41 | 16 | Mehdi Abaakouk | echo "openstack" > $BODI_CHROOT_PATH/etc/hostname |
42 | 16 | Mehdi Abaakouk | cat > $BODI_CHROOT_PATH/etc/resolv.conf <<EOF |
43 | 16 | Mehdi Abaakouk | domain tetaneutral.net |
44 | 16 | Mehdi Abaakouk | search tetaneutral.net |
45 | 16 | Mehdi Abaakouk | nameserver 8.8.8.8 |
46 | 16 | Mehdi Abaakouk | EOF |
47 | 6 | Mehdi Abaakouk | cat > $BODI_CHROOT_PATH/etc/network/interfaces <<EOF |
48 | 6 | Mehdi Abaakouk | auto lo |
49 | 6 | Mehdi Abaakouk | iface lo inet loopback |
50 | 6 | Mehdi Abaakouk | auto eth0 |
51 | 6 | Mehdi Abaakouk | iface eth0 inet manual |
52 | 6 | Mehdi Abaakouk | up echo 0 > /proc/sys/net/ipv6/conf/autoconf |
53 | 6 | Mehdi Abaakouk | up echo 0 > /proc/sys/net/ipv6/conf/accept_ra |
54 | 6 | Mehdi Abaakouk | up ip link set eth0 up |
55 | 6 | Mehdi Abaakouk | up ip addr add 89.234.156.249/32 dev eth0 |
56 | 6 | Mehdi Abaakouk | up ip route add 89.234.156.251/32 dev eth0 |
57 | 6 | Mehdi Abaakouk | up ip route add default via 89.234.156.251 |
58 | 6 | Mehdi Abaakouk | EOF |
59 | 6 | Mehdi Abaakouk | chroot $BODI_CHROOT_PATH apt-get purge -y cloud-init* |
60 | 6 | Mehdi Abaakouk | mkdir -p $BODI_CHROOT_PATH/root/.ssh |
61 | 6 | Mehdi Abaakouk | chmod 600 $BODI_CHROOT_PATH/root/.ssh |
62 | 6 | Mehdi Abaakouk | cat >> $BODI_CHROOT_PATH/root/.ssh/authorized_keys <<EOF |
63 | 4 | Mehdi Abaakouk | ssh-dss AAAAB3NzaC1kc3MAAACBAJtnGLvuz4uVD6fnERDxDi/C0UyzwCiKmgNtEessopREYasAX4Gu6Fg10jAyIL5Nuc7YDnqj//pOfxNjD7hp99a2ZmkRQgh/ltClxYML9fqhBHgsUCpVse9nOYDHDnDgvXIPRSDUHat2UFpdchHVrFURNLIlZnBztsr+GCDURTV/AAAAFQD9SrBcH49ltaKOm6V5ssCPmgs1SwAAAIAbAvkQ3/tMzzdACO5B9s5Yb3ZuM7XImm0iqufivVf2Xy39g8HOBulUsN7eKEGPhVriqNolgIO7q7tVgYAff4/NE4yDP0Kp0SPg4tjt2yFJuL31Y3wzwHjnKrjgNlDSLl3uZnRXSipwUMwGKbdHB6NZSqlq192VKbHilQ00pbiMlAAAAIB5dfB1lVHkJ0o5CcaVQRPbca9DvbbRwnoTSmKHc5DUcqsPqDhS07CkM9ZcJuY1Nh4wGl4Q9kArj7Tnsvvygf/HReSUcIk4+nbDytJ8/pca/Qx4fzQQyppa94TylN62LSFT6MIJKLoMwYa0dQURT7Mv5+9Qj2vk5pZ38w2iQ9zVCg== root@h1 |
64 | 1 | Mehdi Abaakouk | EOF |
65 | 4 | Mehdi Abaakouk | |
66 | 10 | Mehdi Abaakouk | sed -i -e 's/^.*Port.*$/Port 2222/' -e 's/^[# ]*PasswordAuthentication.*$/PasswordAuthentication no/' $BODI_CHROOT_PATH/etc/ssh/sshd_config |
67 | 16 | Mehdi Abaakouk | chroot $BODI_CHROOT_PATH dpkg-reconfigure openssh-server |
68 | 16 | Mehdi Abaakouk | |
69 | 14 | Mehdi Abaakouk | echo "T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100" >> $BODI_CHROOT_PATH/etc/inittab |
70 | 16 | Mehdi Abaakouk | |
71 | 14 | Mehdi Abaakouk | |
72 | 1 | Mehdi Abaakouk | $ chmod +x hook.sh |
73 | 7 | Mehdi Abaakouk | </pre> |
74 | 4 | Mehdi Abaakouk | |
75 | 7 | Mehdi Abaakouk | <pre> |
76 | 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 |
77 | 4 | Mehdi Abaakouk | $ mv debian-jessie-7.0.0-3-amd64.raw /openstack.raw |
78 | 4 | Mehdi Abaakouk | $ rm debian-jessie-7.0.0-3-amd64.qcow2 |
79 | 4 | Mehdi Abaakouk | </pre> |
80 | 5 | Mehdi Abaakouk | |
81 | 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_ |
82 | 11 | Mehdi Abaakouk | |
83 | 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. |
84 | 4 | Mehdi Abaakouk | |
85 | 6 | Mehdi Abaakouk | h4. Préparation du réseau |
86 | 4 | Mehdi Abaakouk | |
87 | 4 | Mehdi Abaakouk | <pre> |
88 | 4 | Mehdi Abaakouk | $ ovs-vsctl add-br br-net |
89 | 4 | Mehdi Abaakouk | $ ip link set br-net up |
90 | 4 | Mehdi Abaakouk | $ ovs-vsctl br-set-external-id br-net bridge-id br-net |
91 | 8 | Mehdi Abaakouk | $ ip route add 89.234.156.249/32 dev br-net proto 42 |
92 | 4 | Mehdi Abaakouk | </pre> |
93 | 5 | Mehdi Abaakouk | |
94 | 6 | Mehdi Abaakouk | h4. Installation de la VM |
95 | 4 | Mehdi Abaakouk | |
96 | 4 | Mehdi Abaakouk | <pre> |
97 | 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 |
98 | 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 |
99 | 4 | Mehdi Abaakouk | $ virsh start openstack |
100 | 4 | Mehdi Abaakouk | </pre> |
101 | 4 | Mehdi Abaakouk | |
102 | 4 | Mehdi Abaakouk | h2. Management d'openstack |
103 | 4 | Mehdi Abaakouk | |
104 | 3 | Mehdi Abaakouk | h3. Build and upload debian image: |
105 | 3 | Mehdi Abaakouk | |
106 | 3 | Mehdi Abaakouk | <pre> |
107 | 3 | Mehdi Abaakouk | $ apt-get install openstack-debian-images |
108 | 3 | Mehdi Abaakouk | #NOTE(sileht): temporairement appliquer les patches de au-dessus |
109 | 3 | Mehdi Abaakouk | $ build-openstack-debian-image -m -r jessie -u http://apt.tetaneutral.net/debian/ -s http://apt.tetaneutral.net/debian/ |
110 | 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 |
111 | 1 | Mehdi Abaakouk | </pre> |