fix E-LAN issues
authorstevenvanrossem <steven.vanrossem@intec.ugent.be>
Fri, 4 Nov 2016 14:33:28 +0000 (15:33 +0100)
committerstevenvanrossem <steven.vanrossem@intec.ugent.be>
Fri, 4 Nov 2016 14:33:28 +0000 (15:33 +0100)
src/emuvim/api/sonata/dummygatekeeper.py
src/emuvim/api/sonata/sap_vnfd.yml [changed mode: 0644->0755]
src/emuvim/examples/sonata_y1_demo_topology_1_w_ls_and_mon_and_sap.py [changed mode: 0644->0755]

index 8a9416c..00201f9 100755 (executable)
@@ -227,6 +227,9 @@ class Service(object):
         # 4b. deploy E-LAN links
         base = 10
         for link in elan_fwd_links:
+
+            elan=[]
+
             # generate lan ip address
             ip = 1
             for intf in link["connection_points_reference"]:
@@ -235,6 +238,8 @@ class Service(object):
                 if vnf_id in self.sap_identifiers:
                     src_docker_name = "{0}_{1}".format(vnf_id, intf_name)
                     vnf_id = src_docker_name
+                else:
+                    src_docker_name = vnf_id
                 vnf_name = vnf_id2vnf_name[vnf_id]
                 LOG.debug(
                     "Setting up E-LAN link. %s(%s:%s) -> %s" % (
@@ -249,6 +254,15 @@ class Service(object):
                         self._vnf_reconfigure_network(vnfi, intf_name, ip_address)
                         # increase for the next ip address on this E-LAN
                         ip += 1
+
+                        # add this vnf and interface to the E-LAN for tagging
+                        network = self.vnfds[vnf_name].get("dc").net  # there should be a cleaner way to find the DCNetwork
+                        elan.append({'name':src_docker_name,'interface':intf_name})
+
+
+            # install the VLAN tags for this E-LAN
+            print(elan)
+            network.setLAN(elan)
             # increase the base ip address for the next E-LAN
             base += 1
 
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index df7a6ac..b38720e
@@ -46,7 +46,7 @@ logging.basicConfig(level=logging.INFO)
 
 def create_topology1():
     # create topology
-    net = DCNetwork(controller=RemoteController, monitor=True, enable_learning=False)
+    net = DCNetwork(controller=RemoteController, monitor=True, enable_learning=True)
     dc1 = net.addDatacenter("dc1")
     dc2 = net.addDatacenter("dc2")
     s1 = net.addSwitch("s1")