dynamically generate virtualbng.json
diff --git a/xos/configurations/cord/Dockerfile.cord b/xos/configurations/cord/Dockerfile.cord
index f7fdb65..8734eef 100644
--- a/xos/configurations/cord/Dockerfile.cord
+++ b/xos/configurations/cord/Dockerfile.cord
@@ -19,6 +19,7 @@
 ADD xos/observers/monitoring_channel/supervisor/monitoring_channel_observer.conf /etc/supervisor/conf.d/
 RUN sed -i 's/proxy_ssh=True/proxy_ssh=False/' /opt/xos/observers/vcpe/vcpe_observer_config
 RUN sed -i 's/proxy_ssh=True/proxy_ssh=False/' /opt/xos/observers/monitoring_channel/monitoring_channel_observer_config
+ADD xos/configurations/cord/virtualbng.json /root/setup/
 
 CMD /usr/bin/make -C /opt/xos/configurations/cord -f Makefile.inside; /bin/bash
 
diff --git a/xos/configurations/cord/Makefile b/xos/configurations/cord/Makefile
index f85f8a4..701e92f 100644
--- a/xos/configurations/cord/Makefile
+++ b/xos/configurations/cord/Makefile
@@ -2,7 +2,7 @@
 RUNNING_CONTAINER:=$(shell sudo docker ps|grep "xos"|awk '{print $$NF}')
 LAST_CONTAINER=$(shell sudo docker ps -l -q)
 
-cord: common_cloudlab ceilometer_dashboard
+cord: common_cloudlab ceilometer_dashboard virtualbng_json
 	echo "# Autogenerated -- do not edit" > Dockerfile
 	cat ../common/Dockerfile.common Dockerfile.cord >> Dockerfile
 	cd ../../..; sudo docker build -t xos -f xos/configurations/cord/Dockerfile .
@@ -18,6 +18,9 @@
 	bash install_xos_ceilometer_dashboard.sh
 	bash install_ceilometer_patch.sh
 
+virtualbng_json:
+	bash make-virtualbng-json.sh
+
 stop:
 	sudo docker stop $(RUNNING_CONTAINER)
 
diff --git a/xos/configurations/cord/cord.yaml b/xos/configurations/cord/cord.yaml
index 9929a84..6b09510 100644
--- a/xos/configurations/cord/cord.yaml
+++ b/xos/configurations/cord/cord.yaml
@@ -97,20 +97,9 @@
                 }
               }
             }
-          config_virtualbng.json: >
-            {
-                "localPublicIpPrefixes" : [
-                    "10.254.0.128/25"
-                ],
-                "nextHopIpAddress" : "10.254.0.1",
-                "publicFacingMac" : "00:00:00:00:00:66",
-                "xosIpAddress" : "10.11.10.1",
-                "xosRestPort" : "9999",
-                "hosts" : {
-                    "cp-1.devel.xos-pg0.clemson.cloudlab.us" : "of:0000000000000001/1",
-                    "cp-2.devel.xos-pg0.clemson.cloudlab.us" : "of:0000000000000001/1"
-                }
-            }
+          config_virtualbng.json: { get_artifact: [ SELF, virtualbng_json, LOCAL_FILE] }
+      artifacts:
+          virtualbng_json: /root/setup/virtualbng.json
 
     service_ONOS_vOLT:
       type: tosca.nodes.ONOSService
diff --git a/xos/configurations/cord/make-virtualbng-json.sh b/xos/configurations/cord/make-virtualbng-json.sh
new file mode 100644
index 0000000..0e1d350
--- /dev/null
+++ b/xos/configurations/cord/make-virtualbng-json.sh
@@ -0,0 +1,39 @@
+#FN=/opt/xos/configurations/common/cloudlab-nodes.yaml
+FN=virtualbng.json
+
+rm -f $FN
+
+cat >> $FN <<EOF
+{
+    "localPublicIpPrefixes" : [
+        "10.254.0.128/25"
+    ],
+    "nextHopIpAddress" : "10.254.0.1",
+    "publicFacingMac" : "00:00:00:00:00:66",
+    "xosIpAddress" : "10.11.10.1",
+    "xosRestPort" : "9999",
+    "hosts" : {
+EOF
+
+NODES=$( sudo bash -c "source /root/setup/admin-openrc.sh ; nova hypervisor-list" |grep cloudlab|awk '{print $4}' )
+
+NODECOUNT=0
+for NODE in $NODES; do
+    ((NODECOUNT++))
+done
+
+I=0
+for NODE in $NODES; do
+    echo $NODE
+    ((I++))
+    if [[ "$I" -lt "$NODECOUNT" ]]; then
+        echo "      \"$NODE\" : \"of:0000000000000001/1\"," >> $FN
+    else
+        echo "      \"$NODE\" : \"of:0000000000000001/1\"" >> $FN
+    fi
+done
+
+cat >> $FN <<EOF
+    }
+}
+EOF