aruba / aoscx-ansible-collection

Ansible collections for AOS-CX switches 
48 stars 23 forks source link

aoscx_l2_interface: Internal service error. Code 500 #75

Closed smirlach closed 1 year ago

smirlach commented 1 year ago

Hello,

i'm trying to add a VLAN in mode trunk to an interface and get the error: pyaoscx.exceptions.generic_op_error.GenericOperationError: 'GENERIC OPERATION ERROR: Internal service error.\n: Code: 500

The task i'm trying to execute is:

  - name: Add VLAN configuration to inside_channel
    arubanetworks.aoscx.aoscx_l2_interface:
      interface: lag1
      vlan_mode: trunk
      vlan_trunks: 2005

The full error message i get is:

The full traceback is:
Traceback (most recent call last):
  File "/Users/user/.pyenv/versions/3.9.6/lib/python3.9/site-packages/pyaoscx/pyaoscx_factory.py", line 132, in interface
    interface_obj.create()
  File "/Users/user/.pyenv/versions/3.9.6/lib/python3.9/site-packages/pyaoscx/pyaoscx_module.py", line 40, in ensure_connected
    return fnct(self, *args, **kwargs)
  File "/Users/user/.pyenv/versions/3.9.6/lib/python3.9/site-packages/pyaoscx/interface.py", line 467, in create
    raise GenericOperationError(response.text, response.status_code)
pyaoscx.exceptions.generic_op_error.GenericOperationError: 'GENERIC OPERATION ERROR: Internal service error.\n: Code: 500'

Can someone please assist me?

Best regards

alagoutte commented 1 year ago

Hi,

What switch model ?

What release of Aruba CX module ? and plugins ?

tchiapuziowong commented 1 year ago

Hi @smirlach , At this time LAG interface isn't supported with the aoscx_l2_interface module but we're preparing a release that will include support of this feature within the very near future - I will mark this as an enhancement and update it when the release is public. Thank you for your patience!

smirlach commented 1 year ago

Hi @tchiapuziowong, thanks for the reply. After a little bit of further investigating the stack trace i think this issue correlates with my other issue aruba/pyaoscx#24. This is due to the fact that the aoscx_l2_interface module also seems to work for LAG interfaces as long as there is no VRRP configured for any VLAN.

tchiapuziowong commented 1 year ago

@smirlach can you share the switch firmware/model you're using? As well as the desired CLI configuration you're trying to achieve? When I attempt to configure VRRP on an individual interface that's L2 (no routing) I receive an error stating that VRRP cannot be configured on an L2 interface, which could be the cause of this error...

Access-6200-01(config-if)# vrrp 2 address-family ipv4
Cannot configure VRRP on an L2 interface.
Access-6200-01(config-if)# routing
Access-6200-01(config-if)# show run curr
interface 1/1/14
    no shutdown
    routing
    exit
Access-6200-01(config-if)#  vrrp 2 address-family ipv4
Access-6200-01(config-if-vrrp)# show run curr
interface 1/1/14
    vrrp 2 address-family ipv4
smirlach commented 1 year ago

Hi @tchiapuziowong, the switch firmware is GL.10.10.1010and the model is JL635A Aruba 8325-48Y8C 48p 25G 8p 100G Swch. Maybe i was a bit unclear 😅 I'm still trying to add a VLAN to a LAG interface as mentioned when i opened the issue (https://github.com/aruba/aoscx-ansible-collection/issues/75#issue-1778710660), but as mentioned i get an error there. After checking the source code of the AOSCX Ansible collection i have seen that the PYAOSCX function _Interface.configureL2 is used to configure the interface: https://github.com/aruba/aoscx-ansible-collection/blob/de5c759feee19d60a38d392e68d2d0ecf7146250/plugins/modules/aoscx_l2_interface.py#L508 When the vlan_mode in the Ansible module is set to trunk the function VLAN.get() is executed which leads to the error mentioned in https://github.com/aruba/pyaoscx/issues/24.

Also see: https://github.com/aruba/pyaoscx/blob/648cfc7f63938004e41a6222ebfd9aeb62f67501/pyaoscx/interface.py#L933-L957

tchiapuziowong commented 1 year ago

@smirlach can you provide your VLAN & LAG configuration? Omitting or changing sensitive data

smirlach commented 1 year ago

@tchiapuziowong there you go:

lag configuration:

interface lag 1
    no shutdown
    no routing
    vlan trunk native 1
    vlan trunk allowed 99,992,2000-2002,2005-2006,2022
    lacp mode active
    exit

vlan configuration (Layer3):

interface vlan 992
    ip address <ip>
    ip ospf 1 area 0.0.0.0
    vrrp 1 address-family ipv4
        address <ip> primary
        preempt delay minimum 60
        priority 95
        no shutdown
        exit
    exit

What we actually want to do is to create a VLAN with arubanetworks.aoscx.aoscx_vlan, e.g. 2005 and add it then as a trunk to the lag 1 interface as described. But as soon as there is a VRRP configuration for a Layer 3 VLAN (interface vlan 992) this doesn't work anymore. If i remove the VRRP configuration it works again.

tchiapuziowong commented 1 year ago

Okay thank you for providing the config! I was able to confirm that with the upcoming release that supports LAG will work with this use case - I'll update this issue once the release is public and have you verify the issue is no longer seen!

alagoutte commented 1 year ago

Okay thank you for providing the config! I was able to confirm that with the upcoming release that supports LAG will work with this use case - I'll update this issue once the release is public and have you verify the issue is no longer seen!

can be close ? the release 4.5 add support of LAG ?