Bug 1452243 - Interface matching regular expression ignores interfaces with a '-' in the name
Summary: Interface matching regular expression ignores interfaces with a '-' in the name
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-setup-lib
Classification: oVirt
Component: Core
Version: 1.1.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.1.3
: 1.1.3
Assignee: Simone Tiraboschi
QA Contact: Artyom
URL:
Whiteboard:
Depends On: 1459229
Blocks: 1455431
TreeView+ depends on / blocked
 
Reported: 2017-05-18 16:12 UTC by Simone Tiraboschi
Modified: 2017-07-06 13:11 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
ovirt-setup-lib now correctly handles interfaces with a '-' in the name like 'nm-bond1.122' which are allowed by NetworkManager/Cockpit UI.
Clone Of:
Environment:
Last Closed: 2017-07-06 13:11:27 UTC
oVirt Team: Integration
Embargoed:
rule-engine: ovirt-4.1+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 77242 0 None MERGED interface: allow multiple hypens and dots in interface names 2020-05-22 14:54:55 UTC
oVirt gerrit 77303 0 master MERGED packaging: spec: consume ovirt-setup-lib 1.1.1 2020-05-22 14:54:55 UTC
oVirt gerrit 77305 0 ovirt-hosted-engine-setup-2.1 MERGED packaging: spec: consume ovirt-setup-lib 1.1.1 2020-05-22 14:54:55 UTC
oVirt gerrit 77307 0 master MERGED packaging: spec: consume ovirt-setup-lib 1.1.1 2020-05-22 14:54:55 UTC
oVirt gerrit 77309 0 ovirt-engine-4.1 MERGED packaging: spec: consume ovirt-setup-lib 1.1.1 2020-05-22 14:54:55 UTC
oVirt gerrit 77882 0 master MERGED plugins: cloud_init: support interfaces with dash 2020-05-22 14:54:55 UTC
oVirt gerrit 77904 0 ovirt-hosted-engine-setup-2.1 MERGED plugins: cloud_init: support interfaces with dash 2020-05-22 14:54:56 UTC

Description Simone Tiraboschi 2017-05-18 16:12:33 UTC
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):


How reproducible:
100%

Steps to Reproduce:
1. create a bond with a dash in the name
2. configure an IP address over the bond and ensure that the hostname resolves there
3. try deploying hosted-engine

Actual results:

The address got resolving the hostname could not be identified on any interface (since ovirt-setup-lib ignores the bond due to the dash) ans so hosted-engine-setup aborts.

2017-05-17 15:53:53 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/network/bridge.py", line 345, in _validate_hostname_first_host
    allow_empty=False,
  File "/usr/lib/python2.7/site-packages/ovirt_setup_lib/hostname.py", line 452, in getHostname
    store=(True if envkey else False),
  File "/usr/lib/python2.7/site-packages/ovirt_setup_lib/dialog.py", line 144, in queryEnvKey
    raise RuntimeError(msg)
RuntimeError: Host name is not valid: host.domain.name resolves to 192.168.45.65 and not all of them can be mapped to non loopback devices on this host


Expected results:
The user can successfully deploy

Additional info:

Comment 2 Artyom 2017-06-05 08:52:36 UTC
Checked on
ovirt-hosted-engine-setup-2.1.2-2.el7ev.noarch
ovirt-setup-lib-1.1.1-1.el7ev.noarch

Deployment fails with the traceback:
017-06-05 09:49:20 DEBUG otopi.plugins.gr_he_common.vm.cloud_init plugin.execute:921 execute-output: ('/sbin/ip', 'addr', 'show', 'my-bond') stdout:
5: 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
       valid_lft 42000sec preferred_lft 42000sec
    inet6 2620:52:0:2348:6248:5124:671d:1146/64 scope global noprefixroute dynamic
       valid_lft 2591821sec preferred_lft 604621sec
    inet6 fe80::b925:96f4:3a25:af8/64 scope link
       valid_lft forever preferred_lft forever

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


Problem in our 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 3 Red Hat Bugzilla Rules Engine 2017-06-05 08:52:42 UTC
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 4 Sandro Bonazzola 2017-06-06 11:42:40 UTC
Please open a separate bug on ovirt-hosted-engine-setup since the failing regexp is there, not in ovirt-setup-lib. Moving this back to ON_QA.

Comment 7 Artyom 2017-06-11 12:35:00 UTC
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"


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