ansible-collections / netapp.ontap

Ansible collection to support NetApp ONTAP configuration.
https://galaxy.ansible.com/netapp/ontap
GNU General Public License v3.0
56 stars 36 forks source link

Vserver peer fails with FSxN #45

Closed snkellner closed 2 years ago

snkellner commented 2 years ago

Summary

When I try to create a vserver peer with application flexcache for vservers on two different FSxN instances it fails. The vserver peer remains in state pending and I have to accept the vserver peering on the destination cluster manually.

Component Name

na_ontap_vserver_peer

Ansible Version

$ ansible --version
[DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.7.10 (default, Jun  3 2021, 
00:02:01) [GCC 7.3.1 20180712 (Red Hat 7.3.1-13)]. This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting 
deprecation_warnings=False in ansible.cfg.
ansible [core 2.11.5] 
  config file = None
  configured module search path = ['/home/ec2-user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ec2-user/.local/lib/python3.7/site-packages/ansible
  ansible collection location = /home/ec2-user/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/ec2-user/.local/bin/ansible
  python version = 3.7.10 (default, Jun  3 2021, 00:02:01) [GCC 7.3.1 20180712 (Red Hat 7.3.1-13)]
  jinja version = 3.0.1
  libyaml = True

ONTAP Collection Version

$ ansible-galaxy collection list
[ec2-user@ip-10-0-1-102 ~]$ ansible-galaxy collection list
[DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.7.10 (default, Jun  3 2021, 
00:02:01) [GCC 7.3.1 20180712 (Red Hat 7.3.1-13)]. This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting 
deprecation_warnings=False in ansible.cfg.

# /home/ec2-user/.local/lib/python3.7/site-packages/ansible_collections
Collection                    Version
----------------------------- -------
amazon.aws                    1.5.1  
ansible.netcommon             2.4.0  
ansible.posix                 1.3.0  
ansible.utils                 2.4.0  
ansible.windows               1.7.2  
arista.eos                    2.2.0  
awx.awx                       19.2.2 
azure.azcollection            1.9.0  
check_point.mgmt              2.0.0  
chocolatey.chocolatey         1.1.0  
cisco.aci                     2.0.0  
cisco.asa                     2.0.3  
cisco.intersight              1.0.17 
cisco.ios                     2.4.0  
cisco.iosxr                   2.4.0  
cisco.meraki                  2.4.2  
cisco.mso                     1.2.0  
cisco.nso                     1.0.3  
cisco.nxos                    2.5.1  
cisco.ucs                     1.6.0  
cloudscale_ch.cloud           2.2.0  
community.aws                 1.5.0  
community.azure               1.0.0  
community.crypto              1.9.3  
community.digitalocean        1.10.0 
community.docker              1.9.1  
community.fortios             1.0.0  
community.general             3.7.0  
community.google              1.0.0  
community.grafana             1.2.3  
community.hashi_vault         1.3.2  
community.hrobot              1.1.1  
community.kubernetes          1.2.1  
community.kubevirt            1.0.0  
community.libvirt             1.0.2  
community.mongodb             1.3.1  
community.mysql               2.1.1  
community.network             3.0.0  
community.okd                 1.1.2  
community.postgresql          1.4.0  
community.proxysql            1.2.0  
community.rabbitmq            1.1.0  
community.routeros            1.2.0  
community.skydive             1.0.0  
community.sops                1.1.0  
community.vmware              1.14.0 
community.windows             1.6.0  
community.zabbix              1.4.0  
containers.podman             1.8.0  
cyberark.conjur               1.1.0  
cyberark.pas                  1.0.7  
dellemc.enterprise_sonic      1.1.0  
dellemc.openmanage            3.6.0  
dellemc.os10                  1.1.1  
dellemc.os6                   1.0.7  
dellemc.os9                   1.0.4  
f5networks.f5_modules         1.11.1 
fortinet.fortimanager         2.1.3  
fortinet.fortios              2.1.2  
frr.frr                       1.0.3  
gluster.gluster               1.0.2  
google.cloud                  1.0.2  
hetzner.hcloud                1.6.0  
hpe.nimble                    1.1.3  
ibm.qradar                    1.0.3  
infinidat.infinibox           1.2.4  
inspur.sm                     1.3.0  
junipernetworks.junos         2.5.0  
kubernetes.core               1.2.1  
mellanox.onyx                 1.0.0  
netapp.aws                    21.6.0 
netapp.azure                  21.9.0 
netapp.cloudmanager           21.10.0
netapp.elementsw              21.6.1 
netapp.ontap                  21.11.0
netapp.um_info                21.7.0 
netapp_eseries.santricity     1.2.13 
netbox.netbox                 3.1.2  
ngine_io.cloudstack           2.1.0  
ngine_io.exoscale             1.0.0  
ngine_io.vultr                1.1.0  
openstack.cloud               1.5.1  
openvswitch.openvswitch       2.0.0  
ovirt.ovirt                   1.6.3  
purestorage.flasharray        1.10.0 
purestorage.flashblade        1.6.0  
sensu.sensu_go                1.12.0 
servicenow.servicenow         1.0.6  
splunk.es                     1.0.2  
t_systems_mms.icinga_director 1.22.0 
theforeman.foreman            2.2.0  
vyos.vyos                     2.5.1  
wti.remote                    1.0.1  

# /home/ec2-user/.ansible/collections/ansible_collections
Collection   Version
------------ -------
netapp.ontap 21.15.1

ONTAP Version

sridharc-vsim34::> version
NetApp Release 9.7.0: Tue May 18 10:45:16 UTC 2021
9.10.1

Playbook

- name: Source vserver peer create
      na_ontap_vserver_peer:
        state: present
        peer_vserver: "{{ dst_vserver }}"
        peer_cluster: "{{ peer_cluster }}"
        vserver: "{{ src_vserver }}"
        applications: ['flexcache']
        local_name_for_peer: "{{ dst_vserver }}"
        local_name_for_source: "{{ src_vserver }}"       
        peer_options:
          hostname: "{{ dst_ontap }}"
        <<: *ontap

vars:
# cluster management and credentials to access the instances
netapp_hostname: "198.19.254.109"
netapp_username: "fsxadmin"
netapp_password: "Netapp1!"

# Variables to create snapmirror
src_ontap: "{{ netapp_hostname }}"
src_name: skdemo01
src_lif: "10.0.4.8,10.0.5.85"
src_vserver: "svm_{{ src_name }}"
src_cluster: "FsxId0e711a91c5abe695c"
dst_ontap: "198.19.254.66"
dst_name: skdemo02
dst_lif: "10.0.4.85,10.0.5.96"
dst_vserver: "svm_{{ dst_name }}"
passphrase: IamAp483p45a83
peer_cluster: "FsxId092d3dcdeb87ca58b"

# flexcache variables
origin_volume: "vol_skdemo01"
flexcache_volume: "vol_flexcache01"
flexcache_size_gb: 1

Steps to Reproduce

ansible-playbook create-flexcache-relationship.yml

Expected Results

I expect the vserver peering is successful without manual intervention.

Actual Results

TASK [Source vserver peer create] ***********************************************************************************************************************************
fatal: [localhost]: FAILED! => {
    "changed": false
}

MSG:

job reported error: {'message': "entry doesn't exist", 'code': '4', 'target': 'uuid'}, received {'job': {'uuid': '11846b8c-7d12-11ec-b4fd-27af4f524e66', '_links': {'self': {'href': '/api/cluster/jobs/11846b8c-7d12-11ec-b4fd-27af4f524e66'}}}}.

PLAY RECAP **********************************************************************************************************************************************************
localhost                  : ok=1    changed=1    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
atosato commented 2 years ago

Same issue using applications: ["snapmirror"] It seems a regression: this role worked fine till Ontap collection 21.13.1 and it stop working using 21.14.0. or later.

lonico commented 2 years ago

Yes, I would expect the issue to be the same whether the application is snapmirror or flexcache.

We added REST support in 21.14.0 so a possible work-around is to force ZAPI with

use_rest: never

in your task.

We tried to reproduce this with ONTAP systems, without success. So maybe it's FSx specific. Retrieving the job status is a cluster level operation in ONTAP classic. We'll look into this.

lonico commented 2 years ago

I could reproduce the issue. The peering relationship is actually created, but the job is not found. This also prevents to accept the peering request,

lonico commented 2 years ago

We are suspecting an ONTAP bug that is specific to FSx and svm/peers. We'll add a work-around in the vserver_peer module.

lonico commented 2 years ago

ONTAP should have a fix in 9.11.0 release. But we can ignore the error in Ansible.

lonico commented 2 years ago

fixed in 21.18.0