Discussion regarding lag and l2_interface resource modules

Good day!

I would like to start a discussion regarding the lag and l2_interface resource modules across ios/iosxr/nxos.

This is based upon a problem I stumbled upon a with nxos, where vlan configuration on a port is not possible when it’s part of a port-channel:

n93180yc-fx(config-if)#k execution. To see the full traceback, use -vvv. The error was:
fatal: [n93180yc-fx]: FAILED! =>
  msg: |-
    Unexpected failure during module execution: switchport trunk allowed vlan add 1337
                                                ^
    % Invalid command at '^' marker.
    n93180yc-fx(config-if)#
  stdout: ''

As you can see on the actual device, the command is removed once an interface is part of a port-channel:

interface Ethernet1/50
  switchport trunk allowed vlan 100-102
  channel-group 20 mode active
  no shutdown
n93180yc-fx(config-if)# int eth1/50
n93180yc-fx(config-if)# switchport ?
  host  Set port host

Working around this issue is complicated as the facts for port-channel membership is gathered with the cisco.nxos.nxos_lag_interfaces resource module and not the cisco.nxos.nxos_l2_interfaces resource module, where the vlans are actually configured.

I’ve discussed this with @sagarpaul, and we both agreed that lag_interfaces should be configurable through the l2_interfaces resource module and that the lag_interfaces one can be deprecated.

What is the communitys standpoint around a change like this to the cisco.* collections.
Have people had these kind of problems, and how were they solved?

Best regards.

1 Like

Thanks for bringing it to notice, considering lag_interface operations are tied mostly to l2_interface related attributes.

And for module-specific operations, fact crunching or dealing with VLANs that are added within a Port Channel and then added into an interface, can be tricky to deal with.
The point is that whatever you configure on the port channel interface is typically inherited by all member physical interfaces, and the member interfaces themselves usually can’t have conflicting configurations.
Let me check on how possible it to have things under one module or if we can add facts or operations to get both information in one place.
wrt to nxos_lag_interfaces and nxos_l2_interfaces

thinking…

1 Like