Example #1
0
    def run(self):
        nb_driver_class = importutils.import_class(cfg.CONF.df.nb_db_class)
        self.nb_api = api_nb.NbApi(nb_driver_class())
        self.nb_api.initialize(db_ip=cfg.CONF.df.remote_db_ip,
                               db_port=cfg.CONF.df.remote_db_port)
        self.vswitch_api = ovsdb_vswitch_impl.OvsdbSwitchApi(self.ip)
        self.vswitch_api.initialize()

        self.vswitch_api.sync()
        self.vswitch_api.del_controller('br-int').execute()
        self.vswitch_api.set_controllers(
            'br-int', ['tcp:' + self.ip + ':6633']).execute()

        self.dispatcher.load()
        self.dispatcher.is_ready()

        self.db_sync_loop()
Example #2
0
    def __init__(self, chassis_name):
        self.next_network_id = 0
        self.db_store = db_store.DbStore()
        self.chassis_name = chassis_name
        self.ip = cfg.CONF.df.local_ip
        self.tunnel_type = cfg.CONF.df.tunnel_type
        self.sync_finished = False
        nb_driver_class = importutils.import_class(cfg.CONF.df.nb_db_class)
        self.nb_api = api_nb.NbApi(nb_driver_class(),
                                   use_pubsub=cfg.CONF.df.enable_df_pub_sub)
        self.vswitch_api = ovsdb_vswitch_impl.OvsdbSwitchApi(
            self.ip, self.nb_api)
        kwargs = dict(nb_api=self.nb_api,
                      vswitch_api=self.vswitch_api,
                      db_store=self.db_store)
        app_mgr = AppManager.get_instance()
        self.open_flow_app = app_mgr.instantiate(RyuDFAdapter, **kwargs)

        self.topology = None
        self.enable_selective_topo_dist = \
            cfg.CONF.df.enable_selective_topology_distribution