Software Development Kit (SDK) and API Discussions

netapp API issue in ansible

pamo
6,897 Views

I am running ontap 9.1 and redhat 6.8 used for ansible

 

ansible version details:

[root@rhel2 /]# ansible --version
ansible 2.7.9
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.6/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.6.6 (r266:84292, May 22 2015, 08:34:51) [GCC 4.4.7 20120313 (Red Hat 4.4.7-15)]

 

Getting this error while running the first playbook for aggr creation

The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_na_cdot_aggregate_payload_TmquWf/__main__.py", line 138, in get_aggr
enable_tunneling=False)
File "/usr/lib/python2.6/site-packages/netapp_lib/api/zapi/zapi.py", line 281, in invoke_successfully
result = self.invoke_elem(na_element, enable_tunneling)
File "/usr/lib/python2.6/site-packages/netapp_lib/api/zapi/zapi.py", line 263, in invoke_elem
raise NaApiError('Unexpected error', e.message)
NaApiError: NetApp API failed. Reason - Unexpected error:

fatal: [localhost]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"disk_count": 4,
"hostname": "192.168.0.101",
"name": "ansibleAggr",
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"state": "present",
"username": "admin"
}
},
"msg": "NetApp API failed. Reason - Unexpected error:"

 

Need help on this

 

 

 

 

 

 

5 REPLIES 5

pamo
6,893 Views

With respect to above also getting the below error

 


The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_na_cdot_aggregate_payload_i1cIi0/__main__.py", line 138, in get_aggr
enable_tunneling=False)
File "/usr/lib/python2.6/site-packages/netapp_lib/api/zapi/zapi.py", line 290, in invoke_successfully
raise NaApiError(code, msg)
NaApiError: NetApp API failed. Reason - 13010:Version 1.110 was requested, but only 1.100 is supported.

fatal: [localhost]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"disk_count": 4,
"hostname": "192.168.0.101",
"name": "ansibleAggr",
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"state": "present",
"username": "admin"
}
},
"msg": "NetApp API failed. Reason - 13010:Version 1.110 was requested, but only 1.100 is supported."
}
to retry, use: --limit @/first.retry

PLAY RECAP *********************************************************************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1

 

Had already installed latest netapp libraries netapp-lib-2018.11.1

GrahamMcGeown
6,854 Views

Hi pamo

 

It looks like you are using one of the older "na_cdot_*" modules which might not work with newer ONTAP versions. Have you looked at "na_ontap_aggregate" rather than "na_cdot_aggregate"?

 

Cheers

 

Graham

pamo
6,814 Views

hi Graham,

Thanks for your reply

I used na_ontap_aggregate but no luck again getting the below error

 

The full traceback is:
Traceback (most recent call last):
File "/root/.ansible/tmp/ansible-tmp-1552932185.2-107080005953841/AnsiballZ_na_ontap_aggregate.py", line 113, in <module>
_ansiballz_main()
File "/root/.ansible/tmp/ansible-tmp-1552932185.2-107080005953841/AnsiballZ_na_ontap_aggregate.py", line 105, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/root/.ansible/tmp/ansible-tmp-1552932185.2-107080005953841/AnsiballZ_na_ontap_aggregate.py", line 48, in invoke_module
imp.load_module('__main__', mod, module, MOD_DESC)
File "/tmp/ansible_na_ontap_aggregate_payload_fnpAZ0/__main__.py", line 391, in <module>
File "/tmp/ansible_na_ontap_aggregate_payload_fnpAZ0/__main__.py", line 387, in main
File "/tmp/ansible_na_ontap_aggregate_payload_fnpAZ0/__main__.py", line 353, in apply
File "/tmp/ansible_na_ontap_aggregate_payload_fnpAZ0/__main__.py", line 344, in asup_log_for_cserver
File "/tmp/ansible_na_ontap_aggregate_payload_fnpAZ0/ansible_na_ontap_aggregate_payload.zip/ansible/module_utils/netapp.py", line 268, in get_cserver
File "/usr/lib/python2.6/site-packages/netapp_lib/api/zapi/zapi.py", line 290, in invoke_successfully
raise NaApiError(code, msg)
netapp_lib.api.zapi.zapi.NaApiError: NetApp API failed. Reason - 13010:Version 1.110 was requested, but only 1.100 is supported.

fatal: [localhost]: FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File \"/root/.ansible/tmp/ansible-tmp-1552932185.2-107080005953841/AnsiballZ_na_ontap_aggregate.py\", line 113, in <module>\n _ansiballz_main()\n File \"/root/.ansible/tmp/ansible-tmp-1552932185.2-107080005953841/AnsiballZ_na_ontap_aggregate.py\", line 105, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/root/.ansible/tmp/ansible-tmp-1552932185.2-107080005953841/AnsiballZ_na_ontap_aggregate.py\", line 48, in invoke_module\n imp.load_module('__main__', mod, module, MOD_DESC)\n File \"/tmp/ansible_na_ontap_aggregate_payload_fnpAZ0/__main__.py\", line 391, in <module>\n File \"/tmp/ansible_na_ontap_aggregate_payload_fnpAZ0/__main__.py\", line 387, in main\n File \"/tmp/ansible_na_ontap_aggregate_payload_fnpAZ0/__main__.py\", line 353, in apply\n File \"/tmp/ansible_na_ontap_aggregate_payload_fnpAZ0/__main__.py\", line 344, in asup_log_for_cserver\n File \"/tmp/ansible_na_ontap_aggregate_payload_fnpAZ0/ansible_na_ontap_aggregate_payload.zip/ansible/module_utils/netapp.py\", line 268, in get_cserver\n File \"/usr/lib/python2.6/site-packages/netapp_lib/api/zapi/zapi.py\", line 290, in invoke_successfully\n raise NaApiError(code, msg)\nnetapp_lib.api.zapi.zapi.NaApiError: NetApp API failed. Reason - 13010:Version 1.110 was requested, but only 1.100 is supported.\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
to retry, use: --limit @/first.retry

PLAY RECAP **********************************************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1

 

i am using the below programme

 

- hosts: localhost
tasks:
- name: Manage Aggregates
na_ontap_aggregate:
state: present
name: ansibleAggr
disk_count: 4
hostname: "192.168.0.101"
username: "username"
password: "password"

 

gaurav_verma
6,796 Views

>>NaApiError: NetApp API failed. Reason - 13010:Version 1.110 was requested, but only 1.100 is supported.

>>"msg": "NetApp API failed. Reason - 13010:Version 1.110 was requested, but only 1.100 is supported."

This is your main error and that looks like because of ONTAP version issue. This is neither ansible issue not a python issue. For test purpose you can test same with ZEDI using same api. 

 

You can read in ansible documentation for this module 

  • A physical or virtual clustered Data ONTAP system. The modules were developed with Clustered Data ONTAP 9.3

https://docs.ansible.com/ansible/latest/modules/na_ontap_aggregate_module.html#na-ontap-aggregate-module

 

I suggest to upgrade to minimum 9.3. 

 

rajpalem1
5,130 Views
 
Need help with the below code , getting the below error , is this a firewall issue ?
---
- hosts: localhost
collections:
- netapp.ontap
name: Volume Action
vars:
hostname: "a.b.c.d"
vserver: svm_netapptestcvo07
aggr: aggr1
vol_name: ansibleVolTest
netapp_username: admin
netapp_password: ******
tasks:
- name: Understand the data
debug:
msg: "The username {{ netapp_username }} has got the details xyz {{ netapp_password }} vbz"
- name: Volume Create
na_ontap_volume:
state: present
name: "{{ vol_name }}"
vserver: "{{ vserver }}"
aggregate_name: "{{ aggr }}"
size: 1
size_unit: gb
policy: default
#junction_path: "/{{ vol_name }}"
hostname: "{{ hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
https: true
validate_certs: false
 
.........
 
{
"exception": "Traceback (most recent call last):\n File \"/tmp/ansible_na_ontap_volume_payload_wYE289/ansible_na_ontap_volume_payload.zip/ansible/modules/storage/netapp/na_ontap_volume.py\", line 535, in volume_get_iter\n File \"/var/lib/awx/venv/ansible/lib/python2.7/site-packages/netapp_lib/api/zapi/zapi.py\", line 292, in invoke_successfully\n result = self.invoke_elem(na_element, enable_tunneling)\n File \"/var/lib/awx/venv/ansible/lib/python2.7/site-packages/netapp_lib/api/zapi/zapi.py\", line 272, in invoke_elem\n raise NaApiError(msg, error)\nNaApiError: NetApp API failed. Reason - URL error:URLError(error(110, 'Connection timed out'),)\n",
"_ansible_no_log": false,
"invocation": {
"module_args": {
"comment": null,
"space_slo": null,
"unix_permissions": null,
"size": 1,
"aggr_list": null,
"encrypt": false,
"wait_for_completion": false,
"tiering_policy": null,
"hostname": "10.**.**.**",
"snapdir_access": null,
"size_unit": "gb",
"vserver": "svm_netapptestcvo07",
"state": "present",
"qos_policy_group": null,
"https": false,
"vserver_dr_protection": null,
"policy": "default",
"auto_provision_as": null,
"aggregate_name": "aggr1",
"aggr_list_multiplier": null,
"username": "admin",
"from_name": null,
"is_infinite": false,
"atime_update": null,
"qos_adaptive_policy_group": null,
"http_port": null,
"is_online": true,
"ontapi": null,
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"efficiency_policy": null,
"volume_security_style": "mixed",
"name": "ansibleVolTest",
"language": null,
"type": null,
"percent_snapshot_space": null,
"space_guarantee": null,
"junction_path": null,
"snapshot_policy": null,
"time_out": 180,
"validate_certs": false,
"use_rest": "Auto",
"nvfail_enabled": null
}
},
"changed": false,
"msg": "Error fetching volume ansibleVolTest : NetApp API failed. Reason - URL error:URLError(error(110, 'Connection timed out'),)"
}
Public