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. 矩阵乘法 codevs 1287 矩阵乘法

    1287 矩阵乘法  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 黄金 Gold       题目描述 Description 小明最近在为线性代数而头疼,线性代数确实很抽象 ...

  2. Fisker大师用ZBrush制作兽人萨尔全过程

    十二年前,暴雪推出第一款网络游戏<魔兽世界>,以迅雷不及掩耳盗铃之势风靡全球:十二年后,魔兽终于改编成大电影,同样掀起了一场巨大的风暴, 接二连三打破了多项票房纪录.纵观游戏史,很难找出一 ...

  3. C++基础笔记(四)C++内存管理

    析构函数 * 析构函数在对象所占用内存释放时调用,通常用来释放相关的资源 * 析构函数就是一个特殊的类成员函数,它是构造函数相反 构造函数:对象在分配内存之后,立即调用 析构函数:对象在内存被释放之前 ...

  4. Eclipse快捷键列表大全

    from: http://hi.baidu.com/lzycsd/item/c6febccceacc173c44941684 from: http://www.open-open.com/bbs/vi ...

  5. 常用excel技巧

    1.excel 设置行列分色显示  =MOD(ROW(),2)=0 2.多表匹配数据 通过身份证在另外一个表查找这个人的基本信息 第一张表 第二张表: =VLOOKUP(F12,'2014总表'!D: ...

  6. SQLite 解决:Could not load file or assembly 'System.Data.SQLite ... 试图加载格式不正确的程序/or one of its dependencies. 找不到指定的模块。

     Could not load file or assembly 'System.Data.SQLite.dll' or one of its dependencies. 找不到指定的模块. 错误提示 ...

  7. android studio使用说明

    一.学习的基本配置文档,搞好各种参数的基本配置,熟练使用. C:\Program Files\Java\jdk1.7.0_09\bin   二.problems meet in weather and ...

  8. [iOS翻译]《iOS7 by Tutorials》系列:在Xcode 5里使用单元测试(上)

    简介: 单元测试是软件开发的一个重要方面.毕竟,单元测试可以帮你找到bug和崩溃原因,而程序崩溃是Apple在审查时拒绝app上架的首要原因. 单元测试不是万能的,但Apple把它作为开发工具包的一部 ...

  9. [CareerCup] 5.1 Insert Bits 插入位

    5.1 You are given two 32-bit numbers, N and M, and two bit positions, land j. Write a method to inse ...

  10. [CareerCup] 6.4 Blue Eyes People on Island 岛上的蓝眼人

    6.4 A bunch of people are living on an island, when a visitor comes with a strange order: all blue-e ...