Skip to content
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
11 changes: 11 additions & 0 deletions ansible/config_sonic_basedon_testbed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,17 @@
- "ports"
when: front_panel_asic_ifnames != []

- block:
- name: Create new dictionary for my slot
set_fact:
new_asic_topo_config : "{{ new_asic_topo_config | default( { slot_num : asic_topo_config.slot0 }) }}"

- name: set asic_topo_config to new dictionary
set_fact:
asic_topo_config: "{{ new_asic_topo_config }}"

when: switch_type is defined and switch_type == 'voq' and slot_num is defined and asic_topo_config|length > 0

- name: create minigraph file in ansible minigraph folder
template: src=templates/minigraph_template.j2
dest=minigraph/{{ inventory_hostname}}.{{ topo }}.xml
Expand Down
3 changes: 2 additions & 1 deletion ansible/library/topo_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def __init__(self):

def parse_topo_defintion(self, topo_definition, po_map, dut_num, neigh_type='VMs'):
vmconfig = dict()
if topo_definition['topology'][neigh_type] is None:
return vmconfig
for vm in topo_definition['topology'][neigh_type]:
vmconfig[vm] = dict()
vmconfig[vm]['intfs'] = [[] for i in range(dut_num)]
Expand All @@ -105,7 +107,6 @@ def parse_topo_defintion(self, topo_definition, po_map, dut_num, neigh_type='VMs
for asic_intf in topo_definition['topology'][neigh_type][vm]['asic_intfs']:
vmconfig[vm]['asic_intfs'][dut_index].append(asic_intf)


# physical interface
if 'configuration' in topo_definition:
if 'interfaces' in topo_definition['configuration'][vm]:
Expand Down
57 changes: 22 additions & 35 deletions ansible/templates/minigraph_cpg.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<CpgDec>
<CpgDec>
{% if card_type is not defined or card_type != 'supervisor' %}
<IsisRouters xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
<PeeringSessions>
Expand Down Expand Up @@ -216,6 +216,21 @@
</BGPPeer>
{% endif %}
{% endfor %}
{% if switch_type is defined and switch_type == 'voq' %}
{% set asic_id = asic.split('ASIC')[1]|int %}
{% for a_linecard in all_loopback4096 %}
{% for idx in range(all_loopback4096[a_linecard]|length) %}
{% if loopback4096_ip[asic_id] != all_loopback4096[a_linecard][idx] %}
<BGPPeer>
<Address>{{ all_inbands[a_linecard][idx] }}</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
<Vrf i:nil="true"/>
</BGPPeer>
{% endif %}
{% endfor %}
{% endfor %}
{% else %}
{% for neigh_asic in asic_config['neigh_asic'] %}
{% if neigh_asic in asic_config['neigh_asic'] and asic_config['neigh_asic'][neigh_asic]['peer_ipv4'][0] %}
<BGPPeer>
Expand All @@ -226,56 +241,28 @@
</BGPPeer>
{% endif %}
{% endfor %}
{% endif %}
</a:Peers>
<a:RouteMaps/>
</a:BGPRouterDeclaration>
{% endfor %}
{% endif %}
{% if switch_type is defined and (switch_type == 'voq' or switch_type == 'chassis-packet') %}
{% for a_linecard in all_loopback4096 %}
{% if a_linecard != inventory_hostname %}
{% for idx in range(all_loopback4096[a_linecard]|length) %}
<a:BGPRouterDeclaration>
<a:ASN>{{ vm_topo_config['dut_asn'] }}</a:ASN>
{% if switch_type == 'voq' %}
<a:Hostname>{{ chassis_ibgp_peers[all_inbands[a_linecard][idx].split('/')[0]] }}</a:Hostname>
{% else %}
<a:Hostname>{{ chassis_ibgp_peers[all_loopback4096[a_linecard][idx].split('/')[0]] }}</a:Hostname>
{% endif %}
<a:RouteMaps/>
</a:BGPRouterDeclaration>
{% endfor %}
{% endif %}
{% endfor %}
{% if num_asics > 1 %}
{% for asic_id in range(num_asics) %}
{% set asic_name = "ASIC" + asic_id|string %}
<a:BGPRouterDeclaration>
<a:ASN>{{ vm_topo_config['dut_asn'] }}</a:ASN>
<a:Hostname>{{ asic_name }}</a:Hostname>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this is removed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we asic_topo_config defined for multi-asic line cards, this is covered by iterating over asic_topo_config at line 203.

<a:Peers>
{% for index in range( vms_number) %}
{% if vms[index] in vm_asic_ifnames and vm_asic_ifnames[vms[index]][0].split('-')[1] == asic_name %}
<BGPPeer>
<Address>{{ vm_topo_config['vm'][vms[index]]['peer_ipv4'][dut_index|int] }}</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
<Vrf i:nil="true"/>
</BGPPeer>
{% endif %}
{% endfor %}
{% for a_linecard in all_loopback4096 %}
{% for idx in range(all_loopback4096[a_linecard]|length) %}
{% if loopback4096_ip[asic_id] != all_loopback4096[a_linecard][idx] %}
<BGPPeer>
<Address>{{ all_loopback4096[a_linecard][idx] }}</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
<Vrf i:nil="true"/>
</BGPPeer>
{% endif %}
{% endfor %}
{% endfor %}
</a:Peers>
</a:BGPRouterDeclaration>
{% endfor %}
{% endif %}
{% endif %}
{% endif %}
</Routers>
{% endif %}
Expand Down
16 changes: 16 additions & 0 deletions ansible/vars/topo_Nokia-IXR7250E-36x400G.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
slot0:
ASIC0:
topology:
NEIGH_ASIC:
configuration_properties:
common:
asic_type: FrontEnd
configuration:

ASIC1:
topology:
NEIGH_ASIC:
configuration_properties:
common:
asic_type: FrontEnd
configuration: