Bug 2038957

Summary: Failure to activate connection: nm-manager-error-quark: No suitable device found for this connection
Product: Red Hat Enterprise Linux 9 Reporter: Noriko Hosoi <nhosoi>
Component: rhel-system-rolesAssignee: Rich Megginson <rmeggins>
Status: CLOSED ERRATA QA Contact: Zhiqian Guan <zhguan>
Severity: unspecified Docs Contact: Mayur Patil <maypatil>
Priority: unspecified    
Version: 9.0CC: ferferna, gfialova, jharuda, maypatil, mtembo, nhosoi, rmeggins, spetrosi, till, wenliang, zhguan
Target Milestone: rcKeywords: Bugfix, Triaged
Target Release: 9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: role:network
Fixed In Version: rhel-system-roles-1.13.0-1.el9 Doc Type: Bug Fix
Doc Text:
.The `nm` provider in the Networking System Role now correctly manages bridges Previously, if you used the `initscripts` provider, the Networking System Role created an `ifcfg` file which configured NetworkManager to mark bridge interfaces as unmanaged. Also, NetworkManager failed to detect followup `initscript` actions. For example, the `down` and `absent` actions of initscript provider will not change the NetworkManager's understanding on unmanaged state of this interface if not reloading the connection after the `down` and `absent` actions. With this fix, the Networking System Role uses the `NM.Client.reload_connections_async()` function to reload NetworkManager on managed hosts with NetworkManager 1.18. As a result, NetworkManager manages the bridge interface when switching the provider from `initscript` to `nm`.
Story Points: ---
Clone Of: 2034908 Environment:
Last Closed: 2022-05-17 13:03:10 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: 2034908    
Bug Blocks: 2038956    

Description Noriko Hosoi 2022-01-10 16:08:43 UTC
+++ This bug was initially created as a clone of Bug #2034908 +++

Description of problem:

The system role build `rhel-system-roles-1.7.3-2.el7_9` CI gating failed on
`tests_ethernet_nm.yml` (https://dashboard.osci.redhat.com/#/artifact/brew-build/aid/41866280?focus=id:7faf82018486-1)
and the failures indicated that the the created veth device is strictly unmanaged even if we explicitly set it to managed.

```
nmcli d set lsr27 managed yes

Dec 20 19:39:10 ibm-p8-kvm-03-guest-02.virt.pnr.lab.eng.rdu2.redhat.com NetworkManager[738]: <info>  [1640047150.4781] audit: op="device-managed" arg="managed" pid=19292 uid=0 result="success" (Journal)

(nmcli d)
DEVICE     TYPE      STATE         CONNECTION  
eth0       ethernet  connected     System eth0
peerlsr27  ethernet  disconnected  --          
lsr27      ethernet  unmanaged     --          
```

The situation arised only when the last test playbook is  `tests_ethernet_initscripts.yml`, when initscripts provider ran, the connection profile (/etc/sysconfig/network-scripts/ifcfg-lsr27) contained `NM_CONTROLLED=no`, which indicated that the device lsr27 is not managed by NM and at the end we cleaned the device and profile then when NM provider ran, we have to reload the connection because the connection profile was deleted (changed) previously. The test palybooks `tests_auto_gateway_nm.yml`, `tests_ipv6_nm.yml`, `tests_vlan _mtu_nm.yml` ran into the same issue. 


Version-Release number of selected component (if applicable):
rhel-system-roles-1.7.3-2.el7_9

How reproducible:
Always


Steps to Reproduce:
1. Download rhel-guest-image-7.9-30.x86_64.qcow2 from http://download.hosts.prod.upshift.rdu2.redhat.com/released/rhel-6-7-8/rhel-7/RHEL-7/7.9/Server/x86_64/images/rhel-guest-image-7.9-30.x86_64.qcow2

2. `sudo TEST_DEBUG=1 TEST_SUBJECTS=rhel-guest-image-7.9-30.x86_64.qcow2 ansible-playbook -v -i /usr/share/ansible/inventory/standard-inventory-qcow2  ./tests/tests_ethernet_initscripts.yml ./tests/tests_ethernet_nm.yml`


Actual results:
Errors: "state:up persistent_state:present, 'lsr27': up connection failed: failure to activate connection: nm-manager-error-quark: No suitable device found for this connection"


Expected results:
No errors 

Additional info:

Comment 3 Zhiqian Guan 2022-02-10 06:27:59 UTC
:: [ 01:20:38 ] :: [   PASS   ] :: Test network/tests_ethernet_initscripts.yml (roles/rhel-system-roles.network/tests/tests_ethernet_initscripts.yml) with ANSIBLE-2.9 against RHEL_7_9_GA (Expected 0, got 0)
:: [ 01:21:13 ] :: [   PASS   ] :: Test network/tests_ethernet_nm.yml (roles/rhel-system-roles.network/tests/tests_ethernet_nm.yml) with ANSIBLE-2.9 against RHEL_7_9_GA (Expected 0, got 0)

now tests_ethernet_nm.yml playbook can pass after tests_ethernet_initscripts.yml playbook.

Hi Rich, would you mind setting this to ON_QA? since it's already been pre-verified, and stay at POST for a long time..

Comment 4 Rich Megginson 2022-02-10 14:22:08 UTC
(In reply to Zhiqian Guan from comment #3)
> :: [ 01:20:38 ] :: [   PASS   ] :: Test
> network/tests_ethernet_initscripts.yml
> (roles/rhel-system-roles.network/tests/tests_ethernet_initscripts.yml) with
> ANSIBLE-2.9 against RHEL_7_9_GA (Expected 0, got 0)
> :: [ 01:21:13 ] :: [   PASS   ] :: Test network/tests_ethernet_nm.yml
> (roles/rhel-system-roles.network/tests/tests_ethernet_nm.yml) with
> ANSIBLE-2.9 against RHEL_7_9_GA (Expected 0, got 0)
> 
> now tests_ethernet_nm.yml playbook can pass after
> tests_ethernet_initscripts.yml playbook.
> 
> Hi Rich, would you mind setting this to ON_QA? since it's already been
> pre-verified, and stay at POST for a long time..

I can't do it yet - I need to do an official build and attach it to an errata

Comment 7 Zhiqian Guan 2022-02-15 08:54:14 UTC
:: [ 03:52:06 ] :: [   PASS   ] :: Test network/tests_ethernet_initscripts.yml (roles/rhel-system-roles.network/tests/tests_ethernet_initscripts.yml) with ANSIBLE-2.9 against RHEL_6_10_GA (Expected 0, got 0)
:: [ 03:52:32 ] :: [   PASS   ] :: Test network/tests_ethernet_nm.yml (roles/rhel-system-roles.network/tests/tests_ethernet_nm.yml) with ANSIBLE-2.9 against RHEL_6_10_GA (Expected 0, got 0)

:: [ 03:30:44 ] :: [   PASS   ] :: Test network/tests_ethernet_initscripts.yml (roles/rhel-system-roles.network/tests/tests_ethernet_initscripts.yml) with ANSIBLE-2.9 against RHEL_7_9_GA (Expected 0, got 0)
:: [ 03:31:24 ] :: [   PASS   ] :: Test network/tests_ethernet_nm.yml (roles/rhel-system-roles.network/tests/tests_ethernet_nm.yml) with ANSIBLE-2.9 against RHEL_7_9_GA (Expected 0, got 0)

:: [ 03:34:07 ] :: [   PASS   ] :: Test network/tests_ethernet_initscripts.yml (roles/rhel-system-roles.network/tests/tests_ethernet_initscripts.yml) with ANSIBLE-2.9 against RHEL_8_5_0_GA (Expected 0, got 0)
:: [ 03:35:46 ] :: [   PASS   ] :: Test network/tests_ethernet_nm.yml (roles/rhel-system-roles.network/tests/tests_ethernet_nm.yml) with ANSIBLE-2.9 against RHEL_8_5_0_GA (Expected 0, got 0)

:: [ 03:37:57 ] :: [   PASS   ] :: Test network/tests_ethernet_initscripts.yml (roles/rhel-system-roles.network/tests/tests_ethernet_initscripts.yml) with ANSIBLE-2.9 against RHEL_8_6_TESTING (Expected 0, got 0)
:: [ 03:38:57 ] :: [   PASS   ] :: Test network/tests_ethernet_nm.yml (roles/rhel-system-roles.network/tests/tests_ethernet_nm.yml) with ANSIBLE-2.9 against RHEL_8_6_TESTING (Expected 0, got 0)

:: [ 03:42:26 ] :: [   PASS   ] :: Test network/tests_ethernet_initscripts.yml (roles/rhel-system-roles.network/tests/tests_ethernet_initscripts.yml) with ANSIBLE-2.9 against RHEL_9_TESTING (Expected 0, got 0)
:: [ 03:43:14 ] :: [   PASS   ] :: Test network/tests_ethernet_nm.yml (roles/rhel-system-roles.network/tests/tests_ethernet_nm.yml) with ANSIBLE-2.9 against RHEL_9_TESTING (Expected 0, got 0)

Result looks good, set this to VERIFIED

Comment 18 errata-xmlrpc 2022-05-17 13:03:10 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 (new packages: rhel-system-roles), 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:2443