Bug 2084118

Summary: ovs-bridge does not report a key called bridge
Product: Red Hat Enterprise Linux 9 Reporter: Harel Braha <hbraha>
Component: nmstateAssignee: Gris Ge <fge>
Status: CLOSED ERRATA QA Contact: Mingyu Shi <mshi>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: CentOS StreamCC: amusil, bstinson, eraviv, ferferna, fge, jiji, jishi, jwboyer, mburman, mperina, network-qe, sfaye, till
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-15 10:00:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2084171    

Description Harel Braha 2022-05-11 12:55:14 UTC
Description of problem:

It seems that `nmstatectl show` does not report a key called bridge for ovs-bridge.
this info is expected by vdsm from all bridges on the host.
On the vdsm side, a key error is caused by that missing field.

Version-Release number of selected component (if applicable):
nmstate-2.1.0-1.el9


How reproducible:
always

Steps to Reproduce:
1.add host to engine with the nmstate version mention above.
2.
3.

Actual results:
failure adding host with this error


Expected results:


Additional info:
would expect a key bridge somewhere in here: 

  - name: br-int
    type: ovs-bridge
    state: up
    ovs-db:
      external_ids:
        ovn-startup-ts: "1652253903911"
  - name: eth0
    type: ethernet
    state: up
    mac-address: "54:52:C0:A8:CA:03"
    mtu: 1500
    ipv4:
      enabled: true
      dhcp: true

Comment 2 Gris Ge 2022-05-12 06:49:41 UTC
Hi Harel,

Could you provide a reproducer for me to try?

Thank you!

Comment 8 Gris Ge 2022-05-24 08:30:09 UTC
In RHEL8, we ignore/hide this OVS bridge as it is not created by NetworkManager.

In RHEL9, let me do the same instead of providing partial information.

Comment 9 Gris Ge 2022-06-07 04:16:11 UTC
Patch posed to upstream: https://github.com/nmstate/nmstate/pull/1921

The OVS bridge created by `ovs-vsctl` is unmanaged by NetworkManager, previously(2.1.1) we are showing it as `state: ignore` which is lacking the important `bridge` key. Above patch is purging all ignored user space interface when querying.

To reproduce this problem:
 * sudo ovs-vsctl add-br br0
 * sudo nmstatectl show

Expected output: only contain the ovs-interface br0(as is auto-managed by NetworkManager). No `ovs-bridge` br0 is shown in output.

Comment 10 Mingyu Shi 2022-06-13 06:22:29 UTC
Pretested with:
nmstate-2.1.1-0.20220607080409587754.pr1921.36.gfd093ec.el9.x86_64
NetworkManager-1.39.6-1.el9.x86_64
openvswitch2.15-2.15.0-60.el9fdp.x86_64
DISTRO=RHEL-9.1.0-20220612.2

ovs-vsctl add-br ovsbr0
nmstatectl show

# the older version:
  - name: ovsbr0
    type: ovs-interface
    state: down
    mac-address: "46:C0:E6:A9:59:4F"
    mtu: 1500
    ipv4:
      enabled: false
    ipv6:
      enabled: false
    accept-all-mac-addresses: false
    ovs-db:
      external_ids: {}
    ethtool:
      feature:
        tx-udp_tnl-segmentation: true
        tx-scatter-gather-fraglist: true
        tx-tcp-mangleid-segmentation: true
        tx-udp-segmentation: true
        tx-vlan-stag-hw-insert: true
        tx-tcp-ecn-segmentation: true
        tx-sctp-segmentation: true
        tx-checksum-ip-generic: true
        highdma: true
        tx-gre-csum-segmentation: true
        tx-udp_tnl-csum-segmentation: true
        tx-gso-list: true
        tx-nocache-copy: false
        tx-vlan-hw-insert: true
        rx-gro-list: false
        tx-tcp-segmentation: true
        tx-ipxip4-segmentation: true
        rx-udp-gro-forwarding: false
        tx-tcp6-segmentation: true
        tx-generic-segmentation: true
        tx-gre-segmentation: true
        tx-ipxip6-segmentation: true
        rx-gro: true
  - name: ovsbr0
    type: ovs-port
    state: ignore
  - name: ovsbr0
    type: ovs-bridge
    state: ignore
    ovs-db:
      external_ids: {}

# the tested version:
  - name: ovsbr0
    type: ovs-interface
    state: down
    mac-address: "46:C0:E6:A9:59:4F"
    mtu: 1500
    ipv4:
      enabled: false
    ipv6:
      enabled: false
    accept-all-mac-addresses: false
    ovs-db:
      external_ids: {}
    ethtool:
      feature:
        tx-tcp-mangleid-segmentation: true
        tx-nocache-copy: false
        tx-gre-csum-segmentation: true
        tx-generic-segmentation: true
        rx-gro: true
        tx-vlan-hw-insert: true
        rx-udp-gro-forwarding: false
        tx-ipxip4-segmentation: true
        tx-checksum-ip-generic: true
        tx-udp_tnl-segmentation: true
        tx-tcp6-segmentation: true
        tx-udp_tnl-csum-segmentation: true
        tx-scatter-gather-fraglist: true
        tx-gso-list: true
        rx-gro-list: false
        tx-vlan-stag-hw-insert: true
        tx-ipxip6-segmentation: true
        tx-tcp-segmentation: true
        tx-tcp-ecn-segmentation: true
        tx-sctp-segmentation: true
        tx-gre-segmentation: true
        highdma: true
        tx-udp-segmentation: true

no ovs-port and ovs-bridge in the output.


(In reply to Gris Ge from comment #9)
> Patch posed to upstream: https://github.com/nmstate/nmstate/pull/1921
> 
> The OVS bridge created by `ovs-vsctl` is unmanaged by NetworkManager,
> previously(2.1.1) we are showing it as `state: ignore` which is lacking the
> important `bridge` key. Above patch is purging all ignored user space
> interface when querying.
> 
> To reproduce this problem:
>  * sudo ovs-vsctl add-br br0
>  * sudo nmstatectl show
> 
> Expected output: only contain the ovs-interface br0(as is auto-managed by
> NetworkManager). No `ovs-bridge` br0 is shown in output.

But the ovsbr0(type=ovs-interface) is not managed by NetworkManager, and I think in the past versions(including python and rust), ovs-interface created by ovs-vsctl is not managed either.
@Gris , can you please confirm if this is correct(ovs-interface is not managed but shown under "nmstatectl show", like in the python version)?

# nmcli con
NAME  UUID                                  TYPE      DEVICE 
eno1  910aab28-a8b6-4c15-90f4-b7c671fe78f2  ethernet  eno1

Comment 11 Gris Ge 2022-06-19 14:04:26 UTC
The output is expected.

The ovs-interface has kernel representative and is auto-managed by NM as `external`.

Comment 12 Fernando F. Mancera 2022-06-20 09:17:16 UTC
This was done by Gris, assign it back to him. I pre-verified this with integration tests and manually.

Comment 17 Mingyu Shi 2022-07-13 06:10:20 UTC
Verified with versions:
nmstate-2.1.2-1.el9.x86_64
NetworkManager-1.39.8-1.el9.x86_64
openvswitch2.15-2.15.0-64.el9fdp.x86_64

Is same with #comment10

Comment 19 errata-xmlrpc 2022-11-15 10:00:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (nmstate bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:7991