This document describes the multiple vlan range feature.
Presetntly in cloudstack we can only extend the vlan range but cannot add multiple non contiguous vlan ranges. This feature provides this flexibility to add multiple vlan ranges.
The admin may want to add a new vlan range once the existing vlan range is exhausted or the admin may want to add multiple vlan ranges based on the way he provisioned vlans.
Admin can update the vlan range after creation or can add multiple non contiguous vlan ranges while creating a zone. This can be done by changing the UpdatephysicalNetwork api. It allows only extending of the vlan. we plan to extend the api to update the vlan with multiple vlan ranges.
API Name |
API parameters |
API response |
Available only for root admin |
---|---|---|---|
UpdatePhysicalNetwork |
vlan |
returns the updated vlan ranges |
yes |
currently the api updatePhysicalNetwork has the vlan parameter this will be used to add a vlan range as well as for deleting a vlan range.
vlan parameter will add all the vlan ranges specified and will also delete the vlans that are not specified if they are present in the db. if the new vlan range overlaps the existing vlan range it will extend that vlan. In other words the user needs to specify all the vlans that he wants to keep.
The changes will be atomic.
before removing any range we need to check if any of the vlans in the range are in use. The operation will fail if some vlans in the remove range are in use.
i.e. if E=100-200 (existing) U(used)=101,121,131
and remove=100-201 we do not remove this range as 101,121, and 131 are being used.
if the admin wants to remove the reset of the range leaving the used ones he can say
remove 100-100, 102-120, etc
Note: If remove fails Add will also fail.
execution flow for the adding a vlan range.
1.)check if the vlan already exists.
2.)check if it overlaps any existing vlan ranges. If it overlaps extend the existing range.
E= 100-200 Add=200-300, in this case we extend the existing vlan to 100-300.
3.)if it dose not overlap add the new vlan
range.
execution flow for removing the vlan range.
1.) check if the vlan range exists.
2.) Acquire a DB lock .
3.) check if there are any used vlans in the range. throw an error and exit if any used vlans exist.
4.) If there are no used vlans remove the range.
No data base changes are required.