示例#1
0
 def __init__(self, service_plugin):
     super(DynamicRoutingBGPVPNDriver, self).__init__(service_plugin)
     self.l2_notifier = l2pop_rpc.L2populationAgentNotifyAPI()
     self.rpc_listener = rpc.BGPVPNRpcCallback(self)
     self.connection = None
     self._core_plugin = None
     self.register_callbacks()
示例#2
0
    def _call_on_l2pop_driver(self, flow_rule, method_name):
        pop_host = flow_rule['host_id']
        pop_ports = self._get_remote_pop_ports(flow_rule)
        for (port, segment) in pop_ports:
            port_id = port['id']
            host_id = port['binding:host_id']
            active_entry_count = self._get_network_other_active_entry_count(
                pop_host, port_id)

            if active_entry_count == 1:
                fdb_entry = self._get_agent_fdb(port, segment, host_id)

                getattr(l2pop_rpc.L2populationAgentNotifyAPI(),
                        method_name)(self.rpc_ctx, fdb_entry, pop_host)
示例#3
0
    def _setup_rpc(self):

        # LBaaS Plugin API
        topic = constants_v2.TOPIC_PROCESS_ON_HOST_V2
        if self.conf.environment_specific_plugin:
            topic = topic + '_' + self.conf.environment_prefix
            LOG.debug('agent in %s environment will send callbacks to %s' %
                      (self.conf.environment_prefix, topic))
        self.plugin_rpc = plugin_rpc.LBaaSv2PluginRPC(
            topic, self.context, self.conf.environment_prefix,
            self.conf.environment_group_number, self.agent_host)

        # Allow driver to make callbacks using the
        # same RPC proxy as the manager
        self.lbdriver.set_plugin_rpc(self.plugin_rpc)

        self._setup_state_rpc(topic)

        # Setup message queues to listen for updates from
        # Neutron.
        if not self.conf.f5_global_routed_mode:
            # Core plugin
            self.lbdriver.set_tunnel_rpc(agent_rpc.PluginApi(topics.PLUGIN))

            consumers = [[constants_v2.TUNNEL, topics.UPDATE]]
            if self.conf.l2_population:
                # L2 Populate plugin Callbacks API
                self.lbdriver.set_l2pop_rpc(
                    l2pop_rpc.L2populationAgentNotifyAPI())

                consumers.append(
                    [topics.L2POPULATION, topics.UPDATE, self.agent_host])

            self.endpoints = [self]

            self.connection = agent_rpc.create_consumers(
                self.endpoints, topics.AGENT, consumers)
示例#4
0
 def __init__(self):
     super(L2populationMechanismDriver, self).__init__()
     self.L2populationAgentNotify = l2pop_rpc.L2populationAgentNotifyAPI()
示例#5
0
 def _trigger_l2pop_delete(self, context, other_fdb_entries, host=None):
     """Sends L2pop DELETE RPC message to the neutron L2 agent."""
     l2pop_rpc.L2populationAgentNotifyAPI().remove_fdb_entries(
         context, other_fdb_entries, host)
示例#6
0
 def _trigger_l2pop_sync(self, context, other_fdb_entries):
     """Sends L2pop ADD RPC message to the neutron L2 agent."""
     l2pop_rpc.L2populationAgentNotifyAPI().add_fdb_entries(
         context, other_fdb_entries)
示例#7
0
"""Agent manager to handle plugin to agent RPC and periodic tasks."""