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

lag: Remove 'lag' link type, cleanup virtual links #1646

Merged
merged 36 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
082fb48
* Remove 'lag' as a link.type, but leave it as an interface.type
jbemmel Dec 13, 2024
95f6a5b
'lan' and 'stub' are used for
jbemmel Dec 13, 2024
cc539f0
Rename to 'virtual_lag'
jbemmel Dec 13, 2024
02eb26c
Use '_peerlink' for peerlinks to make it more clear that those match …
jbemmel Dec 13, 2024
b99c6ac
vlan_member is also an interface type
jbemmel Dec 13, 2024
9f4eebd
Update error test
jbemmel Dec 13, 2024
4b062db
* Remove interface.type definition -> requires refactoring of when la…
jbemmel Dec 13, 2024
85c0acc
Implement p2p pool selection logic
jbemmel Dec 14, 2024
d4df2d4
vlan: postpone 'link_pre_transform' to 'link_pre_link_transform', aft…
jbemmel Dec 14, 2024
9bc299b
Correct ip indexes, restore test results
jbemmel Dec 14, 2024
1032fce
No return type anymore
jbemmel Dec 14, 2024
c47a0df
Change in VLAN processing (delayed) alters the errors that get detected:
jbemmel Dec 14, 2024
3341a5e
Split error test cases, as they now hide each other
jbemmel Dec 14, 2024
7d30794
Deep merge when copying gateway attribute
jbemmel Dec 14, 2024
92f6b60
Undo changes to vlan module
jbemmel Dec 15, 2024
8ddc042
Refactored to temporarily rename interface.type to '_type' to bypass …
jbemmel Dec 15, 2024
c8ab81d
Undo test changes
jbemmel Dec 15, 2024
6f51faf
Fix _type check
jbemmel Dec 15, 2024
13f0b25
Rename attribute
jbemmel Dec 15, 2024
e37c0ed
* Add attribute inheritance tests to L2 test case
jbemmel Dec 15, 2024
6c8b6bf
Remove unused attributes from member interfaces
jbemmel Dec 15, 2024
c5fe939
Add missing returns
jbemmel Dec 15, 2024
ee234dc
Cleanup attribute copying
jbemmel Dec 15, 2024
b59ee83
* Remove MTU from lag interfaces
jbemmel Dec 15, 2024
2cce656
Test both L2 and L3 VLANs in trunk
jbemmel Dec 15, 2024
44fd76c
Fix YAML lint issues
jbemmel Dec 15, 2024
b59984d
Cleanup test case
jbemmel Dec 15, 2024
332b95f
Update Aruba templates too
jbemmel Dec 27, 2024
4db412f
Use internal flag to mark temporary virtual lag links
jbemmel Dec 30, 2024
68a0701
Remove 'virtual_lag' type, no longer used
jbemmel Jan 1, 2025
9bb92f3
Update gateway test result
jbemmel Jan 1, 2025
13bf985
Updated test results
jbemmel Jan 2, 2025
31a2ba1
Fix peerlink matching on Cumulus NVUE
jbemmel Jan 2, 2025
aaa413d
Fix Linux template
jbemmel Jan 2, 2025
5b0a8ef
Do not copy VLAN attributes, the VLAN module will handle that
jbemmel Jan 2, 2025
f9734dd
Don't bother copying attributes, other modules will take care of that
jbemmel Jan 3, 2025
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 netsim/ansible/templates/lag/arubacx.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface lag {{ intf.lag.mlag.ifindex }}
description VSX ISL

!
{% for ch in ([intf]+interfaces) if ch==intf or ch.lag._parentindex|default(False) == intf.linkindex %}
{% for ch in ([intf]+interfaces) if ch==intf or ch.lag._peerlink|default(0) == intf.linkindex %}
interface {{ ch.ifname }}
no shutdown
description {{ ch.name }} (ISL in lag {{intf.lag.mlag.ifindex }})
Expand Down Expand Up @@ -54,7 +54,7 @@ interface {{ intf.ifname }}{{ mclag_intf }}{{ mclag_intf_static }}
no shutdown

!
{% for ch in interfaces if ch.lag._parentindex|default(False) == intf.linkindex %}
{% for ch in interfaces if ch.lag._parentindex|default(False) == intf.lag.ifindex %}
!
interface {{ ch.ifname }}
description {{ ch.name }} in lag {{ intf.lag.ifindex }}
Expand Down
2 changes: 1 addition & 1 deletion netsim/ansible/templates/lag/cumulus.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ iface {{ data.ifname }}
pre-up ip link add {{ data.ifname }} type bond
bond-slaves {%-
for i in interfaces
if i.lag._parentindex|default(False) == data.linkindex %} {{ i.ifname }}{%- endfor %}
if i.lag._parentindex|default(False) == data.lag.ifindex %} {{ i.ifname }}{%- endfor %}
{% set _lacp = data.lag.lacp|default(lag.lacp) %}
{% if _lacp=='slow' %}
bond-lacp-rate slow
Expand Down
4 changes: 2 additions & 2 deletions netsim/ansible/templates/lag/cumulus_nvue.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
member:
{% for intf in interfaces if intf.lag.mlag.peergroup is defined %}
{{ intf.ifname }}: {}
{% for ch in interfaces if ch.lag._parentindex|default(False) == intf.linkindex %}
{% for ch in interfaces if ch.lag._peerlink|default(0) == intf.linkindex %}
{{ ch.ifname }}: {}
{% endfor %}
{% endfor %}
Expand Down Expand Up @@ -42,7 +42,7 @@
mode: static
{% endif %}
member:
{% for c in interfaces if c.lag._parentindex|default(False) == i.linkindex %}
{% for c in interfaces if c.lag._parentindex|default(False) == i.lag.ifindex %}
{{ c.ifname }}: {}
{% endfor %}
{% endfor %}
4 changes: 2 additions & 2 deletions netsim/ansible/templates/lag/dellos10.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ vlt-domain {{ intf.lag.mlag.peergroup }}
backup destination {{ intf.lag.mlag.peer }}
vlt-mac {{ intf.lag.mlag.mac | hwaddr('linux') }}
discovery-interface {{ intf.ifname }}
{% for ch in interfaces if ch.lag._parentindex|default(False) == intf.linkindex %}
{% for ch in interfaces if ch.lag._peerlink|default(0) == intf.linkindex %}
discovery-interface {{ ch.ifname }}
{% endfor %}
{% endfor %}
Expand All @@ -23,7 +23,7 @@ interface {{ intf.ifname }}
description "{{ intf.name }}"
{% endif %}
!
{% for ch in interfaces if ch.lag._parentindex|default(False) == intf.linkindex %}
{% for ch in interfaces if ch.lag._parentindex|default(False) == intf.lag.ifindex %}
{% set _lag_mode =
'on' if intf.lag.lacp|default('') == 'off' else
'active' if intf.lag.lacp_mode|default('') == 'active' else
Expand Down
4 changes: 2 additions & 2 deletions netsim/ansible/templates/lag/eos.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ mlag
peer-link port-channel {{ intf.lag.mlag.ifindex }}
no shutdown
!
{% for ch in ([intf]+interfaces) if ch==intf or ch.lag._parentindex|default(False) == intf.linkindex %}
{% for ch in ([intf]+interfaces) if ch==intf or ch.lag._peerlink|default(0) == intf.linkindex %}
interface {{ ch.ifname }}
description {{ ch.name }} (peerlink in channel-group {{intf.lag.mlag.ifindex }})
channel-group {{ intf.lag.mlag.ifindex }} mode active
Expand All @@ -47,7 +47,7 @@ interface {{ intf.ifname }}
description {{ intf.name }}
{% endif %}
!
{% for ch in interfaces if ch.lag._parentindex|default(False) == intf.linkindex %}
{% for ch in interfaces if ch.lag._parentindex|default(False) == intf.lag.ifindex %}
!
{% set _lag_mode =
'on' if intf.lag.lacp|default('') == 'off' else
Expand Down
2 changes: 1 addition & 1 deletion netsim/ansible/templates/lag/frr.j2
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% include "linux.j2" %}
{% include "linux.j2" %}
2 changes: 1 addition & 1 deletion netsim/ansible/templates/lag/linux.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ethtool -s {{ l.ifname }} autoneg off speed 1000 duplex full
{% endif %}
ip link set dev {{ l.ifname }} down
ip link set dev {{ l.ifname }} master {%
for i in interfaces if i.type=='lag' and i.linkindex==l.lag._parentindex %}{{ i.ifname }}
for i in interfaces if i.type=='lag' and i.lag.ifindex==l.lag._parentindex %}{{ i.ifname }}
{% endfor %}
{% endif %}
ip link set dev {{ l.ifname }} up
Expand Down
2 changes: 1 addition & 1 deletion netsim/defaults/attributes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ link: # Global link attributes
_alt_types: [ bool_false, prefix_str, named_pfx ]
role: id
pool: id
type: { type: str, valid_values: [ lan, p2p, stub, loopback, tunnel, vlan_member, lag ] }
type: { type: str, valid_values: [ lan, p2p, stub, loopback, tunnel, vlan_member ] }
unnumbered: bool
interfaces:
mtu: { type: int, min_value: 64, max_value: 65535 }
Expand Down
Loading
Loading