ovs-agent流程
1. 代码流程分析
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)

ovs-agent流程的更多相关文章
- Openstack部署总结:“部署过程Error: Local ip for ovs agent must be set when tunneling is enabled”问题
问题叙述性说明 正在使用RDO当多节点部署测试,因为使用了一些老机器和机器类型的差异(一些HP的PC,有些DELL的PC).以下错误出现: Applying 192.168.40.107_neutro ...
- Openstack Neutron OVS ARP Responder
ARP – Why do we need it? In any environment, be it the physical data-center, your home, or a virtual ...
- OVS ARP Responder – Theory and Practice
Prefix In the GRE tunnels post I’ve explained how overlay networks are used for connectivity and ten ...
- 从三个开源项目认识OpenFlow交换机 - OVS
在SDN/NFV的网络革新技术浪潮的引领下,催生了诸多数据面开源方案的诞生.业界知名度较高的有OVS(Open vSwitch).FD.io (Fast Data I/O).ODP(Open Data ...
- SNMP AGENT函数介绍
http://wenku.baidu.com/view/6a7903a9d1f34693daef3e9f.html 一. SNMP AGENT在SNMP框架中的位置 1.1 SNMP是被广泛接受并投 ...
- Neutron 理解 (2): 使用 Open vSwitch + VLAN 组网 [Netruon Open vSwitch + VLAN Virutal Network]
学习 Neutron 系列文章: (1)Neutron 所实现的虚拟化网络 (2)Neutron OpenvSwitch + VLAN 虚拟网络 (3)Neutron OpenvSwitch + GR ...
- 理解 OpenStack 高可用(HA)(3):Neutron 分布式虚拟路由(Neutron Distributed Virtual Routing)
本系列会分析OpenStack 的高可用性(HA)概念和解决方案: (1)OpenStack 高可用方案概述 (2)Neutron L3 Agent HA - VRRP (虚拟路由冗余协议) (3)N ...
- VLAN模式
一 二层基础知识 1.1 vlan介绍 本小节重点: vlan的含义 vlan的类型 交换机端口类型 vlan的不足 1.1.1:vlan的含义 局域网LAN的发展是VLAN产生的基础,因而先介绍一下 ...
- openstack项目【day24】:VLAN模式
本节内容 一 二层基础知识 1.1 vlan介绍 1.1.1:vlan的含义 1.1.2:vlan的类型 1.1.3:vlan的不足 1.2 : 二层交换的基础知识 1.2.1:二层交换机最基本的功能 ...
- openstack之Neutron网络模式vlan,gre,vxlan详解
第一:neutron openvswitch + vlan虚拟网络 一:基础知识 vlan基础知识 1.vlan介绍 1.1:首先说下lan,LAN 表示 Local Area Network,本地局 ...
随机推荐
- 两种动态加载JavaScript文件的方法
两种动态加载JavaScript文件的方法 第一种便是利用ajax方式,第二种是,动静创建一个script标签,配置其src属性,经过把script标签拔出到页面head来加载js,感乐趣的网友可以看 ...
- python3使用套接字遇到TypeError: 'str' does not support the buffer interface如何解决
这是我查看的博客 http://blog.csdn.net/chuanchuan608/article/details/17915959 直接引用里面的关键语句: When you use clien ...
- HDU 2298 Toxophily 【二分+三分】
一个人站在(0,0)处射箭,箭的速度为v,问是否能够射到(x,y)处,并求最小角度. 首先需要判断在满足X=x的情况下最大高度hmax是否能够达到y,根据物理公式可得 h=vy*t-0.5*g*t*t ...
- 反序列化存入数据库里面的session数据
session数据存取的方法可通过session.serialize_handler方法来判断,反序列化可通过下面的unserialize方法,参考http://stackoverflow.com/q ...
- 用于json的 .ashx 小细节
public void ProcessRequest(HttpContext context) { switch (action) { case "attribute_field_valid ...
- js正则匹配只能输入有效数字可加小数点
var reg = /^\d+\.?\d*$/; if(value.search(/^\d+\.?\d*$/)===0 && parseFloat(value)>0){//只能输 ...
- 哎呀,发现自己不会用模块的方式用kprobe啊,弱爆了
在内核外面编译模块,会报warning函数名undefined的错误,解决方法是把函数给export出来:EXPORT_SYMBOL 一直以来,用kprobe比较多的是kprobe event的用法, ...
- Open Sans字体兼容问题解决办法[font-face]
参考:http://www.tantengvip.com/2014/11/open-sans/ 1.font-face使用方法 font-face是CSS3中的一个模块,主要是把自定义的Web字体嵌入 ...
- http请求过程
想象用浏览器打开imooc.com网站,HTTP走过的环节: 1.首先,是对imooc.com域名解析,(1.1)浏览器搜索浏览器自身的DNS缓存.(DNS(Domain Name System,域名 ...
- tftp从linux下载文件
1,背景: 当我们ssh到一台linux上时候,从linux上下载一些文件,方案如下: 1.1通过sftp:通过win7 ftp客户端连接到linux去下载文件. 1.2通过tftp 2,问题 有些l ...