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 status=`juju action do heat/0 domain-setup`
51 echo "...... deployment finishing ......."
54 #read the value from deployment.yaml
55 if [ -e ~/.juju/deployment.yaml ]; then
56 cp ~/.juju/deployment.yaml ./deployment.yaml
57 if [ -e ~/.juju/deployconfig.yaml ]; then
58 cp ~/.juju/deployconfig.yaml ./deployconfig.yaml
59 extport=`grep "ext-port" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //' | tr ',' ' '`
60 sed --i "s@#ext-port: \"eth1\"@ext-port: \"$extport\"@g" ./bundles.yaml
61 datanet=`grep "dataNetwork" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'`
62 if [ "$datanet" != "''" ]; then
63 sed -i -- "s@#os-data-network: 10.4.8.0/21@os-data-network: $datanet@g" ./bundles.yaml
65 admnet=`grep "admNetwork" deployconfig.yaml | cut -d ' ' -f 4 | sed -e 's/ //'`
66 sed --i "s@10.4.1.1@$admnet@g" ./bundles.yaml
67 cephdisk=`grep "ceph-disk" deployconfig.yaml | cut -d ':' -f 2 | sed -e 's/ //'`
68 sed --i "s@osd-devices: /srv@osd-devices: $cephdisk@g" ./bundles.yaml
69 osdomname=`grep "os-domain-name" deployconfig.yaml | cut -d ':' -f 2 | sed -e 's/ //'`
70 if [ "$osdomname" != "''" ]; then
71 sed --i "s@#use-internal-endpoints: true@use-internal-endpoints: true@g" ./bundles.yaml
72 sed --i "s@#endpoint-type: internalURL@endpoint-type: internalURL@g" ./bundles.yaml
73 sed --i "s@#os-public-hostname: pod.maas@os-public-hostname: api.$osdomname@g" ./bundles.yaml
74 sed --i "s@#console-proxy-ip: pod.maas@console-proxy-ip: $osdomname@g" ./bundles.yaml
81 sed -i -- 's/10.4.1.1/172.16.50.1/g' ./bundles.yaml
82 sed -i -- 's/#ext-port: "eth1"/ext-port: "eth1"/g' ./bundles.yaml
85 sed -i -- 's/#ext-port: "eth1"/ext-port: "eth2"/g' ./bundles.yaml
88 sed -i -- 's/10.4.1.1/192.168.122.1/g' ./bundles.yaml
89 sed -i -- 's/#ext-port: "eth1"/ext-port: "eth1"/g' ./bundles.yaml
93 # lets put the if seperateor as "," as this will save me from world.
97 if [ "$fea" == "" ]; then
104 sed -i -- 's/#prefer-ipv6: true/prefer-ipv6: true/g' ./bundles.yaml
107 sed -i -- 's/#enable-dvr: true/enable-dvr: true/g' ./bundles.yaml
108 sed -i -- 's/#l2-population: true/l2-population: true/g' ./bundles.yaml
111 sed -i -- 's/profile: "openvswitch-odl-Be"/profile: "openvswitch-odl-beryllium-sfc"/g' ./bundles.yaml
114 sed -i -- 's/profile: "openvswitch-odl-Be"/profile: "openvswitch-odl-beryllium-vpn"/g' ./bundles.yaml
117 sed -i -- 's/profile: "openvswitch-odl-Be"/profile: "openvswitch-odl-beryllium-l3"/g' ./bundles.yaml
120 sed -i -- 's/#enable-dpdk: true/enable-dpdk: true/g' ./bundles.yaml
121 sed -i -- 's/#hugepages: "50%"/hugepages: "50%"/g' ./bundles.yaml
124 sed -i -- 's/#- - nova-compute:lxd/- - nova-compute:lxd/g' ./bundles.yaml
125 sed -i -- 's/#- lxd:lxd/- lxd:lxd/g' ./bundles.yaml
126 sed -i -- 's/#virt-type: lxd/virt-type: lxd/g' ./bundles.yaml
127 # adding the lxd subordinate charm
128 echo " lxd:" >> ./bundles.yaml
129 echo " charm: local:xenial/lxd" >> ./bundles.yaml
134 #changing the target to the openstack release we want to deploy.
135 sed -i -- "s|mitaka|$2|g" ./bundles.yaml
137 #update source if trusty is target distribution
140 sed -i -- "s|#source|source|g" ./bundles.yaml
141 sed -i -- "s|#source-branch:|source-branch:|g" ./bundles.yaml
144 #changing the target to the ubuntu distro we want to deploy.
145 sed -i -- "s|trusty|$6|g" ./bundles.yaml
149 if [ "$osdomname" != "''" ]; then
150 var=os-$4-$fea-$1-publicapi
155 if [ "$4" != "nosdn" ]; then
156 python genBundle.py -l deployconfig.yaml -s $var > bundles.yaml
157 elif [ "$4" == "odl" ]; then
158 python genBundle.py -l deployconfig.yaml -s $var > bundles.yaml
159 elif [ "$4" == "onos" ]; then
160 python genBundle.py -l deployconfig.yaml -s $var > bundles.yaml
163 echo "... Deployment Started ...."
164 juju-deployer -vW -d -t 3600 -c bundles.yaml $6-"$2"-nodes
167 juju ssh nodes/0 "echo 512 | sudo tee /proc/sys/fs/inotify/max_user_instances"
169 juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml $6-"$2"