4 sudo apt-get install -y python-openstackclient python-heatclient
9 # Parameters used across all ONAP components
10 pub_net=$(openstack network list -f value|grep public | cut -f1 -d' ')
11 sed -i "s/public_net_id:.*/public_net_id: $pub_net/" onap_openstack.env
12 sed -i "s/ubuntu_1404_image:.*/ubuntu_1404_image: ubuntu1404/" onap_openstack.env
13 sed -i "s/ubuntu_1604_image:.*/ubuntu_1604_image: ubuntu1604/" onap_openstack.env
14 sed -i "s/flavor_small:.*/flavor_small: m1.small/" onap_openstack.env
15 sed -i "s/flavor_medium:.*/flavor_medium: m1.medium/" onap_openstack.env
16 sed -i "s/flavor_large:.*/flavor_large: m1.large/" onap_openstack.env
17 sed -i "s/flavor_xlarge:.*/flavor_xlarge: m1.xlarge/" onap_openstack.env
19 ssh-keygen -t rsa -N '' -f onap
20 cp onap onap.pub /vagrant
21 pub_key=$(cat onap.pub)
22 sed -i "s,pub_key:.*,pub_key: $pub_key," onap_openstack.env
23 tenant=$(openstack project list -f value | grep " admin" | cut -f1 -d' ')
24 sed -i "s/openstack_tenant_id:.*/openstack_tenant_id: $tenant/" onap_openstack.env
25 sed -i "s/openstack_username:.*/openstack_username: admin/" onap_openstack.env
26 sed -i "s/openstack_api_key:.*/openstack_api_key: apikey/" onap_openstack.env
27 sed -i "s,horizon_url:.*,horizon_url: http://192.168.0.10/dashboard," onap_openstack.env
28 sed -i "s,keystone_url:.*,keystone_url: http://192.168.0.10/identity/," onap_openstack.env
31 sed -i "s/dns_list:.*/dns_list: 8.8.8.8/" onap_openstack.env
32 sed -i "s/external_dns:.*/external_dns: 8.8.8.8/" onap_openstack.env
34 openstack stack delete --yes --wait ONAP || true
35 openstack stack create -t onap_openstack.yaml -e onap_openstack.env ONAP
38 sudo sed -i "/.*simpledemo.openecomp.org.*/d" /etc/hosts
39 vms=$(grep "_vm:" onap_openstack.yaml | cut -f1 -d"_")
42 ip=$(openstack server list --name $vm -f yaml | grep Networks | cut -f2 -d",")
43 echo "$ip $vm.api.simpledemo.openecomp.org" | sudo tee -a /etc/hosts
45 ssh -o StrictHostKeyChecking=no ubuntu@portal.api.simpledemo.openecomp.org -i onap "curl sina.com.cn"