Add two new host-types: 'host' and 'tap', which will serve as North/South debian hosts, and an OVS mirror host respectively
This commit is contained in:
12
generate
12
generate
@ -151,8 +151,10 @@ def create_node(lab, node_id, node_type):
|
||||
lo4_base = lab["ipv4"].split("/")[0]
|
||||
lo6_base = lab["ipv6"].split("/")[0]
|
||||
total_nodes = 0
|
||||
for node_type, ncount in lab["nodes"].items():
|
||||
total_nodes += ncount
|
||||
for nt, nc in lab["nodes"].items():
|
||||
if nt == node_type:
|
||||
offset = total_nodes
|
||||
total_nodes += nc
|
||||
|
||||
ret = {
|
||||
"hostname": "%s%d-%d" % (node_type, lab["id"], node_id),
|
||||
@ -160,12 +162,12 @@ def create_node(lab, node_id, node_type):
|
||||
"mgmt": {
|
||||
"ipv4": "%s/%s"
|
||||
% (
|
||||
ipaddress.IPv4Address(v4_base) + total_nodes * lab["id"] + node_id,
|
||||
ipaddress.IPv4Address(v4_base) + total_nodes * lab["id"] + offset + node_id,
|
||||
v4_plen,
|
||||
),
|
||||
"ipv6": "%s/%s"
|
||||
% (
|
||||
ipaddress.IPv6Address(v6_base) + total_nodes * lab["id"] + node_id,
|
||||
ipaddress.IPv6Address(v6_base) + total_nodes * lab["id"] + offset + node_id,
|
||||
v6_plen,
|
||||
),
|
||||
"gw4": lab["mgmt"]["gw4"],
|
||||
@ -246,7 +248,7 @@ def main():
|
||||
|
||||
for node_type, ncount in data["lab"]["nodes"].items():
|
||||
for node_id in range(ncount):
|
||||
log.info("Generating for VPP node %d" % node_id)
|
||||
log.info("Generating for %s node %d" % (node_type, node_id))
|
||||
data["node"] = create_node(data["lab"], node_id, node_type)
|
||||
log.debug("node: %s" % data["node"])
|
||||
|
||||
|
Reference in New Issue
Block a user