Openstack

帶有 Linux 橋設置的 Devstack

  • September 7, 2020

我在 Virtualbox 中創建了一個乾淨的 Ubuntu 18.04 VM,並希望使用 Linux Bridges 而不是 OpenVSwitch 作為後端來設置 devstack。我使用兩個網路介面設置虛擬機,每個介面都橋接到物理乙太網。一個 (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

這裡可能是什麼問題?如果您需要更多資訊,請詢問,我會提供。

這應該是評論,因為我無法對其進行測試,但我沒有足夠的聲譽在這裡發表評論。我相當肯定這個答案確實是一個答案。

ovs-vsctl儘管您配置的是 Linuxbridge 而不是 Openvswitch,但啟動腳本仍會執行。錯誤發生_move_neutron_addresses_routelib/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 行。

我認為這是一個錯誤。或者我錯過了一些東西:)

引用自:https://serverfault.com/questions/1032560