예제 #1
0
 def create_vnf(self, opts, host):
     options = copy.deepcopy(opts)
     host_name = getattr(host, 'name', None)
     if host_name is None:
         raise RuntimeError("Unsupported host type: %s" % type(host))
     vnf = Store()
     del options['name']
     vnf.startCmd = self.catalog.make_cmd(options['function'],
                                          name=host_name,
                                          **options)
     return vnf
예제 #2
0
 def _fire_vnf_update(self, vnf_name, status):
     m = {'FAILED': 'failed',
          'UP_AND_RUNNING': 'running',
          'INITIALIZING': 'starting',
          'STOPPED': 'stopped',
          }
     event = Store()
     event.name = vnf_name
     try:
         event.on_node = self.network.nodes[vnf_name]['parent']
     except KeyError:
         event.on_node = None
     event.status = m.get(status, 'failed')
     self.fire('vnf_update', event)
예제 #3
0
    def __init__(self):
        'lazy init'
        self.__dict__ = self.__shared_state
        if self.__dict__:
            # already initialized
            return

        GenericEventNotifyer.__init__(self)
        self.net = None
        # Initial topo to create Mininet topology
        self.initial_topo = None
        # Network state
        self.state = NetworkManager.DOWN
        self.port_map = {}
        self.dpid = {}
        # Running topo to manage/store running topo obtained from Mininet - dummy object
        self.network = Store()
        # Active link list
        self.network.links = {}
        # Active node list
        self.network.nodes = {}
        # Queue for parallel event processing
        self.of_event_queue = []
        # Timer daemon process for periodic polling
        self.process = None
        self.vnf_manager = None
        self.last_status_poll = 0
        pox.core.core.listen_to_dependencies(self)
        # Start periodic scan
        self.periodic_scan()
예제 #4
0
 def _fire_vnf_update(self, vnf_name, status):
     m = {
         'FAILED': 'failed',
         'UP_AND_RUNNING': 'running',
         'INITIALIZING': 'starting',
         'STOPPED': 'stopped',
     }
     event = Store()
     event.name = vnf_name
     try:
         event.on_node = self.network.nodes[vnf_name]['parent']
     except KeyError:
         event.on_node = None
     event.status = m.get(status, 'failed')
     self.fire('vnf_update', event)
예제 #5
0
 def _fire_port_map_update(self, port_map):
     event = Store()
     event.port_map = port_map
     self.fire('port_map_update', event)
예제 #6
0
 def _fire_dpid_update(self, dpids):
     event = Store()
     event.dpids = dpids
     self.fire('dpid_update', event)
예제 #7
0
 def _fire_network_state_change(self):
     """Signalling the node/link params are changed"""
     event = Store()
     event.state = self.state
     self.fire('network_state_change', event)
예제 #8
0
 def _fire_port_map_update(self, port_map):
     event = Store()
     event.port_map = port_map
     self.fire('port_map_update', event)
예제 #9
0
 def _fire_dpid_update(self, dpids):
     event = Store()
     event.dpids = dpids
     self.fire('dpid_update', event)
예제 #10
0
 def _fire_network_state_change(self):
     """Signalling the node/link params are changed"""
     event = Store()
     event.state = self.state
     self.fire('network_state_change', event)