Automatically assigned VLAN ID can produce invalid values for 802.1Q tags
|Category:||Drivers - Network|
|Target version:||Release 5.0|
|Affected Versions:||OpenNebula 4.14|
An automatically assigned VLAN ID is calculated by adding a constant to the network id, in vlan.rb:120
@nic[:vlan_id] = CONF[:start_vlan] + network_id
802.1Q VLAN IDs are limited to the values 0x001 through 0xFFE, whereas network_id has no such restriction. Repeated creation and deletion of virtual network will eventually result in assigning an invalid VLAN ID.
VLAN ID assignment should be decoupled from the network ID, and the assignment algorithm should be able to reuse previously allocated IDs after the owning network has been deleted. The user should also be able to specify an upper bound for the IDs to be allocated, as described in #3298.
Here is a concrete use case where the current behavior is an issue:
A continuous integration system dynamically creates new testbeds. Each testbed is new VMs on a new virtual network with its own VLAN, thus isolated from all other testbeds. After a test run is complete, the testbed VMs and virtual network are deleted.
Bug #4376: Make vlan_id_automatic a top level attribute
and only allow modification of vlan_id if vlan_id_automatic
is set to false (the vlan_id has been specified manually)