merged master
diff --git a/README.md b/README.md
index 9b86cba..63260de 100644
--- a/README.md
+++ b/README.md
@@ -73,16 +73,18 @@
## How to install a single-node CORD test environment on CloudLab
-The process for setting up a CORD test environment on CloudLab is similar (but
-not identical) to the one for setting up a CORD POD above.
+Setting up a single-node CORD environment is simple.
-* Start a CloudLab experiment using profile *OnePC-Ubuntu14.04.4*
-* Run the `bootstrap.sh` script to install Ansible and set up keys for login via `localhost`
-* Run:
-```
-ansible-playbook -i cord-test-hosts cord-setup.yml
-```
-As mentioned above, be patient! With a fast Internet connection, the entire process will take about
+* Start a CloudLab experiment using profile *OnePC-Ubuntu14.04.4* and login to the node
+* `wget https://raw.githubusercontent.com/open-cloud/openstack-cluster-setup/master/scripts/single-node-pod.sh`
+* `bash single-node-pod.sh [-t] [-e]`
+ * With no options, the script installs the OpenStack services and a simulated fabric. It creates VMs for
+ XOS and ONOS but does not start these services.
+ * Adding the `-t` option will start XOS, bring up a vSG, install a test client, and run a simple E2E test.
+ * Adding the `-e` option will add the [ExampleService](http://guide.xosproject.org/devguide/exampleservice/)
+ to XOS (and test it if `-t` is also specified).
+
+As mentioned above, be patient! With a fast Internet connection, the entire process will take at least
one hour to complete.
The install will bring up various OpenStack services, including Neutron with the VTN plugin. It will also create
diff --git a/cord-setup.yml b/cord-setup.yml
index a1cd437..994fc41 100644
--- a/cord-setup.yml
+++ b/cord-setup.yml
@@ -209,8 +209,12 @@
- name: Copy cord.yaml bundle
template: src=templates/cord.yaml dest={{ ansible_env['PWD'] }}/cord.yaml
+ - name: Update root certificate database
+ sudo: yes
+ command: update-ca-certificates
+
- name: Deploy OpenStack services with Juju
- shell: juju quickstart cord.yaml
+ shell: juju quickstart --no-browser cord.yaml
- hosts: head
sudo: no
diff --git a/files/tmp/set-up-xos.yml b/files/tmp/set-up-xos.yml
index eb296b7..e729d8b 100644
--- a/files/tmp/set-up-xos.yml
+++ b/files/tmp/set-up-xos.yml
@@ -42,5 +42,5 @@
- file: path={{ ansible_env['PWD'] }}/xos/xos/configurations/cord-pod/images
state=directory
- - get_url: url=http://www.vicci.org/opencloud/trusty-server-cloudimg-amd64-disk1.img
+ - get_url: url=http://128.112.139.30/opencloud/trusty-server-cloudimg-amd64-disk1.img
dest={{ ansible_env['PWD'] }}/xos/xos/configurations/cord-pod/images/trusty-server-multi-nic.img
diff --git a/scripts/create-vms-cord.sh b/scripts/create-vms-cord.sh
index 10c69d8..a0af3ed 100755
--- a/scripts/create-vms-cord.sh
+++ b/scripts/create-vms-cord.sh
@@ -27,9 +27,9 @@
if $TESTING
then
# Don't use mgmtbr for testing
- uvt-kvm create $NAME --cpu=$CPU --memory=$MEM_MB --disk=$DISK_GB
+ uvt-kvm create $NAME release=trusty --cpu=$CPU --memory=$MEM_MB --disk=$DISK_GB
else
- uvt-kvm create $NAME --cpu=$CPU --memory=$MEM_MB --disk=$DISK_GB --bridge mgmtbr
+ uvt-kvm create $NAME release=trusty --cpu=$CPU --memory=$MEM_MB --disk=$DISK_GB --bridge mgmtbr
fi
# uvt-kvm wait --insecure $NAME
fi
diff --git a/scripts/create-vms.sh b/scripts/create-vms.sh
index dba3099..1f1c789 100755
--- a/scripts/create-vms.sh
+++ b/scripts/create-vms.sh
@@ -8,7 +8,7 @@
uvt-kvm list | grep $1
if [ "$?" -ne "0" ]
then
- uvt-kvm create $NAME --cpu=$CPU --memory=$MEM_MB --disk=$DISK_GB
+ uvt-kvm create $NAME release=trusty --cpu=$CPU --memory=$MEM_MB --disk=$DISK_GB
uvt-kvm wait --insecure $NAME
fi
}
diff --git a/scripts/single-node-pod.sh b/scripts/single-node-pod.sh
index 39777f7..1457f3c 100755
--- a/scripts/single-node-pod.sh
+++ b/scripts/single-node-pod.sh
@@ -1,10 +1,10 @@
-#!/bin/bash
+#!/usr/bin/env bash
function cleanup_from_previous_test() {
VMS=$( sudo virsh list|grep running|awk '{print $2}' )
for VM in $VMS
do
- sudo uvt-kvm destroy $VM
+ sudo uvt-kvm destroy $VM
done
rm -rf ~/.juju
@@ -52,9 +52,9 @@
i=0
until juju status --format=summary|grep "started: 22" > /dev/null
do
- sleep 60
- (( i += 1 ))
- echo "Waited $i minutes"
+ sleep 60
+ (( i += 1 ))
+ echo "Waited $i minutes"
done
echo "All OpenStack services are up."
@@ -64,6 +64,24 @@
echo ""
echo "Setting up simulated fabric on nova-compute node"
ssh ubuntu@nova-compute.cordtest.opencloud.us "wget https://raw.githubusercontent.com/open-cloud/openstack-cluster-setup/master/scripts/compute-ext-net.sh; sudo bash compute-ext-net.sh"
+
+ if [[ $EXAMPLESERVICE -eq 1 ]]
+ then
+ SCRIPT=compute-ext-net-tutorial.sh
+ else
+ SCRIPT=compute-ext-net.sh
+ fi
+ ssh ubuntu@nova-compute "wget https://raw.githubusercontent.com/open-cloud/openstack-cluster-setup/master/scripts/$SCRIPT; sudo bash $SCRIPT"
+}
+
+function build_xos_with_exampleservice() {
+ echo ""
+ echo "Adding exampleservice to XOS"
+ ssh ubuntu@xos "cd xos; git config --global user.email 'ubuntu@localhost'; git config --global user.name 'XOS ExampleService'"
+ ssh ubuntu@xos "cd xos/xos/configurations/cord-pod; git cherry-pick 775e00549e535803522fbcd70152e5e1b0629c83"
+ echo ""
+ echo "Rebuilding XOS containers"
+ ssh ubuntu@xos "cd xos/xos/configurations/cord-pod; make local_containers"
}
function setup_xos() {
@@ -97,6 +115,11 @@
ssh ubuntu@nova-compute.cordtest.opencloud.us "sudo lxc-attach -n testclient -- ip link add link eth0.222 name eth0.222.111 type vlan id 111"
ssh ubuntu@nova-compute.cordtest.opencloud.us "sudo lxc-attach -n testclient -- ifconfig eth0.222 up"
ssh ubuntu@nova-compute.cordtest.opencloud.us "sudo lxc-attach -n testclient -- ifconfig eth0.222.111 up"
+
+ if [[ $EXAMPLESERVICE -eq 1 ]]
+ then
+ ssh ubuntu@xos "cd xos/xos/configurations/cord-pod; make exampleservice"
+ fi
}
function run_e2e_test() {
@@ -104,11 +127,12 @@
echo "*** Wait for vSG VM to come up"
i=0
- until nova list --all-tenants|grep ACTIVE > /dev/null
+
+ until nova list --all-tenants|grep 'vsg.*ACTIVE' > /dev/null
do
- sleep 60
- (( i += 1 ))
- echo "Waited $i minutes"
+ sleep 60
+ (( i += 1 ))
+ echo "Waited $i minutes"
done
# get mgmt IP address
@@ -120,20 +144,20 @@
i=0
until ssh -o ProxyCommand="ssh -W %h:%p ubuntu@nova-compute" ubuntu@$MGMTIP "sudo docker ps|grep vcpe" > /dev/null
do
- sleep 60
- (( i += 1 ))
- echo "Waited $i minutes"
+ sleep 60
+ (( i += 1 ))
+ echo "Waited $i minutes"
done
echo ""
echo "*** Run dhclient in test client"
+
ssh ubuntu@nova-compute.cordtest.opencloud.us "sudo lxc-attach -n testclient -- dhclient eth0.222.111" > /dev/null
echo ""
echo "*** Routes in test client"
ssh ubuntu@nova-compute.cordtest.opencloud.us "sudo lxc-attach -n testclient -- route -n"
-
echo ""
echo "*** Test external connectivity in test client"
ssh ubuntu@nova-compute.cordtest.opencloud.us "sudo lxc-attach -n testclient -- ping -c 3 8.8.8.8"
@@ -141,26 +165,66 @@
echo ""
if [ $? -eq 0 ]
then
- echo "*** [PASSED] End-to-end connectivity test"
- exit 0
+ echo "*** [PASSED] End-to-end connectivity test"
else
- echo "*** [FAILED] End-to-end connectivity test"
- exit 1
+ echo "*** [FAILED] End-to-end connectivity test"
+ exit 1
fi
}
+function run_exampleservice_test () {
+ source ~/admin-openrc.sh
+
+ echo "*** Wait for exampleservice VM to come up."
+ i=0
+ until nova list --all-tenants|grep exampleservice.*ACTIVE > /dev/null
+ do
+ sleep 60
+ (( i += 1 ))
+ echo "Waited $i minutes"
+ done
+
+ # get mgmt IP address
+ ID=$( nova list --all-tenants|grep mysite_exampleservice|awk '{print $2}' )
+ MGMTIP=$( nova interface-list $ID|grep 172.27|awk '{print $8}' )
+ PUBLICIP=$( nova interface-list $ID|grep 10.168|awk '{print $8}' )
+
+ echo ""
+ echo "*** ssh into exampleservice VM, wait for Apache come up"
+ i=0
+ until ssh -o ProxyCommand="ssh -W %h:%p ubuntu@nova-compute" ubuntu@$MGMTIP "ls /var/run/apache2/apache2.pid"
+ do
+ sleep 60
+ (( i += 1 ))
+ echo "Waited $i minutes"
+ done
+
+
+ echo ""
+ echo "*** Install curl in test client"
+ ssh ubuntu@nova-compute "sudo lxc-attach -n testclient -- apt-get -y install curl"
+
+ echo ""
+ echo "*** Test connectivity to ExampleService from test client"
+ ssh ubuntu@nova-compute "sudo lxc-attach -n testclient -- curl -s http://$PUBLICIP"
+}
+
# Parse options
RUN_TEST=0
-while getopts ":ht" opt; do
+EXAMPLESERVICE=0
+while getopts ":eht" opt; do
case ${opt} in
h ) "echo Usage:"
echo " $0 install OpenStack and prep XOS and ONOS VMs [default]"
+ echo " $0 -e add exampleservice to XOS"
echo " $0 -h display this help message"
echo " $0 -t do install, bring up cord-pod configuration, run E2E test"
exit 0
;;
t ) RUN_TEST=1
;;
+ e ) EXAMPLESERVICE=1
+ ;;
\? ) echo "Invalid option"
exit 1
;;
@@ -183,7 +247,18 @@
if [[ $RUN_TEST -eq 1 ]]
then
+ if [[ $EXAMPLESERVICE -eq 1 ]]
+ then
+ build_xos_with_exampleservice
+ fi
setup_xos
setup_test_client
run_e2e_test
+ if [[ $EXAMPLESERVICE -eq 1 ]]
+ then
+ run_exampleservice_test
+ fi
fi
+
+exit 0
+
diff --git a/templates/cord.yaml b/templates/cord.yaml
index c608671..eeb46ee 100644
--- a/templates/cord.yaml
+++ b/templates/cord.yaml
@@ -149,7 +149,7 @@
annotations:
gui-x: '500'
gui-y: '500'
- charm: cs:~cordteam/trusty/neutron-api-1
+ charm: cs:~cordteam/trusty/neutron-api-3
num_units: 1
options:
neutron-plugin: onosvtn