Bug 1930019

Summary: [SR-IOV] nmstate shouldn't try to activate VF profiles
Product: Red Hat Enterprise Linux 8 Reporter: Michael Burman <mburman>
Component: nmstateAssignee: Fernando F. Mancera <ferferna>
Status: CLOSED ERRATA QA Contact: Mingyu Shi <mshi>
Severity: high Docs Contact:
Priority: unspecified    
Version: 8.3CC: amusil, ferferna, fge, jiji, jishi, mperina, network-qe, till
Target Milestone: rcKeywords: Regression, Triaged, ZStream
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: nmstate-1.0.2-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1931290 (view as bug list) Environment:
Last Closed: 2021-05-18 15:18:22 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: 1931290    
Attachments:
Description Flags
tested.log none

Description Michael Burman 2021-02-18 08:16:36 UTC
Description of problem:
[SR-IOV] nmstate shouldn't try to activate VF profiles

We have noticed that nmstate trying to activate the VF profiles, but it shouldn't.
After enabling the VF, the VF shouldn't seen in the output of nmcli c s at all.
It should be seen only as disconnected under nmcli dev status.
Because of that, the VFs profiles remain as white connection under nmcli c s:
eno2v0     8531fee8-fa1f-4e47-a440-ce9de4215adc  ethernet  --        
eno2v1     cad3ee46-45a4-4210-b8e7-bc55a79bab35  ethernet  --

After we disable the VFs on the host, they still remain there and cause error next time trying to enable Vfs on this mother PF. 
There shouldn't be any ethernet profile connection activated for the VF and the Vfs profiles shouldn't be see under nmcli c s, only as disconnected connection under nmcli dev status

MainProcess|jsonrpc/2::ERROR::2021-02-18 09:38:05,320::supervdsm_server::98::SuperVdsm.ServerCallback::(wrapper) Error in change_numvfs

libnmstate.error.NmstateVerificationError: 
desired
=======
---
name: eno2v0
type: ethernet
state: down

current
=======
---
name: eno2v0
type: ethernet
state: up
ethernet:
  auto-negotiation: false
  duplex: full
  speed: 10000
ipv4:
  enabled: false
ipv6:
  enabled: false
lldp:
  enabled: false
mac-address: xx:xx:xx:xx:xx:xx
mtu: 1500

difference
==========
--- desired
+++ current
@@ -1,4 +1,16 @@
 ---
 name: eno2v0
 type: ethernet
-state: down
+state: up
+ethernet:
+  auto-negotiation: false
+  duplex: full
+  speed: 10000
+ipv4:
+  enabled: false
+ipv6:
+  enabled: false
+lldp:
+  enabled: false
+mac-address: xx:xx:xx:xx:xx:xx
+mtu: 1500

Version-Release number of selected component (if applicable):
nmstate-0.3.4-25.el8_3.noarch

How reproducible:
100%

Steps to Reproduce:
1. Enable VF via RHV

Actual results:
nmstate thinks the VF profile should be activated and there is a connection created under nmcli c s

Expected results:
nmstate shouldn't try to activate VF profile, it shouldn't appear under nmcli c s at all. Only under nmcli dev status as disconnected red profile as was always.

Comment 2 Gris Ge 2021-02-18 09:57:57 UTC
Patch sent to upstream https://github.com/nmstate/nmstate/pull/1520 for review.


The patch will instruct nmstate to remove the deleted VFs' profile when total_vfs decreased.

Comment 3 Martin Perina 2021-02-18 10:19:04 UTC
We really need that fixed in RHEL 8.3.z

Comment 4 Mingyu Shi 2021-02-18 15:36:22 UTC
Created attachment 1757832 [details]
tested.log

Tested with versions:
nmstate-1.0.2-0.20210218100459029637.pr1520.23.g0df0f6e.el8.noarch
nispor-1.0.1-3.el8.x86_64
NetworkManager-1.30.0-0.10.el8.x86_64

Comment 5 Gris Ge 2021-02-18 22:07:08 UTC
Upstream merged.

Comment 10 Fernando F. Mancera 2021-02-21 21:55:12 UTC
I've created a new fix for nmstate-0.3: https://github.com/nmstate/nmstate/pull/1524

Comment 15 Mingyu Shi 2021-02-22 09:38:17 UTC
Verified with versions:
nmstate-1.0.2-1.el8.noarch
nispor-1.0.1-3.el8.x86_64
NetworkManager-1.30.0-0.10.el8.x86_64

Notice the fix in nmstate-1.0 is to remove corresponding VF profiles when reduce number of `total-vfs`.
Another issue, creating VFs automatically creates there NM profiles, doesn't exist on RHEL8.4(nmstate-1.0), check the cloned for 8.3.0.z: https://bugzilla.redhat.com/show_bug.cgi?id=1931290

Comment 17 errata-xmlrpc 2021-05-18 15:18:22 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-2021:1748