Bug 1732505

Summary: Unable to add compute resource if configured network is without bridge parameter
Product: Red Hat Satellite Reporter: Akshay Kapse <akapse>
Component: Compute Resources - libvirtAssignee: Marek Hulan <mhulan>
Status: CLOSED ERRATA QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.4CC: ajambhul, dsynk, egolov, ktordeur, lzap, mdekan, osousa, takirby, tbrisker
Target Milestone: 6.10.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-2.4.0,tfm-rubygem-fog-libvirt-0.9.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-16 14:08:51 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:
Attachments:
Description Flags
foreman-tail none

Description Akshay Kapse 2019-07-23 13:52:08 UTC
Description of problem:
 If there is a network without "bridge" parameter present, e.g. pool of virtual functions on NIC - almost every operation on this compute resource throws an error:

Oops, we're sorry but something went wrong Call to virNetworkGetBridgeName failed: internal error: network 'libvirt_network_name' does not have a bridge name.


Version-Release number of selected component (if applicable):
Satellite version 6.4

How reproducible:
100%

Steps to Reproduce:
1. Create a network without bridge.
2. Assign this network to the host and register.
3. Now try to add this host as a compute resource to the Satellite
Red Hat Satellite Web-UI --> Infrastructure --> Compute Profiles.

Actual results:
Error observed from the foreman-tail:
Action failed
ActionView::Template::Error: Call to virNetworkGetBridgeName failed: internal error: network 'direct-pool' does not have a bridge name.
/opt/theforeman/tfm/root/usr/share/gems/gems/fog-libvirt-0.4.1/lib/fog/libvirt/requests/compute/list_networks.rb:33:in `bridge_name'

Expected results:
Able to use such networks which do not have bridge specified.

Additional info:
Tried to add an additional network with bridge name specified but, Satellite still looks for the profile which do not have bridge name specified and throws error.

Comment 4 Bryan Kearney 2021-01-26 14:35:09 UTC
Upstream bug assigned to mhulan

Comment 5 Bryan Kearney 2021-01-26 14:35:11 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/22259 has been resolved.

Comment 6 Marek Hulan 2021-07-09 09:31:22 UTC
The original issue was fixed however there's another problem introduced with the exception namespace change. The fix for it exists in the upstream thanks to https://github.com/fog/fog-libvirt/pull/88 but new version of fog-libvirt was not released since this was merged. lzap, I think you have permissions for this gem now, could you please release 0.8.1 with this fix and do the packaging dance? We're probably ok with just cherrypicking this patch if you feel that's safer. Then please add this to fixed in version. QE will fail this BZ soon.

Comment 7 Lukáš Hellebrandt 2021-07-09 09:56:57 UTC
Failed with Sat 6.10.0 snap 5.0.

Based on comment 6 and the following reproducer (the one in OP is confusing):
0) Have a Libvirt and Satellite
1) # # on Libvirt
# cat example_network.xml 
<network>
<name>pf-eth0</name>
<uuid>0ae0eb24-d0d9-4a02-942e-d245c77e12ba</uuid>
<forward mode='hostdev' managed='yes'>
<driver name='vfio'/>
</forward>
</network>
2) # # on Libvirt
# virsh net-create /root/example_network.xml
3) Add the Libvirt as a compute resource to the Satellite
4) WebUI -> Hosts -> Create -> Deploy On == <libvirt-with-sriov-device> -> tab Interfaces

=> "Error loading interfaces information: Internal Server Error" => Devices without bridge (e.g. SR-IOV devices) are still not supported.

Traceback attached.

Comment 8 Lukáš Hellebrandt 2021-07-09 09:57:51 UTC
Created attachment 1799932 [details]
foreman-tail

Comment 9 Lukas Zapletal 2021-07-14 12:56:23 UTC
I am on that:

https://github.com/fog/fog-libvirt/pull/100

Comment 10 Lukas Zapletal 2021-07-21 15:45:18 UTC
https://github.com/theforeman/foreman/pull/8686

PRs pending merge.

Comment 11 Lukas Zapletal 2021-07-23 09:34:03 UTC
Please update to 0.9.0.

Comment 12 Lukáš Hellebrandt 2021-10-06 16:08:02 UTC
Verified with Sat 6.10.0 snap 21.0.

I don't have a SRIOV device but I tested using a fake network as shown in comment 7. After the fix, a CR with such a network can be added and a "Create Host" form loads fine.

Comment 15 errata-xmlrpc 2021-11-16 14:08:51 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 (Moderate: Satellite 6.10 Release), 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/RHSA-2021:4702