<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: na_ontap_volume: fails to delete volume when state is set to absent in Software Development Kit (SDK) and API Discussions</title>
    <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/na-ontap-volume-fails-to-delete-volume-when-state-is-set-to-absent/m-p/170361#M3167</link>
    <description>&lt;P&gt;Fixed by putting&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;collections:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- netapp.ontap&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;in playbook.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As mentioned in&amp;nbsp;&lt;A href="https://netapp.io/2019/09/17/coming-together-nicely/" target="_blank" rel="noopener"&gt;https://netapp.io/2019/09/17/coming-together-nicely/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;---
- hosts: localhost
&amp;nbsp; &lt;EM&gt;collections:&lt;/EM&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;- netapp.ontap&lt;/EM&gt;&lt;BR /&gt;Don't forget to do the action above this section.&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Sep 2021 15:29:45 GMT</pubDate>
    <dc:creator>maartendeboer</dc:creator>
    <dc:date>2021-09-28T15:29:45Z</dc:date>
    <item>
      <title>na_ontap_volume: fails to delete volume when state is set to absent</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/na-ontap-volume-fails-to-delete-volume-when-state-is-set-to-absent/m-p/162959#M3119</link>
      <description>&lt;P&gt;na_ontap_volume faisl to delete a volume on a filer when using state: absent&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i created a new 1GB test volume using the ontap CLI , to test the deletion process. ... like so ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;emdccn0006::&amp;gt; vol create -vserver emdccn0005v55dr -volume testvol_12345 -aggregate emdccn0006c02_aggr2 -size 1g -state online&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;emdccn0006::&amp;gt;&lt;BR /&gt;emdccn0006::&amp;gt; vol show testvol_12345&lt;BR /&gt;Vserver Volume Aggregate State Type Size Available Used%&lt;BR /&gt;--------- ------------ ------------ ---------- ---- ---------- ---------- -----&lt;BR /&gt;emdccn0005v55dr testvol_12345 emdccn0006c02_aggr2 online RW 1GB 972.6MB 5%&lt;/P&gt;&lt;P&gt;emdccn0006::&amp;gt;&lt;BR /&gt;emdccn0006::&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;emdccn0006::&amp;gt; version&lt;BR /&gt;NetApp Release 9.1P16: Wed Nov 14 19:51:52 UTC 2018&lt;/P&gt;&lt;P&gt;emdccn0006::&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so filer = version 9.1P16&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the ansible doco for na_ontap_volume shows the following example ...&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="p p-Indicator"&gt;-&lt;/SPAN&gt; &lt;SPAN class="nt"&gt;name&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt; &lt;SPAN class="l l-Scalar l-Scalar-Plain"&gt;Volume Delete&lt;/SPAN&gt;
  &lt;SPAN class="nt"&gt;na_ontap_volume&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="nt"&gt;state&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt; &lt;SPAN class="l l-Scalar l-Scalar-Plain"&gt;absent&lt;/SPAN&gt;
    &lt;SPAN class="nt"&gt;name&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt; &lt;SPAN class="l l-Scalar l-Scalar-Plain"&gt;ansibleVolume12&lt;/SPAN&gt;
    &lt;SPAN class="nt"&gt;aggregate_name&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt; &lt;SPAN class="l l-Scalar l-Scalar-Plain"&gt;ansible_aggr&lt;/SPAN&gt;
    &lt;SPAN class="nt"&gt;vserver&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt; &lt;SPAN class="l l-Scalar l-Scalar-Plain"&gt;ansibleVServer&lt;/SPAN&gt;
    &lt;SPAN class="nt"&gt;hostname&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt; &lt;SPAN class="s"&gt;"&lt;/SPAN&gt;&lt;SPAN class="cp"&gt;{{&lt;/SPAN&gt; &lt;SPAN class="nv"&gt;netapp_hostname&lt;/SPAN&gt; &lt;SPAN class="cp"&gt;}}&lt;/SPAN&gt;&lt;SPAN class="s"&gt;"&lt;/SPAN&gt;
    &lt;SPAN class="nt"&gt;username&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt; &lt;SPAN class="s"&gt;"&lt;/SPAN&gt;&lt;SPAN class="cp"&gt;{{&lt;/SPAN&gt; &lt;SPAN class="nv"&gt;netapp_username&lt;/SPAN&gt; &lt;SPAN class="cp"&gt;}}&lt;/SPAN&gt;&lt;SPAN class="s"&gt;"&lt;/SPAN&gt;
    &lt;SPAN class="nt"&gt;password&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt; &lt;SPAN class="s"&gt;"&lt;/SPAN&gt;&lt;SPAN class="cp"&gt;{{&lt;/SPAN&gt; &lt;SPAN class="nv"&gt;netapp_password&lt;/SPAN&gt; &lt;SPAN class="cp"&gt;}}&lt;/SPAN&gt;&lt;SPAN class="s"&gt;"&lt;/SPAN&gt;
&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so following on from this .....&lt;/P&gt;&lt;P&gt;i then created a yml file to delete the volume using ansible like so ...&lt;/P&gt;&lt;P&gt;$ cat delete-dr-volume.yml&lt;BR /&gt;---&lt;/P&gt;&lt;P&gt;- hosts: localhost&lt;BR /&gt;gather_facts: false&lt;/P&gt;&lt;P&gt;name: "Ansible Storage Delete ..."&lt;BR /&gt;tasks:&lt;/P&gt;&lt;P&gt;- name: "Delete Volume : testvol_12345 , if it exists ..."&lt;BR /&gt;na_ontap_volume:&lt;BR /&gt;state: absent&lt;BR /&gt;name: testvol_12345&lt;BR /&gt;aggregate_name: emdccn0006c02_aggr2&lt;BR /&gt;vserver: emdccn0005v55dr&lt;BR /&gt;hostname: emdccn0006.dc.corp.abc.com&lt;BR /&gt;username: admin&lt;BR /&gt;password: XXXXX&lt;BR /&gt;&lt;A href="mailto:d629924@vm010$" target="_blank"&gt;$&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(cut and paste didnt quite align , noted above )&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;d629924@vm010$ pip show netapp-lib&lt;BR /&gt;Name: netapp-lib&lt;BR /&gt;Version: 2019.12.20&lt;BR /&gt;Summary: netapp-lib is required for Ansible deployments to interact with NetApp storage systems.&lt;BR /&gt;Home-page: UNKNOWN&lt;BR /&gt;Author: NetApp, Inc.&lt;BR /&gt;Author-email: ng-ansibleteam@netapp.com&lt;BR /&gt;License: Proprietary::NetApp&lt;BR /&gt;Location: /usr/local/lib/python3.6/site-packages&lt;BR /&gt;Requires: lxml, xmltodict&lt;BR /&gt;Required-by:&lt;BR /&gt;&lt;A href="mailto:d629924@vm010$" target="_blank"&gt;$&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;note : i'm using netapp-lib =&amp;nbsp;Version: 2019.12.20&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i get this error when running the playbook ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;$ ansible-playbook ./pb-delete/delete-dr-volume.yml&lt;BR /&gt;[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PLAY [Ansible Storage Delete ...] *******************************************************************************************************************&lt;/P&gt;&lt;P&gt;TASK [Delete Volume : testvol_12345 , if it exists ...] ********************************************************************************************&lt;BR /&gt;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.'&lt;BR /&gt;fatal: [localhost]: FAILED! =&amp;gt; {"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 &amp;lt;module&amp;gt;\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 &amp;lt;module&amp;gt;\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}&lt;/P&gt;&lt;P&gt;PLAY RECAP ******************************************************************************************************************************************&lt;BR /&gt;localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0&lt;/P&gt;&lt;P&gt;$&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the specific error is :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;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.'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone assist me with my issue ? Not sure what i'm doing wrong, unless the fix is a netapp-lib upgrade ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards Adrian&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 10:38:52 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/na-ontap-volume-fails-to-delete-volume-when-state-is-set-to-absent/m-p/162959#M3119</guid>
      <dc:creator>raffs</dc:creator>
      <dc:date>2025-06-04T10:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: na_ontap_volume: fails to delete volume when state is set to absent</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/na-ontap-volume-fails-to-delete-volume-when-state-is-set-to-absent/m-p/164906#M3126</link>
      <description>&lt;P&gt;Hi Adrian,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The slack channels on &lt;A href="https://netapp.io&amp;nbsp;" target="_blank"&gt;https://netapp.io&amp;nbsp;&lt;/A&gt; is the quickest place to get help on this.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A few points about what's going on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; You might want to consider a ONTAP upgrade to 9.5+&amp;nbsp;&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; I don't think you need to specify the aggregate_name in the remove command&lt;/P&gt;&lt;P&gt;3. You might need to unmount the volume prior to deleting it.&lt;/P&gt;&lt;P&gt;4. ONTAP collections have replaced the syntax your currently using which would also address points 2 and 3 above there is a blog post on netapp.io that addresses this topic.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 18:39:56 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/na-ontap-volume-fails-to-delete-volume-when-state-is-set-to-absent/m-p/164906#M3126</guid>
      <dc:creator>olson</dc:creator>
      <dc:date>2021-03-12T18:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: na_ontap_volume: fails to delete volume when state is set to absent</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/na-ontap-volume-fails-to-delete-volume-when-state-is-set-to-absent/m-p/168214#M3143</link>
      <description>&lt;P&gt;I'm facing the same issue with error "No element by given name volume-comp-aggr-attributes." when running a playbook with&amp;nbsp;na_ontap_volume: onto ONTAP&amp;nbsp;Release 9.1P9&lt;/P&gt;&lt;P&gt;This happens when run the playbook for the 2nd or more time.&lt;/P&gt;&lt;P&gt;Is this due to the lower ONTAP-release?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 13:59:52 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/na-ontap-volume-fails-to-delete-volume-when-state-is-set-to-absent/m-p/168214#M3143</guid>
      <dc:creator>maartendeboer</dc:creator>
      <dc:date>2021-07-02T13:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: na_ontap_volume: fails to delete volume when state is set to absent</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/na-ontap-volume-fails-to-delete-volume-when-state-is-set-to-absent/m-p/170361#M3167</link>
      <description>&lt;P&gt;Fixed by putting&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;collections:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- netapp.ontap&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;in playbook.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As mentioned in&amp;nbsp;&lt;A href="https://netapp.io/2019/09/17/coming-together-nicely/" target="_blank" rel="noopener"&gt;https://netapp.io/2019/09/17/coming-together-nicely/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;---
- hosts: localhost
&amp;nbsp; &lt;EM&gt;collections:&lt;/EM&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;- netapp.ontap&lt;/EM&gt;&lt;BR /&gt;Don't forget to do the action above this section.&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 15:29:45 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/na-ontap-volume-fails-to-delete-volume-when-state-is-set-to-absent/m-p/170361#M3167</guid>
      <dc:creator>maartendeboer</dc:creator>
      <dc:date>2021-09-28T15:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: na_ontap_volume: fails to delete volume when state is set to absent</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/na-ontap-volume-fails-to-delete-volume-when-state-is-set-to-absent/m-p/170401#M3168</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/9277"&gt;@maartendeboer&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, it is due to running ONTAP 9.1P9 as composite aggregate also referred to as FabricPool wasn't introduced until ONTAP 9.2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Team NetApp&lt;/P&gt;</description>
      <pubDate>Wed, 29 Sep 2021 04:49:52 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/na-ontap-volume-fails-to-delete-volume-when-state-is-set-to-absent/m-p/170401#M3168</guid>
      <dc:creator>ttran</dc:creator>
      <dc:date>2021-09-29T04:49:52Z</dc:date>
    </item>
  </channel>
</rss>

