Uploaded image for project: 'Red Hat OpenStack Services on OpenShift'
  1. Red Hat OpenStack Services on OpenShift
  2. OSPRH-20985

[os-net-config][ifcfg] Error not raised configuring OVS bridge

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Can't Do
    • Icon: Normal Normal
    • None
    • None
    • os-net-config
    • None
    • 0
    • False
    • Hide

      None

      Show
      None
    • False
    • ?
    • rhos-connectivity-nfv
    • None
    • Important

      When configuring an nonexistent nic in ovs_bridge using the ifcfg provider an error is log but not raised, preventing fallback_config from running.

      To Reproduce
      Load a config like this:

      remove_config:
        - remove_type: interface
          remove_name: nic3
      network_config:
        - type: ovs_bridge
          name: br0
          use_dhcp: false
          members:
          - type: interface
            name: nic99
      fallback_config:
        - type: interface
          name: nic3
          use_dhcp: false
          dns_servers: ["192.168.122.80"]
          addresses:
            - ip_netmask: 192.168.122.101/24
          routes:
            - default: true
              next_hop: 192.168.122.1
      

      Note that:

      • Control plane nic3 configuration is removed.
      • br0 OVS bridge has an nonexistent member nic99.
      • fallback_config restores nic3 configuration (i.e. control plane connectivity).

      When the os-net-config above is applied:

      # Before apply
      [root@compute-1 ~]# ip a sh enp130s0f0
      10: enp130s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
          link/ether f8:f2:1e:33:04:e0 brd ff:ff:ff:ff:ff:ff
          inet 192.168.122.101/24 brd 192.168.122.255 scope global enp130s0f0
             valid_lft forever preferred_lft forever
          inet6 fe80::faf2:1eff:fe33:4e0/64 scope link 
             valid_lft forever preferred_lft forever
      
      # Apply config
      [root@compute-1 ~]# ip r |grep 192.168.122
      default via 192.168.122.1 dev enp130s0f0 
      192.168.122.0/24 dev enp130s0f0 proto kernel scope link src 192.168.122.101 
      
      [root@compute-1 ~]# os-net-config -p ifcfg -m /var/tmp/os-net-config_tests/mapping.yaml -c /var/tmp/os-net-config_tests/config_fallback-ovs_bridge.yaml --exit-on-validation-errors -d
      ...
      2025-10-17 09:58:00.442 DEBUG os_net_config.impl_ifcfg.apply nic99: Calling stop_dhclient_interfaces()
      2025-10-17 09:58:00.443 INFO os_net_config.execute running ifup on interface: nic99
      2025-10-17 09:58:00.967 ERROR os_net_config.execute stderr : WARN      : [ifup] You are using 'ifup' script provided by 'network-scripts', which are now deprecated.
      WARN      : [ifup] 'network-scripts' will be removed from distribution in near future.
      WARN      : [ifup] It is advised to switch to 'NetworkManager' instead - it provides 'ifup/ifdown' scripts as well.
      ovs-vsctl: Error detected while setting up 'nic99': could not open network device nic99 (No such device).  See ovs-vswitchd log for details.
      ovs-vsctl: The default log directory is "/var/log/openvswitch".
      WARN      : [ifup] You are using 'ifup' script provided by 'network-scripts', which are now deprecated.
      WARN      : [ifup] 'network-scripts' will be removed from distribution in near future.
      WARN      : [ifup] It is advised to switch to 'NetworkManager' instead - it provides 'ifup/ifdown' scripts as well.
      
      2025-10-17 09:58:00.967 DEBUG os_net_config.execute stdout : ERROR     : [/etc/sysconfig/network-scripts/ifup-eth] Device nic99 does not seem to be present, delaying initialization.
      
      2025-10-17 09:58:00.967 INFO os_net_config.config_provider ifcfg: Successfully configured network_config
      2025-10-17 09:58:00.968 INFO os_net_config.main ifcfg: Configured network_config successfully
      

      Observe that, although the error is log, the configuration is considered to have been applied successfully:

      • The OVS bridge is created with the nonexistent nic as port:
        [root@compute-1 ~]# ovs-vsctl show
        f5fae7d2-ea5d-4859-af5d-5a05a26a8f1c
            Bridge br0
                fail_mode: standalone
                Port br0
                    Interface br0
                        type: internal
                Port nic99
                    Interface nic99
                        error: "could not open network device nic99 (No such device)"
            ovs_version: "3.5.2-33.el9fdp"
        
      • The network-scripts files are generated:
        [root@compute-1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-br0
        # This file is autogenerated by os-net-config
        DEVICE=br0
        ONBOOT=yes
        HOTPLUG=no
        NM_CONTROLLED=no
        PEERDNS=no
        DEVICETYPE=ovs
        TYPE=OVSBridge
        OVS_EXTRA="set bridge br0 other-config:mac-table-size=50000 -- set bridge br0 fail_mode=standalone -- del-controller br0"
        [root@compute-1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-nic99
        # This file is autogenerated by os-net-config
        DEVICE=nic99
        ONBOOT=yes
        HOTPLUG=no
        NM_CONTROLLED=no
        PEERDNS=no
        DEVICETYPE=ovs
        TYPE=OVSPort
        OVS_BRIDGE=br0
        BOOTPROTO=none
        

      However, the control plane connectivity is lost:

      [root@compute-1 ~]# ip r |grep 192.168.122
      [root@compute-1 ~]# ip a sh enp130s0f0
      10: enp130s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
          link/ether f8:f2:1e:33:04:e0 brd ff:ff:ff:ff:ff:ff
      
      [root@compute-1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-enp130s0f0
      cat: /etc/sysconfig/network-scripts/ifcfg-enp130s0f0: No such file or directory
      

      Expected behavior
      Raise and error and execute fallback_config as with nmstate provider.

      If we apply the same config using nmstate as provider an error is raised:

      # Before apply
      [root@compute-0 ~]# ip r |grep 192.168.122
      default via 192.168.122.1 dev enp130s0f0 proto static 
      192.168.122.0/24 dev enp130s0f0 proto kernel scope link src 192.168.122.100 metric 106 
      [root@compute-0 ~]# ip a sh enp130s0f0
      11: enp130s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
          link/ether f8:f2:1e:03:a5:c0 brd ff:ff:ff:ff:ff:ff
          inet 192.168.122.100/24 brd 192.168.122.255 scope global noprefixroute enp130s0f0
             valid_lft forever preferred_lft forever
      
      # Apply
      [root@compute-0 ~]# os-net-config -p nmstate -m /var/tmp/os-net-config_tests/mapping.yaml -c /var/tmp/os-net-config_tests/config_fallback-ovs_bridge.yaml -d --exit-on-validation-errors 
      ...
      2025-10-17 10:13:06.773 DEBUG os_net_config.impl_nmstate.apply Updated the interfaces: enp130s0f0
      2025-10-17 10:13:06.774 INFO os_net_config.config_provider nmstate: Successfully configured fallback_config
      2025-10-17 10:13:06.774 INFO os_net_config.safe_fallback nmstate: fallback_config is completed
      

      Consequently:

      • The nic3 config (control plane connectivity) is restored:
        [root@compute-0 ~]# ip r |grep 192.168.122
        default via 192.168.122.1 dev enp130s0f0 proto static 
        192.168.122.0/24 dev enp130s0f0 proto kernel scope link src 192.168.122.100 metric 106 
        [root@compute-0 ~]# ip a sh enp130s0f0
        11: enp130s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
            link/ether f8:f2:1e:03:a5:c0 brd ff:ff:ff:ff:ff:ff
            inet 192.168.122.100/24 brd 192.168.122.255 scope global noprefixroute enp130s0f0
               valid_lft forever preferred_lft forever
        
      • The OVS bridge is not created:
        [root@compute-0 ~]# ovs-vsctl show
        bf9dfa0a-663a-4af5-a860-0e08c8da34ac
            ovs_version: "3.5.2-33.el9fdp"
        
        [root@compute-0 ~]# nmstatectl show br0
        [2025-10-17T14:15:58Z INFO  nmstatectl] Nmstate version: 2.2.52
        interfaces: []
        
        [root@compute-0 ~]# nmcli c s
        NAME                 UUID                                  TYPE      DEVICE      
        enp130s0f0           2db20af7-6d5a-4587-a625-63964c450d80  ethernet  enp130s0f0  
        Wired connection 1   b459617d-9560-3335-8df5-424d3812fc7e  ethernet  eno1        
        Wired connection 2   77a1c97a-a95f-37d0-a0e9-79137c8e90c1  ethernet  eno2        
        enp130s0f2           8cee0573-84f0-41a9-9032-2837672821c0  ethernet  enp130s0f2  
        enp130s0f3           54e2e7ff-cdf9-4583-9b5d-de2cb2a5f6be  ethernet  enp130s0f3  
        enp6s0f0             94a3ff29-1155-47e3-bfe6-fec859417860  ethernet  enp6s0f0    
        enp6s0f1             27e08404-33cb-47e9-8e49-c34a7b01232d  ethernet  enp6s0f1    
        Wired connection 12  c7a81b54-8df7-37c4-83ff-29c36b87be3e  ethernet  enp6s0f2    
        Wired connection 13  fcfe6af5-5f4e-364f-a36c-b1eef9d3baab  ethernet  enp6s0f3    
        Wired connection 5   9ca32059-b092-3b2d-bb38-badb3533f03c  ethernet  enp130s0f1  
        Wired connection 8   61a60c0e-ab76-3d2e-92d1-b59c90bc7528  ethernet  enp4s0f0np0 
        Wired connection 9   5903dc95-fa55-3bc4-8d57-f76a76285724  ethernet  enp4s0f1np1 
        lo                   f04b3397-8d37-4419-b253-db3aec93af21  loopback  lo          
        Wired connection 3   736af75f-979b-3143-83b1-1fd44a106ede  ethernet  --          
        Wired connection 4   8fe004e2-d6c1-39c9-81d3-24c556cf77be  ethernet  --          
        Wired connection 6   9396c245-6f5e-3928-a79c-1235e6ce57ba  ethernet  --          
        Wired connection 7   d5912a8f-a6f1-3d09-9a8e-20f1d5270fe4  ethernet  --   
        

      Bug impact
      Fallback config not applied if there is an error in OVS bridge config.

              ksundara@redhat.com Karthik Sundaravel
              rdiazcam@redhat.com Ricardo Diaz Campos
              rhos-dfg-nfv
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: