Bug 1459229 - Interface matching regular expression ignores interfaces with a '-' in the name
Interface matching regular expression ignores interfaces with a '-' in the name
Status: NEW
Product: ovirt-hosted-engine-setup
Classification: oVirt
Component: Network (Show other bugs)
2.1.2
x86_64 Linux
medium Severity medium (vote)
: ovirt-4.2.0
: ---
Assigned To: Simone Tiraboschi
Artyom
: Triaged
Depends On:
Blocks: 1452243 1455606
  Show dependency treegraph
 
Reported: 2017-06-06 11:01 EDT by Artyom
Modified: 2017-09-28 04:34 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Integration
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
ylavi: ovirt‑4.2+


Attachments (Terms of Use)
ovirt-hosted-engine-setup log (212.01 KB, text/plain)
2017-06-06 11:01 EDT, Artyom
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 77882 master MERGED plugins: cloud_init: support interfaces with dash 2017-06-07 06:13 EDT
oVirt gerrit 77904 ovirt-hosted-engine-setup-2.1 MERGED plugins: cloud_init: support interfaces with dash 2017-06-07 06:20 EDT
oVirt gerrit 79026 master MERGED Revert "plugins: cloud_init: support interfaces with dash" 2017-07-05 08:34 EDT
oVirt gerrit 79027 ovirt-hosted-engine-setup-2.1 MERGED Revert "plugins: cloud_init: support interfaces with dash" 2017-07-05 08:34 EDT

  None (edit)
Description Artyom 2017-06-06 11:01:09 EDT
Created attachment 1285442 [details]
ovirt-hosted-engine-setup log

Description of problem:
Interface matching regular expression ignores interfaces with a '-' in the name so a bond named 'nm-bond1.122' will be ignored due to the '-' in its name.
The user instead could configure a device with that name from NetworkManager/Cockpit UI.

Version-Release number of selected component (if applicable):
ovirt-hosted-engine-setup-2.1.2-2.el7ev.noarch

How reproducible:
Always

Steps to Reproduce:
1. Create bond on the host with -
my-bond: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 00:14:5e:dd:05:55 brd ff:ff:ff:ff:ff:ff
    inet 10.35.72.13/24 brd 10.35.72.255 scope global dynamic my-bond
...
2. Run hosted-engine deploy
3.

Actual results:
Deployment fails with the traceback
2017-06-05 09:49:20 DEBUG otopi.plugins.gr_he_common.vm.cloud_init plugin.execute:926 execute-output: ('/sbin/ip', 'addr', 'show', 'my-bond') stderr:


2017-06-05 09:49:20 DEBUG otopi.plugins.gr_he_common.vm.cloud_init cloud_init._getMyIPAddress:132 address: None
2017-06-05 09:49:20 DEBUG otopi.context context._executeMethod:142 method exception
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/otopi/context.py", line 132, in _executeMethod
    method['method']()
  File "/usr/share/ovirt-hosted-engine-setup/scripts/../plugins/gr-he-common/vm/cloud_init.py", line 781, in _customize_vm_networking
    self._customize_vm_addressing()
  File "/usr/share/ovirt-hosted-engine-setup/scripts/../plugins/gr-he-common/vm/cloud_init.py", line 215, in _customize_vm_addressing
    my_ip = self._getMyIPAddress()
  File "/usr/share/ovirt-hosted-engine-setup/scripts/../plugins/gr-he-common/vm/cloud_init.py", line 136, in _getMyIPAddress
    _('Cannot acquire nic/bridge address')
RuntimeError: Cannot acquire nic/bridge address
2017-06-05 09:49:20 ERROR otopi.context context._executeMethod:151 Failed to execute stage 'Environment customization': Cannot acquire nic/bridge address

Expected results:
Deployment succeeds

Additional info:

Problem in the regular expression
_INET_ADDRESS_RE = re.compile(
        flags=re.VERBOSE,
        pattern=r"""
            \s+
            inet
            \s
            (?P<address>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/\d{1,2})
            .+
            \s+
            (?P<interface>[a-zA-Z0-9_.]+)
            $
    """
    )
Comment 1 Artyom 2017-06-15 08:13:59 EDT
Verified on ovirt-hosted-engine-setup-2.1.3-1.el7ev.noarch

It is looking fine from hosted-engine perspective now, but guys from network team said that bond name with '-' not supported by VDSM and engine.
See the error:
  File "/usr/share/ovirt-hosted-engine-setup/scripts/../plugins/gr-he-common/network/bridge.py", line 388, in _setupNetworks
    'message: "%s"' % (networks, code, message))
RuntimeError: Failed to setup networks {'ovirtmgmt': {'bonding': 'my-bond', 'bootproto': 'dhcp', 'blockingdhcp': True, 'defaultRoute': True}}. Error code: "25" message: "u'my-bond' is not a valid bonding device name"
Comment 2 Red Hat Bugzilla Rules Engine 2017-07-05 07:58:35 EDT
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.
Comment 3 Yaniv Kaul 2017-08-04 12:16:44 EDT
Is this on track to get into 4.1.5?
Comment 4 Simone Tiraboschi 2017-08-07 05:42:00 EDT
(In reply to Yaniv Kaul from comment #3)
> Is this on track to get into 4.1.5?

We fixed this once and reverted as for https://bugzilla.redhat.com/show_bug.cgi?id=1467733
Now we have a patch ( https://gerrit.ovirt.org/#/c/79012/ ) to properly fix it on hosted-engine-setup side but an interface name with a dash will still cause an issue on vdsm side as for https://bugzilla.redhat.com/show_bug.cgi?id=1459229#c1 so we are still not ready to merge it.

Note You need to log in before you can comment on or make changes to this bug.