neutron-plugin-openvswitch-agent启动流程_第1页
neutron-plugin-openvswitch-agent启动流程_第2页
neutron-plugin-openvswitch-agent启动流程_第3页
neutron-plugin-openvswitch-agent启动流程_第4页
neutron-plugin-openvswitch-agent启动流程_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

neutron-plugin-openvswitch-agent启动流程所有OVS命令的调用通过neutron-rootwrapsudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.confThe agent starts out by retrieving the IP information of the OVS integration bridge (br-int) local port. The MAC address returned is reformated for use as the suffix of the Neutron OVS agents ID.ip -o link show br-intIf the br-tun patch port exists on the br-int bridge it is deleted.ovs-vsctl -timeout=2 - -if-exists del-port br-int patch-tunNext any existing entries in the integration bridge flow table are deleted to ensure a clean environment and the first OpenFlow flow entry is added. The arguments hard_timeout and idle_timeout are set to 0 to ensure that the flow does not expire. Thepriority argument is set to 1 to ensure that other flows with a priority NXM_OF_VLAN_TCI clears the internal-to-Open vSwitch-switch VLAN TCI load:NXM_NX_TUN_ID-NXM_NX_TUN_ID writes the GRE tunnel ID to the tun_id registeroutput:NXM_OF_IN_PORT sets what the egress OVS port isand finally output: 1 forwards the packet out via the original patch-int port.ovs-ofctl add-flow br-tunhard_timeout=0,idle_timeout=0,priority=1,table=10,actions=learn(table=20,priority=1,hard_timeout=300,NXM_OF_VLAN_TCI0.11,NXM_OF_ETH_DST=NXM_OF_ETH_SRC,load:0-NXM_OF_VLAN_TCI,load:NXM_NX_TUN_ID-NXM_NX_TUN_ID,output:NXM_OF_IN_PORT), output:1The next flow is used to capture any remaining packets and forward them to flow table 21 (FLOOD_TO_TUN) - basically these packets are unknown and all unknown packets are not considered multicast/broadcast and should be dropped.ovs-ofctl add-flow br-tunhard_timeout=0,idle_timeout=0,priority=0,table=20,actions=resubmit(,21)Finally, drop any of the packets that get to flow table 21 (FLOOD_TO_TUN).ovs-ofctl add-flow br-tun hard_timeout=0,idle_timeout=0,priority=0,table=21,actions=dropNext the Neutron OVS agent retrieves the list of existing bridges, filters out the integration and tunnel bridges, and then searches for any remaining bridges to determine whether any are externally linked and should be managed.ovs-vsctl -timeout=2 list-brUp to now the integration bridge (br-int) and tunnel bridge (br-tun) have been configured with their default specifications. The GRE tunnel ports have not been created or configured so the agent does that now.The remote GRE endpoints are retrieved from the topology schema overseen/maintained by the neutron-server daemon. Notice that the GRE ports below are named using an IP prefixed by gre, this one thing that has changed (IMHO for the better) in the latest iteration of the Neutron OVS agent. The IP address in the name is the remote hosts IP, in this case 172.31.254.29 is a remote nova-compute nodes IP address.For brevitys sake Im only including the configuration steps for one remote GRE endpoint, this environment has many but the configuration is the same.First a port is created on the tunnel bridge with the name gre-172.31.254.29ovs-vsctl -timeout=2 - -may-exist add-port br-tun gre-172.31.254.29the port is configured as type greovs-vsctl -timeout=2 set Interface gre-172.31.254.29 type=grea remote GRE endpoint is addedovs-vsctl -timeout=2set Interface gre-172.31.254.29 options:remote_ip=172.31.254.29the local GRE endpoint is addedovs-vsctl -timeout=2 set Interface gre-172.31.254.29 options:local_ip=172.31.254.65will be controlled by a OpenFlow flowovs-vsctl -timeout=2 set Interface gre-172.31.254.29 options:in_key=flowovs-vsctl -timeout=2 set Interface gre-172.31.254.29 options:out_key=flowand then a check is done to determine whether the port was created and configured successfully. In the background a comparison is done between the returned ofport value and -1. As long as the ofport value is greater than -1 the port was created/configured successfully. If -1 is returned the port configuration failed but the agents initialization sequence doesnt stop.ovs-vsctl -timeout=2 get Interface gre-172.31.254.29 ofportThe integer returned from the last command is also used to populate the in_port argument value in the next OpenFlow flow table configuration command which is used to add the port to the GRE_TUN_TO_LV flow table. Any network packets that ingress this new GRE endpoint port will be manipulated using the OpenFlow flow entries in the GRE_TUN_TO_LV created earlier.ovs-ofctl add-flow br-tunhard_timeout=0,idle_timeout=0,priority=1,in_port=4,actions=resubmit(,2)The next two commands tally the existing, added, and/or removed ports by comparing the ports that existed during the last poll of the Neutron OVS agent. Both of these commands are initiated by an if statement found on line 1081 and 1082 in the ovs_neutron_plugin.py file:ovs-vsctl -timeout=2 list-ports br-intSecondly the list Interface action retrieves a list of the ports with their names and external IDs (the attached MAC address, interface ID, interface status, and VM ID) and assigns the results to a variable.ovs-vsctl -timeout=2 -format=json - -columns=name,external_ids list InterfaceThe two variables are compared, if a difference is found the divergence is calculated as one of two states: added or removed, and the network

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论