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

[BUG]: sonic_lag_interfaces can not create LACP port if MTU is not 9100 #411

Open
TafkaMax opened this issue Jul 1, 2024 · 1 comment
Open

Comments

@TafkaMax
Copy link
Contributor

TafkaMax commented Jul 1, 2024

Bug Description

When creating LAG interfaces with the sonic_lag_interfaces module LACP port can not be created if underlying interface MTU is not 9100.

Product Name

Dell Enterprise Sonic

Component or Module Name

sonic_lag_interfaces

DellEMC Enterprise SONiC Ansible Collection Version

latest master at: d6bdb3b

SONiC Software Version

SONiC Software Version: SONiC-OS-4.2.1-Enterprise_Base

Configuration

CONFIG_FILE() = /home/tansper/ansible/ansible.cfg
DEFAULT_HOST_LIST(/home/tansper/ansible/ansible.cfg) = ['/home/tansper/ansible/hosts']
DEFAULT_LOOKUP_PLUGIN_PATH(/home/tansper/ansible/ansible.cfg) = ['/home/tansper/ansible/plugins/lookup']
DEFAULT_VAULT_PASSWORD_FILE(/home/tansper/ansible/ansible.cfg) = /home/tansper/ansible/scripts/vault_password.sh
EDITOR(env: EDITOR) = vim
HOST_KEY_CHECKING(/home/tansper/ansible/ansible.cfg) = False
PAGER(env: PAGER) = less

Steps to Reproduce

Ensure that Ethernet1 MTU is 1500 or something not 9100

sonic_lag_interfaces:
  config:
      - name: PortChannel1
             members:
               interfaces:
                 - member: Ethernet1
       mode: lacp
  state: merged

Expected Behavior

PortChannel1 is created with the correct MTU being set from underlying interface

Actual Behavior

Error: Configuration not allowed when port MTU not same as portchannel MTU

Logs

FAILED! => {"changed": false, "code": -32603, "msg": "{'ietf-restconf:errors': {'error': [{'error-type': 'application', 'error-tag': 'invalid-value', 'error-app-tag': 'mtu-invalid', 'error-message': 'Configuration not allowed when port MTU not same as portchannel MTU', 'error-info': {'cvl-error': {'error-code': 1002, 'table-name': 'PORTCHANNEL_MEMBER', 'key-values': ['PORTCHANNEL_MEMBER', 'PortChannel2', 'Ethernet2']}}}]}, 'code': 400, 'request_data': {'path': 'data/openconfig-interfaces:interfaces/interface=Ethernet2/openconfig-if-ethernet:ethernet/config/openconfig-if-aggregate:aggregate-id', 'method': 'patch'}}"}

Screenshots

No response

Additional Information

No response

@TafkaMax
Copy link
Contributor Author

TafkaMax commented Jul 1, 2024

I created this workaround for now to create the portchannels and then modify the mtu via CLI.

---
- name: Merge LAG/PortChannel config to device confis. Add only names for now.
  dellemc.enterprise_sonic.sonic_lag_interfaces:
    config: '{{ sonic__portchannels|ansible.utils.keep_keys(target=["name"]) }}'
    state: "{% if sonic_replace_config|default(false) %}replaced{% else %}merged{% endif %}"

- name: Set MTU of portchannels when specified.
  connection: network_cli
  dellemc.enterprise_sonic.sonic_command:
    commands:
      - 'configure terminal'
      - 'interface PortChannel {{ loop_index }}'
      - 'mtu {{ item.mtu }}'
  when: '"mtu" in item'
  loop: '{{ sonic__portchannels }}'
  loop_control:
    index_var: loop_index

- name: Merge Full LAG/PortChannel config to device confis. 
  dellemc.enterprise_sonic.sonic_lag_interfaces:
    config: '{{ sonic__portchannels|ansible.utils.remove_keys(target=["mtu"]) }}'
    state: "{% if sonic_replace_config|default(false) %}replaced{% else %}merged{% endif %}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant