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

Fix interface aggregation in switch_config #2554

Merged

Conversation

rdiazcam
Copy link
Contributor

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.

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.
@github-actions github-actions bot marked this pull request as draft November 19, 2024 16:17
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.

@saneax
Copy link

saneax commented Nov 19, 2024

/lgtm - thanks, much appreciate the fix.

@rdiazcam rdiazcam requested a review from eshulman2 November 19, 2024 16:25
@eshulman2
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Nov 19, 2024
@rdiazcam rdiazcam marked this pull request as ready for review November 20, 2024 08:12
Copy link
Contributor

openshift-ci bot commented Nov 20, 2024

Adding label do-not-merge/contains-merge-commits because PR contains merge commits, which are not allowed in this repository.
Use git rebase to reapply your commits on top of the target branch. Detailed instructions for doing so can be found here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@frenzyfriday
Copy link
Collaborator

/lgtm

@frenzyfriday
Copy link
Collaborator

you may need a rebase because of the 2 commits

@pablintino
Copy link
Collaborator

/approve

Copy link
Contributor

openshift-ci bot commented Nov 20, 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 merged commit 03d186e into openstack-k8s-operators:main Nov 20, 2024
4 checks passed
@rdiazcam
Copy link
Contributor Author

/cherrypick 18.0-fr1

@openshift-cherrypick-robot

@rdiazcam: new pull request created: #2565

In response to this:

/cherrypick 18.0-fr1

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

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.

6 participants