Bug 1459229 - Interface matching regular expression ignores interfaces with a '-' in the name [NEEDINFO]
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 with 1 vote (vote)
: ovirt-4.3.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: 2018-02-14 08:20 EST (History)
7 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: ---
sbonazzo: needinfo? (stirabos)
ylavi: ovirt‑4.3+


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.
Comment 5 Sandro Bonazzola 2017-11-24 10:07:38 EST
(In reply to Simone Tiraboschi from comment #4)
> (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.

Please open a bug on VDSM about this and make it blocking this one.
Comment 6 Sam McLeod 2018-01-07 18:32:13 EST
FYI - I recently posted to the mailing list regarding a similar issue where our bonds are all named after the network / VLAN they exist on, I'll add my comments here to avoid creating another bug.

---

I'm having a problem where when setting up hosted engine deployment it fails stating that the selected bond name is bad.

"code=25, message=bad bond name(s): mgmt)"

- Is there a problem similar to https://bugzilla.redhat.com/show_bug.cgi?id=1519807 that's known?
- If it seems to be this bug, is it preferred that I simply update the existing, closed issue as I have done, or open a new bug?

---

--> install logs provided to Doron Fediuck and a few others at Redhat

---

Dan Kenigsberg from Redhat:

"I see that you are trying to use a bond interface named "mgmt".
To avoid confusion while debugging a system, Vdsm has opted to allow
only bond names starting with "bond" followed by one or more decimal
digits. Anything else is considered "bad bond".

I prefer keeping the "bond" prefix compulsory, but I'd like to hear
why using different names is useful.

You can reopen this bug, but please move it to vdsm and rename it: it
should be something like "Allow any bondXYZ name for bonds" or "Allow
any bond name" and explain there why it is a good idea.

Dominik, is there an Engine-side limitation on bond names?"

---

Yedidyah Bar David from Redhat:

"Please note that this is just but one bug in a series/tree of
related bugs, some of which are open. If you decide to follow
Dan's suggestion, perhaps reuse one of the others, or perhaps
even better - open a new one, and eventually one or more will
be closed as duplicate of one or more of the others. Sadly,
not all of them link properly to each other, and at least one
which was fixed caused another bug, so the fix was reverted.
See also e.g. all of the discussion in:

https://bugzilla.redhat.com/show_bug.cgi?id=1459229"
Comment 7 Sam McLeod 2018-01-07 18:36:13 EST
By the way, it is very useful to name a bonded interface things other than bondXYZ, for example, you might have 6 bonds, each of a different network or native VLAN.

It helps with debugging, troubleshooting and logging if the interface is named after the (native) network, e.g. your iSCSI storage network might have a bond called 'storage', while your management or hypervisor network might have a bond named 'mgmt' then perhaps you have 'data' bond that might have several vlans off it such as 'db' (database), 'dmz', 'staff' etc... depending on how and where you chop your network up.
Comment 8 Sam McLeod 2018-01-17 17:41:59 EST
FYI - Someone on #ovirt IRC just had a use case where they were also confused as to why this was failing, they had a bridge as they're using it in a test environment / for a proof of concept as well and didn't realise it had to be bondXYZ

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