X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=ci%2Fopenstack.sh;h=2e1eb9e1074116937c060381d7e65e18d686a1c2;hb=2ead372983bbb1fb9f258c638d1d559a4f28c53f;hp=6ccea248c5c5e10f67a09d4af4fddfa046661ea5;hpb=6bc61ee14197bfb8faaf149c84b457485b5b8c11;p=joid.git diff --git a/ci/openstack.sh b/ci/openstack.sh index 6ccea248..2e1eb9e1 100755 --- a/ci/openstack.sh +++ b/ci/openstack.sh @@ -7,6 +7,13 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +#./openstack.sh "$opnfvsdn" "$opnfvlab" "$opnfvdistro" "$openstack" || true + +opnfvsdn=$1 +opnfvlab=$2 +opnfvdistro=$3 +opnfvos=$4 + if [ -f ./deployconfig.yaml ];then EXTERNAL_NETWORK=`grep floating-ip-range deployconfig.yaml | cut -d ' ' -f 4 ` @@ -68,7 +75,7 @@ create_openrc() { } configOpenrc() { -if [ "$API_FQDN" != "''" ]; then +if [ "$API_FQDN" != "None" ]; then cat <<-EOF export OS_USERNAME=$1 export OS_PASSWORD=$2 @@ -94,7 +101,7 @@ EOF fi } -if [ "$API_FQDN" != "''" ]; then +if [ "$API_FQDN" != "None" ]; then # Push api fqdn local ip to all /etc/hosts API_FQDN=$(juju get keystone | python -c "import yaml; import sys;\ print yaml.load(sys.stdin)['settings']['os-public-hostname']['value']") @@ -122,6 +129,21 @@ create_openrc . ./cloud/admin-openrc +echo "...... deploy public api proxy ......" + +if [ "$opnfvlab" == "orangepod1" ] && [ "$opnfvsdn" == "nosdn" ]; then # only for first test phase + if [ -e ./labconfig.yaml ]; then + PUB_API_NET=$(grep floating-ip-range ./labconfig.yaml |cut -d/ -f2) + PUB_API_IP=$(grep public-api-ip ./labconfig.yaml |cut -d: -f2) + juju run --unit nodes/0 "sudo ip a a ${PUB_API_IP}/${PUB_API_NET} dev br-ex" || true + juju run --unit nodes/0 "sudo ip l set dev br-ex up" || true + python genPublicAPIProxyBundle.py -l labconfig.yaml >> bundles.yaml + juju-deployer -vW -d -t 7200 -r 5 -c bundles.yaml $opnfvdistro-"$opnfvos" || true + fi +fi + +echo "...... deploy end public api proxy ......" + ## ## removing the swift API endpoint which is created by radosgw. ## one option is not to used radosgw and other one is remove endpoint. @@ -137,20 +159,28 @@ create_openrc ## Create external subnet Network ## -#neutron net-create ext-net --shared --router:external=True -neutron net-show ext-net > /dev/null 2>&1 || neutron net-create ext-net --router:external=True - -if [ "onos" == "$1" ]; then +if [ "onos" == "$opnfvsdn" ]; then launch_eth + neutron net-show ext-net > /dev/null 2>&1 || neutron net-create ext-net --router:external=True neutron subnet-show ext-subnet > /dev/null 2>&1 || neutron subnet-create ext-net \ --name ext-subnet --allocation-pool start=$EXTNET_FIP,end=$EXTNET_LIP \ - --disable-dhcp --gateway $EXTNET_GW --dns-nameserver 8.8.8.8 $EXTNET_NET + --disable-dhcp --gateway $EXTNET_GW $EXTNET_NET #neutron subnet-create ext-net --name ext-subnet $EXTNET_NET #update_gw_mac +elif [ "nosdn" == "$opnfvsdn" ]; then + neutron net-show ext-net > /dev/null 2>&1 || neutron net-create ext-net \ + --router:external=True \ + --provider:network_type flat \ + --provider:physical_network external + + neutron subnet-show ext-subnet > /dev/null 2>&1 || neutron subnet-create ext-net \ + --name ext-subnet --allocation-pool start=$EXTNET_FIP,end=$EXTNET_LIP \ + --disable-dhcp --gateway $EXTNET_GW $EXTNET_NET else + neutron net-show ext-net > /dev/null 2>&1 || neutron net-create ext-net --router:external=True neutron subnet-show ext-subnet > /dev/null 2>&1 || neutron subnet-create ext-net \ --name ext-subnet --allocation-pool start=$EXTNET_FIP,end=$EXTNET_LIP \ - --disable-dhcp --gateway $EXTNET_GW --dns-nameserver 8.8.8.8 $EXTNET_NET + --disable-dhcp --gateway $EXTNET_GW $EXTNET_NET fi