使用packstack安裝,版本為M,默認為vxlan網絡, 操作系統為centos7.
由於學習的需要修改為flat網絡。
首先修改配置文件:
/etc/neutron/plugins/ml2/ml2_conf.ini
type_drivers = flat
tenant_network_types =flat
mechanism_drivers =openvswitch
flat_networks = physnet1
然后修改/etc/neutron/plugins/ml2/openvswitch_agent.ini
bridge_mappings = physnet1:br-phy
增加ovs br-phy,並且綁定對外端口:
[root@myopenstack ml2]# ovs-vsctl show 73bdadc0-287a-4c0f-9c54-6ad6fb575347 Bridge br-ex Port "qg-2ccfa701-cd" Interface "qg-2ccfa701-cd" type: internal Port br-ex Interface br-ex type: internal Bridge br-phy Port "enp0s3" Interface "enp0s3" Port phy-br-phy Interface phy-br-phy type: patch options: {peer=int-br-phy} Port br-phy Interface br-phy type: internal
然后重啟service: neutron-server neutron-dhcp-agent neutron-openvswitch-agent
創建網絡:
創建一個instance,使用這個網絡。
但是instance創建完成后,不能夠與外界通信。
自己嘗試分析原因:
[root@myopenstack ml2]# brctl show
bridge name bridge id STP enabled interfaces
qbr187d132b-9d 8000.ce4f9fccba4d no qvb187d132b-9d
tap187d132b-9d
instance創建一個linux bridge, 端口為qvb187d132b-9d。
[root@myopenstack ml2]# ovs-vsctl show
73bdadc0-287a-4c0f-9c54-6ad6fb575347
Bridge br-ex
Port "qg-2ccfa701-cd"
Interface "qg-2ccfa701-cd"
type: internal
Port br-ex
Interface br-ex
type: internal
Bridge br-phy
Port "enp0s3"
Interface "enp0s3"
Port phy-br-phy
Interface phy-br-phy
type: patch
options: {peer=int-br-phy}
Port br-phy
Interface br-phy
type: internal
Bridge br-tun
fail_mode: secure
Port br-tun
Interface br-tun
type: internal
Port patch-int
Interface patch-int
type: patch
options: {peer=patch-tun}
Bridge br-flat
Port br-flat
Interface br-flat
type: internal
Port phy-br-flat
Interface phy-br-flat
type: patch
options: {peer=int-br-flat}
Bridge br-int
fail_mode: secure
Port int-br-phy
Interface int-br-phy
type: patch
options: {peer=phy-br-phy}
Port "int-br-eth0"
Interface "int-br-eth0"
type: patch
options: {peer="phy-br-eth0"}
Port br-int
Interface br-int
type: internal
Port "tap239b2780-1b"
tag: 2
Interface "tap239b2780-1b"
type: internal
Port int-br-flat
Interface int-br-flat
type: patch
options: {peer=phy-br-flat}
Port "qvo187d132b-9d"
tag: 1
Interface "qvo187d132b-9d"
Port "qr-9e110b6b-5d"
tag: 2
Interface "qr-9e110b6b-5d"
type: internal
Port "tap2b05a39d-da"
tag: 1
Interface "tap2b05a39d-da"
type: internal
Port patch-tun
Interface patch-tun
type: patch
options: {peer=patch-int}
ovs_version: "2.5.0"
linux bridge 連接到bridage br-int 而不是預期的 bridge br-phy.
誰能幫忙看看這個問題的原因何在?
非常感謝。