Initial cut at vOLT config
diff --git a/xos/configurations/cord-pod/docker-compose.yml b/xos/configurations/cord-pod/docker-compose.yml
index e2a5768..5087485 100644
--- a/xos/configurations/cord-pod/docker-compose.yml
+++ b/xos/configurations/cord-pod/docker-compose.yml
@@ -3,20 +3,20 @@
expose:
- "5432"
-xos_synchronizer_openstack:
- command: bash -c "sleep 120; python /opt/xos/synchronizers/openstack/xos-synchronizer.py"
- image: xosproject/xos-synchronizer-openstack
- labels:
- org.xosproject.kind: synchronizer
- org.xosproject.target: openstack
- links:
- - xos_db
- volumes:
- - ../common/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro
- - ./xos_cord_config:/opt/xos/xos_configuration/xos_cord_config:ro
- - .:/root/setup:ro
- - ../vtn/files/xos_vtn_config:/opt/xos/xos_configuration/xos_vtn_config:ro
- - ./images:/opt/xos/images:ro
+#xos_synchronizer_openstack:
+# command: bash -c "sleep 120; python /opt/xos/synchronizers/openstack/xos-synchronizer.py"
+# image: xosproject/xos-synchronizer-openstack
+# labels:
+# org.xosproject.kind: synchronizer
+# org.xosproject.target: openstack
+# links:
+# - xos_db
+# volumes:
+# - ../common/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro
+# - ./xos_cord_config:/opt/xos/xos_configuration/xos_cord_config:ro
+# - .:/root/setup:ro
+# - ../vtn/files/xos_vtn_config:/opt/xos/xos_configuration/xos_vtn_config:ro
+# - ./images:/opt/xos/images:ro
xos_synchronizer_onos:
image: xosproject/xos-synchronizer-openstack
@@ -30,28 +30,28 @@
- .:/root/setup:ro
- ./id_rsa:/opt/xos/synchronizers/onos/onos_key:ro # private key
-xos_synchronizer_vcpe:
- image: xosproject/xos-synchronizer-openstack
- command: bash -c "sleep 120; cp /root/setup/node_key /opt/xos/synchronizers/vcpe/; chmod 0600 /opt/xos/synchronizers/vcpe/node_key; python /opt/xos/synchronizers/vcpe/vcpe-synchronizer.py -C /root/setup/files/vcpe_synchronizer_config"
- labels:
- org.xosproject.kind: synchronizer
- org.xosproject.target: vcpe
- links:
- - xos_db
- volumes:
- - .:/root/setup:ro
- - ./id_rsa:/opt/xos/synchronizers/vcpe/vcpe_private_key:ro # private key
+#xos_synchronizer_vcpe:
+# image: xosproject/xos-synchronizer-openstack
+# command: bash -c "sleep 120; cp /root/setup/node_key /opt/xos/synchronizers/vcpe/; chmod 0600 /opt/xos/synchronizers/vcpe/node_key; python /opt/xos/synchronizers/vcpe/vcpe-synchronizer.py -C /root/setup/files/vcpe_synchronizer_config"
+# labels:
+# org.xosproject.kind: synchronizer
+# org.xosproject.target: vcpe
+# links:
+# - xos_db
+# volumes:
+# - .:/root/setup:ro
+# - ./id_rsa:/opt/xos/synchronizers/vcpe/vcpe_private_key:ro # private key
-xos_synchronizer_vtn:
- image: xosproject/xos-synchronizer-openstack
- command: bash -c "sleep 120; python /opt/xos/synchronizers/vtn/vtn-synchronizer.py -C /opt/xos/synchronizers/vtn/vtn_synchronizer_config"
- labels:
- org.xosproject.kind: synchronizer
- org.xosproject.target: vtn
- links:
- - xos_db
- volumes:
- - .:/root/setup:ro
+#xos_synchronizer_vtn:
+# image: xosproject/xos-synchronizer-openstack
+# command: bash -c "sleep 120; python /opt/xos/synchronizers/vtn/vtn-synchronizer.py -C /opt/xos/synchronizers/vtn/vtn_synchronizer_config"
+# labels:
+# org.xosproject.kind: synchronizer
+# org.xosproject.target: vtn
+# links:
+# - xos_db
+# volumes:
+# - .:/root/setup:ro
#xos_synchronizer_vbng:
# image: xosproject/xos-synchronizer-openstack
@@ -62,29 +62,29 @@
# links:
# - xos_db
-xos_synchronizer_monitoring_channel:
- image: xosproject/xos-synchronizer-openstack
- command: bash -c "sleep 120; python /opt/xos/synchronizers/monitoring_channel/monitoring_channel_synchronizer.py -C /root/setup/files/monitoring_channel_synchronizer_config"
- labels:
- org.xosproject.kind: synchronizer
- org.xosproject.target: monitoring_channel
- links:
- - xos_db
- volumes:
- - .:/root/setup:ro
- - ./id_rsa:/opt/xos/synchronizers/monitoring_channel/monitoring_channel_private_key:ro # private key
+#xos_synchronizer_monitoring_channel:
+# image: xosproject/xos-synchronizer-openstack
+# command: bash -c "sleep 120; python /opt/xos/synchronizers/monitoring_channel/monitoring_channel_synchronizer.py -C /root/setup/files/monitoring_channel_synchronizer_config"
+# labels:
+# org.xosproject.kind: synchronizer
+# org.xosproject.target: monitoring_channel
+# links:
+# - xos_db
+# volumes:
+# - .:/root/setup:ro
+# - ./id_rsa:/opt/xos/synchronizers/monitoring_channel/monitoring_channel_private_key:ro # private key
-xos_synchronizer_vtr:
- image: xosproject/xos-synchronizer-openstack
- command: bash -c "sleep 120; cp /root/setup/node_key /opt/xos/synchronizers/vtr/; chmod 0600 /opt/xos/synchronizers/vtr/node_key; python /opt/xos/synchronizers/vtr/vtr-synchronizer.py -C /root/setup/files/vtr_synchronizer_config"
- labels:
- org.xosproject.kind: synchronizer
- org.xosproject.target: vtr
- links:
- - xos_db
- volumes:
- - .:/root/setup:ro
- - ./id_rsa:/opt/xos/synchronizers/vtr/vcpe_private_key:ro # private key
+#xos_synchronizer_vtr:
+# image: xosproject/xos-synchronizer-openstack
+# command: bash -c "sleep 120; cp /root/setup/node_key /opt/xos/synchronizers/vtr/; chmod 0600 /opt/xos/synchronizers/vtr/node_key; python /opt/xos/synchronizers/vtr/vtr-synchronizer.py -C /root/setup/files/vtr_synchronizer_config"
+# labels:
+# org.xosproject.kind: synchronizer
+# org.xosproject.target: vtr
+# links:
+# - xos_db
+# volumes:
+# - .:/root/setup:ro
+# - ./id_rsa:/opt/xos/synchronizers/vtr/vcpe_private_key:ro # private key
xos:
command: python /opt/xos/manage.py runserver 0.0.0.0:80 --insecure --makemigrations
diff --git a/xos/synchronizers/onos/steps/sync_onosapp.py b/xos/synchronizers/onos/steps/sync_onosapp.py
index 64c9452..0ea9643 100644
--- a/xos/synchronizers/onos/steps/sync_onosapp.py
+++ b/xos/synchronizers/onos/steps/sync_onosapp.py
@@ -243,18 +243,33 @@
return json.dumps(data, indent=4, sort_keys=True)
def get_volt_network_config(self, o, attrs):
- data = {
- "devices" : {
- "of:1000000000000001" : {
- "accessDevice" : {
- "uplink" : "2",
- "vlan" : "222",
- },
- "basic" : {
- "driver" : "pmc-olt"
- }
+ try:
+ volt = VOLTService.get_service_objects().all()[0]
+ except:
+ return None
+
+ devices = []
+ for voltdev in volt.volt_devices.all():
+ access_devices = []
+ for access in voltdev.access_devices.all():
+ access_device = {
+ "uplink" : access.uplink
+ "vlan" : access.vlan
+ }
+ access_devices.append(access_device)
+
+ device = {
+ voltdev.openflow_id : {
+ "accessDevice" : access_devices
+ },
+ "basic" : {
+ "driver" : voltdev.driver
}
}
+ devices.append(device)
+
+ data = {
+ "devices" : devices
}
return json.dumps(data, indent=4, sort_keys=True)