Hello all:

During the PTG it was discussed how to handle the static configuration of the allowed VNI ranges for a network type. In particular it was discussed the VLAN ID ranges, that has the particularity of being defined by a physical network (unlike the tunnelled protocols that have a set of ranges but without any network association).

During the PTG it was mentioned the possibility of creating an API to handle the VLAN network ranges. After a quick talk with Slawek, he pointed me to the network segment ranges API [1]. This API allows the creation of new segment ranges not configured in the static "ml2_type_vlan.network_vlan_ranges" configuration variable (again, I'm focusing only on the VLAN type network). It is possible, for example, not to define any range statically and then create, per physical network, a set of allowed ranges.

Some considerations:
* The configured value in "ml2_type_vlan.network_vlan_ranges" (static configuration) will be read during the Neutron API start process and will create a "default" network segment range register. This register is immutable and cannot be modified nor deleted.
* Each network segment range will have a "used" reference, that is the number of VLAN IDs assigned in this range. If there is one single network with a VLAN ID on this range, it won't be possible to update or delete this network segment range register.
* These ranges apply to the auto allocation functionality. If an admin (that is by default an admin privilege configured in the policies) creates a network with a defined VLAN outside any set of ranges, that will be allowed.

I hope that will help you. And if you have a proposal to upgrade the current API, that will be welcome.

Regards.

[1]https://docs.openstack.org/neutron/latest/admin/config-network-segment-ranges.html