diff options
author | Guo Ruijing <ruijing.guo@intel.com> | 2017-05-10 15:05:30 -0700 |
---|---|---|
committer | Guo Ruijing <ruijing.guo@intel.com> | 2017-05-13 00:32:18 +0800 |
commit | 5a14ee34314b6d500c63dc19523ee4748734c8c0 (patch) | |
tree | 4f82b4514f9ab5517372916372a1227d31b9f61e /vagrant/create_onap.sh | |
parent | 62e3159bb6e3f90e2ad53b8da39a7ea34c819b4f (diff) |
setup onap demo by vagrant
Change-Id: I7d46f7f6081e7aed0cc2ea2506a47925171f9be2
Co-Authored-By: Chen, Wei <wei.d.chen@intel.com>
Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
Diffstat (limited to 'vagrant/create_onap.sh')
-rwxr-xr-x | vagrant/create_onap.sh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/vagrant/create_onap.sh b/vagrant/create_onap.sh new file mode 100755 index 00000000..e201d500 --- /dev/null +++ b/vagrant/create_onap.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +set -ex + +source /vagrant/openrc +cp /demo/heat/OpenECOMP/* . + +# Parameters used across all ONAP components +pub_net=$(openstack network list -f value|grep public | cut -f1 -d' ') +sed -i "s/public_net_id:.*/public_net_id: $pub_net/" onap_openstack.env +sed -i "s/ubuntu_1404_image:.*/ubuntu_1404_image: ubuntu1404/" onap_openstack.env +sed -i "s/ubuntu_1604_image:.*/ubuntu_1604_image: ubuntu1604/" onap_openstack.env +sed -i "s/flavor_small:.*/flavor_small: m1.small/" onap_openstack.env +sed -i "s/flavor_medium:.*/flavor_medium: m1.medium/" onap_openstack.env +sed -i "s/flavor_large:.*/flavor_large: m1.large/" onap_openstack.env +sed -i "s/flavor_xlarge:.*/flavor_xlarge: m1.xlarge/" onap_openstack.env +rm -rf onap onap.pub +ssh-keygen -t rsa -N '' -f onap +cp onap onap.pub /vagrant +pub_key=$(cat onap.pub) +sed -i "s,pub_key:.*,pub_key: $pub_key," onap_openstack.env +tenant=$(openstack project list -f value | grep " admin" | cut -f1 -d' ') +sed -i "s/openstack_tenant_id:.*/openstack_tenant_id: $tenant/" onap_openstack.env +sed -i "s/openstack_username:.*/openstack_username: admin/" onap_openstack.env +sed -i "s/openstack_api_key:.*/openstack_api_key: apikey/" onap_openstack.env +sed -i "s,horizon_url:.*,horizon_url: http://192.168.0.10/dashboard," onap_openstack.env +sed -i "s,keystone_url:.*,keystone_url: http://192.168.0.10/identity/," onap_openstack.env + +# Network parameters +sed -i "s/external_dns:.*/external_dns: 8.8.8.8/" onap_openstack.env + +openstack stack create -t onap_openstack.yaml -e onap_openstack.env ONAP + +sleep 180 +vms=$(grep "_vm:" onap_openstack.yaml | cut -f1 -d"_") +sudo rm -rf /vagrant/hosts +for vm in $vms +do + ip=$(openstack server list --name $vm -f yaml | grep Networks | cut -f2 -d",") + echo "$ip $vm.api.simpledemo.openecomp.org" >> /vagrant/hosts +done |