<?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 Delete Volume after all LUNs are unmapped in Active IQ Unified Manager Discussions</title>
    <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Delete-Volume-after-all-LUNs-are-unmapped/m-p/98033#M17321</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm try to create a workflow that deletes LUNs, as specified, and then deletes the volume only if there are no additional LUNs mapped in the volume.&amp;nbsp; I'm using WFA 2.2 and Clustered Mode&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example would be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Volume:&amp;nbsp; volume1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LUNs in Volume:&amp;nbsp; lun1, lun2, lun3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;lun1 mapped to host1&lt;/P&gt;&lt;P&gt;lun2 mapped to host2&lt;/P&gt;&lt;P&gt;lun3 mapped to host1 and host2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the user wants to delete lun1, they would enter the lun_path to delete.&amp;nbsp; The workflow checks in lun1 is mapped and fails if mapped.&amp;nbsp; It deletes the lun if no mapping exists.&amp;nbsp; I have that part working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the user unmapped lun1 and ran the delete workflow, I only want that LUN deleted, but not the volume because other luns and mapped and in use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the user unmapped all luns and ran the delete workflow, I want to delete the LUNs and then delete the volume.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This the query I use to find the igroup mapping for a particular LUN, but can't figure out how to modify to find any mapped luns in a volume.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SELECT&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lun.full_path as 'lun.full_path',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; igroup.name as 'name',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vserver.name as 'vserver.name',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cluster.name as 'vserver.cluster.primary_address'&lt;BR /&gt;FROM&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cm_storage.igroup igroup,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cm_storage.vserver vserver,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cm_storage.lunmap lunmap,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cm_storage.lun lun,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cm_storage.cluster cluster&lt;BR /&gt;WHERE&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lunmap.lun_id = lun.id&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND lunmap.igroup_id = igroup.id&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND vserver.name = '${vserver_name}'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND lun.full_path = '${lun_path}'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND igroup.protocol = 'iscsi'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND cluster.name = '${cluster_name}'&lt;BR /&gt;ORDER BY&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; igroup.name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Roger&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>Thu, 05 Jun 2025 05:23:37 GMT</pubDate>
    <dc:creator>rogerhinson</dc:creator>
    <dc:date>2025-06-05T05:23:37Z</dc:date>
    <item>
      <title>Delete Volume after all LUNs are unmapped</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Delete-Volume-after-all-LUNs-are-unmapped/m-p/98033#M17321</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm try to create a workflow that deletes LUNs, as specified, and then deletes the volume only if there are no additional LUNs mapped in the volume.&amp;nbsp; I'm using WFA 2.2 and Clustered Mode&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example would be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Volume:&amp;nbsp; volume1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LUNs in Volume:&amp;nbsp; lun1, lun2, lun3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;lun1 mapped to host1&lt;/P&gt;&lt;P&gt;lun2 mapped to host2&lt;/P&gt;&lt;P&gt;lun3 mapped to host1 and host2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the user wants to delete lun1, they would enter the lun_path to delete.&amp;nbsp; The workflow checks in lun1 is mapped and fails if mapped.&amp;nbsp; It deletes the lun if no mapping exists.&amp;nbsp; I have that part working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the user unmapped lun1 and ran the delete workflow, I only want that LUN deleted, but not the volume because other luns and mapped and in use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the user unmapped all luns and ran the delete workflow, I want to delete the LUNs and then delete the volume.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This the query I use to find the igroup mapping for a particular LUN, but can't figure out how to modify to find any mapped luns in a volume.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SELECT&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lun.full_path as 'lun.full_path',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; igroup.name as 'name',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vserver.name as 'vserver.name',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cluster.name as 'vserver.cluster.primary_address'&lt;BR /&gt;FROM&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cm_storage.igroup igroup,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cm_storage.vserver vserver,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cm_storage.lunmap lunmap,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cm_storage.lun lun,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cm_storage.cluster cluster&lt;BR /&gt;WHERE&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lunmap.lun_id = lun.id&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND lunmap.igroup_id = igroup.id&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND vserver.name = '${vserver_name}'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND lun.full_path = '${lun_path}'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND igroup.protocol = 'iscsi'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND cluster.name = '${cluster_name}'&lt;BR /&gt;ORDER BY&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; igroup.name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Roger&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>Thu, 05 Jun 2025 05:23:37 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Delete-Volume-after-all-LUNs-are-unmapped/m-p/98033#M17321</guid>
      <dc:creator>rogerhinson</dc:creator>
      <dc:date>2025-06-05T05:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Volume after all LUNs are unmapped</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Delete-Volume-after-all-LUNs-are-unmapped/m-p/98246#M17349</link>
      <description>&lt;BLOCKQUOTE&gt;Hi Roger,&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;Only the LUN_ID is mapped to an IGROUP ID.&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;But the cm_storage.lun database also has the VOLUME_ID ( besides the LUN_ID, QTREE_ID,VSERVER_ID and FULL_PATH ).&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;In order to find VOLUMES with MAPPED LUNs I would&amp;nbsp;try to modify the following :&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;SELECT&lt;BR /&gt;volume.name,&lt;BR /&gt;lun.id,&lt;BR /&gt;lunmap.lun_id,&lt;BR /&gt;lun.volume_id,&lt;BR /&gt;lun.vserver_id,&lt;BR /&gt;lun.full_path&lt;BR /&gt;FROM&lt;BR /&gt;cm_storage.volume,&lt;BR /&gt;cm_storage.lunmap,&lt;BR /&gt;cm_storage.lun&lt;BR /&gt;WHERE&lt;BR /&gt;volume.id = lun.volume_id AND&lt;BR /&gt;lunmap.lun_id = lun.id&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;Hope it helps.&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;Thanks,&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;BR /&gt;Trentin123.&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Dec 2014 18:21:22 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Delete-Volume-after-all-LUNs-are-unmapped/m-p/98246#M17349</guid>
      <dc:creator>trentino123</dc:creator>
      <dc:date>2014-12-10T18:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Volume after all LUNs are unmapped</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Delete-Volume-after-all-LUNs-are-unmapped/m-p/98372#M17362</link>
      <description>&lt;P&gt;Thanks very much.&amp;nbsp; This worked for me.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Dec 2014 00:27:45 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Delete-Volume-after-all-LUNs-are-unmapped/m-p/98372#M17362</guid>
      <dc:creator>rogerhinson</dc:creator>
      <dc:date>2014-12-13T00:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Volume after all LUNs are unmapped</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Delete-Volume-after-all-LUNs-are-unmapped/m-p/98419#M17367</link>
      <description>&lt;P&gt;Glad to know it helped, thanks Roger!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Dec 2014 13:28:04 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Delete-Volume-after-all-LUNs-are-unmapped/m-p/98419#M17367</guid>
      <dc:creator>trentino123</dc:creator>
      <dc:date>2014-12-15T13:28:04Z</dc:date>
    </item>
  </channel>
</rss>

