带有 Linux Bridge 设置的 Devstack

带有 Linux Bridge 设置的 Devstack

我在 Virtualbox 中创建了一个干净的 Ubuntu 18.04 VM,并希望使用 Linux Bridges 而不是 OpenVSwitch 作为后端来设置 devstack。我为 VM 设置了两个网络接口,每个接口都桥接到物理以太网。一个 (enp0s8) 用于管理目的。一个 (enp0s3) 应该是(模拟的)公共互联网。

我跟着Openstack 文档中的指南并使用以下配置:

[[local|localrc]]
HOST_IP=172.17.5.3
SERVICE_HOST=172.17.5.3
MYSQL_HOST=172.17.5.3
RABBIT_HOST=172.17.5.3
GLANCE_HOSTPORT=172.17.5.3:9292
ADMIN_PASSWORD=secret
DATABASE_PASSWORD=secret
RABBIT_PASSWORD=secret
SERVICE_PASSWORD=secret

## Neutron options
Q_USE_SECGROUP=True
FLOATING_RANGE="172.17.4.0/24"
IPV4_ADDRS_SAFE_TO_USE="10.0.4.0/22"
Q_FLOATING_ALLOCATION_POOL=start=172.17.4.200,end=172.17.4.250
PUBLIC_NETWORK_GATEWAY="172.17.4.1"
PUBLIC_INTERFACE=enp0s3

# Linuxbridge provider networking configuration
Q_USE_PROVIDERNET_FOR_PUBLIC=True
Q_AGENT=linuxbridge
LB_PHYSICAL_INTERFACE=enp0s3
PUBLIC_PHYSICAL_NETWORK=default
LB_INTERFACE_MAPPINGS=default:enp0s3

失败并出现以下错误:

++lib/neutron-legacy:_move_neutron_addresses_route:634  ip -f inet a s dev enp0s3 scope global primary                                                                                                             
++lib/neutron-legacy:_move_neutron_addresses_route:634  grep inet
+lib/neutron-legacy:_move_neutron_addresses_route:634  IP_BRD=
+lib/neutron-legacy:_move_neutron_addresses_route:636  '[' '' '!=' '' ']'
+lib/neutron-legacy:_move_neutron_addresses_route:640  [[ True == \T\r\u\e ]]
+lib/neutron-legacy:_move_neutron_addresses_route:641  ADD_OVS_PORT='sudo ovs-vsctl --may-exist add-port br-ex enp0s3'
+lib/neutron-legacy:_move_neutron_addresses_route:644  [[ False == \T\r\u\e ]]
+lib/neutron-legacy:_move_neutron_addresses_route:648  [[ '' != '' ]]
+lib/neutron-legacy:_move_neutron_addresses_route:660  sudo ovs-vsctl --may-exist add-port br-ex enp0s3
ovs-vsctl: no bridge named br-ex
+lib/neutron-legacy:_move_neutron_addresses_route:1  exit_trap
+./stack.sh:exit_trap:489                  local r=1
++./stack.sh:exit_trap:490                  jobs -p
+./stack.sh:exit_trap:490                  jobs=
+./stack.sh:exit_trap:493                  [[ -n '' ]]
+./stack.sh:exit_trap:499                  '[' -f /tmp/tmp.UH77TYI9rG ']'
+./stack.sh:exit_trap:500                  rm /tmp/tmp.UH77TYI9rG
+./stack.sh:exit_trap:504                  kill_spinner
+./stack.sh:kill_spinner:399               '[' '!' -z '' ']'
+./stack.sh:exit_trap:506                  [[ 1 -ne 0 ]]
+./stack.sh:exit_trap:507                  echo 'Error on exit'
Error on exit
+./stack.sh:exit_trap:509                  type -p generate-subunit
+./stack.sh:exit_trap:510                  generate-subunit 1599133116 5497 fail
+./stack.sh:exit_trap:512                  [[ -z /opt/stack/logs ]]
+./stack.sh:exit_trap:515                  /usr/bin/python3.6 /home/lukas/devstack/tools/worlddump.py -d /opt/stack/logs
World dumping... see /opt/stack/logs/worlddump-2020-09-03-131013.txt for details
+./stack.sh:exit_trap:524                  exit 1

这里可能存在什么问题?如果您需要更多信息,请提出要求,我会提供。

答案1

这应该是一条评论,因为我无法测试它,但我没有足够的声誉在这里发表评论。我相当肯定这个答案确实是一个答案。

尽管您配置的是 Linuxbridge 而不是 Openvswitch,启动脚本仍会执行ovs-vsctl。错误发生在_move_neutron_addresses_route中的某个函数的第 660 行lib/neutron-legacy。此函数在设置 OVS_PHYSICAL_BRIDGE 时执行:

if [[ -n "$OVS_PHYSICAL_BRIDGE" ]]; then
    _move_neutron_addresses_route "$OVS_PHYSICAL_BRIDGE" "$PUBLIC_INTERFACE" False True "inet"

不幸的是,lib/neutron-legacy无论如何都会设置 OVS_PHYSICAL_BRIDGE。第 227 行:

OVS_PHYSICAL_BRIDGE=${OVS_PHYSICAL_BRIDGE:-br-ex}

因此,我担心的是,即使你在中设置了 OVS_PHYSICAL_BRIDGE="" local.conf,它也会被设置为br-ex,并且上述代码将被执行。

lib/neutron-legacy我的建议:在启动堆栈之前尝试删除或注释掉第 227 行。

我认为这是一个错误。或者我遗漏了一些东西 :)

相关内容