Skip to content

Commit

Permalink
Merged PR 929: Add bluefield01 and bluefield02 testbeds (attempt soni…
Browse files Browse the repository at this point in the history
…c-net#2)

- Add device and connection info to inventory/graph files
- Create testbed and allocate VMs and PTF IPs
- Modify 'available_vmset_finder' script to account for more topology types

Note: Actual topology file has been created in public repo
  • Loading branch information
theasianpianist committed Sep 3, 2022
1 parent e9d7982 commit 581900a
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 6 deletions.
20 changes: 17 additions & 3 deletions ansible/available_vmset_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ def build_topo_vmcnt():
topo_vm_cnt = dict()

try:
topo_files = [f for f in os.listdir(TOPO_PATH) if os.path.isfile('{}{}'.format(TOPO_PATH, f)) and f.startswith('topo_t') or f.startswith('topo_mgmt')]
topo_files = [f for f in os.listdir(TOPO_PATH) if os.path.isfile('{}{}'.format(TOPO_PATH, f)) and f.startswith('topo')]
for tfile in topo_files:
topo = re.findall('topo_(.*)\.yml', tfile)[0]
with open(TOPO_PATH + tfile) as f:
vmtopo = yaml.load(f, Loader=yaml.FullLoader)
topo_vm_cnt[topo] = len(vmtopo['topology']['VMs'])
try:
topo_vm_cnt[topo] = len(vmtopo['topology']['VMs'])
except KeyError:
pass
except EnvironmentError as e:
print 'Error while trying to open/read topo files: {}'.format(str(e))
exit(1)
Expand All @@ -58,11 +61,22 @@ def parse_file(topo_vm_cnt, testbed_file, server_pool):
if "ptf" in tb["topo"]["name"]:
continue
if tb["server"] in server_pool:
server_info[tb["server"]].append((tb["vm_base"], topo_vm_cnt[tb["topo"]["name"]]))
try:
server_info[tb["server"]].append((tb["vm_base"], topo_vm_cnt[tb["topo"]["name"]]))
except KeyError:
pass
except EnvironmentError as e:
print 'Error while trying to open/read testbed file: {}'.format(str(e))
exit(1)

unused_servers = []
for server, vm_list in server_info.items():
if not vm_list:
unused_servers.append(server)

for server in unused_servers:
server_info.pop(server)

for key in server_info:
server_info[key] = sorted(server_info[key], key=itemgetter(0))
return server_info
Expand Down
2 changes: 2 additions & 0 deletions ansible/files/sonic_str2_devices.csv
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ str2-7250-lc2-2,10.3.147.133/23,Nokia-IXR7250E-36x100G,DevSonic,
str2-7215-acs-2,10.3.146.63/23,Nokia-7215,FanoutLeafSonic,
str2-7215-acs-3,10.3.147.140/23,Nokia-7215,DevSonic,
str2-7215-acs-4,10.3.147.48/23,Nokia-7215,FanoutLeafSonic,
str2-bluefield-01,10.64.246.248/23,DPU,DevSonic,
str2-bluefield-02,10.64.246.249/23,DPU,DevSonic
str2-acs-serv-16,10.64.246.95/23,TestServ,Server,
str2-acs-serv-18,10.64.246.97/23,TestServ,Server,
str2-acs-serv-19,10.64.246.111/23,TestServ,Server,
Expand Down
6 changes: 5 additions & 1 deletion ansible/files/sonic_str2_links.csv
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ str2-7260cx3-acs-root02,Ethernet42/1,str2-7260cx3-acs-fan-24,Ethernet64/1,100000
str2-7260cx3-acs-root02,Ethernet43/1,str2-7260cx3-acs-fan-25,Ethernet64/1,100000,"1314-1373",Trunk
str2-7260cx3-acs-root02,Ethernet47/1,str2-7260cx3-acs-fan-26,Ethernet64/1,100000,"1442-1501",Trunk
str2-7260cx3-acs-root02,Ethernet48/1,str2-7260cx3-acs-fan-27,Ethernet64/1,100000,"1378-1437",Trunk
str2-7260cx3-acs-root02,Ethernet49/1,str2-7260cx3-acs-fan-28,Ethernet64/1,100000,"1438-1441,1502-1505",Trunk
str2-7260cx3-acs-root02,Ethernet49/1,str2-7260cx3-acs-fan-28,Ethernet64/1,100000,"1438-1441,1502-1505,3997-4000",Trunk
str2-7260cx3-acs-root02,Ethernet50/1,str2-7260cx3-acs-fan-29,Ethernet64/1,100000,"1630-1633,1636-1665",Trunk
str2-7260cx3-acs-root02,Ethernet52/1,str2-7260cx3-acs-fan-30,Ethernet64/1,100000,"2039-2068",Trunk
str2-7260cx3-acs-root02,Ethernet56/1,str2-7260cx3-acs-fan-31,Ethernet64/1,100000,"1506-1565",Trunk
Expand Down Expand Up @@ -1641,6 +1641,10 @@ str2-7260cx3-acs-11,Ethernet248,str2-7260cx3-acs-fan-13,Ethernet34/1,50000,3993,
str2-7260cx3-acs-11,Ethernet250,str2-7260cx3-acs-fan-13,Ethernet34/3,50000,3994,Access
str2-7260cx3-acs-11,Ethernet252,str2-7260cx3-acs-fan-13,Ethernet35/1,50000,3995,Access
str2-7260cx3-acs-11,Ethernet254,str2-7260cx3-acs-fan-13,Ethernet35/3,50000,3996,Access
str2-bluefield-01,Ethernet0,str2-7260cx3-acs-fan-28,Ethernet9/1,100000,3997,Access
str2-bluefield-01,Ethernet4,str2-7260cx3-acs-fan-28,Ethernet10/1,100000,3998,Access
str2-bluefield-02,Ethernet0,str2-7260cx3-acs-fan-28,Ethernet11/1,100000,3999,Access
str2-bluefield-02,Ethernet4,str2-7260cx3-acs-fan-28,Ethernet12/1,100000,4000,Access
str2-7050qx-32s-acs-02,Ethernet0,str2-7260cx3-acs-fan-20,Ethernet1/1,40000,2000,Access
str2-7050qx-32s-acs-02,Ethernet1,str2-7260cx3-acs-fan-20,Ethernet1/2,40000,2001,Access
str2-7050qx-32s-acs-02,Ethernet2,str2-7260cx3-acs-fan-20,Ethernet1/3,40000,2002,Access
Expand Down
20 changes: 18 additions & 2 deletions ansible/files/spytest_connection_graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
<Device Hostname="str2-7215-acs-2" HwSku="Nokia-7215" Type="FanoutLeafSonic"/>
<Device Hostname="str2-7215-acs-3" HwSku="Nokia-7215" Type="DevSonic"/>
<Device Hostname="str2-7215-acs-4" HwSku="Nokia-7215" Type="FanoutLeafSonic"/>
<Device Hostname="str2-bluefield-01" HwSku="DPU" Type="DevSonic"/>
<Device Hostname="str2-bluefield-02" HwSku="DPU" Type="DevSonic"/>
<Device Hostname="str2-acs-serv-16" HwSku="TestServ" Type="Server"/>
<Device Hostname="str2-acs-serv-18" HwSku="TestServ" Type="Server"/>
<Device Hostname="str2-acs-serv-19" HwSku="TestServ" Type="Server"/>
Expand Down Expand Up @@ -1771,6 +1773,10 @@
<DeviceInterfaceLink BandWidth="50000" EndDevice="str2-7260cx3-acs-fan-13" EndPort="Ethernet34/3" StartDevice="str2-7260cx3-acs-11" StartPort="Ethernet250"/>
<DeviceInterfaceLink BandWidth="50000" EndDevice="str2-7260cx3-acs-fan-13" EndPort="Ethernet35/1" StartDevice="str2-7260cx3-acs-11" StartPort="Ethernet252"/>
<DeviceInterfaceLink BandWidth="50000" EndDevice="str2-7260cx3-acs-fan-13" EndPort="Ethernet35/3" StartDevice="str2-7260cx3-acs-11" StartPort="Ethernet254"/>
<DeviceInterfaceLink BandWidth="100000" EndDevice="str2-7260cx3-acs-fan-28" EndPort="Ethernet9/1" StartDevice="str2-bluefield-01" StartPort="Ethernet0"/>
<DeviceInterfaceLink BandWidth="100000" EndDevice="str2-7260cx3-acs-fan-28" EndPort="Ethernet10/1" StartDevice="str2-bluefield-01" StartPort="Ethernet4"/>
<DeviceInterfaceLink BandWidth="100000" EndDevice="str2-7260cx3-acs-fan-28" EndPort="Ethernet11/1" StartDevice="str2-bluefield-02" StartPort="Ethernet0"/>
<DeviceInterfaceLink BandWidth="100000" EndDevice="str2-7260cx3-acs-fan-28" EndPort="Ethernet12/1" StartDevice="str2-bluefield-02" StartPort="Ethernet4"/>
<DeviceInterfaceLink BandWidth="40000" EndDevice="str2-7260cx3-acs-fan-20" EndPort="Ethernet1/1" StartDevice="str2-7050qx-32s-acs-02" StartPort="Ethernet0"/>
<DeviceInterfaceLink BandWidth="40000" EndDevice="str2-7260cx3-acs-fan-20" EndPort="Ethernet1/2" StartDevice="str2-7050qx-32s-acs-02" StartPort="Ethernet1"/>
<DeviceInterfaceLink BandWidth="40000" EndDevice="str2-7260cx3-acs-fan-20" EndPort="Ethernet1/3" StartDevice="str2-7050qx-32s-acs-02" StartPort="Ethernet2"/>
Expand Down Expand Up @@ -3020,7 +3026,7 @@
<InterfaceVlan mode="Trunk" portname="Ethernet43/1" vlanids="1314-1373"/>
<InterfaceVlan mode="Trunk" portname="Ethernet47/1" vlanids="1442-1501"/>
<InterfaceVlan mode="Trunk" portname="Ethernet48/1" vlanids="1378-1437"/>
<InterfaceVlan mode="Trunk" portname="Ethernet49/1" vlanids="1438-1441,1502-1505"/>
<InterfaceVlan mode="Trunk" portname="Ethernet49/1" vlanids="1438-1441,1502-1505,3997-4000"/>
<InterfaceVlan mode="Trunk" portname="Ethernet50/1" vlanids="1630-1633,1636-1665"/>
<InterfaceVlan mode="Trunk" portname="Ethernet52/1" vlanids="2039-2068"/>
<InterfaceVlan mode="Trunk" portname="Ethernet56/1" vlanids="1506-1565"/>
Expand Down Expand Up @@ -5015,7 +5021,11 @@
<ManagementIPInterface Name="ManagementIp" Prefix="10.3.147.82/23"/>
</DevicesL3Info>
<DevicesL2Info Hostname="str2-7260cx3-acs-fan-28">
<InterfaceVlan mode="Trunk" portname="Ethernet64/1" vlanids="1438-1441,1502-1505"/>
<InterfaceVlan mode="Trunk" portname="Ethernet64/1" vlanids="1438-1441,1502-1505,3997-4000"/>
<InterfaceVlan mode="Access" portname="Ethernet9/1" vlanids="3997"/>
<InterfaceVlan mode="Access" portname="Ethernet10/1" vlanids="3998"/>
<InterfaceVlan mode="Access" portname="Ethernet11/1" vlanids="3999"/>
<InterfaceVlan mode="Access" portname="Ethernet12/1" vlanids="4000"/>
<InterfaceVlan mode="Access" portname="Ethernet5/1" vlanids="1438"/>
<InterfaceVlan mode="Access" portname="Ethernet6/1" vlanids="1439"/>
<InterfaceVlan mode="Access" portname="Ethernet7/1" vlanids="1440"/>
Expand Down Expand Up @@ -6283,6 +6293,12 @@
<InterfaceVlan mode="Access" portname="Ethernet46" vlanids="1308"/>
<InterfaceVlan mode="Access" portname="Ethernet47" vlanids="1309"/>
</DevicesL2Info>
<DevicesL3Info Hostname="str2-bluefield-01">
<ManagementIPInterface Name="ManagementIp" Prefix="10.64.246.248/23"/>
</DevicesL3Info>
<DevicesL3Info Hostname="str2-bluefield-02">
<ManagementIPInterface Name="ManagementIp" Prefix="10.64.246.249/23"/>
</DevicesL3Info>
<DevicesL3Info Hostname="str2-acs-serv-16">
<ManagementIPInterface Name="ManagementIp" Prefix="10.64.246.95/23"/>
</DevicesL3Info>
Expand Down
16 changes: 16 additions & 0 deletions ansible/str2
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ all:
ansible_host: 10.64.246.231
vms21-9:
ansible_host: 10.64.246.236
vms21-10:
ansible_host: 10.64.247.29
vms21-11:
ansible_host: 10.64.247.241
vms18-3:
ansible_host: 10.64.246.158
vms24-2:
Expand Down Expand Up @@ -1462,6 +1466,18 @@ sonic_dell_z9332f:
"0xFD": ""
"0xFE": "0x8D29EEBB"
pdu_host: pdu-111

sonic_appliance:
vars:
iface_speed: 100000
hosts:
str2-bluefield-01:
ansible_host: 10.64.246.248
hwsku: Bluefield
str2-bluefield-02:
ansible_host: 10.64.246.249
hwsku: Bluefield

server:
hosts:
str2-acs-serv-16:
Expand Down
28 changes: 28 additions & 0 deletions ansible/testbed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,34 @@
auto_recover: 'True'
comment: v-saidia

- conf-name: vms21-dpu-01
group-name: vms21-10
topo: appliance
ptf_image_name: docker-ptf
ptf: vms21-10
ptf_ip: 10.64.247.29/23
ptf_ipv6:
server: server_21
vm_base: VM21040
dut:
- str2-bluefield-01
auto_recover: 'True'
comment: lawlee

- conf-name: vms21-dpu-02
group-name: vms21-11
topo: appliance
ptf_image_name: docker-ptf
ptf: vms21-11
ptf_ip: 10.64.247.241/23
ptf_ipv6:
server: server_21
vm_base: VM21042
dut:
- str2-bluefield-02
auto_recover: 'True'
comment: lawlee

- conf-name: vms28-t1-8102-02
group-name: vms28-1
topo: t1-64-lag
Expand Down
1 change: 1 addition & 0 deletions ansible/veos
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ all:
- dualtor-mixed
- dualtor-mixed-56
- dualtor-mixed-120
- appliance
- m0

vm_host_1:
Expand Down

0 comments on commit 581900a

Please sign in to comment.