Ubuntu上的OpenStack多节点网络配置

时间:2018-09-25 20:43:18

标签: openstack devstack openvswitch openstack-neutron

我正在尝试通过devstack设置一个简单的2节点部署。我同时遵循了多节点实验和“ Using devstack with Neutron”指南。我与后者取得了最大的进步。但是,我似乎仍然无法与在仅计算节点上运行的实例进行通信。在控制器/计算节点上运行的实例看起来不错。我可以从办公室中的任何计算机ping / ssh到他们。

我的环境:2台ubuntu 18.04裸机服务器,带有路由器的专用网络分发DHCP地址(我留出了一小部分地址)。我禁用了Ubuntu NetworkManager,并通过/ etc / network / interfaces中的ifupdown进行了配置:

auto enp0s31f6
iface enp0s31f6 inet static
    address 192.168.7.170
    netmask 255.255.255.0
    gateway 192.168.7.254
    multicast 192.168.7.255
    dns-nameservers 8.8.8.8 8.8.4.4

控制器/计算节点local.conf根据指南进行配置:

[[local|localrc]]

HOST_IP=192.168.7.170
SERVICE_HOST=192.168.7.170
MYSQL_HOST=192.168.7.170
RABBIT_HOST=192.168.7.170
GLANCE_HOSTPORT=192.168.7.170:9292
DATABASE_PASSWORD=Passw0rd
RABBIT_PASSWORD=Passw0rd
SERVICE_PASSWORD=Passw0rd
ADMIN_PASSWORD=Passw0rd

LOGFILE=/opt/stack/logs/stack.sh.log

## Neutron options
Q_USE_SECGROUP=True
FLOATING_RANGE="192.168.7.0/24"
IPV4_ADDRS_SAFE_TO_USE="10.0.0.0/22"
Q_FLOATING_ALLOCATION_POOL=start=192.168.7.249,end=192.168.7.253
PUBLIC_NETWORK_GATEWAY="192.168.7.254"
PUBLIC_INTERFACE=enp0s31f6

# Open vSwitch provider networking configuration
Q_USE_PROVIDERNET_FOR_PUBLIC=True
Q_ASSIGN_GATEWAY_TO_PUBLIC_BRIDGE=False
OVS_PHYSICAL_BRIDGE=br-ex
PUBLIC_BRIDGE=br-ex
OVS_BRIDGE_MAPPINGS=public:br-ex

一个区别是Q_ASSIGN_GATEWAY_TO_PUBLIC_BRIDGE。我发现如果未设置此项,服务器上会丢失很多数据包。我不明白为什么要将网关作为辅助地址添加到vSwitch。

我注意到的另一个奇怪之处是,一旦设置了OVS新娘并将我的公共接口添加为端口,网络网关就不再充当DNS服务器。如果我使用google,就可以了。

在仅计算节点上,我具有local.conf:

[[local|localrc]]

HOST_IP=192.168.7.172
LOGFILE=/opt/stack/logs/stack.sh.log

SERVICE_HOST=192.168.7.170
MYSQL_HOST=$SERVICE_HOST
RABBIT_HOST=$SERVICE_HOST
GLANCE_HOSTPORT=$SERVICE_HOST:9292

ADMIN_PASSWORD=Passw0rd
DATABASE_PASSWORD=Passw0rd
RABBIT_PASSWORD=Passw0rd
SERVICE_PASSWORD=Passw0rd

PUBLIC_INTERFACE=enp0s31f6
ENABLED_SERVICES=n-cpu,rabbit,q-agt,placement-client

我在控制器/计算节点上运行stack.sh,然后在仅计算节点上运行。安装看起来不错。我可以设置安全组,ssh密钥对等并启动实例。我为每个和关联分配浮动IP。地址来自池,如预期的那样。我可以看到使用OVS在每个节点上建立的隧道:

controller$ sudo ovs-vsctl show
1cc8a95d-660d-453f-9772-02393adc2031
    Manager "ptcp:6640:127.0.0.1"
        is_connected: true
    Bridge br-tun
        Controller "tcp:127.0.0.1:6633"
            is_connected: true
        fail_mode: secure
        Port br-tun
            Interface br-tun
                type: internal
        Port patch-int
            Interface patch-int
                type: patch
                options: {peer=patch-tun}
        Port "vxlan-c0a807ac"
            Interface "vxlan-c0a807ac"
                type: vxlan
                options: {df_default="true", in_key=flow, local_ip="192.168.7.170", out_key=flow, remote_ip="192.168.7.172"}
    Bridge br-ex
        Controller "tcp:127.0.0.1:6633"
            is_connected: true
        fail_mode: secure
        Port br-ex
            Interface br-ex
                type: internal
        Port phy-br-ex
            Interface phy-br-ex
                type: patch
                options: {peer=int-br-ex}
        Port "enp0s31f6"
            Interface "enp0s31f6"
    Bridge br-int
        Controller "tcp:127.0.0.1:6633"
            is_connected: true
        fail_mode: secure
        Port "qg-7db4efa8-8f"
            tag: 2
            Interface "qg-7db4efa8-8f"
                type: internal
        Port "tap88eb8a36-86"
            tag: 1
            Interface "tap88eb8a36-86"
                type: internal
        Port patch-tun
            Interface patch-tun
                type: patch
                options: {peer=patch-int}
        Port int-br-ex
            Interface int-br-ex
                type: patch
                options: {peer=phy-br-ex}
        Port br-int
            Interface br-int
                type: internal
        Port "qr-e0e43871-2d"
            tag: 1
            Interface "qr-e0e43871-2d"
                type: internal
        Port "qvo5a54876d-0c"
            tag: 1
            Interface "qvo5a54876d-0c"
        Port "qr-9452dacf-82"
            tag: 1
            Interface "qr-9452dacf-82"
                type: internal
    ovs_version: "2.8.1"

以及仅计算节点上:

compute$ sudo ovs-vsctl show
c817878d-7127-4d17-9a69-4ff296adc157
    Manager "ptcp:6640:127.0.0.1"
        is_connected: true
    Bridge br-int
        Controller "tcp:127.0.0.1:6633"
            is_connected: true
        fail_mode: secure
        Port "qvo1b56a018-10"
            tag: 1
            Interface "qvo1b56a018-10"
        Port patch-tun
            Interface patch-tun
                type: patch
                options: {peer=patch-int}
        Port br-int
            Interface br-int
                type: internal
        Port int-br-ex
            Interface int-br-ex
                type: patch
                options: {peer=phy-br-ex}
    Bridge br-ex
        Controller "tcp:127.0.0.1:6633"
            is_connected: true
        fail_mode: secure
        Port phy-br-ex
            Interface phy-br-ex
                type: patch
                options: {peer=int-br-ex}
        Port br-ex
            Interface br-ex
                type: internal
    Bridge br-tun
        Controller "tcp:127.0.0.1:6633"
            is_connected: true
        fail_mode: secure
        Port "vxlan-c0a807aa"
            Interface "vxlan-c0a807aa"
                type: vxlan
                options: {df_default="true", in_key=flow, local_ip="192.168.7.172", out_key=flow, remote_ip="192.168.7.170"}
        Port br-tun
            Interface br-tun
                type: internal
        Port patch-int
            Interface patch-int
                type: patch
                options: {peer=patch-tun}
    ovs_version: "2.8.1"

关于我的设置可能有什么问题的任何想法?有什么建议可以尝试吗?

1 个答案:

答案 0 :(得分:0)

原来,我停止服务后,Ubuntu网络管理器正在重新声明自身。我采取了更激烈的步骤,从服务器上禁用和清除它:systemctl disable NetworkManager.service然后是apt-get purge network-manager

一旦它一去不复返,一切就如广告所宣传的那样开始运作。我从上面的local.conf开始,能够旋转两个服务器上的实例,并连接到它们,并且它们彼此之间的连接都没有问题,等等。然后,我在堆栈中添加了更多块(热量,大酒瓶,巴比肯,lbaasv2 ),一切仍然可靠。

故事的寓意是:Ubuntu Network Manager和devstack ovs config不能很好地配合使用。要使后者工作,您必须删除前者(据我所知)。

此外,在ovs遇到所有此类麻烦之前,我必须对仅计算节点上的devstack的lib / etcd3脚本应用建议的修复程序。截至2018年9月27日,stable / queens分支中的变化很小但必不可少。参见https://github.com/openstack-dev/devstack/commit/19279b0f8。没有此stack.sh的计算节点尝试绑定到控制器节点上的地址失败。