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. C++ 基础笔记(一)

    解释型和编译型 解释型: 边解释边执行,翻译成机器代码后就执行. 编译型: 整篇代码编译成机器码后,保存在可执行文件中,然后启动该程序文件,运行获得结果. Hello World #include & ...

  2. UMLUnified Modeling Language (UML)又称统一建模语言或标准建模语言

    1.用例图(use case diagram) 2.活动图(activity diagram) 3.静态结构图 4.顺序图(Sequence Diagram):时序图 5.交互纵览图(Interact ...

  3. java 21 - 12 IO流的打印流

    打印流 字节流打印流 PrintStream 字符打印流 PrintWriter打印流的特点: A:只有写数据的,没有读取数据.只能操作目的地,不能操作数据源.(只能写入数据到文件中,而不能从文件中提 ...

  4. java 16 - 9 增强for的概述和使用

    JDK5的新特性:自动拆装箱,泛型,增强for,静态导入,可变参数,枚举 增强for:是for循环的一种. 格式: for(元素数据类型 变量 : 数组或者Collection集合) { 使用变量即可 ...

  5. Java的IO操作---File类

    目标 1)掌握File类作用 2)可以使用file类中方法对文件进行读写操作. File类 唯一与文件有关的类.使用file类可进行创建或删除操作,要想使用File类,首先观察File类的构造方法. ...

  6. 部署Zipkin分布式性能追踪日志系统的操作记录

    Zipkin是Twitter的一个开源项目,是一个致力于收集Twitter所有服务的监控数据的分布式跟踪系统,它提供了收集数据,和查询数据两大接口服务. 部署Zipkin环境的操作记录:部署Zipki ...

  7. 在collection view中加入 NavigationController问题

    在开发过程中用collectionView集合视图的时候,用navgationController跳转会出现导航栏掩盖部分内容现象, 这时候需要在viewDidLoad里面填写 self.edgesF ...

  8. RelayCommand命令

    原文:http://www.cnblogs.com/xiepeixing/archive/2013/08/13/3255152.html 常用Wpf开发中我们在ViewModel中实现INotifyP ...

  9. Linux PPTP搭建

    PPPTP概述 tcp1723 1,安装 rpm -ivh ppp--14.1.rhel5.x86_64.rpm #安装ppp rpm -ivh pptpd--.rhel5.x86_64.rpm #安 ...

  10. 微信开放平台,微信登陆第三方网站 提示redirect_uri 参数错误

    在微信开放平台上我填写的回调域是:bbs.qiaoshisui.com/LoginApi/WeiXinCallBack,我构造的链接是:https://open.weixin.qq.com/conne ...