Skip to content

Commit

Permalink
Use naming convention to infer VLAN tagging
Browse files Browse the repository at this point in the history
Any interface not matching the convention: <interface>.<vlan id> will be
assumed to untagged when generating the config drive. The link type will
be set to `phy` in `network_data.json` instead of `vlan`. This prevents
invalid config drive configuration from being generated.

Change-Id: I00e7615581c7a214e0ee8e8f04cacdbb3ea4131a
Story: 2009910
Task: 44736
(cherry picked from commit dd95618)
  • Loading branch information
jovial authored and markgoddard committed Mar 17, 2022
1 parent ee6d461 commit 1f00615
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kayobe/plugins/filter/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ def net_configdrive_network_device(context, name, inventory_hostname=None):
bootproto = net_bootproto(context, name, inventory_hostname)
mtu = net_mtu(context, name, inventory_hostname)
vlan = net_vlan(context, name, inventory_hostname)
if vlan:
if vlan and '.' in device:
backend = [device.split('.')[0]]
else:
backend = None
Expand All @@ -591,7 +591,7 @@ def net_configdrive_network_device(context, name, inventory_hostname=None):
'mtu': mtu,
'backend': backend,
}
if vlan:
if backend:
interface['type'] = 'vlan'
interface = {k: v for k, v in interface.items() if v is not None}
return interface
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
fixes:
- |
Fixes an issue with config drive generation for infrastructure and seed VMs
when using untagged interfaces. The symptom of this issue is that kayobe
cannot login to the instance. If you check the libvirt console log, you
will see ``KeyError: 'vlan_link'``. See `story 2009910
<https://storyboard.openstack.org/#!/story/2009910>`__ for details.

0 comments on commit 1f00615

Please sign in to comment.