网站首页 > 技术文章 正文
neutron/plugins/openvswitch/agent/ovs_neutron_agent.py:main() plugin = OVSNeutronAgent(**agent_config) self.setup_integration_br() #创建br-int集成网桥并初始化流表 self.setup_rpc() #建立一些agent与server侧常用的rpc通道 self.plugin_rpc = OVSPluginApi(topics.PLUGIN) #如get_device_details/update_device_down/update_device_up/tunnel_sync self.sg_plugin_rpc = sg_rpc.SecurityGroupServerRpcApi(topics.PLUGIN) #查询安全组信息 self.state_rpc = agent_rpc.PluginReportStateAPI(topics.PLUGIN) #处理report_state self.connection = agent_rpc.create_consumers(...) #创建以下消费者们:port update/delete, tunnel update/delete, security_group update, dvr update, l2population update host heartbeat = loopingcall.FixedIntervalLoopingCall(self._report_state) #周期任务上报agent状态,如br-int上有多少device,agent当前时间等 self.setup_physical_bridges(bridge_mappings) #处理物理网桥与br-int的关联(采用veth对/path对),如果物理网桥不存在则直接退出agent,并初始化流表 self.setup_tunnel_br()/ self.reset_tunnel_br(tun_br) #创建br-tun,与br-int关联(采用patch对),并初始化流表 #为啥要分开处理? self.setup_ancillary_bridges(integ_br, tun_br) # 识别出本host上除了br-int、br-tun和物理网桥之外的网桥,如br-ex self.sg_agent = OVSSecurityGroupAgent(...) # 用于处理安全组 self.connection.consume_in_threads() # 对以上consume开启各个线程监听并处理 plugin.daemon_loop() self.rpc_loop() tunnel_sync() #在agent首次启动或有异常发生时,会进行tunnel同步。 #上报本agent的tunnel ip到neutron server DB中,neutron server同时发送关于该tunnel ip的消息(tunnel_update)给其他agents #如果没有开启l2pop,则在本agent上会在br-tun上创建tunnel port,其他agents也会创建相应的remote tunnel port,并创建相应流表 port_info = self.scan_ports() #周期检测br-int上的端口变化 sync = self.process_network_ports(port_info) #处理增加或删除的port
neutron-server和neutron-openvswitch-agent的消息队列如下:
neutron-server可能会发生上述几种消息广播给neutron-openvswitch-agent。openvswitch agent会先看一下端口是否在本地,如果在本地则进行对应动作。
2. nova与neutron-openvswitch-agent的交互
首先boot虚机时,nova-compute发消息给neutron-server请求创建port。之后,在driver里面在br-int上建立port后,neutron-openvswitch-port循环检测br-int会发现新增端口,对其设定合适的openflow规则以及localvlan,最后将port状态设置为ACTIVE。
附:ovs启动流程图(http://bingotree.cn/wp-content/uploads/2015/05/ovs-agent%E5%90%AF%E5%8A%A8%E6%B5%81%E7%A8%8B1.png)
猜你喜欢
- 2024-11-17 吴谨言专访大反转!痛批耍大牌后竟翻红,六公主七连发力显真诚
- 2024-11-17 港股2月28日物业股涨幅榜:CHINAOVSPPT涨1.72%位居首位
- 2024-11-17 港股2月28日物业股午盘:CHINAOVSPPT涨1.72%位居首位
- 2024-11-17 港股3月2日物业股涨幅榜:CHINAOVSPPT涨1.03%位居首位
- 2024-11-17 港股3月2日物业股午盘:CHINAOVSPPT涨1.03%
- 2024-11-17 天赋与心痛的背后:邓鸣贺成长悲剧引发的深刻反思
- 2024-11-17 冯小刚女儿徐朵追星范丞丞 同框合照曝光惹人羡,回应网友尽显亲民
- 2024-11-17 “资本大佬”王冉:51岁娶小17岁童瑶,并承诺余生为娇妻保驾护航
- 2024-11-17 港股3月2日物业股午盘:CHINAOVSPPT涨1.03%位居首位
- 2024-11-17 「IT之家开箱」vivo S15 图赏:双镜云窗,盛夏风光
你 发表评论:
欢迎- 最近发表
- 标签列表
-
- oraclesql优化 (66)
- 类的加载机制 (75)
- feignclient (62)
- 一致性hash算法 (71)
- dockfile (66)
- 锁机制 (57)
- javaresponse (60)
- 查看hive版本 (59)
- phpworkerman (57)
- spark算子 (58)
- vue双向绑定的原理 (68)
- springbootget请求 (58)
- docker网络三种模式 (67)
- spring控制反转 (71)
- data:image/jpeg (69)
- base64 (69)
- java分页 (64)
- kibanadocker (60)
- qabstracttablemodel (62)
- java生成pdf文件 (69)
- deletelater (62)
- com.aspose.words (58)
- android.mk (62)
- qopengl (73)
- epoch_millis (61)
本文暂时没有评论,来添加一个吧(●'◡'●)