VLAN templating only works if specified in the subnet, not in the interface
When adding a new host you get the option of listing the VLAN tag. Unfortunately in the networking templates we see:
<% vlan = virtual && subnet.has_vlanid? -%
Which means that the VLAN id you enter is ignored and VLAN=yes does not get created.
I'm not sure if this is as simple a fix as subnet.has_vlanid? || interface.has_vlanid? but as it's taken me an hour to figure out what's going on I just wanted to mention it.
#2 Updated by Marek Hulán over 3 years ago
- Assignee set to Marek Hulán
- Status changed from New to Assigned
In general, you're right and we should fix the template. A bit simpler workaround without need of changing the template is to set some tag to subnet while we can still override it per interface. One can view the subnet vlanid as a default for all interfaces attached to it.