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
4 changes: 2 additions & 2 deletions ansible/templates/topo/dev_metadata.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<DeviceInfo>
<AutoNegotiation>true</AutoNegotiation>
<EthernetInterfaces xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
{% for index in range(32) %}
{% set sonic_if_name='Ethernet'+((index*4)|string) %}
{% set num_of_intf = port_alias | length %}
{% for index in range(num_of_intf) %}
<a:EthernetInterface>
<ElementType>DeviceInterface</ElementType>
<AlternateSpeeds i:nil="true"/>
Expand Down
243 changes: 243 additions & 0 deletions ansible/templates/topo/t0-64.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
<DeviceMiniGraph xmlns="Microsoft.Search.Autopilot.Evolution" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<CpgDec>
<IsisRouters xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
<PeeringSessions>
{% for index in range(4) %}
<BGPSession>
<MacSec>false</MacSec>
<StartRouter>{{ inventory_hostname }}</StartRouter>
<StartPeer>10.0.0.{{ index*4 }}</StartPeer>
<EndRouter>ARISTA0{{ index+1 }}T1</EndRouter>
<EndPeer>10.0.0.{{ index*4 +1 }}</EndPeer>
<Multihop>1</Multihop>
<HoldTime>10</HoldTime>
<KeepAliveTime>3</KeepAliveTime>
</BGPSession>
<BGPSession>
<StartRouter>{{ inventory_hostname }}</StartRouter>
<StartPeer>FC00::{{ ('%0x' % (index*8+1)) | upper }}</StartPeer>
<EndRouter>ARISTA0{{ index+1 }}T1</EndRouter>
<EndPeer>FC00::{{ ('%0x' % (index*8+2)) | upper }}</EndPeer>
<Multihop>1</Multihop>
<HoldTime>10</HoldTime>
<KeepAliveTime>3</KeepAliveTime>
</BGPSession>
{% endfor %}
</PeeringSessions>
<Routers xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
<a:BGPRouterDeclaration>
<a:ASN>64601</a:ASN>
<a:Hostname>{{ inventory_hostname }}</a:Hostname>
<a:Peers>
{% for index in range(4) %}
<BGPPeer>
<ElementType>BGPPeer</ElementType>
<Address>10.0.0.{{ index*4+1 }}</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
<Vrf i:nil="true"/>
</BGPPeer>
<BGPPeer>
<ElementType>BGPPeer</ElementType>
<Address>FC00::{{ ('%0x' % (index*8+2)) | upper }}</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
<Vrf i:nil="true"/>
</BGPPeer>
{% endfor %}
<BGPPeer i:type="a:BGPPeerPassive">
<ElementType>BGPPeer</ElementType>
<Address>10.1.0.32</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
<Vrf i:nil="true"/>
<a:Name>BGPSLBPassive</a:Name>
<a:PeersRange>10.255.0.0/27</a:PeersRange>
</BGPPeer>
<BGPPeer i:type="a:BGPPeerPassive">
<ElementType>BGPPeer</ElementType>
<Address>10.1.0.32</Address>
<RouteMapIn i:nil="true"/>
<RouteMapOut i:nil="true"/>
<Vrf i:nil="true"/>
<a:Name>BGPVac</a:Name>
<a:PeersRange>192.168.0.0/27</a:PeersRange>
</BGPPeer>
</a:Peers>
<a:RouteMaps/>
</a:BGPRouterDeclaration>
{% for index in range(4) %}
<a:BGPRouterDeclaration>
<a:ASN>64802</a:ASN>
<a:Hostname>ARISTA0{{ index+1 }}T1</a:Hostname>
<a:RouteMaps/>
</a:BGPRouterDeclaration>
{% endfor %}
</Routers>
</CpgDec>
<DpgDec>
<DeviceDataPlaneInfo>
<IPSecTunnels/>
<LoopbackIPInterfaces xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
<a:LoopbackIPInterface>
<Name>HostIP</Name>
<AttachTo>Loopback0</AttachTo>
<a:Prefix xmlns:b="Microsoft.Search.Autopilot.Evolution">
<b:IPPrefix>10.1.0.32/32</b:IPPrefix>
</a:Prefix>
<a:PrefixStr>10.1.0.32/32</a:PrefixStr>
</a:LoopbackIPInterface>
<a:LoopbackIPInterface>
<Name>HostIP1</Name>
<AttachTo>Loopback0</AttachTo>
<a:Prefix xmlns:b="Microsoft.Search.Autopilot.Evolution">
<b:IPPrefix>FC00:1::32/128</b:IPPrefix>
</a:Prefix>
<a:PrefixStr>FC00:1::32/128</a:PrefixStr>
</a:LoopbackIPInterface>
</LoopbackIPInterfaces>
<ManagementIPInterfaces xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution">
<a:ManagementIPInterface>
<Name>HostIP</Name>
<AttachTo>eth0</AttachTo>
<a:Prefix xmlns:b="Microsoft.Search.Autopilot.Evolution">
<b:IPPrefix>{{ ansible_host }}/{{ mgmt_subnet_mask_length }}</b:IPPrefix>
</a:Prefix>
<a:PrefixStr>{{ ansible_host }}/{{ mgmt_subnet_mask_length }}</a:PrefixStr>
</a:ManagementIPInterface>
<a:ManagementIPInterface>
<Name>V6HostIP</Name>
<AttachTo>eth0</AttachTo>
<a:Prefix xmlns:b="Microsoft.Search.Autopilot.Evolution">
<b:IPPrefix>FC00:2::32/64</b:IPPrefix>
</a:Prefix>
<a:PrefixStr>FC00:2::32/64</a:PrefixStr>
</a:ManagementIPInterface>
</ManagementIPInterfaces>
<ManagementVIPInterfaces xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
<MplsInterfaces/>
<MplsTeInterfaces/>
<RsvpInterfaces/>
<Hostname>{{ inventory_hostname }}</Hostname>
<PortChannelInterfaces>
{% for index in range(0,32,16) %}
<PortChannel>
<ElementType>PortChannelInterface</ElementType>
<Name>PortChannel{{ index }}</Name>
<AttachTo>{{ port_alias[index] }};{{ port_alias[index+1] }}</AttachTo>
<SubInterface/>
</PortChannel>
<PortChannel>
<ElementType>PortChannelInterface</ElementType>
<Name>PortChannel{{ index+4 }}</Name>
<AttachTo>{{ port_alias[index+4] }};{{ port_alias[index+5] }}</AttachTo>
<SubInterface/>
</PortChannel>
{% endfor %}
</PortChannelInterfaces>
<VlanInterfaces>
<VlanInterface>
<ElementType>VlanInterface</ElementType>
<Name>Vlan1000</Name>
<AttachTo>{{ port_alias[6] }};{{ port_alias[7] }};{{ port_alias[8] }};{{ port_alias[9] }};{{ port_alias[10] }};{{ port_alias[11] }};{{ port_alias[12] }};{{ port_alias[13] }};{{ port_alias[14] }};{{ port_alias[15] }};{{ port_alias[22] }};{{ port_alias[23] }};{{ port_alias[24] }};{{ port_alias[25] }};{{ port_alias[26] }};{{ port_alias[27] }};{{ port_alias[28] }};{{ port_alias[29] }};{{ port_alias[30] }};{{ port_alias[31] }};{{ port_alias[32] }};{{ port_alias[36] }};{{ port_alias[37] }};{{ port_alias[38] }};{{ port_alias[39] }};{{ port_alias[40] }};{{ port_alias[41] }};{{ port_alias[42] }};{{ port_alias[48] }};{{ port_alias[52] }};{{ port_alias[53] }};{{ port_alias[54] }};{{ port_alias[55] }};{{ port_alias[56] }};{{ port_alias[57] }};{{ port_alias[58] }}</AttachTo>
<NoDhcpRelay>False</NoDhcpRelay>
<StaticDHCPRelay>0.0.0.0/0</StaticDHCPRelay>
<Type i:nil="true"/>
<VlanID>1000</VlanID>
<Tag>1000</Tag>
<Subnets>192.168.0.0/27</Subnets>
</VlanInterface>
</VlanInterfaces>
<IPInterfaces>
{% for index in range(4) %}
{% set po_index=index*4 if index < 2 else index*4+8 %}
<IPInterface>
<Name i:nil="true"/>
<AttachTo>PortChannel{{ po_index }}</AttachTo>
<Prefix>10.0.0.{{ index*4 }}/31</Prefix>
</IPInterface>
<IPInterface>
<Name i:Name="true"/>
<AttachTo>PortChannel{{ po_index }}</AttachTo>
<Prefix>FC00::{{ ('%0x' % (index*8+1)) | upper }}/126</Prefix>
</IPInterface>
{% endfor %}
<IPInterface>
<Name i:nil="true"/>
<AttachTo>Vlan1000</AttachTo>
<Prefix>192.168.0.1/27</Prefix>
</IPInterface>
</IPInterfaces>
<DataAcls/>
<AclInterfaces/>
<DownstreamSummaries/>
<DownstreamSummarySet xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Search.Autopilot.Evolution"/>
</DeviceDataPlaneInfo>
</DpgDec>
<PngDec>
<DeviceInterfaceLinks>
{% for index in range(2) %}
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>ARISTA0{{ index*2+1 }}T1</EndDevice>
<EndPort>Ethernet1</EndPort>
<StartDevice>{{ inventory_hostname }}</StartDevice>
<StartPort>{{ port_alias[index*16] }}</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>ARISTA0{{ index*2+1 }}T1</EndDevice>
<EndPort>Ethernet2</EndPort>
<StartDevice>{{ inventory_hostname }}</StartDevice>
<StartPort>{{ port_alias[index*16+1] }}</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>ARISTA0{{ index*2+2 }}T1</EndDevice>
<EndPort>Ethernet1</EndPort>
<StartDevice>{{ inventory_hostname }}</StartDevice>
<StartPort>{{ port_alias[index*16+4] }}</StartPort>
</DeviceLinkBase>
<DeviceLinkBase>
<ElementType>DeviceInterfaceLink</ElementType>
<EndDevice>ARISTA0{{ index*2+2 }}T1</EndDevice>
<EndPort>Ethernet2</EndPort>
<StartDevice>{{ inventory_hostname }}</StartDevice>
<StartPort>{{ port_alias[index*16+5] }}</StartPort>
</DeviceLinkBase>
{% endfor %}
</DeviceInterfaceLinks>
<Devices>
<Device i:type="ToRRouter">
<Hostname>{{ inventory_hostname }}</Hostname>
<HwSku>{{ hwsku }}</HwSku>
<ManagementAddress xmlns:a="Microsoft.Search.Autopilot.NetMux">
<a:IPPrefix>{{ ansible_host }}</a:IPPrefix>
</ManagementAddress>
</Device>
{% if VM_topo %}
{% for dev in neighbor_eosvm_mgmt %}
{% if 'T1' in dev %}
{% set dev_type = 'LeafRouter' %}
{% elif 'T2' in dev %}
{% set dev_type = 'SpineRouter' %}
{% elif 'T0' in dev %}
{% set dev_type = 'TorRouter' %}
{% else %}
{% set dev_ytpe = 'Unknown' %}
{% endif %}
<Device i:type="{{ dev_type }}">
<Hostname>"{{ dev }}"</Hostname>
<ManagementAddress xmlns:a="Microsoft.Search.Autopilot.NetMux">
<a:IPPrefix>{{ neighbor_eosvm_mgmt[dev] }}</a:IPPrefix>
</ManagementAddress>
<HwSku>Arista-VM</HwSku>
</Device>
{% endfor %}
{% endif %}
</Devices>
</PngDec>
{% include 'dev_metadata.j2' %}
<Hostname>{{ inventory_hostname }}</Hostname>
<HwSku>{{ hwsku }}</HwSku>
</DeviceMiniGraph>