Add framework for managing segment id pools.

Also added the virst implementation, vxlan, to the NVP driver.
This commit is contained in:
Brad Morgan
2016-01-23 01:17:04 -08:00
parent cb3b2b2a0d
commit ed46b2f0b4
14 changed files with 1373 additions and 5 deletions

View File

@@ -270,6 +270,23 @@ def _make_mac_range_dict(mac_range):
"cidr": mac_range["cidr"]}
def _make_segment_allocation_range_dict(sa_range, allocations=None):
size = len(xrange(sa_range["first_id"], sa_range["last_id"] + 1))
sa_dict = {
"id": sa_range["id"],
"segment_id": sa_range["segment_id"],
"segment_type": sa_range["segment_type"],
"first_id": sa_range["first_id"],
"last_id": sa_range["last_id"],
"do_not_use": sa_range["do_not_use"],
"size": size}
if allocations is not None:
sa_dict["free_ids"] = sa_dict["size"] - allocations
return sa_dict
def _make_route_dict(route):
return {"id": route["id"],
"cidr": route["cidr"],