Skip to content

Commit

Permalink
Add mlag_on_orphan_port_channel_downlink knob to turn on the new beha…
Browse files Browse the repository at this point in the history
…vior
  • Loading branch information
ClausHolbechArista committed Jan 30, 2024
1 parent 6dfdd81 commit 8c9064d
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ interface Port-Channel6
switchport
switchport trunk allowed vlan none
switchport mode trunk
mlag 6
!
interface Ethernet1
description P2P_LINK_TO_UNDERLAY-MULTICAST-SPINE1_Ethernet1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ port_channel_interfaces:
shutdown: false
mode: trunk
vlans: none
mlag: 6
ethernet_interfaces:
- name: Ethernet3
peer: UNDERLAY-MULTICAST-L3LEAF1B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ fabric_name: SINGLE_LINK_TO_MLAG_PAIR
design:
type: l2ls

type: leaf

mlag_on_orphan_port_channel_downlink: false

leaf:
defaults:
mlag_peer_ipv4_pool: 10.10.255.0/24
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,29 +285,44 @@ all:
WAN_TESTS:
children:
AUTOVPN_TESTS:
children:
AUTOVPN_RRS:
hosts:
autovpn-rr1:
autovpn-rr2:
hosts:
autovpn-edge:
autovpn-rr1:
autovpn-rr2:
CV_PATHFINDER_TESTS:
hosts:
cv-pathfinder-edge:
cv-pathfinder-edge-no-common-path-group:
cv-pathfinder-transit:
cv-pathfinder-pathfinder:
children:
CV_PATHFINDER_MULTI_RR_TESTS:
CV_PATHFINDERS:
hosts:
cv-pathfinder-pathfinder1:
cv-pathfinder-pathfinder2:
cv-pathfinder-pathfinder:
children:
CV_PATHFINDER_MULTI_RR_TESTS:
hosts:
cv-pathfinder-pathfinder1:
cv-pathfinder-pathfinder2:
UPLINK_P2P_VRFS_TESTS:
hosts:
UPLINK_P2P_VRFS_TESTS_SPINE1:
UPLINK_P2P_VRFS_TESTS_SPINE2:
UPLINK_P2P_VRFS_TESTS_LEAF1:
UPLINK_P2P_VRFS_TESTS_L2LEAF1:
NEW_NETWORK_SERVICES_BGP_VRF_CONFIG_TESTS:
hosts:
new_network_services_bgp_vrf_config_true:
new_network_services_bgp_vrf_config_false:
SINGLE_LINK_TO_MLAG_PAIR:
children:
L2LS_LEAFS:
hosts:
SL-LEAF0A:
SL-LEAF0B:
SL-LEAF1A:
SL-LEAF1B:
SL-MLEAF1:
hosts:
SL-LEAF0A:
SL-LEAF0B:
SL-LEAF1A:
SL-LEAF1B:
SL-MLEAF1:
AVD_LAB:
children:
DC1_FABRIC:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,13 @@ def _get_port_channel_uplink(self: EosDesignsFacts, uplink_index: int, uplink_in
# Override our description on port-channel to be peer's group name if they are mlag pair or A/A #}
uplink["channel_description"] = uplink_switch_facts.shared_utils.group

# Used to determine whether or not port-channel towards uplink switch should have an mlag id
# Used to determine whether or not port-channel should have an mlag id configure on the uplink_switch
unique_uplink_switches = set(self.shared_utils.uplink_switches)
if self.shared_utils.mlag is True:
# Override the peer's description on port-channel to be our group name if we are mlag pair #}
uplink["peer_channel_description"] = self.shared_utils.group

# Updating unique_uplink_switches with this switch's mlag peer's uplink switches
# Updating unique_uplink_switches with our mlag peer's uplink switches
unique_uplink_switches.update(self.shared_utils.mlag_peer_facts.shared_utils.uplink_switches)

# Only enable mlag for this port-channel on the uplink switch if there are multiple unique uplink switches
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
| Variable | Type | Required | Default | Value Restrictions | Description |
| -------- | ---- | -------- | ------- | ------------------ | ----------- |
| [<samp>enable_trunk_groups</samp>](## "enable_trunk_groups") | Boolean | | `False` | | Enable Trunk Group support across eos_designs.<br>Warning: Because of the nature of the EOS Trunk Group feature, enabling this is "all or nothing".<br>*All* vlans and *all* trunks towards connected endpoints must be using trunk groups as well.<br>If trunk groups are not assigned to a trunk, no vlans will be enabled on that trunk.<br>See "Details on enable_trunk_groups" below before enabling this feature.<br> |
| [<samp>mlag_on_orphan_port_channel_downlink</samp>](## "mlag_on_orphan_port_channel_downlink") | Boolean | | `True` | | If `true` (default) an MLAG ID will always be configured on a Port-Channel Downlink even if the downlink is only on one MLAG switch.<br>If `false` an MLAG ID will only be configured on Port-Channel Downlinks dual-homed to two MLAG switches.<br>Note the default value will change to `false` in AVD version 5.0 |
| [<samp>only_local_vlan_trunk_groups</samp>](## "only_local_vlan_trunk_groups") | Boolean | | `False` | | A vlan can have many trunk_groups assigned.<br>To avoid unneeded configuration changes on all leaf switches when a new trunk group is added,<br>this feature will only configure the vlan trunk groups matched with local connected_endpoints.<br>See "Details on only_local_vlan_trunk_groups" below.<br>Requires "enable_trunk_groups: true".<br> |
| [<samp>p2p_uplinks_mtu</samp>](## "p2p_uplinks_mtu") | Integer | | `9214` | Min: 68<br>Max: 65535 | Point to Point Links MTU. |
| [<samp>p2p_uplinks_qos_profile</samp>](## "p2p_uplinks_qos_profile") | String | | | | QOS Profile assigned on all infrastructure links. |
Expand Down Expand Up @@ -49,6 +50,11 @@
# See "Details on enable_trunk_groups" below before enabling this feature.
enable_trunk_groups: <bool; default=False>

# If `true` (default) an MLAG ID will always be configured on a Port-Channel Downlink even if the downlink is only on one MLAG switch.
# If `false` an MLAG ID will only be configured on Port-Channel Downlinks dual-homed to two MLAG switches.
# Note the default value will change to `false` in AVD version 5.0
mlag_on_orphan_port_channel_downlink: <bool; default=True>

# A vlan can have many trunk_groups assigned.
# To avoid unneeded configuration changes on all leaf switches when a new trunk group is added,
# this feature will only configure the vlan trunk groups matched with local connected_endpoints.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def port_channel_interfaces(self) -> list | None:
elif (vlans := link.get("vlans")) is not None:
port_channel_interface["vlans"] = vlans

if self.shared_utils.mlag is True and link.get("mlag", True):
# Configure MLAG on MLAG switches unless "mlag_on_orphan_port_channel_downlink" is False AND link.mlag is False
if self.shared_utils.mlag is True and (get(self._hostvars, "mlag_on_orphan_port_channel_downlink", default=True) or link.get("mlag", True)):
port_channel_interface["mlag"] = int(link.get("channel_group_id"))

if (short_esi := link.get("short_esi")) is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from ansible_collections.arista.avd.plugins.plugin_utils.utils import get



class UtilsMixin:
"""
Mixin Class with internal functions.
Expand Down Expand Up @@ -97,7 +96,6 @@ def _underlay_links(self) -> list:
}
for subinterface in subinterfaces
]

underlay_links.append(strip_empties_from_dict(link))

return natural_sort(underlay_links, "interface")
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2024 Arista Networks, Inc.
# Use of this source code is governed by the Apache License 2.0
# that can be found in the LICENSE file.
# yaml-language-server: $schema=../../../../plugins/plugin_utils/schema/avd_meta_schema.json
# Line above is used by RedHat's YAML Schema vscode extension
# Use Ctrl + Space to get suggestions for every field. Autocomplete will pop up after typing 2 letters.
type: dict
keys:
mlag_on_orphan_port_channel_downlink:
type: bool
documentation_options:
table: fabric-settings
description: |-
If `true` (default) an MLAG ID will always be configured on a Port-Channel Downlink even if the downlink is only on one MLAG switch.
If `false` an MLAG ID will only be configured on Port-Channel Downlinks dual-homed to two MLAG switches.
Note the default value will change to `false` in AVD version 5.0
# TODO: AVD5.0 change default to false and remove the note from the description.
default: true

0 comments on commit 8c9064d

Please sign in to comment.