Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create new topo for SKU Mellanox-SN2700-D40C8S8 #3058

Merged
merged 7 commits into from
Mar 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ansible/config_sonic_basedon_testbed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@
delegate_to: localhost
when: "('host_interfaces_by_dut' in vm_topo_config) and ('tor' in vm_topo_config['dut_type'] | lower)"

- name: find downlink portchannel configuration for T0 topology
set_fact:
portchannel_config: "{{ vm_topo_config['DUT']['portchannel_config'] | default({})}}"
delegate_to: localhost
when: "('host_interfaces_by_dut' in vm_topo_config) and ('tor' in vm_topo_config['dut_type'] | lower)"

- name: find any tunnel configurations
tunnel_config:
vm_topo_config: "{{ vm_topo_config }}"
Expand Down
1 change: 1 addition & 0 deletions ansible/library/vlan_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def main():
vlan_configs[vlan]['prefix'] = vlan_param['prefix']
vlan_configs[vlan]['prefix_v6'] = vlan_param['prefix_v6']
vlan_configs[vlan]['intfs'] = [port_alias[i] for i in vlan_param['intfs']]
vlan_configs[vlan]['portchannels'] = vlan_param.get('portchannels', [])

if 'mac' in vlan_param:
vlan_configs[vlan]['mac'] = vlan_param['mac']
Expand Down
19 changes: 19 additions & 0 deletions ansible/module_utils/port_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,25 @@ def get_port_alias_to_name_map(hwsku):
elif hwsku == "Arista-7060CX-32S-C32" or hwsku == "Arista-7060CX-32S-Q32" or hwsku == "Arista-7060CX-32S-C32-T1" or hwsku == "Arista-7170-32CD-C32":
for i in range(1, 33):
port_alias_to_name_map["Ethernet%d/1" % i] = "Ethernet%d" % ((i - 1) * 4)
elif hwsku == "Mellanox-SN2700-D40C8S8":
# 10G ports
s10G_ports = range(0, 4) + range(8, 12)

# 50G ports
s50G_ports = [x for x in range(16, 24, 2)] + [x for x in range(40, 88, 2)] + [x for x in range(104, 128, 2)]

# 100G ports
s100G_ports = [x for x in range(24, 40, 4)] + [x for x in range(88, 104, 4)]

for i in s10G_ports:
alias = "etp%d" % (i / 4 + 1) + chr(ord('a') + i % 4)
port_alias_to_name_map[alias] = "Ethernet%d" % i
for i in s50G_ports:
alias = "etp%d" % (i / 4 + 1) + ("a" if i % 4 == 0 else "b")
port_alias_to_name_map[alias] = "Ethernet%d" % i
for i in s100G_ports:
alias = "etp%d" % (i / 4 + 1)
port_alias_to_name_map[alias] = "Ethernet%d" % i
elif hwsku == "Mellanox-SN2700-D48C8":
# 50G ports
s50G_ports = [x for x in range(0, 24, 2)] + [x for x in range(40, 88, 2)] + [x for x in range(104, 128, 2)]
Expand Down
12 changes: 11 additions & 1 deletion ansible/templates/minigraph_dpg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@
</PortChannel>
{% endif %}
{% endfor %}
{% if 'tor' in vm_topo_config['dut_type'] | lower %}
{% for portchannel, params in portchannel_config.items() %}
{% set port_channel_intf=';'.join(params['intfs'] | map('extract', port_alias)) %}
<PortChannel>
<Name>{{ portchannel }}</Name>
<AttachTo>{{ port_channel_intf }}</AttachTo>
<SubInterface/>
</PortChannel>
{% endfor %}
{% endif %}
</PortChannelInterfaces>
{% if tunnel_configs | length > 0 %}
<TunnelInterfaces>
Expand All @@ -89,7 +99,7 @@
{% for vlan, vlan_param in vlan_configs.items() %}
<VlanInterface>
<Name>{{ vlan }}</Name>
{% set vlan_intf_str=';'.join(vlan_param['intfs']) %}
{% set vlan_intf_str=';'.join(vlan_param['intfs'] + vlan_param['portchannels']) %}
<AttachTo>{{ vlan_intf_str }}</AttachTo>
<NoDhcpRelay>False</NoDhcpRelay>
<StaticDHCPRelay>0.0.0.0/0</StaticDHCPRelay>
Expand Down
325 changes: 325 additions & 0 deletions ansible/vars/topo_t0-56-po2vlan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,325 @@
topology:
host_interfaces:
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
disabled_host_interfaces:
- 1
- 2
- 3
- 5
- 6
- 7
- 9
- 11
- 17
- 19
- 21
- 23
- 25
- 27
- 29
- 31
- 33
- 35
- 37
- 39
- 45
- 47
- 49
- 51
- 53
- 55
VMs:
ARISTA01T1:
vlans:
- 12
vm_offset: 0
ARISTA02T1:
vlans:
- 13
vm_offset: 1
ARISTA03T1:
vlans:
- 14
vm_offset: 2
ARISTA04T1:
vlans:
- 15
vm_offset: 3
ARISTA05T1:
vlans:
- 40
vm_offset: 4
ARISTA06T1:
vlans:
- 41
vm_offset: 5
ARISTA07T1:
vlans:
- 42
vm_offset: 6
ARISTA08T1:
vlans:
- 43
vm_offset: 7
DUT:
portchannel_config:
PortChannel101:
intfs: [0, 4]
vlan_configs:
default_vlan_config: two_vlan_a
two_vlan_a:
Vlan101:
id: 101
intfs: []
portchannels: ['PortChannel101']
prefix: 192.168.100.1/21
prefix_v6: fc02:100::1/64
tag: 101
Vlan102:
id: 102
intfs: [8, 10, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 44, 46, 48, 50, 52, 54]
portchannels: ['PortChannel101']
prefix: 192.168.200.1/21
prefix_v6: fc02:200::1/64
tag: 102

configuration_properties:
common:
dut_asn: 65100
dut_type: ToRRouter
swrole: leaf
podset_number: 200
tor_number: 16
tor_subnet_number: 2
max_tor_subnet_number: 16
tor_subnet_size: 128
spine_asn: 65534
leaf_asn_start: 64600
tor_asn_start: 65100
failure_rate: 0
nhipv4: 10.10.246.254
nhipv6: FC0A::FF

configuration:
ARISTA01T1:
properties:
- common
bgp:
asn: 64600
peers:
65100:
- 10.0.0.56
- FC00::71
interfaces:
Loopback0:
ipv4: 100.1.0.29/32
ipv6: 2064:100::1d/128
Ethernet1:
lacp: 1
Port-Channel1:
ipv4: 10.0.0.57/31
ipv6: fc00::72/126
bp_interface:
ipv4: 10.10.246.29/24
ipv6: fc0a::3a/64

ARISTA02T1:
properties:
- common
bgp:
asn: 64600
peers:
65100:
- 10.0.0.58
- FC00::75
interfaces:
Loopback0:
ipv4: 100.1.0.30/32
ipv6: 2064:100::1e/128
Ethernet1:
lacp: 1
Port-Channel1:
ipv4: 10.0.0.59/31
ipv6: fc00::76/126
bp_interface:
ipv4: 10.10.246.30/24
ipv6: fc0a::3d/64

ARISTA03T1:
properties:
- common
bgp:
asn: 64600
peers:
65100:
- 10.0.0.60
- FC00::79
interfaces:
Loopback0:
ipv4: 100.1.0.31/32
ipv6: 2064:100::1f/128
Ethernet1:
lacp: 1
Port-Channel1:
ipv4: 10.0.0.61/31
ipv6: fc00::7a/126
bp_interface:
ipv4: 10.10.246.31/24
ipv6: fc0a::3e/64

ARISTA04T1:
properties:
- common
bgp:
asn: 64600
peers:
65100:
- 10.0.0.62
- FC00::7D
interfaces:
Loopback0:
ipv4: 100.1.0.32/32
ipv6: 2064:100::20/128
Ethernet1:
lacp: 1
Port-Channel1:
ipv4: 10.0.0.63/31
ipv6: fc00::7e/126
bp_interface:
ipv4: 10.10.246.32/24
ipv6: fc0a::41/64

ARISTA05T1:
properties:
- common
bgp:
asn: 64600
peers:
65100:
- 10.0.0.64
- FC00::81
interfaces:
Loopback0:
ipv4: 100.1.0.33/32
ipv6: 2064:100::21/128
Ethernet1:
lacp: 1
Port-Channel1:
ipv4: 10.0.0.65/31
ipv6: fc00::82/126
bp_interface:
ipv4: 10.10.246.33/24
ipv6: fc0a::3a/64

ARISTA06T1:
properties:
- common
bgp:
asn: 64600
peers:
65100:
- 10.0.0.66
- FC00::85
interfaces:
Loopback0:
ipv4: 100.1.0.34/32
ipv6: 2064:100::22/128
Ethernet1:
lacp: 1
Port-Channel1:
ipv4: 10.0.0.67/31
ipv6: fc00::86/126
bp_interface:
ipv4: 10.10.246.34/24
ipv6: fc0a::3d/64

ARISTA07T1:
properties:
- common
bgp:
asn: 64600
peers:
65100:
- 10.0.0.68
- FC00::89
interfaces:
Loopback0:
ipv4: 100.1.0.35/32
ipv6: 2064:100::23/128
Ethernet1:
lacp: 1
Port-Channel1:
ipv4: 10.0.0.69/31
ipv6: fc00::8a/126
bp_interface:
ipv4: 10.10.246.35/24
ipv6: fc0a::3e/64

ARISTA08T1:
properties:
- common
bgp:
asn: 64600
peers:
65100:
- 10.0.0.70
- FC00::8D
interfaces:
Loopback0:
ipv4: 100.1.0.36/32
ipv6: 2064:100::20/128
Ethernet1:
lacp: 1
Port-Channel1:
ipv4: 10.0.0.71/31
ipv6: fc00::8e/126
bp_interface:
ipv4: 10.10.246.36/24
ipv6: fc0a::41/64
Loading