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:
Pim van Pelt
2023-05-06 11:11:25 +00:00
parent d99d9074dc
commit 3f4bcf4f04
23 changed files with 156 additions and 5 deletions

View File

@ -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"])