Bug 1893654

Summary: [OVS] Remove and clear unused OVS profiles from nmcli
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: low Docs Contact:
Priority: unspecified    
Version: 8.4CC: ferferna, fge, jiji, jishi, network-qe, till
Target Milestone: rcKeywords: Triaged
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: nmstate-1.1.0-0.1.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 17:42:37 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:

Description Michael Burman 2020-11-02 10:12:14 UTC
Description of problem:
[OVS] Remove and clear unused OVS profiles from nmcli

nmstate leaves OVS profiles us unmanaged and not connected after no longer used and active on the host.

In RHV we enabled the OVS switch type cluster.
When we moving the host to a legacy cluster(linux bridge), the OVS profiles no longer used or active. But nmcli still report them as unmanaged.
These profiles hosuld be gone and got cleared when no longer used and active.

NAME                UUID                                  TYPE      DEVICE 
ovs-port-ens4f0     13d501de-2151-4cf1-9e42-1f49b8ea6d51  ovs-port  --        
ovs-port-ovirtmgmt  41c16f40-1c9b-4dec-a668-ad625043cd7d  ovs-port  --    

Version-Release number of selected component (if applicable):
nmstate-0.4.1-2.el8.noarch

How reproducible:
100%

Steps to Reproduce:
1. In RHV add host to ovs cluster ->

NAME                UUID                                  TYPE           DEVICE 
ovs-port-ens4f0     68b2b67c-9092-4eea-9ee1-9a994a54f68c  ovs-port       ovs-port-ens4f0    
ovs-port-ovirtmgmt  caa43cdf-0174-4845-9522-7e1721ad4f4e  ovs-port       ovs-port-ovirtmgmt 
vdsmbr_8V33DRwo     7d81de5f-0dcd-417e-91ba-911189d197a7  ovs-bridge     vdsmbr_8V33DRwo

Bridge "vdsmbr_8V33DRwo"
        Port ovs-port-ovirtmgmt
            Interface ovirtmgmt
                type: internal
        Port "ovs-port-ens4f0"
            Interface "ens4f0"
                type: system

2. Move the host to legacy cluster(linux bridge). The ovs bridges are removed and gone. Host now is linux bridge
but the ovs profiles still exist as unmanaged in nmcli report show:

NAME                UUID                                  TYPE      DEVICE 
ovs-port-ens4f0     13d501de-2151-4cf1-9e42-1f49b8ea6d51  ovs-port  --        
ovs-port-ovirtmgmt  41c16f40-1c9b-4dec-a668-ad625043cd7d  ovs-port  --


Actual results:
With nmstate nmstate-0.3.4-13.el8_3.noarch it work as expected the ovs profiles are gone and cleared.
With nmstate-0.4.1-2.el8.noarch the profiles remain and not cleared as expected.

Expected results:
The ovs profiles should be removed once not used and active, like on nmstate 0.3

Comment 2 Fernando F. Mancera 2021-05-06 10:20:16 UTC
This is important, we need to make sure Nmstate is cleaning the profiles correctly.

Comment 3 Fernando F. Mancera 2021-05-11 15:34:25 UTC
(In reply to Michael Burman from comment #0)
> Description of problem:
> [OVS] Remove and clear unused OVS profiles from nmcli
> 
> nmstate leaves OVS profiles us unmanaged and not connected after no longer
> used and active on the host.
> 
> In RHV we enabled the OVS switch type cluster.
> When we moving the host to a legacy cluster(linux bridge), the OVS profiles
> no longer used or active. But nmcli still report them as unmanaged.
> These profiles hosuld be gone and got cleared when no longer used and active.
> 
> NAME                UUID                                  TYPE      DEVICE 
> ovs-port-ens4f0     13d501de-2151-4cf1-9e42-1f49b8ea6d51  ovs-port  --      
> 
> ovs-port-ovirtmgmt  41c16f40-1c9b-4dec-a668-ad625043cd7d  ovs-port  --    
> 
> Version-Release number of selected component (if applicable):
> nmstate-0.4.1-2.el8.noarch
> 
> How reproducible:
> 100%
> 
> Steps to Reproduce:
> 1. In RHV add host to ovs cluster ->
> 
> NAME                UUID                                  TYPE          
> DEVICE 
> ovs-port-ens4f0     68b2b67c-9092-4eea-9ee1-9a994a54f68c  ovs-port      
> ovs-port-ens4f0    
> ovs-port-ovirtmgmt  caa43cdf-0174-4845-9522-7e1721ad4f4e  ovs-port      
> ovs-port-ovirtmgmt 
> vdsmbr_8V33DRwo     7d81de5f-0dcd-417e-91ba-911189d197a7  ovs-bridge    
> vdsmbr_8V33DRwo
> 
> Bridge "vdsmbr_8V33DRwo"
>         Port ovs-port-ovirtmgmt
>             Interface ovirtmgmt
>                 type: internal
>         Port "ovs-port-ens4f0"
>             Interface "ens4f0"
>                 type: system
> 
> 2. Move the host to legacy cluster(linux bridge). The ovs bridges are
> removed and gone. Host now is linux bridge
> but the ovs profiles still exist as unmanaged in nmcli report show:
> 
> NAME                UUID                                  TYPE      DEVICE 
> ovs-port-ens4f0     13d501de-2151-4cf1-9e42-1f49b8ea6d51  ovs-port  --      
> 
> ovs-port-ovirtmgmt  41c16f40-1c9b-4dec-a668-ad625043cd7d  ovs-port  --
> 
> 
> Actual results:
> With nmstate nmstate-0.3.4-13.el8_3.noarch it work as expected the ovs
> profiles are gone and cleared.
> With nmstate-0.4.1-2.el8.noarch the profiles remain and not cleared as
> expected.
> 
> Expected results:
> The ovs profiles should be removed once not used and active, like on nmstate
> 0.3

Hi Michael, a lot of changes have been done on Nmstate during 0.4->1.0. Could you please check if this is still happening? I tried to reproduce it but failed.

Comment 4 Michael Burman 2021-05-12 07:08:55 UTC
(In reply to Fernando F. Mancera from comment #3)
> (In reply to Michael Burman from comment #0)
> > Description of problem:
> > [OVS] Remove and clear unused OVS profiles from nmcli
> > 
> > nmstate leaves OVS profiles us unmanaged and not connected after no longer
> > used and active on the host.
> > 
> > In RHV we enabled the OVS switch type cluster.
> > When we moving the host to a legacy cluster(linux bridge), the OVS profiles
> > no longer used or active. But nmcli still report them as unmanaged.
> > These profiles hosuld be gone and got cleared when no longer used and active.
> > 
> > NAME                UUID                                  TYPE      DEVICE 
> > ovs-port-ens4f0     13d501de-2151-4cf1-9e42-1f49b8ea6d51  ovs-port  --      
> > 
> > ovs-port-ovirtmgmt  41c16f40-1c9b-4dec-a668-ad625043cd7d  ovs-port  --    
> > 
> > Version-Release number of selected component (if applicable):
> > nmstate-0.4.1-2.el8.noarch
> > 
> > How reproducible:
> > 100%
> > 
> > Steps to Reproduce:
> > 1. In RHV add host to ovs cluster ->
> > 
> > NAME                UUID                                  TYPE          
> > DEVICE 
> > ovs-port-ens4f0     68b2b67c-9092-4eea-9ee1-9a994a54f68c  ovs-port      
> > ovs-port-ens4f0    
> > ovs-port-ovirtmgmt  caa43cdf-0174-4845-9522-7e1721ad4f4e  ovs-port      
> > ovs-port-ovirtmgmt 
> > vdsmbr_8V33DRwo     7d81de5f-0dcd-417e-91ba-911189d197a7  ovs-bridge    
> > vdsmbr_8V33DRwo
> > 
> > Bridge "vdsmbr_8V33DRwo"
> >         Port ovs-port-ovirtmgmt
> >             Interface ovirtmgmt
> >                 type: internal
> >         Port "ovs-port-ens4f0"
> >             Interface "ens4f0"
> >                 type: system
> > 
> > 2. Move the host to legacy cluster(linux bridge). The ovs bridges are
> > removed and gone. Host now is linux bridge
> > but the ovs profiles still exist as unmanaged in nmcli report show:
> > 
> > NAME                UUID                                  TYPE      DEVICE 
> > ovs-port-ens4f0     13d501de-2151-4cf1-9e42-1f49b8ea6d51  ovs-port  --      
> > 
> > ovs-port-ovirtmgmt  41c16f40-1c9b-4dec-a668-ad625043cd7d  ovs-port  --
> > 
> > 
> > Actual results:
> > With nmstate nmstate-0.3.4-13.el8_3.noarch it work as expected the ovs
> > profiles are gone and cleared.
> > With nmstate-0.4.1-2.el8.noarch the profiles remain and not cleared as
> > expected.
> > 
> > Expected results:
> > The ovs profiles should be removed once not used and active, like on nmstate
> > 0.3
> 
> Hi Michael, a lot of changes have been done on Nmstate during 0.4->1.0.
> Could you please check if this is still happening? I tried to reproduce it
> but failed.

Hello Fernando,

I can't reproduce with:
nmstate-1.0.2-5.el8.noarch
NetworkManager-1.30.0-7.el8.x86_64

ovs profiles are cleared and removed as expected.

Comment 8 Mingyu Shi 2021-07-16 07:46:36 UTC
Verified with versions:
nmstate-1.1.0-0.7.alpha7.el8.noarch
nispor-1.1.1-1.el8.x86_64
NetworkManager-1.32.2-1.el8.x86_64
openvswitch2.13-2.13.0-114.el8fdp.x86_64

Move veth0 from an ovs bridge ovsbr0 to a linux bridge br0, the ovs NM profiles are gone:
[15:42:58@dell-per740-79 ~/temp]0# cat << EOF > ovs.yaml
> interfaces:
> - name: ovsbr0
>   type: ovs-bridge
>   state: up
>   bridge:
>     port:
>     - name: ovsbr0
>     - name: veth0
> # - name: ovsbr1
> #   type: ovs-bridge
> #   state: up
> #   bridge:
> #     port:
> #     - name: ovsbr1
> #     - name: veth1
> EOF
[15:42:59@dell-per740-79 ~/temp]0# myveth 0
[15:43:02@dell-per740-79 ~/temp]0# nmstatectl set ovs.yaml 
/tmp/nmstatelog/2021-07-16-15:43:05-678393674.log
Desired state applied: 
---
interfaces:
- name: ovsbr0
  type: ovs-bridge
  state: up
  bridge:
    port:
    - name: ovsbr0
    - name: veth0
/tmp/nmstatelog/2021-07-16-15:43:05-678393674.0.log nmstatectl set ovs.yaml return 0
[15:43:06@dell-per740-79 ~/temp]0# cat << EOF > move.yaml
> interfaces:
> - name: br0
>   type: linux-bridge
>   state: up
>   bridge:
>     port:
>     - name: veth0
> - name: ovsbr0
>   type: ovs-bridge
>   state: absent
> # - name: br1
> #   type: linux-bridge
> #   state: up
> #   bridge:
> #     port:
> #     - name: veth1
> EOF
[15:43:16@dell-per740-79 ~/temp]0# rlPha
bash: rlPha: command not found
[15:43:16@dell-per740-79 ~/temp]127# nmcli c
NAME             UUID                                  TYPE           DEVICE          
eno1             a854b026-4edc-46af-8e3a-e0a2e473d975  ethernet       eno1            
eno2             c477f860-5370-46c6-8806-982284af1576  ethernet       eno2            
eno3             e5f203ea-dd93-4d3b-8d31-7778b9f5cf1f  ethernet       eno3            
eno4             10e92804-1512-4c94-9994-f841dcce4ea6  ethernet       eno4            
ens1f0           eea41d02-d02d-49b9-8df3-1d4c6e63f287  ethernet       ens1f0          
ens1f1           794f1394-75c4-4275-8128-78611bff0456  ethernet       ens1f1          
ovsbr0           f4d9dec4-ddfe-45c5-98c0-434ca9331982  ovs-interface  ovsbr0          
ovsbr0           39ccd41b-adfa-4b9e-a612-ccee69132c9f  ovs-bridge     ovsbr0          
ovs-port-ovsbr0  bcfd207f-30b8-4c35-a0c1-e6f29545b7f5  ovs-port       ovs-port-ovsbr0 
ovs-port-veth0   d6f8fb6d-c893-4ef7-ad28-d5f4cf23b12d  ovs-port       ovs-port-veth0  
veth0            f55b4e32-279b-45ef-9690-05c95bb70a8b  ethernet       veth0           
ib0              001f7e4b-b3e3-4130-826b-d47d1755e498  infiniband     --              
ib1              8c27adf6-bd7c-4bc7-95c5-3cc2527209ed  infiniband     --              
[15:43:23@dell-per740-79 ~/temp]0# nmstatectl set move.yaml 
/tmp/nmstatelog/2021-07-16-15:43:26-926457894.log
Desired state applied: 
---
interfaces:
- name: br0
  type: linux-bridge
  state: up
  bridge:
    port:
    - name: veth0
- name: ovsbr0
  type: ovs-bridge
  state: absent
/tmp/nmstatelog/2021-07-16-15:43:26-926457894.0.log nmstatectl set move.yaml return 0
[15:43:27@dell-per740-79 ~/temp]0# nmcli c
NAME    UUID                                  TYPE        DEVICE 
eno1    a854b026-4edc-46af-8e3a-e0a2e473d975  ethernet    eno1   
br0     f93cac44-ff54-404b-ae13-858125ea75d8  bridge      br0    
eno2    c477f860-5370-46c6-8806-982284af1576  ethernet    eno2   
eno3    e5f203ea-dd93-4d3b-8d31-7778b9f5cf1f  ethernet    eno3   
eno4    10e92804-1512-4c94-9994-f841dcce4ea6  ethernet    eno4   
ens1f0  eea41d02-d02d-49b9-8df3-1d4c6e63f287  ethernet    ens1f0 
ens1f1  794f1394-75c4-4275-8128-78611bff0456  ethernet    ens1f1 
veth0   f55b4e32-279b-45ef-9690-05c95bb70a8b  ethernet    veth0  
ib0     001f7e4b-b3e3-4130-826b-d47d1755e498  infiniband  --     
ib1     8c27adf6-bd7c-4bc7-95c5-3cc2527209ed  infiniband  --

Comment 10 errata-xmlrpc 2021-11-09 17:42:37 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:4157