Openswitch not bringing up bond on boot

Jon Massey

Member
Dec 23, 2017
4
0
21
39
I have two ovs bridges configured, each with its own bonded pair of physical interfaces, and a bunch of internal ports. On boot/started openvswitch, it appears that openvswitch tries to start bond0 before bridge0 is up and thus fails.

If I manually run
Code:
ovs-vsctl add-bond vmbr0 bond0 eno1 eno2 lacp=active other_config:lacp-time=fast bomd_mode=balance-tcp
after the fact it comes up OK.

I've ordered my /etc/network/interfaces as per the wiki.

Any ideas?


/etc/network/interfaces
Code:
auto lo
iface lo inet loopback

allow-ovs vmbr1
iface vmbr1 inet manual
        ovs_type OVSBridge
        ovs_ports bond0 vlan200

allow-ovs vmbr0
iface vmbr0 inet manual
        ovs_type OVSBridge
        ovs_ports bond0 vlan1 vlan10 vlan9


allow-vmbr0
iface bond0 inet manual
        ovs_bonds eno1 eno2
        ovs_type OVSBond
        ovs_bridge vmbr0
        ovs_options lacp=active other_config:lacp-time=fast bond_mode=balance-tcp

allow-vmbr1
iface bond1 inet manual
        ovs_bonds enp1s0 enp1s0d1
        ovs_type OVSBond
        ovs_bridge vmbr1
        ovs_options lacp=active bond_mode=balance-tcp other_config:lacp-time=fast



allow-vmbr0 vlan1
iface vlan1 inet static
        address 192.168.0.118/24
        gateway 192.168.0.254
        ovs_type OVSIntPort
        ovs_bridge vmbr0
#primary

allow-vmbr0 vlan10
iface vlan10 inet static
        address 192.168.10.2/24
        ovs_type OVSIntPort
        ovs_bridge vmbr0
        ovs_options tag=10
#clusternet

allow-vmbr1 vlan200
iface vlan200 inet static
        address 192.168.200.118/24
        ovs_type OVSIntPort
        ovs_bridge vmbr1
        ovs_options tag=200
#STORAGENET

[many more intports...]

openvswitch systemctl output
Code:
Jun 21 16:47:08 netcat ovs-vsctl[6622]: ovs|00001|vsctl|INFO|Called as ovs-vsctl --timeout=5 -- --may-exist --fake-iface add-bond vmbr0 bond0 eno1 eno2 lacp=active other_config:lacp-time=fast bond_mode=balance-tcp --
Jun 21 16:47:08 netcat ovs-vsctl[6622]: ovs|00002|db_ctl_base|ERR|no bridge named vmbr0
Jun 21 16:47:08 netcat openvswitch-switch[6521]: ovs-vsctl: no bridge named vmbr0
Jun 21 16:47:08 netcat openvswitch-switch[6521]: Cannot find device "bond0"
Jun 21 16:47:08 netcat ovs-vsctl[6678]: ovs|00001|vsctl|INFO|Called as ovs-vsctl --timeout=5 -- --may-exist add-port vmbr1 vlan200 tag=200 -- set Interface vlan200 type=internal --
Jun 21 16:47:08 netcat ovs-vsctl[6789]: ovs|00001|vsctl|INFO|Called as ovs-vsctl --timeout=5 -- --may-exist add-br vmbr0 --
Jun 21 16:47:08 netcat ovs-vsctl[6812]: ovs|00001|vsctl|INFO|Called as ovs-vsctl --timeout=5 -- --may-exist add-port vmbr0 vlan1 -- set Interface vlan1 type=internal --
Jun 21 16:47:08 netcat ovs-vsctl[6876]: ovs|00001|vsctl|INFO|Called as ovs-vsctl --timeout=5 -- --may-exist add-port vmbr0 vlan10 tag=10 -- set Interface vlan10 type=internal --
Jun 21 16:47:08 netcat ovs-vsctl[6940]: ovs|00001|vsctl|INFO|Called as ovs-vsctl --timeout=5 -- --may-exist add-port vmbr0 vlan9 tag=9 -- set Interface vlan9 type=internal --
Jun 21 16:47:08 netcat systemd[1]: Started Open vSwitch.
 
If it's not too late, a working interfaces file with Proxmox 7 in my case :
Bash:
# The loopback network interface
auto lo
iface lo inet loopback

# The four network interface
allow enp4s0f0
iface enp4s0f0 inet manual

allow enp4s0f1
iface enp4s0f1 inet manual

allow eno1
iface eno1 inet manual

allow eno2
iface eno2 inet manual


allow-vmbr0 bond0
iface bond0 inet manual
    ovs_bridge  vmbr0
    ovs_type    OVSBond
    ovs_bonds   enp4s0f0 enp4s0f1
    ovs_options bond_mode=balance-slb other_config:lacp-fallback-ab=true  other_config:bond-rebalance-interval=5000  vlan_mode=native-untagged tag=666 trunks=10,120,130
    pre-up  ( ifconfig enp4s0f0 mtu 9000 && ifconfig enp4s0f1 mtu 9000 )
    mtu     9000
# OVSBond0 enp4s0f0 enp4s0f1 MTU 9000

auto vmbr0
allow-ovs vmbr0
iface vmbr0 inet manual
    ovs_type  OVSBridge
    ovs_ports bond0 vlan10 vlan120 vlan130
    mtu     9000
# 10CC - 120DMZ - 130SRV

allow-vmbr0 vlan10
iface vlan10 inet manual
    ovs_type    OVSIntPort
    ovs_bridge  vmbr0
    ovs_options tag=10
    ovs_extra   set interface ${IFACE} external-ids:iface-id=$(hostname -s)-${IFACE}-vif
    mtu         9000
# VLAN 10 MTU 9000

allow-vmbr0 vlan120
iface vlan120 inet manual
    ovs_type    OVSIntPort
    ovs_bridge  vmbr0
    ovs_options tag=120
    ovs_extra   set interface ${IFACE} external-ids:iface-id=$(hostname -s)-${IFACE}-vif
    mtu         9000
# VLAN 120 MTU 9000

allow-vmbr0 vlan130
iface vlan130 inet static
    ovs_type    OVSIntPort
    ovs_bridge  vmbr0
    ovs_options tag=130
    ovs_extra   set interface ${IFACE} external-ids:iface-id=$(hostname -s)-${IFACE}-vif
    address   192.168.1.3
    netmask   255.255.255.0
    gateway   192.168.1.254
    mtu       9000
    dns-search      domain.tld
    dns-nameservers …
# VLAN 130 MTU 9000


allow-vmbr1 bond1
iface bond1 inet manual
    ovs_bridge  vmbr1
    ovs_type    OVSBond
    ovs_bonds   eno1 eno2
    ovs_options bond_mode=balance-slb other_config:lacp-fallback-ab=true  other_config:bond-rebalance-interval=5000 tag=200
# OVSBond1 eno1 eno2

auto vmbr1
allow-ovs vmbr1
iface vmbr1 inet manual
    ovs_type    OVSBridge
    ovs_ports   bond1 vlan200
# 200IPR-ADM

allow-vmbr1 vlan200
iface vlan200 inet static
    ovs_type    OVSIntPort
    ovs_bridge  vmbr1
    ovs_options tag=200
    ovs_extra   set interface ${IFACE} external-ids:iface-id=$(hostname -s)-${IFACE}-vif
    address   10.10.10.1
    netmask   255.255.255.0
    network   10.10.10.0
# VLAN 200

Also, it works only with ifupdown+ifenslave, not with ifupdown2 ;)

And ovs-vsctl says :
Bash:
ovs-vsctl show

    Bridge vmbr1
        Port vlan200
            tag: 200
            Interface vlan200
                type: internal
        Port vmbr1
            Interface vmbr1
                type: internal
        Port bond1
            tag: 200
            Interface eno1
            Interface eno2
    Bridge vmbr0
        Port vlan130
            tag: 130
            Interface vlan130
                type: internal
        Port vmbr0
            Interface vmbr0
                type: internal
        Port vlan10
            tag: 10
            Interface vlan10
                type: internal
        Port vlan120
            tag: 110
            Interface vlan120
                type: internal
        Port bond0
            tag: 666
            trunks: [10, 120, 130]
            Interface enp4s0f0
            Interface enp4s0f1
    ovs_version: "2.15.0"
 
  • Like
Reactions: RokaKen