#placeholder for deployment script.
set -ex
+virtinstall=0
+
case "$1" in
'intelpod5' )
cp maas/intel/pod5/deployment.yaml ./deployment.yaml
cp maas/juniper/pod1/deployment.yaml ./deployment.yaml
;;
* )
+ virtinstall=1
cp maas/default/deployment.yaml ./deployment.yaml
;;
esac
juju init -f
cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
+
+if [ $virtinstall ]; then
+ sudo virsh net-dumpxml default > default-net-org.xml
+ sudo sed -i '/dhcp/d' default-net-org.xml
+ sudo sed -i '/range/d' default-net-org.xml
+ sudo virsh net-define default-net-org.xml
+ sudo virsh net-destroy default
+ sudo virsh net-start default
+fi
+
sudo maas-deployer -c deployment.yaml -d --force
sudo chown $USER:$USER environments.yaml
#maas maas boot-source-selections create 1 os="ubuntu" release="precise" arches="amd64" subarches="*" labels="*"
maas maas boot-resources import
maas maas sshkeys new key="`cat $HOME/.ssh/id_rsa.pub`"
-#maas maas sshkeys new key="`cat $HOME/.ssh/id_maas.pub`"
+
+#adding compute and control nodes VM to MAAS for deployment purpose.
+if [ $virtinstall ]; then
+ # create two more VMs to do the deployment.
+ sudo virt-install --connect qemu:///system --name node1-control --ram 8192 --vcpus 4 --disk size=120,format=qcow2,bus=virtio,io=native,pool=default --network bridge=virbr0,model=virtio --boot network,hd,menu=off --noautoconsole --vnc --print-xml | tee node1-control
+
+ sudo virt-install --connect qemu:///system --name node2-compute --ram 8192 --vcpus 4 --disk size=120,format=qcow2,bus=virtio,io=native,pool=default --network bridge=virbr0,model=virtio --boot network,hd,menu=off --noautoconsole --vnc --print-xml | tee node2-compute
+
+ node1controlmac=`grep "mac address" node1-control | cut -d "'" -f 2`
+ node2computemac=`grep "mac address" node2-compute | cut -d "'" -f 2`
+
+ sudo virsh -c qemu:///system define --file node1-control
+ sudo virsh -c qemu:///system define --file node2-compute
+
+ maas maas tags new name='control'
+ maas maas tags new name='compute'
+
+ controlnodeid=`maas maas nodes new autodetect_nodegroup='yes' name='node1-control' tags='control' hostname='node1-control' power_type='virsh' mac_addresses=$node1controlmac power_parameters_power_address='qemu+ssh://ubuntu@192.168.122.1/system' architecture='amd64/generic' power_parameters_power_id='node1-control' | grep system_id | cut -d '"' -f 4 `
+
+ maas maas tag update-nodes control add=$controlnodeid
+
+ computenodeid=`maas maas nodes new autodetect_nodegroup='yes' name='node2-compute' tags='compute' hostname='node2-compute' power_type='virsh' mac_addresses=$node2computemac power_parameters_power_address='qemu+ssh://ubuntu@192.168.122.1/system' architecture='amd64/generic' power_parameters_power_id='node2-compute' | grep system_id | cut -d '"' -f 4 `
+
+ maas maas tag update-nodes compute add=$computenodeid
+
+fi
#echo "... Deployment of opnfv release Started ...."
#python deploy.py $maas_ip
-#echo "... Deployment of opnfv release finished ...."
cp maas/att/virpod1/interfaces.host trusty/ubuntu-nodes-compute/network/interfaces.host
cp maas/att/virpod1/lxc-add-more-interfaces trusty/ubuntu-nodes-controller/lxc/add-more-interfaces
cp maas/att/virpod1/lxc-add-more-interfaces trusty/ubuntu-nodes-compute/lxc/add-more-interfaces
+ # As virtual environment does not need special treatment for interfaces.
+ sed -i -- 's/local:trusty\/ubuntu-nodes-controller/cs:trusty\/ubuntu/g' ./bundles.yaml
+ sed -i -- 's/local:trusty\/ubuntu-nodes-compute/cs:trusty\/ubuntu/g' ./bundles.yaml
# As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20
sed -i -- 's/10.4.1.1/192.168.10.1/g' ./bundles.yaml
# Choose the external port to go out from gateway to use.
sed -i -- 's/# "ext-port": "eth1"/ "ext-port": "eth1"/g' ./bundles.yaml
;;
+ 'default' )
+ sed -i -- 's/local:trusty\/ubuntu-nodes-controller/cs:trusty\/ubuntu/g' ./bundles.yaml
+ sed -i -- 's/local:trusty\/ubuntu-nodes-compute/cs:trusty\/ubuntu/g' ./bundles.yaml
+ sed -i -- 's/10.4.1.1/192.168.122.1/g' ./bundles.yaml
+# sed -i -- 's/# "ext-port": "eth1"/ "ext-port": "eth1"/g' ./bundles.yaml
+ ;;
esac
echo "... Deployment Started ...."
cp maas/att/virpod1/lxc-add-more-interfaces trusty/ubuntu-nodes-controller/lxc/add-more-interfaces
cp maas/att/virpod1/lxc-add-more-interfaces trusty/ubuntu-nodes-compute/lxc/add-more-interfaces
# As virtual environment does not need special treatment for interfaces.
- sed -i -- 's/ubuntu-nodes-controller/ubuntu/g' ./bundles.yaml
- sed -i -- 's/ubuntu-nodes-compute/ubuntu/g' ./bundles.yaml
+ sed -i -- 's/local:trusty\/ubuntu-nodes-controller/cs:trusty\/ubuntu/g' ./bundles.yaml
+ sed -i -- 's/local:trusty\/ubuntu-nodes-compute/cs:trusty\/ubuntu/g' ./bundles.yaml
# As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20
sed -i -- 's/10.4.1.1/192.168.10.1/g' ./bundles.yaml
# Choose the external port to go out from gateway to use.
sed -i -- 's/# "ext-port": "eth1"/ "ext-port": "eth1"/g' ./bundles.yaml
;;
+ 'default' )
+ sed -i -- 's/local:trusty\/ubuntu-nodes-controller/cs:trusty\/ubuntu/g' ./bundles.yaml
+ sed -i -- 's/local:trusty\/ubuntu-nodes-compute/cs:trusty\/ubuntu/g' ./bundles.yaml
+ sed -i -- 's/10.4.1.1/192.168.122.1/g' ./bundles.yaml
+# sed -i -- 's/# "ext-port": "eth1"/ "ext-port": "eth1"/g' ./bundles.yaml
+ ;;
esac
echo "... Deployment Started ...."
cp maas/att/virpod1/interfaces.host trusty/ubuntu-nodes-compute/network/interfaces.host
cp maas/att/virpod1/lxc-add-more-interfaces trusty/ubuntu-nodes-controller/lxc/add-more-interfaces
cp maas/att/virpod1/lxc-add-more-interfaces trusty/ubuntu-nodes-compute/lxc/add-more-interfaces
+ # As virtual environment does not need special treatment for interfaces.
+ sed -i -- 's/local:trusty\/ubuntu-nodes-controller/cs:trusty\/ubuntu/g' ./bundles.yaml
+ sed -i -- 's/local:trusty\/ubuntu-nodes-compute/cs:trusty\/ubuntu/g' ./bundles.yaml
# As per your lab vip address list be deafult uses 10.4.1.11 - 10.4.1.20
sed -i -- 's/10.4.1.1/192.168.10.1/g' ./bundles.yaml
# Choose the external port to go out from gateway to use.
sed -i -- 's/# "ext-port": "eth1"/ "ext-port": "eth1"/g' ./bundles.yaml
;;
+ 'default' )
+ sed -i -- 's/local:trusty\/ubuntu-nodes-controller/cs:trusty\/ubuntu/g' ./bundles.yaml
+ sed -i -- 's/local:trusty\/ubuntu-nodes-compute/cs:trusty\/ubuntu/g' ./bundles.yaml
+ sed -i -- 's/10.4.1.1/192.168.122.1/g' ./bundles.yaml
+# sed -i -- 's/# "ext-port": "eth1"/ "ext-port": "eth1"/g' ./bundles.yaml
+ ;;
+
esac
echo "... Deployment Started ...."