srl-labs / containerlab

container-based networking labs
https://containerlab.dev
BSD 3-Clause "New" or "Revised" License
1.52k stars 261 forks source link

ovs-bridge type getting Error: "<ovs_bridge_name>" already exists but is not a bridge #1181

Closed mitai914 closed 1 year ago

mitai914 commented 1 year ago

After upgrading containerlab from v0.32.1 to v0.34.0, I'm getting the following error: Error: "<ovs_bridge_name>" already exists but is not a bridge

Linux Version: CentOS Linux release 7.9.2009 (Core) Containerlab Version: 0.34.0 Docker Version: 20.10.10

root ~ -> containerlab deploy -t ovs.yaml
INFO[0000] Containerlab v0.34.0 started
INFO[0000] Parsing & checking topology file: ovs.yaml
Error: "ovstransit" already exists but is not a bridge
root ~ -> containerlab deploy -d -t ovs.yaml
INFO[0000] Containerlab v0.34.0 started
DEBU[0000] template variables: <nil>
DEBU[0000] topology:
---
name: ceostest
topology:
  nodes:
    ovstransit:
      kind: ovs-bridge
    ceos01:
      kind: ceos
      image: ceosimage:4.28.5.1M
  links:
    - endpoints: ["ovstransit:ovstransitp1", "ceos01:eth1"]

DEBU[0000] method initMgmtNetwork was called mgmt params &{Network: Bridge: IPv4Subnet: IPv4Gw: IPv6Subnet: IPv6Gw: MTU: ExternalAccess:<nil>}
DEBU[0000] New mgmt params are &{Network:clab Bridge: IPv4Subnet:172.20.20.0/24 IPv4Gw: IPv6Subnet:2001:172:20:20::/64 IPv6Gw: MTU: ExternalAccess:0xc00175c41f}
DEBU[0000] env runtime var value is
DEBU[0000] Running runtime.Init with params &{Timeout:2m0s GracefulShutdown:false Debug:false KeepMgmtNet:false} and &{Network:clab Bridge: IPv4Subnet:172.20.20.0/24 IPv4Gw: IPv6Subnet:2001:172:20:20::/64 IPv6Gw: MTU: ExternalAccess:0xc00175c41f}
DEBU[0000] Runtime: Docker
DEBU[0000] detected docker network mtu value - 1500
DEBU[0000] initialized a runtime with params &{config:{Timeout:120000000000 GracefulShutdown:false Debug:false KeepMgmtNet:false} Client:0xc0016fc500 mgmt:0xc0016fc280}
INFO[0000] Parsing & checking topology file: ovs.yaml
DEBU[0000] node config: &{ShortName:ceos01 LongName:clab-ceostest-ceos01 Fqdn:ceos01.ceostest.io LabDir:/root/clab-ceostest/ceos01 Index:0 Group: Kind:ceos StartupConfig: StartupDelay:0 EnforceStartupConfig:false AutoRemove:0xc00175c75c ResStartupConfig: Config:<nil> ResConfig: NodeType: Position: License: Image:ceosimage:4.28.5.1M Sysctls:map[] User: Entrypoint: Cmd: Exec:[] Env:map[] Binds:[] PortBindings:map[] PortSet:map[] NetworkMode: MgmtNet: MgmtIntf: MgmtIPv4Address: MgmtIPv4PrefixLength:0 MgmtIPv6Address: MgmtIPv6PrefixLength:0 MgmtIPv4Gateway: MgmtIPv6Gateway: MacAddress: ContainerID: TLSCert: TLSKey: TLSAnchor: NSPath: Publish:[] ExtraHosts:[] Labels:map[] Endpoints:[] SANs:[] Sandbox: Kernel: Runtime: CPU:0 CPUSet: Memory: DeploymentStatus: Extras:<nil> WaitFor:[]}
DEBU[0000] node config: &{ShortName:ovstransit LongName:clab-ceostest-ovstransit Fqdn:ovstransit.ceostest.io LabDir:/root/clab-ceostest/ovstransit Index:1 Group: Kind:ovs-bridge StartupConfig: StartupDelay:0 EnforceStartupConfig:false AutoRemove:0xc00175d7e8 ResStartupConfig: Config:<nil> ResConfig: NodeType: Position: License: Image: Sysctls:map[] User: Entrypoint: Cmd: Exec:[] Env:map[] Binds:[] PortBindings:map[] PortSet:map[] NetworkMode: MgmtNet: MgmtIntf: MgmtIPv4Address: MgmtIPv4PrefixLength:0 MgmtIPv6Address: MgmtIPv6PrefixLength:0 MgmtIPv4Gateway: MgmtIPv6Gateway: MacAddress: ContainerID: TLSCert: TLSKey: TLSAnchor: NSPath: Publish:[] ExtraHosts:[] Labels:map[] Endpoints:[] SANs:[] Sandbox: Kernel: Runtime: CPU:0 CPUSet: Memory: DeploymentStatus: Extras:<nil> WaitFor:[]}
DEBU[0000] lab Conf: &{Name:ceostest Prefix:0xc001771700 Mgmt:0xc0016fc280 Topology:0xc0017d40c0}
DEBU[0000] Env: CLAB_VERSION_CHECK=
DEBU[0000] Interface name check is not implemented for "ceos" kind
DEBU[0000] Looking up ceosimage:4.28.5.1M Docker image
DEBU[0000] Image ceosimage:4.28.5.1M present, skip pulling
Error: "ovstransit" already exists but is not a bridge

topology file:

---
name: ceostest
topology:
  nodes:
    ovstransit:
      kind: ovs-bridge
    ceos01:
      kind: ceos
      image: ceosimage:4.28.5.1M
  links:
    - endpoints: ["ovstransit:ovstransitp1", "ceos01:eth1"]

Bridge is manually configured with the following under user root:

ovs-vsctl add-br ovstransit  -- set bridge ovstransit datapath_type=netdev
ovs-vsctl set bridge ovstransit other-config:forward-bpdu=true
ovs-vsctl set interface ovstransit mtu_request=9214
ip link set ovstransit mtu 9214
ip link set ovstransit down
ip link set ovstransit up
root ~ -> ovs-vsctl list-br
ovstransit

ovs version:

root ~ -> ovs-vsctl --version
ovs-vsctl (Open vSwitch) 2.14.0
DB Schema 8.2.0

The same topology file works on the version 0.32.1 after downgrade

steiler commented 1 year ago

Hi @mitai914, yes, we're aware of this bug and there is a PR #1172. It is not yet merged, but we're working on it. If you like, give the PR a try, here is the binary https://github.com/srl-labs/containerlab/suites/10257759262/artifacts/503368844 There might be changes to the way the check is implemented, but the check should already be successfull.

hellt commented 1 year ago

Fix implemented in 0.35