Support veth pairs on bionic

Bug #1773429 reported by David Ames
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Neutron Gateway Charm
Triaged
Medium
Unassigned
OpenStack Neutron Open vSwitch Charm
Triaged
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

Revision history for this message
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]})

Revision history for this message
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)
Changed in charm-neutron-gateway:
milestone: 18.11 → 19.04
Changed in charm-neutron-openvswitch:
milestone: 18.11 → 19.04
David Ames (thedac)
Changed in charm-neutron-gateway:
milestone: 19.04 → 19.07
Changed in charm-neutron-openvswitch:
milestone: 19.04 → 19.07
David Ames (thedac)
Changed in charm-neutron-gateway:
milestone: 19.07 → 19.10
Changed in charm-neutron-openvswitch:
milestone: 19.07 → 19.10
David Ames (thedac)
Changed in charm-neutron-gateway:
milestone: 19.10 → 20.01
Changed in charm-neutron-openvswitch:
milestone: 19.10 → 20.01
James Page (james-page)
Changed in charm-neutron-gateway:
milestone: 20.01 → 20.05
Changed in charm-neutron-openvswitch:
milestone: 20.01 → 20.05
David Ames (thedac)
Changed in charm-neutron-gateway:
milestone: 20.05 → 20.08
Changed in charm-neutron-openvswitch:
milestone: 20.05 → 20.08
James Page (james-page)
Changed in charm-neutron-gateway:
milestone: 20.08 → none
Changed in charm-neutron-openvswitch:
milestone: 20.08 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.