ansible-collections / netapp.ontap

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

Can't create lifs on admin-svm #145

Closed mirkovancolen closed 12 months ago

mirkovancolen commented 1 year ago

Summary

When you try to create a lif using module na_ontap_interface on an admin svm (cluster mgmt or intercluster i.e.) with rest, it fails. if you say use_rest: never, it works.

Component Name

na_ontap_interface

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.6.8
(default, Sep 10 2021, 09:13:53) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]. 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.
/usr/local/lib/python3.6/site-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography (40.0) will be the last to support Python 3.6.
  from cryptography.exceptions import InvalidSignature
ansible [core 2.11.12]
  config file = None
  configured module search path = ['/var/lib/awx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
  ansible collection location = /var/lib/awx/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.6.8 (default, Sep 10 2021, 09:13:53) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
  jinja version = 3.0.3
  libyaml = True

ONTAP Collection Version

$ ansible-galaxy collection list
bash-4.4# 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.6.8
(default, Sep 10 2021, 09:13:53) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]. 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.
/usr/local/lib/python3.6/site-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography (40.0) will be the last to support Python 3.6.
  from cryptography.exceptions import InvalidSignature

# /usr/local/lib/python3.6/site-packages/ansible_collections
Collection                    Version
----------------------------- -------
amazon.aws                    1.5.1
ansible.netcommon             2.5.0
ansible.posix                 1.3.0
ansible.utils                 2.4.3
ansible.windows               1.8.0
arista.eos                    2.2.0
awx.awx                       19.4.0
azure.azcollection            1.10.0
check_point.mgmt              2.2.0
chocolatey.chocolatey         1.1.0
cisco.aci                     2.1.0
cisco.asa                     2.1.0
cisco.intersight              1.0.18
cisco.ios                     2.6.0
cisco.iosxr                   2.6.0
cisco.meraki                  2.5.0
cisco.mso                     1.2.0
cisco.nso                     1.0.3
cisco.nxos                    2.8.2
cisco.ucs                     1.6.0
cloudscale_ch.cloud           2.2.0
community.aws                 1.5.0
community.azure               1.1.0
community.crypto              1.9.8
community.digitalocean        1.13.0
community.docker              1.10.2
community.fortios             1.0.0
community.general             3.8.3
community.google              1.0.0
community.grafana             1.3.0
community.hashi_vault         1.5.0
community.hrobot              1.2.1
community.kubernetes          1.2.1
community.kubevirt            1.0.0
community.libvirt             1.0.2
community.mongodb             1.3.2
community.mysql               2.3.2
community.network             3.0.0
community.okd                 1.1.2
community.postgresql          1.6.0
community.proxysql            1.3.0
community.rabbitmq            1.1.0
community.routeros            1.2.0
community.skydive             1.0.0
community.sops                1.2.0
community.vmware              1.17.0
community.windows             1.8.0
community.zabbix              1.5.1
containers.podman             1.9.0
cyberark.conjur               1.1.0
cyberark.pas                  1.0.13
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.13.0
fortinet.fortimanager         2.1.4
fortinet.fortios              2.1.3
frr.frr                       1.0.3
gluster.gluster               1.0.2
google.cloud                  1.0.2
hetzner.hcloud                1.6.0
hpe.nimble                    1.1.4
ibm.qradar                    1.0.3
infinidat.infinibox           1.3.0
inspur.sm                     1.3.0
junipernetworks.junos         2.8.0
kubernetes.core               1.2.1
mellanox.onyx                 1.0.0
netapp.aws                    21.7.0
netapp.azure                  21.10.0
netapp.cloudmanager           21.12.1
netapp.elementsw              21.7.0
netapp.ontap                  21.14.1
netapp.um_info                21.8.0
netapp_eseries.santricity     1.2.13
netbox.netbox                 3.4.0
ngine_io.cloudstack           2.2.2
ngine_io.exoscale             1.0.0
ngine_io.vultr                1.1.0
openstack.cloud               1.5.3
openvswitch.openvswitch       2.1.0
ovirt.ovirt                   1.6.6
purestorage.flasharray        1.11.0
purestorage.flashblade        1.8.1
sensu.sensu_go                1.12.0
servicenow.servicenow         1.0.6
splunk.es                     1.0.2
t_systems_mms.icinga_director 1.26.0
theforeman.foreman            2.2.0
vyos.vyos                     2.6.0
wti.remote                    1.0.3
bash-4.4#

ONTAP Version

sridharc-vsim34::> version
NetApp Release 9.11.1: Tue Jul 12 04:38:28 UTC 2022

Playbook

- name: Create cluster mgmt lif
  na_ontap_interface:
    state: present
    interface_name: "cluster_mgmt"
    vserver: "{{ cluster.name }}"
    address: "{{ cluster.mgmt_ip }}"
    netmask: "{{ cluster.subnet }}"
    service_policy: default-management
    ipspace: default
    admin_status: up
    use_rest: always
    home_node: "{{ nodes[0].name }}"
    home_port: "{{ cluster.mgmt_port }}"
    <<: *auth

Steps to Reproduce

- name: Create inter cluster lif
  na_ontap_interface:
    state: present
    interface_name: "ic"
    vserver: "{{ cluster.name }}"
    address: "{{ cluster.ic_ip }}"
    netmask: "{{ cluster.subnet }}"
    service_policy: default-intercluster
    ipspace: default
    admin_status: up
    use_rest: never
    home_node: "{{ nodes[0].name }}"
    home_port: "{{ cluster.ic_port }}"
    <<: *auth

Expected Results

I expect so be able to create admin-svm lifs using rest, to cover day0 playbooks.

Actual Results

TASK [cluster : Create inter cluster lif] **************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: NoneType: None
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Error creating interface ic: calling: network/ip/interfaces: got {'message': 'The specified svm.name \"bb8\", is invalid.', 'code': '1967146', 'target': 'svm.name'}."}
carchi8py commented 1 year ago

We are looking in to this.

Not sure this will fix it, but we've made a lot of bug fixes between the version you are on 21.14.1, and the current release, version 22.4.1. Could you try upgrading 22.4.1 and rerunning your playbook and let us know if you get the same error.

mohanrajb9 commented 1 year ago

@mirkovancolen To create cluster scoped IP interface in REST, vserver option should not be used. https://docs.ansible.com/ansible/latest/collections/netapp/ontap/na_ontap_interface_module.html#parameter-vserver

- name: Create cluster mgmt lif
  na_ontap_interface:
    state: present
    interface_name: "cluster_mgmt"
    address: "{{ cluster.mgmt_ip }}"
    netmask: "{{ cluster.subnet }}"
    service_policy: default-management
    ipspace: default
    admin_status: up
    use_rest: always
    home_node: "{{ nodes[0].name }}"
    home_port: "{{ cluster.mgmt_port }}"
    <<: *auth
mirkovancolen commented 1 year ago

Hi,

I have updated to the latest collection. And Have tried your suggestion. But it still fails.

{
  "exception": "NoneType: None\n",
  "msg": "Error creating interface cluster_mgmt: calling: network/ip/interfaces: got {'message': 'failed to set field \"svm\" to \"default\"', 'code': '2'}.",
  "invocation": {
    "module_args": {
      "hostname": "172.16.56.2",
      "username": "admin",
      "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
      "https": true,
      "validate_certs": false,
      "state": "present",
      "interface_name": "cluster_mgmt",
      "address": "172.16.56.1",
      "netmask": "255.255.0.0",
      "service_policy": "default-management",
      "ipspace": "default",
      "admin_status": "up",
      "use_rest": "always",
      "home_node": "joost-01",
      "home_port": "e0c",
      "ignore_zapi_options": [
        "force_subnet_association"
      ],
      "http_port": null,
      "ontapi": null,
      "feature_flags": null,
      "cert_filepath": null,
      "key_filepath": null,
      "force_ontap_version": null,
      "interface_type": null,
      "broadcast_domain": null,
      "current_node": null,
      "current_port": null,
      "role": null,
      "is_ipv4_link_local": null,
      "vserver": null,
      "firewall_policy": null,
      "failover_policy": null,
      "failover_scope": null,
      "failover_group": null,
      "subnet_name": null,
      "is_auto_revert": null,
      "protocols": null,
      "data_protocol": null,
      "force_subnet_association": null,
      "dns_domain_name": null,
      "listen_for_dns_query": null,
      "is_dns_update_enabled": null,
      "from_name": null,
      "probe_port": null,
      "fail_if_subnet_conflicts": null
    }
  },
  "_ansible_no_log": false,
  "changed": false
}
mohanrajb9 commented 1 year ago

I tried your arguments, but getting a different error message. {'message': 'failed to set field \"ipspace.name\" to \"default\"', 'code': '2', 'target': 'ipspace.name'}

I fix this by setting correct ipspace name. Default instead default.

IPspace             Vserver List                  Broadcast Domains
------------------- ----------------------------- ----------------------------
Cluster
                    Cluster                       Cluster
Default
                    ansibleSVM, ansibleSVM11,     Default

can you try with ipspace: Default ?