Support veth pairs on bionic

Bug #1773429 reported by David Ames on 2018-05-25
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack neutron-gateway charm
Medium
Unassigned
OpenStack neutron-openvswitch charm
Medium
Unassigned

Bug Description

Related to LP Bug#1635067

The support for veth pairs for openvswitch data port configuration fails on Bionic with the following because of netplan:

file not found /etc/network/interfaces.d/veth-br-management0.cfg is missing

Dmitrii Shcherbakov (dmitriis) wrote :

Additionally, fixing this bug would require addressing the 'interface names are too long' from https://bugs.launchpad.net/charm-neutron-openvswitch/+bug/1773353

echo -n 'br-management0' | wc -c
14

15-byte byte/character limit (15 bytes for a name + \0 terminator) for interface names is kernel-imposed:
https://bugs.launchpad.net/juju/+bug/1672327/comments/14

echo -n 'veth-br-management0' | wc -c
19

It appears to be that hashing similar to bridge name hashing in MAAS, Juju and Neutron needs to be implemented:

https://bugs.launchpad.net/juju/+bug/1672327

https://github.com/juju/juju/pull/7204/commits/0a55ac9471df324cdf9c1e47ccfdd802dce404c9#diff-65dee4d34a1af94fb6b79057f0c42d3bR197 (the original commit to juju)

https://i316302782.restricted.launchpadlibrarian.net/316302782/0b4d35fa-2578-11e7-b189-002481e91f22.txt?token=GGfWcr03WFJp1x2N6DV7rMxV0qp1389w (the original commit to MAAS)

+ name = b"br-%s" % ifname
+ if len(name) > 15:
+ name = b"b-%s" % ifname
+ if ifname[:2] == b'en':
+ name = b"b-%s" % ifname[2:]
+ if len(name) > 15:
+ ifname_hash = (b"%06x" % (crc32(ifname) & 0xffffffff))[-6:]
+ name = b"b-%s-%s" % (ifname_hash, ifname[len(ifname) - 6:])

veth name handling in neutron which we could simply reuse:

https://git.openstack.org/cgit/openstack/neutron/commit/?id=ca7ed8f84da6962a9c2b8ad21d484931d297f31b

    def get_veth_name(self, prefix, name):
        """Construct a veth name based on the prefix and name that does not
           exceed the maximum length allowed for a linux device. Longer names
           are hashed to help ensure uniqueness.
        """
        if len(prefix + name) <= ip_lib.VETH_MAX_NAME_LENGTH:
            return prefix + name
        # We can't just truncate because bridges may be distinguished
        # by an ident at the end. A hash over the name should be unique.
        # Leave part of the bridge name on for easier identification
        hashlen = 6
        namelen = ip_lib.VETH_MAX_NAME_LENGTH - len(prefix) - hashlen
        new_name = ('%(prefix)s%(truncated)s%(hash)s' %
                    {'prefix': prefix, 'truncated': name[0:namelen],
                     'hash': hashlib.sha1(name).hexdigest()[0:hashlen]})

James Page (james-page) wrote :

long interface names bug is fix committed - we should stable pick those fixes.

Changed in charm-neutron-gateway:
status: New → Triaged
Changed in charm-neutron-openvswitch:
status: New → Triaged
importance: Undecided → Medium
Changed in charm-neutron-gateway:
importance: Undecided → Medium
milestone: none → 18.08
Changed in charm-neutron-openvswitch:
milestone: none → 18.08
Changed in charm-neutron-gateway:
milestone: 18.08 → 18.11
Changed in charm-neutron-openvswitch:
milestone: 18.08 → 18.11
James Page (james-page) on 2018-11-20
Changed in charm-neutron-gateway:
milestone: 18.11 → 19.04
Changed in charm-neutron-openvswitch:
milestone: 18.11 → 19.04
David Ames (thedac) on 2019-04-17
Changed in charm-neutron-gateway:
milestone: 19.04 → 19.07
Changed in charm-neutron-openvswitch:
milestone: 19.04 → 19.07
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers