Pure-Storage-Ansible / FlashArray-Collection

Ansible Collection for Pure Storage FlashArray
GNU General Public License v3.0
19 stars 21 forks source link

purefa_network module not idempotent when creating LACP bond interfaces #582

Closed dbuenoparedes closed 2 weeks ago

dbuenoparedes commented 3 weeks ago

Describe the bug When I try to configure a LACP bond (lacp0) with 2 subordinates (ct0.eth14 and ct0.eth15) it successfully creates them but when I run the same task against an array that has already configured lacp0 bond with the same subordinates interfaces I get the following error:

failed: [us1pure01] (item={'name': 'lacp0', 'type': 'lacp', 'enabled': True, 'subordinates': ['ct0.eth14', 'ct0.eth15'], 'mtu': 9000}) => changed=false 
  ansible_facts:
    discovered_interpreter_python: /usr/bin/python3
  ansible_loop_var: net
  msg: Subordinate ct0.eth14 does not exist. Ensure you have specified the controller.
  net:
    enabled: true
    mtu: 9000
    name: lacp0
    subordinates:
    - ct0.eth14
    - ct0.eth15
    type: lacp

To Reproduce Steps to reproduce the behavior:

  1. Create a simple task with purefa_network with the attributes shown in the previous error
  2. See error

Expected behavior It should show that existing lacp0 interface is already created with the chosen subordinates interfaces.

Environment (please complete the following information):

Additional context This could have something to do that with the CLI the interfaces already configured to be part of a LACP bond are missing from the list of available individual interfaces but they still show up as "subinterfaces" of the bond:

dbuenoparedes@us1pure01> purenetwork eth list --service iscsi
Name      Enabled  Type       Subnet  Address  Mask  Gateway  MTU   MAC                Speed       Services  Subinterfaces
ct0.eth4  False    physical   -       -        -     -        1500  <redacted_MAC_address>  25.00 Gb/s  iscsi     -
ct0.eth5  False    physical   -       -        -     -        1500  <redacted_MAC_address>  25.00 Gb/s  iscsi     -
ct1.eth4  False    physical   -       -        -     -        1500  <redacted_MAC_address>  25.00 Gb/s  iscsi     -
ct1.eth5  False    physical   -       -        -     -        1500  <redacted_MAC_address>  25.00 Gb/s  iscsi     -
lacp0     True     lacp_bond  -       -        -     -        9000  <redacted_MAC_address>  20.00 Gb/s  iscsi     ct0.eth14
                                                                                                                  ct0.eth15
lacp1     True     lacp_bond  -       -        -     -        9000  <redacted_MAC_address>  20.00 Gb/s  iscsi     ct1.eth14
                                                                                                                  ct1.eth15
sdodsley commented 3 weeks ago

We are aware of issues in this module and are in the process of squashing some bugd. Stand by.

sdodsley commented 2 weeks ago

@dbuenoparedes please check pathc #583 to see if this resolves your issue and let us know.

dbuenoparedes commented 2 weeks ago

@sdodsley I've just tested it and it partially works now, it picks up the existing lacp bond although if I change the variable that defines the underlying subordinates (subinterfaces) it doesn't detect this, seems to be just checking for existing lacp interfaces.

sdodsley commented 2 weeks ago

@dbuenoparedes please try again. Updated the patch.

dbuenoparedes commented 2 weeks ago

@sdodsley thanks, I just tried the new file but now on an array where I already have the interfaces the way I want:

PLAY RECAP ***** us1pure01 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0



On an array where I still haven't configure these network interfaces:

- the lacp interfaces seem to be fine as well as the filevif (dry run fails because I haven't created the lacp subinterfaces on this array yet)
dbuenoparedes commented 2 weeks ago

@sdodsley NVM my last comment, I wasn't using the right updated purefa_network.py file, got my collection install mixed up.

I've just tested it again with the latest patch you provided and it works as expected.

Sorry for that and thank you!