Bug 2058292

Summary: [RFE] Allow configuration of VLAN on an unmanaged interface
Product: Red Hat Enterprise Linux 9 Reporter: Petr Horáček <phoracek>
Component: nmstateAssignee: Gris Ge <fge>
Status: CLOSED ERRATA QA Contact: Mingyu Shi <mshi>
Severity: medium Docs Contact: Mayur Patil <maypatil>
Priority: unspecified    
Version: 9.2CC: bgalvani, ferferna, fge, jiji, jishi, lrintel, network-qe, pasik, rkhan, sfaye, sukulkar, till
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: 9.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nmstate-2.2.1-1.el9 Doc Type: Enhancement
Doc Text:
.NetworkManager now allows VLAN configuration over unmanaged interface With this enhancement, you can use an unmanaged networking interface as a base interface when configuring virtual LAN (VLAN) with NetworkManager. As a result, the VLAN base interface remains intact unless changed explicitly through the `nmcli device set _enp1s0_ managed true` command or other API of NetworkManager.
Story Points: ---
Clone Of:
: 2110307 (view as bug list) Environment:
Last Closed: 2023-05-09 07:30:59 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: 2110307    

Description Petr Horáček 2022-02-24 16:26:01 UTC
Description of problem:

It is not possible to configure a VLAN interface on unmanaged NIC. That forces
users who only want to create a VLAN inteface to take ownership over possibly
shared underlying NIC.


Version-Release number of selected component (if applicable):
RHEL 8.4


How reproducible:
Always


Steps to Reproduce:
1. Have a node with unmanaged NIC eno5np0
2. Apply the following nmstate configuration:
interfaces:
- name: eno5np0.350
  type: vlan
  state: up
  ipv4:
    enabled: true
    dhcp: true
    auto-gateway: false
  vlan:
    base-iface: "eno5np0"
    id: 350


Actual results:
type: vlan failed: error=nm-manager-error-quark: Failed to find a compatible device for this connection (3)


Expected results:
If it is something possible to do with Linux networking, it would be useful if
in this case it was possible to configure the VLAN while leaving the NIC
unmanaged (or managed by some tool that may or may not use NetworkManager).


Additional info:
This was reported and described in detail in the context of kubernetes nmstate
in https://bugzilla.redhat.com/show_bug.cgi?id=2017623#c13.

Comment 3 Gris Ge 2022-04-24 05:07:37 UTC
Hi Petr,

Are you expecting the support of 


```yml
interfaces:
- name: eno5np0.350
  type: vlan
  state: up
  ipv4:
    enabled: true
    dhcp: true
    auto-gateway: false
  vlan:
    base-iface: "eno5np0"
    id: 350
- name: eno5np0
  type: ethernet
  state: ignore
```

Currently, NetworkManager does not allow this, technically it is doable, could you provides:

 * Why NetworkManager should not try to manage the vlan parent interface?
 * What feature/function of CNV/openshift is blocked by this?
 * When CNV/openshfit expecting the release of this feature?

Comment 4 Petr Horáček 2022-04-25 13:37:56 UTC
Hello,

yes, this is pretty much what we'd need. Ideally without the need to mention eno5np0 (ignored) at all.

> * Why NetworkManager should not try to manage the vlan parent interface?

Because of something else manages it. In OpenShift, the SR-IOV operator is AFAIK not using NM to configure VFs etc. When it starts working with a NIC, it explicitly makes it unmanaged.

- https://github.com/k8snetworkplumbingwg/sriov-network-operator/blob/236be9826955e819e8fe56cd56cdfa62a8e87344/pkg/utils/utils.go#L375
- https://github.com/k8snetworkplumbingwg/sriov-network-operator/blob/70b25f6965a3d875cb6279f3f9ef8161ad7e0686/pkg/daemon/daemon.go#L1068


> * What feature/function of CNV/openshift is blocked by this?

Users cannot create a VLAN interface on PFs managed by the operator.

> * When CNV/openshfit expecting the release of this feature?

We already registered some complaints about it. However, I don't think this would need to be backported. So either RHEL 8.6 or 9.0?

Comment 5 Petr Horáček 2022-07-21 10:37:16 UTC
Could we get this prioritized? Thanks!

Comment 6 Gris Ge 2022-07-22 06:51:47 UTC
Sure. Let me ask around.

Comment 7 Gris Ge 2022-07-25 07:05:09 UTC
According to these command, we need fixes in NM to get this supported:

ip link add test_nic1 type veth peer name test_nic1peer || true
ip link set test_nic1 up || true
ip link set test_nic1peer up || true

nmcli d set test_nic1peer managed false
nmcli d set test_nic1 managed false

nmcli c add type vlan ifname vlan1 vlan.parent test_nic1 vlan.id 100 \
    connection.autoconnect no connection.id vlan1
nmcli c up vlan1

Comment 10 Gris Ge 2022-11-17 13:40:56 UTC
Hi Petr,

With NetworkManager-1.41.4-1.el9 , creating VLAN over unmanaged interface works well out of box in nmstate.

Comment 13 Petr Horáček 2022-11-24 11:15:28 UTC
Oh that's awesome. Thanks so much Gris for pushing this.

Comment 14 Mingyu Shi 2023-01-30 08:07:17 UTC
Verified with:
nmstate-2.2.5-1.el9.x86_64
nispor-1.2.9-1.el9.x86_64
NetworkManager-1.41.90-1.el9.x86_64
DISTRO=RHEL-9.2.0-20230127.12

Comment 19 errata-xmlrpc 2023-05-09 07:30:59 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-2023:2190