2 #placeholder for deployment script.
5 # ./01-deploybundle.sh $opnfvtype $openstack $opnfvlab $opnfvsdn $opnfvfeature $opnfvdistro
7 #copy and download charms
8 cp $4/fetch-charms.sh ./fetch-charms.sh
9 #modify the ubuntu series wants to deploy
10 sed -i -- "s|distro=trusty|distro=$6|g" ./fetch-charms.sh
17 cp $4/juju-deployer/ovs-$4-nonha.yaml ./bundles.yaml
20 cp $4/juju-deployer/ovs-$4-ha.yaml ./bundles.yaml
23 cp $4/juju-deployer/ovs-$4-tip.yaml ./bundles.yaml
25 sed -i -- "s|branch: master|branch: stable/$2|g" ./*.yaml
28 cp $4/juju-deployer/ovs-$4-nonha.yaml ./bundles.yaml
32 #check whether charms are still executing the code even juju-deployer says installed.
36 while [ $retval -eq 0 ]; do
38 juju status > status.txt
39 if [ "$(grep -c "executing" status.txt )" -ge 2 ]; then
40 echo " still executing the reltionship within charms ..."
41 if [ $timeoutiter -ge 60 ]; then
44 timeoutiter=$((timeoutiter+1))
49 echo "...... deployment finishing ......."
52 #read the value from deployment.yaml
53 if [ -e ~/.juju/deployment.yaml ]; then
54 cp ~/.juju/deployment.yaml ./deployment.yaml
55 if [ -e ~/.juju/deployconfig.yaml ]; then
56 cp ~/.juju/deployconfig.yaml ./deployconfig.yaml
57 extport=`grep "ext-port" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //' | tr ',' ' '`
58 sed --i "s@#ext-port: \"eth1\"@ext-port: \"$extport\"@g" ./bundles.yaml
59 datanet=`grep "dataNetwork" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'`
60 if [ "$datanet" != "''" ]; then
61 sed -i -- "s@#os-data-network: 10.4.8.0/21@os-data-network: $datanet@g" ./bundles.yaml
63 admnet=`grep "admNetwork" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'`
64 sed --i "s@10.4.1.1@$admnet@g" ./bundles.yaml
65 cephdisk=`grep "ceph-disk" deployconfig.yaml | cut -d ':' -f 2 | sed -e 's/ //'`
66 sed --i "s@osd-devices: /srv@osd-devices: $cephdisk@g" ./bundles.yaml
67 osdomname=`grep "os-domain-name" deployconfig.yaml | cut -d ':' -f 2 | sed -e 's/ //'`
68 if [ "$osdomname" != "''" ]; then
69 sed --i "s@#use-internal-endpoints: true@use-internal-endpoints: true@g" ./bundles.yaml
70 sed --i "s@#endpoint-type: internalURL@endpoint-type: internalURL@g" ./bundles.yaml
71 sed --i "s@#os-public-hostname: pod.maas@os-public-hostname: api.$osdomname@g" ./bundles.yaml
72 sed --i "s@#console-proxy-ip: pod.maas@console-proxy-ip: $osdomname@g" ./bundles.yaml
79 sed -i -- 's/10.4.1.1/172.16.50.1/g' ./bundles.yaml
80 sed -i -- 's/#ext-port: "eth1"/ext-port: "eth1"/g' ./bundles.yaml
83 sed -i -- 's/#ext-port: "eth1"/ext-port: "eth2"/g' ./bundles.yaml
86 sed -i -- 's/10.4.1.1/192.168.122.1/g' ./bundles.yaml
87 sed -i -- 's/#ext-port: "eth1"/ext-port: "eth1"/g' ./bundles.yaml
91 # lets put the if seperateor as "," as this will save me from world.
95 if [ "$fea" == "" ]; then
102 sed -i -- 's/#prefer-ipv6: true/prefer-ipv6: true/g' ./bundles.yaml
105 sed -i -- 's/#enable-dvr: true/enable-dvr: true/g' ./bundles.yaml
106 sed -i -- 's/#l2-population: true/l2-population: true/g' ./bundles.yaml
109 sed -i -- 's/profile: "openvswitch-odl-Be"/profile: "openvswitch-odl-beryllium-sfc"/g' ./bundles.yaml
112 sed -i -- 's/profile: "openvswitch-odl-Be"/profile: "openvswitch-odl-beryllium-vpn"/g' ./bundles.yaml
115 sed -i -- 's/profile: "openvswitch-odl-Be"/profile: "openvswitch-odl-beryllium-l3"/g' ./bundles.yaml
118 sed -i -- 's/#enable-dpdk: true/enable-dpdk: true/g' ./bundles.yaml
119 sed -i -- 's/#hugepages: "50%"/hugepages: "50%"/g' ./bundles.yaml
122 sed -i -- 's/#- - nova-compute:lxd/- - nova-compute:lxd/g' ./bundles.yaml
123 sed -i -- 's/#- lxd:lxd/- lxd:lxd/g' ./bundles.yaml
124 sed -i -- 's/#virt-type: lxd/virt-type: lxd/g' ./bundles.yaml
125 # adding the lxd subordinate charm
126 echo " lxd:" >> ./bundles.yaml
127 echo " charm: local:xenial/lxd" >> ./bundles.yaml
132 #changing the target to the openstack release we want to deploy.
133 sed -i -- "s|mitaka|$2|g" ./bundles.yaml
135 #update source if trusty is target distribution
138 sed -i -- "s|#source|source|g" ./bundles.yaml
139 sed -i -- "s|#source-branch:|source-branch:|g" ./bundles.yaml
142 #changing the target to the ubuntu distro we want to deploy.
143 sed -i -- "s|trusty|$6|g" ./bundles.yaml
147 if [ "$osdomname" != "''" ]; then
148 var=os-$4-$fea-$1-publicapi
153 #lets generate the bundle for all target using genBundle.py
154 python genBundle.py -l deployconfig.yaml -s $var > bundles.yaml
156 echo "... Deployment Started ...."
157 juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml $6-"$2"-nodes
158 juju ssh nodes/0 "echo 512 | sudo tee /proc/sys/fs/inotify/max_user_instances"
159 juju ssh nodes/1 "echo 512 | sudo tee /proc/sys/fs/inotify/max_user_instances"
160 juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml $6-"$2"