Hello, I have been trying to find a way to test if a clone split is complete. I know Get-NcCloneSplitStatus gives me information but throws an error after the clone is complete. I looked at the volume fields on the cli and there is field called clone-volume, but could not find the corresponding PS attribute. I ended up doing something like below but wanted to know if there is a better way code wise to test to see if the clone split was done. $snap_busy = (Get-NcVol -Vserver $svm -name $org_vol | Get-NcSnapshot -SnapName $org_snap).Dependency while($snap_busy) { Write-Host "Wakeup in 30 seconds...." Start-Sleep 30 $snap_busy = (Get-NcVol -Vserver $svm -name $org_vol | Get-NcSnapshot -SnapName $org_snap).Dependency }
... View more
na_ontap_volume faisl to delete a volume on a filer when using state: absent i created a new 1GB test volume using the ontap CLI , to test the deletion process. ... like so .... emdccn0006::> vol create -vserver emdccn0005v55dr -volume testvol_12345 -aggregate emdccn0006c02_aggr2 -size 1g -state online emdccn0006::> emdccn0006::> vol show testvol_12345 Vserver Volume Aggregate State Type Size Available Used% --------- ------------ ------------ ---------- ---- ---------- ---------- ----- emdccn0005v55dr testvol_12345 emdccn0006c02_aggr2 online RW 1GB 972.6MB 5% emdccn0006::> emdccn0006::> emdccn0006::> version NetApp Release 9.1P16: Wed Nov 14 19:51:52 UTC 2018 emdccn0006::> so filer = version 9.1P16 the ansible doco for na_ontap_volume shows the following example ... - name : Volume Delete
na_ontap_volume :
state : absent
name : ansibleVolume12
aggregate_name : ansible_aggr
vserver : ansibleVServer
hostname : " {{ netapp_hostname }} "
username : " {{ netapp_username }} "
password : " {{ netapp_password }} "
so following on from this ..... i then created a yml file to delete the volume using ansible like so ... $ cat delete-dr-volume.yml --- - hosts: localhost gather_facts: false name: "Ansible Storage Delete ..." tasks: - name: "Delete Volume : testvol_12345 , if it exists ..." na_ontap_volume: state: absent name: testvol_12345 aggregate_name: emdccn0006c02_aggr2 vserver: emdccn0005v55dr hostname: emdccn0006.dc.corp.abc.com username: admin password: XXXXX $ (cut and paste didnt quite align , noted above ) d629924@vm010$ pip show netapp-lib Name: netapp-lib Version: 2019.12.20 Summary: netapp-lib is required for Ansible deployments to interact with NetApp storage systems. Home-page: UNKNOWN Author: NetApp, Inc. Author-email: ng-ansibleteam@netapp.com License: Proprietary::NetApp Location: /usr/local/lib/python3.6/site-packages Requires: lxml, xmltodict Required-by: $ note : i'm using netapp-lib = Version: 2019.12.20 i get this error when running the playbook ... $ ansible-playbook ./pb-delete/delete-dr-volume.yml [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' PLAY [Ansible Storage Delete ...] ******************************************************************************************************************* TASK [Delete Volume : testvol_12345 , if it exists ...] ******************************************************************************************** An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'No element by given name volume-comp-aggr-attributes.' fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/d629924/.ansible/tmp/ansible-tmp-1610682403.28-220492199842676/AnsiballZ_na_ontap_volume.py\", line 102, in <module>\n _ansiballz_main()\n File \"/home/d629924/.ansible/tmp/ansible-tmp-1610682403.28-220492199842676/AnsiballZ_na_ontap_volume.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/d629924/.ansible/tmp/ansible-tmp-1610682403.28-220492199842676/AnsiballZ_na_ontap_volume.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible.modules.storage.netapp.na_ontap_volume', init_globals=None, run_name='__main__', alter_sys=True)\n File \"/usr/lib64/python2.7/runpy.py\", line 176, in run_module\n fname, loader, pkg_name)\n File \"/usr/lib64/python2.7/runpy.py\", line 82, in _run_module_code\n mod_name, mod_fname, mod_loader, pkg_name)\n File \"/usr/lib64/python2.7/runpy.py\", line 72, in _run_code\n exec code in run_globals\n File \"/tmp/ansible_na_ontap_volume_payload_MN3wQK/ansible_na_ontap_volume_payload.zip/ansible/modules/storage/netapp/na_ontap_volume.py\", line 1283, in <module>\n File \"/tmp/ansible_na_ontap_volume_payload_MN3wQK/ansible_na_ontap_volume_payload.zip/ansible/modules/storage/netapp/na_ontap_volume.py\", line 1279, in main\n File \"/tmp/ansible_na_ontap_volume_payload_MN3wQK/ansible_na_ontap_volume_payload.zip/ansible/modules/storage/netapp/na_ontap_volume.py\", line 1221, in apply\n File \"/tmp/ansible_na_ontap_volume_payload_MN3wQK/ansible_na_ontap_volume_payload.zip/ansible/modules/storage/netapp/na_ontap_volume.py\", line 565, in get_volume\n File \"/usr/lib/python2.7/site-packages/netapp_lib/api/zapi/zapi.py\", line 489, in __getitem__\n raise KeyError('No element by given name %s.' % key)\nKeyError: 'No element by given name volume-comp-aggr-attributes.'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1} PLAY RECAP ****************************************************************************************************************************************** localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 $ the specific error is : An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'No element by given name volume-comp-aggr-attributes.' Can anyone assist me with my issue ? Not sure what i'm doing wrong, unless the fix is a netapp-lib upgrade ? Regards Adrian
... View more
Hi , I am new to APi's, Wrote the below one, My requirement is to get the quota report for a user. Couls someone kindly help me with the error below. cat quota.py #!/usr/bin/python3 from netapp_ontap import HostConnection from netapp_ontap import NetAppRestError from netapp_ontap.resources import QuotaReport with HostConnection("xxxxxxxx", username="admin", password="XXXXXX", verify=False): resource = QuotaReport( index=2305843013508661248, **{"volume.uuid": "de90a323-1349-49c9-acdf-f6822e82f6db"} ) resource.get() print(resource) when i run this in python script, i am getting below error. $ ./quota.py Traceback (most recent call last): File "./quota.py", line 11, in <module> resource.get() File "/usr/local/lib/python3.6/site-packages/netapp_ontap/resources/quota_report.py", line 1339, in get return super()._get(**kwargs) File "/usr/local/lib/python3.6/site-packages/netapp_ontap/utils.py", line 55, in wrapper return on_api_fail(erro) File "/usr/local/lib/python3.6/site-packages/netapp_ontap/utils.py", line 78, in on_api_fail raise NetAppRestError(cause=erro) from None netapp_ontap.error.NetAppRestError: Caused by HTTPError('404 Client Error: Not Found for url: https://10.109.24.221:443/api/storage/quota/reports/2305843013508661248',): "2305843013508661248" is an invalid value for field "volume.uuid" (<UUID>) $
... View more
Hi, We are using nmsdk-runtime-5.7 java library in our application, with Woodstox STAX library in classpath for parsing ZAPI XML responses. Occasionally we see NullPointerException in some of the ZAPI calls while parsing the responses. Please see below example for net-interface-get-iter request. The XML response string below looks proper, but we still get NPE in XmlApiInvocation class. NOTE: The issue is intermittent, and the same API works fine in subsequent call. So not sure what could be causing this. 2021-02-02T21:29:04,044 [DEBUG] - Executing API request net-interface-get-iter to 10.197.138.169:
<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE netapp SYSTEM 'file:/etc/netapp_filer.dtd'><netapp xmlns="http://www.netapp.com/filer/admin" version="1.0" nmsdk_version="5.4" nmsdk_platform="Linux unknown" nmsdk_language="Java" nmsdk_bindings="1"><net-interface-get-iter><desired-attributes><net-interface-info><address></address><address-family></address-family><administrative-status></administrative-status><data-protocols><data-protocol></data-protocol></data-protocols><operational-status></operational-status><role></role></net-interface-info></desired-attributes><max-records>500</max-records></net-interface-get-iter></netapp>
2021-02-02T21:29:04,071 [DEBUG] - Received API response for net-interface-get-iter from 10.197.138.169:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE netapp SYSTEM 'file:/etc/netapp_gx.dtd'>
<netapp version='1.150' xmlns='http://www.netapp.com/filer/admin'>
<results status="passed"><attributes-list><net-interface-info><address>10.197.138.169</address><address-family>ipv4</address-family><administrative-status>up</administrative-status><data-protocols><data-protocol>nfs</data-protocol><data-protocol>cifs</data-protocol><data-protocol>fcache</data-protocol></data-protocols><interface-name>svm_raisa_cifs</interface-name><operational-status>up</operational-status><role>data</role><vserver>svm_raisa</vserver></net-interface-info></attributes-list><num-records>1</num-records></results></netapp>
2021-02-02T21:29:04,089 [ERROR] - null
java.lang.NullPointerException: null
at com.netapp.nmsdk.client.XmlApiInvocation.readResponse(XmlApiInvocation.java:197) ~[nmsdk-runtime-5.7.jar:5.7]
at com.netapp.nmsdk.client.ApiInvocation.processResponse(ApiInvocation.java:218) ~[nmsdk-runtime-5.7.jar:5.7]
at com.netapp.nmsdk.client.ApiInvocation.invoke(ApiInvocation.java:112) ~[nmsdk-runtime-5.7.jar:5.7]
at com.netapp.nmsdk.client.XmlApiInvocation.invoke(XmlApiInvocation.java:42) ~[nmsdk-runtime-5.7.jar:5.7]
at com.netapp.nmsdk.client.ApiRunner.run(ApiRunner.java:135) ~[nmsdk-runtime-5.7.jar:5.7]
at com.netapp.nmsdk.client.ApiRunner.run(ApiRunner.java:105) ~[nmsdk-runtime-5.7.jar:5.7]
at com.netapp.nmsdk.client.ApiIteratorSupport$GetIterStyleIterator.retrieveNextBatch(ApiIteratorSupport.java:182) ~[nmsdk-runtime-5.7.jar:5.7]
at com.netapp.nmsdk.client.ApiIteratorSupport$ApiIterator.retrieveNextBatchIfNecessary(ApiIteratorSupport.java:125) ~[nmsdk-runtime-5.7.jar:5.7]
at com.netapp.nmsdk.client.ApiIteratorSupport$ApiIterator.hasNext(ApiIteratorSupport.java:102) ~[nmsdk-runtime-5.7.jar:5.7]
... View more