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

[18.0-fr1] Fix interface aggregation in switch_config #2565

Conversation

openshift-cherrypick-robot

This is an automated cherry-pick of #2554

/assign rdiazcam

Copy link

Thanks for the PR! ❤️
I'm marking it as a draft, once your happy with it merging and the PR is passing CI, click the "Ready for review" button below.

@pablintino
Copy link
Collaborator

/approve
/lgtm

Copy link
Contributor

openshift-ci bot commented Nov 21, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pablintino

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rdiazcam rdiazcam marked this pull request as ready for review November 22, 2024 15:19
Before the fix when we had and interface already configured like this:
```
description tigon13-enp130s0f2;
enable;
mtu 9192;
unit 0 {
    family ethernet-switching {
        interface-mode trunk;
        vlan {
            members [ vlan130 vlan131 vlan132 vlan133 vlan134 vlan135 vlan136 vlan137 vlan138 vlan139 ];
        }
    }
}
```

And we try to configure aggregation like this:
```
    - description: "aggregation"
      iface: "ae1323"
      iface_mode: "trunk"
      vlan: "130-139"
      mtu: "9192"
      aggr_members:
        - "xe-0/0/2"
        - "xe-0/0/3"
```

An error like this error was raised:
```
TASK [switch_config : Clear interfaces MTU before adding to ae lines={{ interface_config | from_yaml }}] ****
task path: /home/zuul/src/gitlab.cee.redhat.com/openstack-midstream/podified/source/ci-framework/roles/switch_config/tasks/junos_config.yml:111
ok: [nfv_private_sw04] => changed=false
  invocation:
    module_args:                                                                                                                                                                                                                                                                                                                   backup: false
      backup_options: null
      check_commit: false
      comment: configured by junos_config                                                                                                                                                                                                                                                                                          confirm: 0
      confirm_commit: false
      lines:
      - delete interfaces "xe-0/0/2" mtu
      - delete interfaces "xe-0/0/2" unit 0
      - delete interfaces "xe-0/0/3" mtu
      - delete interfaces "xe-0/0/3" unit 0
...

TASK [switch_config : Set aggregation for the interface config={{ interface_config | from_yaml }}, state=replaced] ****
task path: /home/zuul/src/gitlab.cee.redhat.com/openstack-midstream/podified/source/ci-framework/roles/switch_config/tasks/junos_config.yml:125
Tuesday 19 November 2024  10:37:40 -0500 (0:00:02.114)       0:00:50.687 ******
redirecting (type: connection) ansible.builtin.netconf to ansible.netcommon.netconf
redirecting (type: netconf) ansible.builtin.junos to junipernetworks.junos.junos
fatal: [nfv_private_sw04]: FAILED! => changed=false
  module_stderr: 'b''error: Setting mtu on ae child device is not allowed\nerror: Setting mtu on ae child device is not allowed\nerror: configuration check-out failed: (statements constraint check failed)'''
  module_stdout: ''
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
```

The error was due to the quotation marks were added to the actual
switch config to be loaded.

After the fix, with the quoation marks removed, we don't hit the
error:
```
TASK [switch_config : Clear interfaces MTU before adding to ae lines={{ interface_config | from_yaml }}] ***
task path: /home/zuul/src/gitlab.cee.redhat.com/openstack-midstream/podified/source/ci-framework/roles/switch_config/tasks/junos_config.yml:111
changed: [nfv_private_sw04] => changed=true                                                                                                                                                                                                                                                                                    invocation:
    module_args:                                                                                                                                                                                                                                                                                                                   backup: false
      backup_options: null
      check_commit: false
      comment: configured by junos_config                                                                                                                                                                                                                                                                                          confirm: 0
      confirm_commit: false
      lines:
      - delete interfaces xe-0/0/2 mtu
      - delete interfaces xe-0/0/2 unit 0
      - delete interfaces xe-0/0/3 mtu
      - delete interfaces xe-0/0/3 unit 0
...
```

And the switch config is properly loaded:
```
description tigon13-enp130s0f2;
enable;
ether-options {
    802.3ad ae1323;
}

description tigon13-enp130s0f3;
enable;
ether-options {
    802.3ad ae1323;
}

description aggregation;
enable;
mtu 9192;
aggregated-ether-options {
    lacp {
        active;
    }
}
unit 0 {
    family ethernet-switching {
        interface-mode trunk;
        vlan {
            members [ vlan130 vlan131 vlan132 vlan133 vlan134 vlan135 vlan136 vlan137 vlan138 vlan139 ];
        }
    }
}
```

A similar thing happened when we tried to remove the aggregation.
@frenzyfriday
Copy link
Collaborator

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Nov 25, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 0296ee8 into openstack-k8s-operators:18.0-fr1 Nov 25, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants