Merge branch 'master' of github.com:open-cloud/xos
diff --git a/xos/configurations/cord/Makefile b/xos/configurations/cord/Makefile
index 755f704..0dc7a73 100644
--- a/xos/configurations/cord/Makefile
+++ b/xos/configurations/cord/Makefile
@@ -3,7 +3,7 @@
 LAST_CONTAINER=$(shell sudo docker ps -l -q)
 
 cord: common_cloudlab ceilometer_dashboard virtualbng_json vtn_network_cfg_json
-	rm ../../xos_configuration/*
+	if [ -a ../../xos_configuration/* ]; then rm ../../xos_configuration/*; fi
 	echo "# Autogenerated -- do not edit" > Dockerfile
 	cat ../common/Dockerfile.common Dockerfile.cord >> Dockerfile
 	cp ../common/xos_common_config ../../xos_configuration/
diff --git a/xos/configurations/cord/README-VTN.md b/xos/configurations/cord/README-VTN.md
index ffb5d56..9827b0e 100644
--- a/xos/configurations/cord/README-VTN.md
+++ b/xos/configurations/cord/README-VTN.md
@@ -47,7 +47,8 @@
     # change 172.17.0.2 to the IP address for the ONOS container (use "docker inspect")
     iptables -t nat -A PREROUTING -i br-ex -p tcp --dport 8101 -j DNAT --to-destination 172.17.0.2
     iptables -t nat -A PREROUTING -i br-ex -p tcp --dport 8181 -j DNAT --to-destination 172.17.0.2
-
+    iptables -t nat -A PREROUTING -i br-ex -p tcp --dport 6653 -j DNAT --to-destination 172.17.0.2
+    
 Compute nodes (all of them):
 
     systemctl stop neutron-plugin-openvswitch-agent
@@ -71,3 +72,4 @@
 
 Notes:
 * Adding use_vtn=True to the [networking] section in the XOS config file has two effects: 1) it sets the gateway in sync_controller_networks, and 2) it disables automatic creation of nat-net for new slices. This is because VTN will fail if there is no gateway on a network, and because we don't have nat-net under the VTN configuration.
+* When using of-vfctl to look at flow rules, if you get a protocol error, try "ovs-ofctl show -O OpenFlow13 br-int "
diff --git a/xos/configurations/cord/dataplane/change_controller.sh b/xos/configurations/cord/dataplane/change_controller.sh
new file mode 100755
index 0000000..2b961ee
--- /dev/null
+++ b/xos/configurations/cord/dataplane/change_controller.sh
@@ -0,0 +1,13 @@
+#! /bin/bash
+
+# put IP address of node running ONOS VTN App here
+DESIRED_CONTROLLER="tcp:130.127.133.24:6653"
+
+while [[ 1 ]]; do
+    CONTROLLER=`ovs-vsctl get-controller br-int`
+    if [[ "$CONTROLLER" == "tcp:172.17.0.2:6653" ]]; then
+       ovs-vsctl set-controller br-int $DESIRED_CONTROLLER
+       echo "changed controller from $CONTROLLER to $DESIRED_CONTROLLER"
+    fi
+    sleep 10s
+done
diff --git a/xos/configurations/devel/Makefile b/xos/configurations/devel/Makefile
index f33479f..97a9806 100644
--- a/xos/configurations/devel/Makefile
+++ b/xos/configurations/devel/Makefile
@@ -9,7 +9,7 @@
 opencloud: common_opencloud xos
 
 xos:
-	rm ../../xos_configuration/*
+	if [ -a ../../xos_configuration/* ]; then rm ../../xos_configuration/*; fi
 	cp ../common/xos_common_config ../../xos_configuration/
 	echo "# Autogenerated -- do not edit" > Dockerfile
 	cat ../common/Dockerfile.common Dockerfile.devel >> Dockerfile
diff --git a/xos/configurations/frontend/Makefile b/xos/configurations/frontend/Makefile
index e30877a..96b0779 100644
--- a/xos/configurations/frontend/Makefile
+++ b/xos/configurations/frontend/Makefile
@@ -6,7 +6,7 @@
 all: frontend
 
 frontend:
-	rm ../../xos_configuration/*
+	if [ -a ../../xos_configuration/* ]; then rm ../../xos_configuration/*; fi
 	sudo apt-get -y install httpie
 	cat ../common/Dockerfile.common Dockerfile.frontend > Dockerfile
 	cp ../common/xos_common_config ../../xos_configuration/
@@ -16,7 +16,7 @@
 	echo $(RUNNING_CONTAINER)
 
 interactive:
-	rm ../../xos_configuration/*
+	if [ -a ../../xos_configuration/* ]; then rm ../../xos_configuration/*; fi
 	cat ../common/Dockerfile.common Dockerfile.frontend > Dockerfile
 	cp ../common/xos_common_config ../../xos_configuration/
 	#cp ../cord/xos_cord_config ../../xos_configuration/
diff --git a/xos/configurations/test/Makefile b/xos/configurations/test/Makefile
index b1cca93..75143fa 100644
--- a/xos/configurations/test/Makefile
+++ b/xos/configurations/test/Makefile
@@ -1,6 +1,7 @@
 MYIP:=$(shell hostname -i)
 
 test: common_cloudlab
+	if [ -a ../../xos_configuration/* ]; then rm ../../xos_configuration/*; fi
 	cat ../common/Dockerfile.common Dockerfile.test > Dockerfile
 	cd ../../..; sudo docker build -t xos -f xos/configurations/test/Dockerfile .
 	# sudo docker run -d --add-host="ctl:$(MYIP)" -p 9999:8000 xos