5 #need to put mutiple cases here where decide this bundle to deploy by default use the odl bundle.
6 # Below parameters are the default and we can according the release
18 opnfvrel=`grep release: deploy.yaml | cut -d ":" -f2`
19 openstack=`grep openstack: deploy.yaml | cut -d ":" -f2`
20 opnfvtype=`grep type: deploy.yaml | cut -d ":" -f2`
21 opnfvlab=`grep lab: deploy.yaml | cut -d ":" -f2`
22 opnfvsdn=`grep sdn: deploy.yaml | cut -d ":" -f2`
25 usage() { echo "Usage: $0 [-s <nosdn|odl|opencontrail>]
28 [-l <default|intelpod5>]
29 [-f <ipv6,dpdk,lxd,dvr>]
32 [-r <a|b>]" 1>&2 exit 1; }
34 while getopts ":s:t:o:l:h:r:f:d:a:" opt; do
52 opnfvfeature=${OPTARG}
68 #by default maas creates two VMs in case of three more VM needed.
70 maas_ip=`grep " ip_address" deployment.yaml | cut -d " " -f 10`
71 apikey=`grep maas-oauth: environments.yaml | cut -d "'" -f 2`
72 maas login maas http://${maas_ip}/MAAS/api/1.0 ${apikey}
74 nodeexist=`maas maas nodes list hostname=node3-control`
76 if [ $nodeexist != *node3* ]; then
77 sudo virt-install --connect qemu:///system --name node3-control --ram 8192 --vcpus 4 --disk size=120,format=qcow2,bus=virtio,io=native,pool=default --network bridge=virbr0,model=virtio --network bridge=virbr0,model=virtio --boot network,hd,menu=off --noautoconsole --vnc --print-xml | tee node3-control
79 sudo virt-install --connect qemu:///system --name node4-control --ram 8192 --vcpus 4 --disk size=120,format=qcow2,bus=virtio,io=native,pool=default --network bridge=virbr0,model=virtio --network bridge=virbr0,model=virtio --boot network,hd,menu=off --noautoconsole --vnc --print-xml | tee node4-control
81 node3controlmac=`grep "mac address" node3-control | head -1 | cut -d "'" -f 2`
82 node4controlmac=`grep "mac address" node4-control | head -1 | cut -d "'" -f 2`
84 sudo virsh -c qemu:///system define --file node3-control
85 sudo virsh -c qemu:///system define --file node4-control
87 controlnodeid=`maas maas nodes new autodetect_nodegroup='yes' name='node3-control' tags='control' hostname='node3-control' power_type='virsh' mac_addresses=$node3controlmac power_parameters_power_address='qemu+ssh://'$USER'@192.168.122.1/system' architecture='amd64/generic' power_parameters_power_id='node3-control' | grep system_id | cut -d '"' -f 4 `
89 maas maas tag update-nodes control add=$controlnodeid
91 controlnodeid=`maas maas nodes new autodetect_nodegroup='yes' name='node4-control' tags='control' hostname='node4-control' power_type='virsh' mac_addresses=$node4controlmac power_parameters_power_address='qemu+ssh://'$USER'@192.168.122.1/system' architecture='amd64/generic' power_parameters_power_id='node4-control' | grep system_id | cut -d '"' -f 4 `
93 maas maas tag update-nodes control add=$controlnodeid
98 #copy the files and create extra resources needed for HA deployment
99 # in case of default VM labs.
102 if [ ! -f ./environments.yaml ] && [ -e ~/.juju/environments.yaml ]; then
103 cp ~/.juju/environments.yaml ./environments.yaml
104 elif [ ! -f ./environments.yaml ] && [ -e ~/joid_config/environments.yaml ]; then
105 cp ~/joid_config/environments.yaml ./environments.yaml
107 if [ ! -f ./deployment.yaml ] && [ -e ~/.juju/deployment.yaml ]; then
108 cp ~/.juju/deployment.yaml ./deployment.yaml
109 elif [ ! -f ./deployment.yaml ] && [ -e ~/joid_config/deployment.yaml ]; then
110 cp ~/joid_config/deployment.yaml ./deployment.yaml
112 if [ ! -f ./labconfig.yaml ] && [ -e ~/.juju/labconfig.yaml ]; then
113 cp ~/.juju/labconfig.yaml ./labconfig.yaml
114 elif [ ! -f ./labconfig.yaml ] && [ -e ~/joid_config/labconfig.yaml ]; then
115 cp ~/joid_config/labconfig.yaml ./labconfig.yaml
117 if [ ! -f ./deployconfig.yaml ] && [ -e ~/.juju/deployconfig.yaml ]; then
118 cp ~/.juju/deployconfig.yaml ./deployconfig.yaml
119 elif [ ! -f ./deployconfig.yaml ] && [ -e ~/joid_config/deployconfig.yaml ]; then
120 cp ~/joid_config/deployconfig.yaml ./deployconfig.yaml
123 #copy the script which needs to get deployed as part of ofnfv release
124 echo "...... deploying now ......"
125 echo " " >> environments.yaml
126 echo " enable-os-refresh-update: false" >> environments.yaml
127 echo " enable-os-upgrade: false" >> environments.yaml
128 echo " admin-secret: admin" >> environments.yaml
129 echo " default-series: $opnfvdistro" >> environments.yaml
131 cp environments.yaml ~/.juju/
132 cp environments.yaml ~/joid_config/
134 if [[ "$opnfvtype" = "ha" && "$opnfvlab" = "default" ]]; then
141 #case default deploy the opnfv platform:
142 ./02-deploybundle.sh $opnfvtype $openstack $opnfvlab $opnfvsdn $opnfvfeature $opnfvdistro
145 #check whether charms are still executing the code even juju-deployer says installed.
149 while [ $retval -eq 0 ]; do
151 juju status > status.txt
152 if [ "$(grep -c "executing" status.txt )" -ge 1 ]; then
153 echo " still executing the reltionship within charms ..."
154 if [ $timeoutiter -ge 120 ]; then
157 timeoutiter=$((timeoutiter+1))
163 juju expose ceph-radosgw
164 #juju ssh ceph/0 \ 'sudo radosgw-admin user create --uid="ubuntu" --display-name="Ubuntu Ceph"'
166 echo "...... deployment finishing ......."
169 echo "...... deployment started ......"
174 echo "...... deployment finished ......."
176 ./openstack.sh "$opnfvsdn" "$opnfvlab" "$opnfvdistro" "$openstack" || true
178 # creating heat domain after puching the public API into /etc/hosts
179 status=`juju action do heat/0 domain-setup`
182 sudo ../juju/get-cloud-images || true
183 ../juju/joid-configure-openstack || true
185 echo "...... finished ......."