Pure-Storage-Ansible / FlashArray-Collection

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

purefa_network fails to create a file vif interface with lacp bonds as subinterfaces #646

Closed dbuenoparedes closed 1 month ago

dbuenoparedes commented 2 months ago

Describe the bug When trying to create a file vif interface using lacp0 and lacp1 as subinterfaces it fails with the message:

When I try the same task using the CLI it works as expected, command used:

To Reproduce Steps to reproduce the behavior:

  1. Create 2 lacp bond interfaces
  2. Create file vif interface with purefa_network using one or both lacp bond interfaces previously created as subinterfaces
  3. See error

Expected behavior File vif interface should be created the same way as with the CLI command.

Screenshots This is the output of the task, I'm looping through all the interfaces and creating them with the same task:

TASK [purestorage : Configure network interfaces for NFS] **********************************************************************************************************************************************************
ok: [purenfs01-dc6] => (item={'name': 'lacp0', 'type': 'lacp', 'enabled': True, 'subordinates': ['ct0.eth10', 'ct0.eth11'], 'mtu': 9000})
ok: [purenfs01-dc6] => (item={'name': 'lacp1', 'type': 'lacp', 'enabled': True, 'subordinates': ['ct1.eth10', 'ct1.eth11'], 'mtu': 9000})
failed: [purenfs01-dc6] (item={'name': 'filevif', 'type': 'vif', 'enabled': True, 'address': '10.10.10.10/24', 'gateway': '10.10.10.1', 'servicelist': 'file', 'subinterfaces': ['lacp0', 'lacp1'], 'mtu': 1500}) => changed=false 
  ansible_loop_var: net
  msg: Child subinterface lacp0 does not exist
  net:
    address: 10.10.10.10/24
    enabled: true
    gateway: 10.10.10.1 1500
    name: filevif
    servicelist: file
    subinterfaces:
    - lacp0
    - lacp1
    type: vif

Desktop (please complete the following information):

Additional context Task definition I'm using:

- name: Configure network interfaces for NFS
  purestorage.flasharray.purefa_network:
    name: "{{ net.name }}"
    interface: "{{ net.type }}"
    enabled: "{{ net.enabled }}"
    mtu: "{{ net.mtu }}"
    address: "{{ net.address | default(omit) }}"
    gateway: "{{ net.gateway | default(omit) }}"
    subordinates: "{{ net.subordinates | default([]) }}"
    servicelist: "{{ net.servicelist | default([]) }}"
    subinterfaces: "{{ net.subinterfaces | default([]) }}"
    fa_url: "{{ fa_url }}"
    api_token: "{{ api_token }}"
  loop: "{{ fs.networks }}"
  loop_control:
    loop_var: net
  when: fs.networks is defined
  tags: configure-file-network

Network variables:

  networks:
    - name: lacp0
      type: lacp
      enabled: true
      subordinates:
        - ct0.eth10
        - ct0.eth11
      mtu: 9000
    - name: lacp1
      type: lacp
      enabled: true
      subordinates:
        - ct1.eth10
        - ct1.eth11
      mtu: 9000
    - name: filevif
      type: vif
      enabled: true
      address: "10.10.10.10/24"
      gateway: "10.10.10.1"
      servicelist: file
      subinterfaces:
        - lacp0
        - lacp1
      mtu: 1500
sdodsley commented 2 months ago

@dbuenoparedes yes - you are correct. We didn't envisage using 2 LACP bonds as the children of a VIF. We will look at getting this fixed.

sdodsley commented 2 months ago

@dbuenoparedes can you try out the associated PR and see if that fixes your issue?

dbuenoparedes commented 1 month ago

@sdodsley I confirm I was able to create the filevif now using lacp as subinterfaces with the fix in the associated PR.

Thank you!