Bug 2108974 - Regression with bridge_opts while setting priority parameter via RHV - 'priority is not a valid nmstate bridge option'(code revert)
Summary: Regression with bridge_opts while setting priority parameter via RHV - 'prior...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: vdsm
Classification: oVirt
Component: Core
Version: 4.50.1.4
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ovirt-4.5.2
: 4.50.2.2
Assignee: eraviv
QA Contact: Michael Burman
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-20 07:47 UTC by Michael Burman
Modified: 2022-08-30 08:47 UTC (History)
11 users (show)

Fixed In Version: vdsm-4.50.2.2
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-30 08:47:42 UTC
oVirt Team: Network
Embargoed:
mperina: ovirt-4.5+
lsvaty: blocker+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github oVirt vdsm pull 289 0 None Merged Revert nmstate bridge options 2022-07-27 11:17:19 UTC
Red Hat Issue Tracker RHV-47734 0 None None None 2022-07-20 12:47:40 UTC

Description Michael Burman 2022-07-20 07:47:22 UTC
Description of problem:
Regression with bridge_opts while setting priority=1 via RHV - 'priority is not a valid nmstate bridge option'

Since RHV moved to use nmstate 1.2.1-3 we are hitting regression in our network tier1 and some tests are affected, while trying to set bridge_opts parameter of priority=1. This was working fine all the years and now it is broken. I know changes were done in this area. 

Tis is blocikng some tests in our sanity tier1 and it must be green always. 
We need a fix, pushed into 8.6.z, as we are not moving to el8.7 hosts anytime soon or ever. 

VDSM host_mixed_1 command HostSetupNetworksVDS failed: Internal JSON-RPC error: {'reason': 'priority is not a valid nmstate bridge option'}

MainProcess|jsonrpc/5::ERROR::2022-07-20 10:30:33,297::supervdsm_server::98::SuperVdsm.ServerCallback::(wrapper) Error in setupNetworks
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/vdsm/network/link/setup.py", line 83, in parse_nets_bridge_opts
    bridge_opts[key] = nmstate_bridge_opts.convert_value(key, value)
  File "/usr/lib/python3.6/site-packages/vdsm/network/link/setup.py", line 49, in convert_value
    conversion_func = self._types_dict[key]
KeyError: 'priority'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/vdsm/supervdsm_server.py", line 96, in wrapper
    res = func(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/vdsm/network/api.py", line 209, in setupNetworks
    _setup_networks(networks, bondings, options)
  File "/usr/lib/python3.6/site-packages/vdsm/network/api.py", line 233, in _setup_networks
    netswitch.configurator.setup(networks, bondings, options, in_rollback)
  File "/usr/lib/python3.6/site-packages/vdsm/network/netswitch/configurator.py", line 68, in setup
    _setup_nmstate(networks, bondings, options, in_rollback)
  File "/usr/lib/python3.6/site-packages/vdsm/network/netswitch/configurator.py", line 88, in _setup_nmstate
    desired_state = nmstate.generate_state(networks, bondings)
  File "/usr/lib/python3.6/site-packages/vdsm/network/nmstate/api.py", line 62, in generate_state
    networks, rconfig.networks, current_state
  File "/usr/lib/python3.6/site-packages/vdsm/network/nmstate/linux_bridge.py", line 281, in generate_state
    for netname, netattrs in networks.items()
  File "/usr/lib/python3.6/site-packages/vdsm/network/nmstate/linux_bridge.py", line 281, in <listcomp>
    for netname, netattrs in networks.items()
  File "/usr/lib/python3.6/site-packages/vdsm/network/nmstate/linux_bridge.py", line 63, in __init__
    self._create_interfaces_state()
  File "/usr/lib/python3.6/site-packages/vdsm/network/nmstate/linux_bridge.py", line 143, in _create_interfaces_state
    sb_iface, vlan_iface, bridge_iface = self._create_ifaces()
  File "/usr/lib/python3.6/site-packages/vdsm/network/nmstate/linux_bridge.py", line 157, in _create_ifaces
    options=self._create_bridge_options(),
  File "/usr/lib/python3.6/site-packages/vdsm/network/nmstate/linux_bridge.py", line 216, in _create_bridge_options
    opts = parse_nets_bridge_opts(self._netconf.bridge_opts)
  File "/usr/lib/python3.6/site-packages/vdsm/network/link/setup.py", line 86, in parse_nets_bridge_opts
    f'{key} is not a valid nmstate bridge option'
vdsm.network.link.setup.NmstateBridgeOptionNotSupported: priority is not a valid nmstate bridge option

Version-Release number of selected component (if applicable):
nmstate-1.2.1-3.el8_6.x86_64
vdsm-4.50.2.1-1.el8ev.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Send setup network with bridge_opts priroty=1

Actual results:
Failing

Expected results:
Must work as expected/ 

Additional info:
Affecting network tier1 in RHV

Comment 1 Gris Ge 2022-07-20 12:25:39 UTC
Could you provide the yaml/json state passing to nmstate?

I tried the STP priority, it works well:


```
---
interfaces:
  - name: br0
    type: linux-bridge
    state: up
    bridge:
      port:
        - name: eth1
      options:
        stp:
          enabled: true
          forward-delay: 30
          hello-time: 9
          max-age: 39
          priority: 5
```

Comment 2 Michael Burman 2022-07-20 12:38:37 UTC
Well, nmstate moved the bridge_opts(at least some of them) from common options to stp and vdsm throwing an error. It's not even get to nmstate.
We(vdsm) are throwing error because this option is not available in nmstate anymore.

So now we need a fix from vdsm side becasue of this nmstate change. 

Not sure why some bridge_opts, like 'priority' moved to stp and some bridge_opts like 'multicast_querier' remain under common options. 
Anyhow, moving to vdsm then.

Comment 4 Gris Ge 2022-07-20 12:45:19 UTC
Nmstate 1.x never bridge API. I have checked the nmstate-0.3 and nmstate-1.0 are both shipping with priority in stp subtree.

Comment 5 Gris Ge 2022-07-20 12:47:07 UTC
Sorry for the typo. Should be:

Nmstate 1.x never break API. I have checked the nmstate-0.3 and nmstate-1.0 are both shipping with priority in stp subtree.

Comment 9 eraviv 2022-07-25 08:58:30 UTC
Michael,
Do you test or do we require to support any other stp attributes apart from the priority?
Available priorities under STP supported by nmstate are listed in [1]

[1] https://github.com/nmstate/nmstate/blob/nmstate-1.2/libnmstate/schema.py#L282

Comment 11 Martin Perina 2022-07-27 11:17:20 UTC
Code that moved bridge options handling through nmstate as been reverted from VDSM

Comment 12 Michael Burman 2022-08-07 08:58:11 UTC
The revert tested and verified with success on - vdsm-4.50.2.2-1.el8ev.x86_64 and rhvm-4.5.2.1-0.1.el8ev.noarch

BZ 2116119 will track the full support of vdsm to use nmstate for bridge_opts

Comment 13 Sandro Bonazzola 2022-08-30 08:47:42 UTC
This bugzilla is included in oVirt 4.5.2 release, published on August 10th 2022.
Since the problem described in this bug report should be resolved in oVirt 4.5.2 release, it has been closed with a resolution of CURRENT RELEASE.
If the solution does not work for you, please open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.