canonical / canonical/cloud-init

OpenStack helper can generate interface names that are too long for VLANs

Open
#6,018 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
3.8k
Forks
1.1k
Avg merge
2d 23h
Merged PRs (30d)
18

Description

# Bug report

Related to bug #4743, the helper code at https://github.com/canonical/cloud-init/blob/2b7d9636b303ad212d1a446ab59636c5cd75dd4a/cloudinit/sources/helpers/openstack.py#L738-L740 does not respect the maximum length size. When using OpenStack Ironic and using bare metal systems you'll get the kernel driver device names which can be quite long. During normal operation they get renamed down to shorter forms (`ens` prefix vs `enp` prefix). However when the helper runs the longer form is the only name is available.

Why this issue isn't seen more is the fact that the generation of VLAN info isn't happening by default in network_data.json per bug https://bugs.launchpad.net/nova/+bug/2091185 but we are working to remedy that. In testing this issue has cropped up. The workaround here is the fact that OpenStack does not support the `name` field in their scheme per the comments in but a human crafts their own network_data.json today when they use VLANs and often provide their own name.

## Steps to reproduce the problem
Run cloud-init with the OpenStack helper consuming network_data.json without a `name` field on the physical NIC and use something like Broadcom which likes to make 14 character interface names.

## Environment details
- Cloud-init version:
- Operating System Distribution: Ubuntu 24.04
- Cloud provider, platform or installer type: OpenStack

I wonder if it wouldn't be better to remove those lines that issue the rename?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.