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流程的更多相关文章

  1. 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 ...

  2. 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 ...

  3. OVS ARP Responder – Theory and Practice

    Prefix In the GRE tunnels post I’ve explained how overlay networks are used for connectivity and ten ...

  4. 从三个开源项目认识OpenFlow交换机 - OVS

    在SDN/NFV的网络革新技术浪潮的引领下,催生了诸多数据面开源方案的诞生.业界知名度较高的有OVS(Open vSwitch).FD.io (Fast Data I/O).ODP(Open Data ...

  5. SNMP AGENT函数介绍

    http://wenku.baidu.com/view/6a7903a9d1f34693daef3e9f.html 一.  SNMP AGENT在SNMP框架中的位置 1.1 SNMP是被广泛接受并投 ...

  6. Neutron 理解 (2): 使用 Open vSwitch + VLAN 组网 [Netruon Open vSwitch + VLAN Virutal Network]

    学习 Neutron 系列文章: (1)Neutron 所实现的虚拟化网络 (2)Neutron OpenvSwitch + VLAN 虚拟网络 (3)Neutron OpenvSwitch + GR ...

  7. 理解 OpenStack 高可用(HA)(3):Neutron 分布式虚拟路由(Neutron Distributed Virtual Routing)

    本系列会分析OpenStack 的高可用性(HA)概念和解决方案: (1)OpenStack 高可用方案概述 (2)Neutron L3 Agent HA - VRRP (虚拟路由冗余协议) (3)N ...

  8. VLAN模式

    一 二层基础知识 1.1 vlan介绍 本小节重点: vlan的含义 vlan的类型 交换机端口类型 vlan的不足 1.1.1:vlan的含义 局域网LAN的发展是VLAN产生的基础,因而先介绍一下 ...

  9. openstack项目【day24】:VLAN模式

    本节内容 一 二层基础知识 1.1 vlan介绍 1.1.1:vlan的含义 1.1.2:vlan的类型 1.1.3:vlan的不足 1.2 : 二层交换的基础知识 1.2.1:二层交换机最基本的功能 ...

  10. openstack之Neutron网络模式vlan,gre,vxlan详解

    第一:neutron openvswitch + vlan虚拟网络 一:基础知识 vlan基础知识 1.vlan介绍 1.1:首先说下lan,LAN 表示 Local Area Network,本地局 ...

随机推荐

  1. NOIP2009普及组细胞分裂(数论)——yhx

    题目描述 Hanks 博士是 BT (Bio-Tech,生物技术) 领域的知名专家.现在,他正在为一个细胞实 验做准备工作:培养细胞样本. Hanks 博士手里现在有 N 种细胞,编号从 1~N,一个 ...

  2. 【ASP.NET 进阶】定时执行任务实现 (定时读取和修改txt文件数字内容,无刷新显示结果)

    现在有很多网站或系统需要在服务端定时做某件事情,如每天早上8点半清理数据库中的无效数据等等,Demo 具体实现步骤如下: 0.先看解决方案截图 1.创建ASP.NET项目TimedTask,然后新建一 ...

  3. jQuery对象与dom对象的区别与相互转换

    什么是jQuery对象? 就是通过jQuery包装DOM对象后产生的对象.jQuery对象是jQuery独有的,其可以使用jQuery里的方法.例如: $("#test").htm ...

  4. Centos源码安装Python3

    CentOS7默认安装了python2.7.5,当需要使用python3的时候,可以手动下载Python源码后编译安装. 下载python(https://www.python.org/ftp/pyt ...

  5. HTML设置超链接字体颜色和点击后的字体颜色

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  6. Saltstack-自动化部署

    Saltstack概述 Salt一种全新的基础设施管理方式,部署轻松,在几分钟内可运行起来,扩展性好,很容易管理上万台服务器,速度够快,服务器之间秒级通讯. salt底层采用动态的连接总线, 使其可以 ...

  7. 各浏览器对typeof运算符的实现差异

    1,IE6/7/8中typeof运算符对BOM对象如window,document,location,history等对象的方法返回“object”,标准浏览器都返回“function”. 1 2 3 ...

  8. MAC中设置android adb环境变量

    1.找到android sdk的本地路径, adb命令在platform-tool下面,记为XXXX 我的路径是(/Applications/eclipse/android-sdk-mac_x86/p ...

  9. UWP 解压 GZIP

    准备工作: 通过 NUGET 安装 Microsoft.Bcl.Compression ; 使用命名空间 using System.IO.Compression ; public static asy ...

  10. Linux中查看各文件夹大小命令du -h --max-depth=1

    http://blog.csdn.net/ouyang_peng/article/details/10414499 du -h --max-depth=1