Skip to content

Commit 1ea20e9

Browse files
authored
Add F2 topo for Arista-7060X6-64PE-B-P32V128 and Arista-7060X6-64PE-B-P32O64 (sonic-net#21323)
* add F2 T0/T1 topo Signed-off-by: opcoder0 <110003254+opcoder0@users.noreply.github.com>
1 parent 0c0a3d1 commit 1ea20e9

File tree

10 files changed

+1600
-17
lines changed

10 files changed

+1600
-17
lines changed

ansible/generate_topo.py

Lines changed: 201 additions & 17 deletions
Large diffs are not rendered by default.

ansible/module_utils/port_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ def get_port_alias_to_name_map(hwsku, asic_name=None):
133133
port_alias_to_name_map["etp%d%s" % (i, j)] = "Ethernet%d" % ((i - 1) * 8 + x - 1)
134134
port_alias_to_name_map["etp65"] = "Ethernet512"
135135
port_alias_to_name_map["etp66"] = "Ethernet513"
136+
elif hwsku in ["Arista-7060X6-64PE-B-P32V128", "Arista-7060X6-64PE-P32V128"]:
137+
for i in range(1, 33):
138+
port_alias_to_name_map["etp%d" % (i)] = "Ethernet%d" % ((i - 1) * 8)
139+
for i in range(33, 65):
140+
for x, j in zip([1, 3, 5, 7], ["a", "b", "c", "d"]):
141+
port_alias_to_name_map["etp%d%s" % (i, j)] = "Ethernet%d" % ((i - 1) * 8 + x - 1)
136142
elif hwsku == "Arista-7060X6-64PE-256x200G":
137143
for i in range(1, 65):
138144
for j in [1, 3, 5, 7]:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
t0-leaf.j2
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
{% set host = configuration[hostname] %}
2+
{% set mgmt_ip = ansible_host %}
3+
{% if vm_type is defined and vm_type == "ceos" %}
4+
{% set mgmt_if_index = 0 %}
5+
{% else %}
6+
{% set mgmt_if_index = 1 %}
7+
{% endif %}
8+
no schedule tech-support
9+
!
10+
{% if vm_type is defined and vm_type == "ceos" %}
11+
agent LicenseManager shutdown
12+
agent PowerFuse shutdown
13+
agent PowerManager shutdown
14+
agent Thermostat shutdown
15+
agent LedPolicy shutdown
16+
agent StandbyCpld shutdown
17+
agent Bfd shutdown
18+
{% endif %}
19+
!
20+
hostname {{ hostname }}
21+
!
22+
vrf definition MGMT
23+
rd 1:1
24+
!
25+
spanning-tree mode mstp
26+
!
27+
aaa root secret 0 123456
28+
!
29+
username admin privilege 15 role network-admin secret 0 123456
30+
!
31+
clock timezone UTC
32+
!
33+
lldp run
34+
lldp management-address Management{{ mgmt_if_index }}
35+
lldp management-address vrf MGMT
36+
!
37+
snmp-server community {{ snmp_rocommunity }} ro
38+
snmp-server vrf MGMT
39+
!
40+
ip routing
41+
ip routing vrf MGMT
42+
ipv6 unicast-routing
43+
!
44+
{% if disable_ceos_mgmt_gateway is defined and disable_ceos_mgmt_gateway == 'yes'%}
45+
{% elif vm_mgmt_gw is defined %}
46+
ip route vrf MGMT 0.0.0.0/0 {{ vm_mgmt_gw }}
47+
{% else %}
48+
ip route vrf MGMT 0.0.0.0/0 {{ mgmt_gw }}
49+
{% endif %}
50+
!
51+
interface Management {{ mgmt_if_index }}
52+
description TO LAB MGMT SWITCH
53+
{% if vm_type is defined and vm_type == "ceos" %}
54+
vrf MGMT
55+
{% else %}
56+
vrf forwarding MGMT
57+
{% endif %}
58+
ip address {{ mgmt_ip }}/{{ mgmt_prefixlen }}
59+
no shutdown
60+
!
61+
{% for name, iface in host['interfaces'].items() %}
62+
interface {{ name }}
63+
{% if name.startswith('Loopback') %}
64+
description LOOPBACK
65+
{% else %}
66+
mtu 9214
67+
no switchport
68+
no shutdown
69+
{% endif %}
70+
{% if name.startswith('Port-Channel') %}
71+
port-channel min-links 1
72+
{% endif %}
73+
{% if iface['lacp'] is defined %}
74+
channel-group {{ iface['lacp'] }} mode active
75+
lacp rate normal
76+
{% endif %}
77+
{% if iface['ipv4'] is defined %}
78+
ip address {{ iface['ipv4'] }}
79+
{% endif %}
80+
{% if iface['ipv6'] is defined %}
81+
ipv6 enable
82+
ipv6 address {{ iface['ipv6'] }}
83+
ipv6 nd ra suppress
84+
{% endif %}
85+
no shutdown
86+
!
87+
{% endfor %}
88+
!
89+
interface {{ bp_ifname }}
90+
description backplane
91+
no switchport
92+
no shutdown
93+
{% if host['bp_interface']['ipv4'] is defined %}
94+
ip address {{ host['bp_interface']['ipv4'] }}
95+
{% endif %}
96+
{% if host['bp_interface']['ipv6'] is defined %}
97+
ipv6 enable
98+
ipv6 address {{ host['bp_interface']['ipv6'] }}
99+
ipv6 nd ra suppress
100+
{% endif %}
101+
no shutdown
102+
!
103+
router bgp {{ host['bgp']['asn'] }}
104+
router-id {{ host['bgp']['router-id'] if host['bgp']['router-id'] is defined else host['interfaces']['Loopback0']['ipv4'] | ansible.utils.ipaddr('address') }}
105+
!
106+
{% for asn, remote_ips in host['bgp']['peers'].items() %}
107+
{% for remote_ip in remote_ips %}
108+
neighbor {{ remote_ip }} remote-as {{ asn }}
109+
neighbor {{ remote_ip }} description {{ asn }}
110+
neighbor {{ remote_ip }} next-hop-self
111+
{% if remote_ip | ansible.utils.ipv6 %}
112+
address-family ipv6
113+
neighbor {{ remote_ip }} activate
114+
exit
115+
{% endif %}
116+
{% endfor %}
117+
{% endfor %}
118+
{% if props.enable_ipv4_routes_generation is not defined or props.enable_ipv4_routes_generation %}
119+
neighbor {{ props.nhipv4 }} remote-as {{ host['bgp']['asn'] }}
120+
neighbor {{ props.nhipv4 }} description exabgp_v4
121+
{% endif %}
122+
{% if props.enable_ipv6_routes_generation is not defined or props.enable_ipv6_routes_generation %}
123+
neighbor {{ props.nhipv6 }} remote-as {{ host['bgp']['asn'] }}
124+
neighbor {{ props.nhipv6 }} description exabgp_v6
125+
address-family ipv6
126+
neighbor {{ props.nhipv6 }} activate
127+
exit
128+
{% endif %}
129+
!
130+
{% for name, iface in host['interfaces'].items() if name.startswith('Loopback') %}
131+
{% if iface['ipv4'] is defined %}
132+
network {{ iface['ipv4'] }}
133+
{% endif %}
134+
{% if iface['ipv6'] is defined %}
135+
network {{ iface['ipv6'] }}
136+
{% endif %}
137+
{% endfor %}
138+
!
139+
management api http-commands
140+
no protocol https
141+
protocol http
142+
no shutdown
143+
!
144+
end
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
{% set host = configuration[hostname] %}
2+
{% set mgmt_ip = ansible_host %}
3+
{% set tornum = host['tornum'] %}
4+
{% if vm_type is defined and vm_type == "ceos" %}
5+
{% set mgmt_if_index = 0 %}
6+
{% else %}
7+
{% set mgmt_if_index = 1 %}
8+
{% endif %}
9+
no schedule tech-support
10+
!
11+
{% if vm_type is defined and vm_type == "ceos" %}
12+
agent LicenseManager shutdown
13+
agent PowerFuse shutdown
14+
agent PowerManager shutdown
15+
agent Thermostat shutdown
16+
agent LedPolicy shutdown
17+
agent StandbyCpld shutdown
18+
agent Bfd shutdown
19+
{% endif %}
20+
!
21+
hostname {{ hostname }}
22+
!
23+
vrf definition MGMT
24+
rd 1:1
25+
!
26+
spanning-tree mode mstp
27+
!
28+
aaa root secret 0 123456
29+
!
30+
username admin privilege 15 role network-admin secret 0 123456
31+
!
32+
clock timezone UTC
33+
!
34+
lldp run
35+
lldp management-address Management{{ mgmt_if_index }}
36+
lldp management-address vrf MGMT
37+
!
38+
snmp-server community {{ snmp_rocommunity }} ro
39+
snmp-server vrf MGMT
40+
!
41+
ip routing
42+
ip routing vrf MGMT
43+
ipv6 unicast-routing
44+
!
45+
{% if disable_ceos_mgmt_gateway is defined and disable_ceos_mgmt_gateway == 'yes'%}
46+
{% elif vm_mgmt_gw is defined %}
47+
ip route vrf MGMT 0.0.0.0/0 {{ vm_mgmt_gw }}
48+
{% else %}
49+
ip route vrf MGMT 0.0.0.0/0 {{ mgmt_gw }}
50+
{% endif %}
51+
!
52+
interface Management {{ mgmt_if_index }}
53+
description TO LAB MGMT SWITCH
54+
{% if vm_type is defined and vm_type == "ceos" %}
55+
vrf MGMT
56+
{% else %}
57+
vrf forwarding MGMT
58+
{% endif %}
59+
ip address {{ mgmt_ip }}/{{ mgmt_prefixlen }}
60+
no shutdown
61+
!
62+
{% for name, iface in host['interfaces'].items() %}
63+
interface {{ name }}
64+
{% if name.startswith('Loopback') %}
65+
description LOOPBACK
66+
{% else %}
67+
mtu 9214
68+
no switchport
69+
no shutdown
70+
{% endif %}
71+
{% if name.startswith('Port-Channel') %}
72+
port-channel min-links 1
73+
{% endif %}
74+
{% if iface['ipv4'] is defined %}
75+
ip address {{ iface['ipv4'] }}
76+
{% endif %}
77+
{% if iface['ipv6'] is defined %}
78+
ipv6 enable
79+
ipv6 address {{ iface['ipv6'] }}
80+
ipv6 nd ra suppress
81+
{% endif %}
82+
{% if iface['lacp'] is defined %}
83+
channel-group {{ iface['lacp'] }} mode active
84+
lacp rate normal
85+
{% endif %}
86+
no shutdown
87+
!
88+
{% endfor %}
89+
!
90+
interface {{ bp_ifname }}
91+
description backplane
92+
no switchport
93+
no shutdown
94+
{% if host['bp_interface']['ipv4'] is defined %}
95+
ip address {{ host['bp_interface']['ipv4'] }}
96+
{% endif %}
97+
{% if host['bp_interface']['ipv6'] is defined %}
98+
ipv6 enable
99+
ipv6 address {{ host['bp_interface']['ipv6'] }}
100+
ipv6 nd ra suppress
101+
{% endif %}
102+
no shutdown
103+
!
104+
router bgp {{ host['bgp']['asn'] }}
105+
router-id {{ host['interfaces']['Loopback0']['ipv4'] | ansible.utils.ipaddr('address') }}
106+
!
107+
graceful-restart restart-time {{ bgp_gr_timer }}
108+
graceful-restart
109+
!
110+
{% for asn, remote_ips in host['bgp']['peers'].items() %}
111+
{% for remote_ip in remote_ips %}
112+
neighbor {{ remote_ip }} remote-as {{ asn }}
113+
neighbor {{ remote_ip }} description {{ asn }}
114+
neighbor {{ remote_ip }} next-hop-self
115+
{% if remote_ip | ansible.utils.ipv6 %}
116+
address-family ipv6
117+
neighbor {{ remote_ip }} activate
118+
exit
119+
{% endif %}
120+
{% endfor %}
121+
{% endfor %}
122+
neighbor {{ props.nhipv4 }} remote-as {{ host['bgp']['asn'] }}
123+
neighbor {{ props.nhipv4 }} description exabgp_v4
124+
neighbor {{ props.nhipv6 }} remote-as {{ host['bgp']['asn'] }}
125+
neighbor {{ props.nhipv6 }} description exabgp_v6
126+
address-family ipv6
127+
neighbor {{ props.nhipv6 }} activate
128+
exit
129+
!
130+
{% for name, iface in host['interfaces'].items() if name.startswith('Loopback') %}
131+
{% if iface['ipv4'] is defined %}
132+
network {{ iface['ipv4'] }}
133+
{% endif %}
134+
{% if iface['ipv6'] is defined %}
135+
network {{ iface['ipv6'] }}
136+
{% endif %}
137+
{% endfor %}
138+
!
139+
management api http-commands
140+
no protocol https
141+
protocol http
142+
no shutdown
143+
!
144+
end

ansible/templates/topo_t0.j2

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
topology:
2+
host_interfaces:
3+
{%- for hostif in hostif_list %}
4+
- {{ hostif.port_id }}
5+
{%- endfor %}
6+
disabled_host_interfaces:
7+
{%- for hostif in disabled_hostif_list %}
8+
- {{ hostif.port_id }}
9+
{%- endfor %}
10+
{%- if vm_list | length == 0 %}
11+
VMs: {}
12+
{%- else %}
13+
VMs:
14+
{%- for vm in vm_list %}
15+
{{ vm.name }}:
16+
vlans:
17+
{%- for vlan in vm.vlans %}
18+
- {{ vlan }}
19+
{%- endfor %}
20+
vm_offset: {{ vm.vm_offset }}
21+
{%- endfor %}
22+
{%- endif %}
23+
DUT:
24+
vlan_configs:
25+
default_vlan_config: {{ vlan_group_list[0].name }}
26+
{%- for vlan_group in vlan_group_list %}
27+
{{ vlan_group.name }}:
28+
{%- for vlan in vlan_group.vlans %}
29+
Vlan{{ vlan.id }}:
30+
id: {{ vlan.id }}
31+
intfs: {{ vlan.port_ids }}
32+
prefix: {{ vlan.v4_prefix }}
33+
prefix_v6: {{ vlan.v6_prefix }}
34+
tag: {{ vlan.id }}
35+
{%- endfor %}
36+
{%- endfor %}
37+
38+
configuration_properties:
39+
common:
40+
dut_asn: {{ dut.asn }}
41+
dut_type: ToRRouter
42+
swrole: leaf
43+
nhipv4: 10.10.246.254
44+
nhipv6: FC0A::FF
45+
podset_number: 200
46+
tor_number: 16
47+
tor_subnet_number: 2
48+
max_tor_subnet_number: 16
49+
tor_subnet_size: 128
50+
spine_asn: 65534
51+
leaf_asn_start: 64600
52+
tor_asn_start: 65500
53+
failure_rate: 0
54+
55+
configuration:
56+
{%- for vm in vm_list %}
57+
{{vm.name}}:
58+
properties:
59+
- common
60+
bgp:
61+
asn: {{vm.asn}}
62+
peers:
63+
{{vm.peer_asn}}:
64+
- {{vm.dut_intf_ipv4}}
65+
- {{vm.dut_intf_ipv6}}
66+
interfaces:
67+
Loopback0:
68+
ipv4: {{vm.loopback_ipv4}}/32
69+
ipv6: {{vm.loopback_ipv6}}/128
70+
{%- if vm.num_lags > 0 %}
71+
{%- for i in range(1, vm.num_lags + 1) %}
72+
Ethernet{{i}}:
73+
lacp: 1
74+
{%- endfor %}
75+
Port-Channel1:
76+
ipv4: {{vm.pc_intf_ipv4}}/31
77+
ipv6: {{vm.pc_intf_ipv6}}/126
78+
{%- else %}
79+
Ethernet1:
80+
ipv4: {{vm.pc_intf_ipv4}}/31
81+
ipv6: {{vm.pc_intf_ipv6}}/126
82+
{%- endif %}
83+
bp_interface:
84+
ipv4: {{vm.bp_ipv4}}/24
85+
ipv6: {{vm.bp_ipv6}}/64
86+
{%- endfor %}

0 commit comments

Comments
 (0)