Bug 1131918

Summary: "hosted-engine --deploy" allows selection of unusable NICs
Product: Red Hat Enterprise Virtualization Manager Reporter: Barak Korren <bkorren>
Component: ovirt-hosted-engine-setupAssignee: Simone Tiraboschi <stirabos>
Status: CLOSED CURRENTRELEASE QA Contact: Nikolai Sednev <nsednev>
Severity: low Docs Contact:
Priority: medium    
Version: 3.4.1-1CC: dfediuck, gklein, mgoldboi, oblaut, sbonazzo, ykaul
Target Milestone: ovirt-3.6.0-rc   
Target Release: 3.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-3.6.0-beta1 Doc Type: Bug Fix
Doc Text:
Previously, hosted-engine-setup was letting the user choose an invalid interface to create the management bridge on. Now, the list of allowed responses is better filtered.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-17 07:17:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Barak Korren 2014-08-20 09:48:31 UTC
Description of problem:
When asking for a NIC to bridge on, the script shows some options that are unusable and would cause the installer to crash later on.

Version-Release number of selected component (if applicable):
package version: 1.1.5-1.el6ev

How reproducible:
Easily

Steps to Reproduce:
1. Install kvm, libvirt, ovirt, vdsm, etc.
2. Use something like virsh or virt-manager to create virtual networks, bridges etc.
3. Run "hosted-engine --deploy", when asked to select NIC for bridge, you will be shown wierd options like "virbr0-nic"
4. If you'll select on of those options, e.g. "virbr0-nic", the installed will later on fail to execute the network configuration stage.

Actual results:
- Example installer output:
  [ ERROR ] Failed to execute stage 'Misc configuration': 'virbr1-nic'

- Excerpt from installer log:
  2014-08-20 11:14:08 INFO otopi.plugins.ovirt_hosted_engine_setup.network.bridge bridge._misc:196 Configuring the management bridge
  2014-08-20 11:14:09 DEBUG otopi.plugins.ovirt_hosted_engine_setup.network.bridge bridge._misc:204 getVdsCapabilities for virbr1-nic: {...
  2014-08-20 11:14:09 DEBUG otopi.context context._executeMethod:152 method exception
  Traceback (most recent call last):
    File "/usr/lib/python2.6/site-packages/otopi/context.py", line 142, in _executeMethod
      method['method']()
    File "/usr/share/ovirt-hosted-engine-setup/scripts/../plugins/ovirt-hosted-engine-setup/network/bridge.py", line 223, in _misc
      caps = nics_caps[selected]
  KeyError: 'virbr1-nic'
  2014-08-20 11:14:09 ERROR otopi.context context._executeMethod:161 Failed to execute stage 'Misc configuration': 'virbr1-nic'
  2014-08-20 11:14:09 DEBUG otopi.transaction transaction.abort:131 aborting ...

Expected results:
Unusable NICs probably shouldn't show up as option in the installer

Additional info:
Digging in /usr/share/ovirt-hosted-engine-setup/plugins/ovirt-hosted-engine-setup/network/bridge.py
It seems the _customization and _misc methods use different sources to obtain the list of NICs, while _customization uses the 'ethtool' module, _misc obtains the list from VDSM. Probably should both use VDSM.

Comment 1 Sandro Bonazzola 2015-01-26 09:52:35 UTC
In order to get the same device list, we'll change the first part of the customization for using vdsm instead of ethtool for getting the devices list.

Comment 2 Nikolai Sednev 2016-01-20 13:32:22 UTC
Isn't it a dirty environment? Host should not have any virtual bridges/interfaces on it before hosted-engine deployment and also only "yum install ovirt-hosted-engine-setup -y" should trigger installation of all dependent packages like libvirt/quemu-kvm-rhev/sanlock/mom/etc, all these components should not be installed manually.

Comment 3 Doron Fediuck 2016-01-25 16:38:07 UTC
(In reply to Nikolai Sednev from comment #2)
> Isn't it a dirty environment? Host should not have any virtual
> bridges/interfaces on it before hosted-engine deployment and also only "yum
> install ovirt-hosted-engine-setup -y" should trigger installation of all
> dependent packages like libvirt/quemu-kvm-rhev/sanlock/mom/etc, all these
> components should not be installed manually.

I agree we shouldn't support dirty environments, however we have several specific
cases such as ovirt-live which is supposed to ignore external interfaces and rely
on an internal one. Another rare case is where we have a special layout the installer does not support and the user creates it manually. In most other cases
we should discourage noisy environments.

Comment 4 Gil Klein 2016-02-17 07:17:44 UTC
This bug was fixed and is slated to be in the upcoming version. As we
are focusing our testing at this phase on severe bugs, this bug was
closed without going through its verification step. If you think this
bug should be verified by QE, please set its severity to high and move
it back to ON_QA