X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fvim-emu.git;a=blobdiff_plain;f=src%2Femuvim%2Fapi%2Fsonata%2Fdummygatekeeper.py;h=151e5b34fc853e9680092ab746f080a467cfb106;hp=a7f0a6cbd6ea8c48f615e1f4fb9ea88ff39b793d;hb=fa91cf2172cfdddc74e76a49a47404f81c83e049;hpb=68a0ba9dc7fe9ca4f0caf512cf0d4ecdb7a179d5 diff --git a/src/emuvim/api/sonata/dummygatekeeper.py b/src/emuvim/api/sonata/dummygatekeeper.py index a7f0a6c..151e5b3 100755 --- a/src/emuvim/api/sonata/dummygatekeeper.py +++ b/src/emuvim/api/sonata/dummygatekeeper.py @@ -259,7 +259,7 @@ class Service(object): # last step: remove the instance from the list of all instances del self.instances[instance_uuid] - def _start_vnfd(self, vnfd, vnf_id): + def _start_vnfd(self, vnfd, vnf_id, **kwargs): """ Start a single VNFD of this service :param vnfd: vnfd descriptor dict @@ -352,7 +352,8 @@ class Service(object): cpu_period=cpu_period, cpuset=cpu_list, mem_limit=mem_lim, - volumes=volumes) + volumes=volumes, + type=kwargs.get('type','docker')) # rename the docker0 interfaces (eth0) to the management port name defined in the VNFD if USE_DOCKER_MGMT: @@ -546,7 +547,7 @@ class Service(object): if sap["type"] == "internal": vnfi = None if not GK_STANDALONE_MODE: - vnfi = self._start_vnfd(sap, sap['name']) + vnfi = self._start_vnfd(sap, sap['name'], type='sap_int') self.instances[instance_uuid]["vnf_instances"].append(vnfi) elif sap["type"] == "external": @@ -678,15 +679,14 @@ class Service(object): "Setting up E-LAN interface. (%s:%s) -> %s" % ( vnf_id, intf_name, ip_address)) - if vnf_id in self.vnfds: - # re-configure the VNFs IP assignment and ensure that a new subnet is used for each E-LAN - # E-LAN relies on the learning switch capability of Ryu which has to be turned on in the topology - # (DCNetwork(controller=RemoteController, enable_learning=True)), so no explicit chaining is necessary. - vnfi = self._get_vnf_instance(instance_uuid, vnf_id) - if vnfi is not None: - self._vnf_reconfigure_network(vnfi, intf_name, ip_address) - # add this vnf and interface to the E-LAN for tagging - elan_vnf_list.append({'name': src_docker_name, 'interface': intf_name}) + # re-configure the VNFs IP assignment and ensure that a new subnet is used for each E-LAN + # E-LAN relies on the learning switch capability of Ryu which has to be turned on in the topology + # (DCNetwork(controller=RemoteController, enable_learning=True)), so no explicit chaining is necessary. + vnfi = self._get_vnf_instance(instance_uuid, vnf_id) + if vnfi is not None: + self._vnf_reconfigure_network(vnfi, intf_name, ip_address) + # add this vnf and interface to the E-LAN for tagging + elan_vnf_list.append({'name': src_docker_name, 'interface': intf_name}) # install the VLAN tags for this E-LAN GK.net.setLAN(elan_vnf_list)