Ejemplo n.º 1
0
    def __init__(self, host, rpc_qn):
        self._my_host = host
        self._qn = '_'.join((rpc_qn, self._my_host))
        self._cfg = config.CiscoDFAConfig('neutron').cfg
        LOG.debug('Starting DFA Agent on %s', self._my_host)

        # List of task in the agent
        self.agent_task_list = []

        # This flag indicates the agent started for the first time.
        self._need_uplink_info = True

        # Initialize iptables driver. This will be used to update the ip
        # rules in iptables, after launching an instance.
        self._iptd = iptd.IptablesDriver(self._cfg)

        # Setup RPC client for sending heartbeat to controller
        self._url = self._cfg.dfa_rpc.transport_url
        self.setup_client_rpc()

        # Initialize VPD manager.
        br_int = 'br-int'
        br_ext = 'br-ethd'
        root_helper = self._cfg.sys.root_helper
        self._vdpm = vdpm.VdpMgr(br_int, br_ext, root_helper, self.clnt,
                                 thishost)
        self.pool = eventlet.GreenPool()
        self.setup_rpc()
Ejemplo n.º 2
0
    def __init__(self, host, rpc_qn):
        self._host_name = host
        self._cfg = config.CiscoDFAConfig('neutron').cfg
        self._my_host = self._cfg.DEFAULT.host if self._cfg.DEFAULT.host else (
            utils.find_agent_host_id(host))
        self._qn = '_'.join((rpc_qn, self._my_host))
        LOG.debug('Starting DFA Agent on %s', self._my_host)

        # List of task in the agent
        self.agent_task_list = []

        # This flag indicates the agent started for the first time.
        self._need_uplink_info = True

        # Initialize iptables driver. This will be used to update the ip
        # rules in iptables, after launching an instance.

        if (self._cfg.dcnm.dcnm_dhcp.lower() == 'true'):
            self._iptd = iptd.IptablesDriver(self._cfg)
        else:
            self._iptd = None
            LOG.debug("Using native dhcp, iptable driver is not needed")

        # Setup RPC client for sending heartbeat to controller
        self._url = self._cfg.dfa_rpc.transport_url
        self.setup_client_rpc()

        # Initialize VPD manager.
        br_int = self._cfg.dfa_agent.integration_bridge
        br_ext = self._cfg.dfa_agent.external_dfa_bridge
        config_dict = {
            'integration_bridge': br_int,
            'external_bridge': br_ext,
            'host_id': self._my_host,
            'root_helper': self._cfg.sys.root_helper,
            'node_list': self._cfg.general.node,
            'node_uplink_list': self._cfg.general.node_uplink
        }

        self._vdpm = vdpm.VdpMgr(config_dict, self.clnt, self._host_name)
        self.pool = eventlet.GreenPool()
        self.setup_rpc()