O版,OVS+VXLAN网络
在计算节点查看 br-tun 流表,关于流表的详细解释清参考(http://blog.csdn.net/dylloveyou/article/details/72639187)
[root@compute01 neutron]# ovs-ofctl dump-flows br-tun
NXST_FLOW reply (xid=0x4):
cookie=0x9aec1bf161d6039e, duration=59133.523s, table=0, n_packets=3, n_bytes=416, idle_age=37761, priority=1,in_port=1 actions=resubmit(,2)
cookie=0x9aec1bf161d6039e, duration=59125.488s, table=0, n_packets=2, n_bytes=433, idle_age=37761, priority=1,in_port=2 actions=resubmit(,4)
cookie=0x9aec1bf161d6039e, duration=59125.463s, table=0, n_packets=0, n_bytes=0, idle_age=59125, priority=1,in_port=3 actions=resubmit(,4)
cookie=0x9aec1bf161d6039e, duration=59133.521s, table=0, n_packets=0, n_bytes=0, idle_age=59133, priority=0 actions=drop
cookie=0x9aec1bf161d6039e, duration=59133.518s, table=2, n_packets=1, n_bytes=42, idle_age=37766, priority=1,arp,dl_dst=ff:ff:ff:ff:ff:ff actions=resubmit(,21)
cookie=0x9aec1bf161d6039e, duration=59133.515s, table=2, n_packets=2, n_bytes=374, idle_age=37761, priority=0,dl_dst=00:00:00:00:00:00/01:00:00:00:00:00 actions=resubmit(,20)
cookie=0x9aec1bf161d6039e, duration=59133.512s, table=2, n_packets=0, n_bytes=0, idle_age=59133, priority=0,dl_dst=01:00:00:00:00:00/01:00:00:00:00:00 actions=resubmit(,22)
cookie=0x9aec1bf161d6039e, duration=59133.511s, table=3, n_packets=0, n_bytes=0, idle_age=59133, priority=0 actions=drop
cookie=0x9aec1bf161d6039e, duration=59131.764s, table=4, n_packets=2, n_bytes=433, idle_age=37761, priority=1,tun_id=0x64 actions=mod_vlan_vid:1,resubmit(,10)
cookie=0x9aec1bf161d6039e, duration=59133.509s, table=4, n_packets=0, n_bytes=0, idle_age=59133, priority=0 actions=drop
cookie=0x9aec1bf161d6039e, duration=59133.507s, table=6, n_packets=0, n_bytes=0, idle_age=59133, priority=0 actions=drop
cookie=0x9aec1bf161d6039e, duration=59133.505s, table=10, n_packets=2, n_bytes=433, idle_age=37761, priority=1
......
ovs 执行 emer-reset 命令
[root@compute01 neutron]# ovs-vsctl emer-reset
再次查看流表信息,已经清空
[root@compute01 neutron]# ovs-ofctl dump-flows br-tun
cookie=0x0, duration=9.061s, table=0, n_packets=0, n_bytes=0, idle_age=9, priority=0 actions=NORMAL
查看 openvswitch-agent.log,则认为OVS is Dead,但是OVS还是正常运行的
2017-12-05 20:29:11.841 7 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native.ofswitch [req-fc25e364-ab2c-451b-9627-224bcd6560f6 - - - - -] ofctl request version=0x4,msg_type=0x12,msg_len=0x38,xid=0xbe6dd15e,OFPFlowStatsRequest(cookie=0,cookie_mask=0,flags=0,match=OFPMatch(oxm_fields={}),out_group=4294967295,out_port=4294967295,table_id=23,type=1) timed out
2017-12-05 20:29:11.843 7 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native.br_int [req-fc25e364-ab2c-451b-9627-224bcd6560f6 - - - - -] Failed to communicate with the switch
2017-12-05 20:29:11.843 7 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native.br_int Traceback (most recent call last):
2017-12-05 20:29:11.843 7 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native.br_int File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/br_int.py", line 52, in check_canary_table
2017-12-05 20:29:11.843 7 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native.br_int flows = self.dump_flows(constants.CANARY_TABLE)
2017-12-05 20:29:11.843 7 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native.br_int File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/ofswitch.py", line 131, in dump_flows
2017-12-05 20:29:11.843 7 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native.br_int reply_multi=True)
2017-12-05 20:29:11.843 7 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native.br_int File "/usr/lib/python2.7/site-packages/neutron/plugins/ml2/drivers/openvswitch/agent/openflow/native/ofswitch.py", line 89, in _send_msg
2017-12-05 20:29:11.843 7 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native.br_int raise RuntimeError(m)
2017-12-05 20:29:11.843 7 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native.br_int RuntimeError: ofctl request version=0x4,msg_type=0x12,msg_len=0x38,xid=0xbe6dd15e,OFPFlowStatsRequest(cookie=0,cookie_mask=0,flags=0,match=OFPMatch(oxm_fields={}),out_group=4294967295,out_port=4294967295,table_id=23,type=1) timed out
2017-12-05 20:29:11.843 7 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native.br_int
2017-12-05 20:29:11.850 7 WARNING neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent [req-fc25e364-ab2c-451b-9627-224bcd6560f6 - - - - -] OVS is dead. OVSNeutronAgent will keep running and checking OVS status periodically.
2017-12-05 20:29:41.884 7 ERROR neutron.plugins.ml2.drivers.openvswitch.agent.openflow.native.ofswitch [req-fc25e364-ab2c-451b-9627-224bcd6560f6 - - - - -] Switch connection timeout
......
重启 neutron-openvswitch-agent 后,流表恢复正常。
再看M版
在计算节点查看 br-tun 的流表
root@compute1:~# ovs-ofctl dump-flows br-tun
NXST_FLOW reply (xid=0x4):
cookie=0x8452729fc5c996cb, duration=16.012s, table=0, n_packets=0, n_bytes=0, idle_age=16, priority=1,in_port=1 actions=resubmit(,2)
cookie=0x8452729fc5c996cb, duration=12.923s, table=0, n_packets=0, n_bytes=0, idle_age=12, priority=1,in_port=4 actions=resubmit(,4)
cookie=0x8452729fc5c996cb, duration=12.230s, table=0, n_packets=0, n_bytes=0, idle_age=12, priority=1,in_port=3 actions=resubmit(,4)
cookie=0x8452729fc5c996cb, duration=16.012s, table=0, n_packets=0, n_bytes=0, idle_age=16, priority=0 actions=drop
......
执行 ovs-vsctl emer-reset
再查看流表,又恢复了
查看 openvswitch-agent.log,openvswitch-agent 认为 OVS is restarted. OVSNeutronAgent will reset bridges
2017-12-06 09:20:10.704 2004 WARNING neutron.plugins.ml2.drivers.openvswitch.agent.ovs_neutron_agent [req-ce029de0-f521-4701-bc6e-f6fa97da90e4 - - - - -] OVS is restarted. OVSNeutronAgent will reset bridges and recover ports.
......
为什么同样的操作,在M版能自动恢复流表,而在O版报错呢,这样算不算neutron-openvswitch-agent的一个bug?