Bug 1276780

Summary: Host creation fails when creating libvirtd VM with bridged network
Product: Red Hat Satellite Reporter: Balaji <bjayavel>
Component: Compute ResourcesAssignee: Marek Hulan <mhulan>
Status: CLOSED ERRATA QA Contact: Sachin Ghai <sghai>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.1.3CC: bbuckingham, cwelton, mhulan, sghai
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
URL: http://projects.theforeman.org/issues/14204
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 11:21:08 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: 1317909    
Bug Blocks:    
Attachments:
Description Flags
host with bridge network failure
none
'Network' dropdown shows only bridge interfaces. none

Description Balaji 2015-10-30 21:08:57 UTC
Created attachment 1088025 [details]
host with bridge network failure

Description of problem:
Host creation fails with the message:
Unable to save
Failed to power up a compute KVM (Libvirt) instance test.example.com: Call to virDomainCreateWithFlags failed: Unable to add bridge em1 port vnet0: Operation not supported

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


How reproducible:
 Consistent. 

Steps to Reproduce:
1.Setup a KVM env and inetgrate with Satellite 6.1.3. Setup a bridged network in the KVM. 
2.Create the host with physical (Bridge)network to encounter this error.
3.

Actual results:

Host creation fails. 
Expected results:
Should accept bridged network.

Additional info:
Workaround: Continue selecting Virtual NAT network with default network. Complete creating the host. Go to virt-manager, select the console for the new VM, and manually change the NIC setting to bridge desired.

Comment 2 Marek Hulan 2016-03-15 14:22:38 UTC
This is caused selecting wrong interface for bridged networking. Existing bridge must be selected for this type of networking, according to screenshot a physical interface em1 was used.

We shouldn't list non-bridge interfaces in the select box, unfortunately ruby-libvirt does not give us enough information. I reported the issue against ruby-libvirt, meanwhile we have to parse XML ourselves (hopefully short-term solution).

Comment 3 Marek Hulan 2016-03-15 14:27:36 UTC
Created redmine issue http://projects.theforeman.org/issues/14204 from this bug

Comment 4 Bryan Kearney 2016-03-15 16:10:30 UTC
Upstream bug component is Compute Resources

Comment 5 Bryan Kearney 2016-03-16 10:10:17 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/14204 has been closed
-------------
Marek Hulán
Applied in changeset commit:01fde835c5f50561dcde4a4f8b7a0f1ecf1bb2db.

Comment 6 Sachin Ghai 2016-05-18 12:18:57 UTC
Verified with sat62 GA snap11.

I can create host on network_type -> "Physical(Bridge)". As soon as I select 'Libvirt' compute-resource, this option auto populated under 'Interfaces" tab.

And under Nic type, I can see 'virtio', rtl8139.

@Marek: Could you please confirm  if anything else needs to be checked ?

As per comment2, where I shouln't see non-bridged interfaces ? Is it under Interfaces -> Libvirt section -> Nic_type ??

Please confirm ?

Comment 7 Marek Hulan 2016-05-19 08:00:51 UTC
After you choose libvirt compute resource and you select Physical (Bridge) network type, there is a field Network. This field used to display all network interfaces on libvirt host but now it should display only bridges.

When there's at least one bridge it's a select box. Previously there were also non-bridge interfaces listed, usually one could see 'em1' which when selected caused problems during host build. Now you should not be able to select 'em1'. If there's not bridge on libvirt host, there is no select box but text input where user could specify bridge name (but it must exist on host, otherwise build would fail).

To test that you can select bridge, you might need to create some on libvirt host first. You can command similar to this

    sudo virsh iface-bridge enp0s25 br0

where enp0s25 is interface that will be put into the bridge br0. To unbridge the interface use

    sudo virsh iface-unbridge br0

Comment 8 Sachin Ghai 2016-05-23 08:53:07 UTC
Thanks Marek.. 
 Verified with sat6.2 GA snap12.1

I can see only bridge interfaces not all interfaces under 'Network' dropdown. And I can provision on selected bridge interface. Please see attached screenshot that shows bridge interfaces only under 'Network' dropdown. Thanks

Comment 9 Sachin Ghai 2016-05-23 08:54:42 UTC
Created attachment 1160481 [details]
'Network' dropdown shows only bridge interfaces.

Comment 10 Marek Hulan 2016-05-23 10:40:22 UTC
Great, I think you can consider this verified.

Comment 11 Sachin Ghai 2016-05-23 12:47:13 UTC
Oh, forgot to change the state. Moving now.

Comment 12 Bryan Kearney 2016-07-27 11:21:08 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, 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-2016:1501