Cloud Articles and Resources

Data ONTAP PowerShell Toolkit - Find LUN and Vol Clones holding Snapshot

If you are using FlexClone functionality of NetApp array to create and destroy LUN and Volume clones in automated way, you probably had such situations where snapshots need to be destroyed, but array doesn't let you to delete snapshot because is busy with clone. Finding such Volume or LUN clones sometimes is challenging task requires executing multiple commands.

My customer has automated system which creates hundreds and thousands of clones every day and sometimes fails to clean up. As a result it leaves Storage Administrator with task of cleanings snapshots and clones after such failures. To make this task a bit easier I put together GetSnapshotClones.ps1 script to extract Volume and LUN clones dependent on Snapshot of the Volume. Script takes two parameters - Volume and Snapshot and returns array of clone objects.

Here is an example of calling script and script output.

PS C:\@work\Scripts> .\GetSnapshotClones.ps1


Name           : Win2K8R2_VOL_FUJI_16
ParentVolume   : Win2K8R2_VOL_MASTER
ParentLun      :
CloneType      : Vol
ParentSnapshot : clone_Win2K8R2_VOL_FUJ.1

Name           : Win2K8R2_VOL_FUJI_15
ParentVolume   : Win2K8R2_VOL_MASTER
ParentLun      :
CloneType      : Vol
ParentSnapshot : clone_FUJI_15_BOOT_VOL.1

Name           : Win2K8R2_VOL_FUJI_14

ParentVolume   : Win2K8R2_VOL_MASTER
ParentLun      :
CloneType      : Vol
ParentSnapshot : clone_FUJI_14_BOOT_VOL.1

Please Note:

All content posted on the NetApp Community is publicly searchable and viewable. Participation in the NetApp Community is voluntary.

In accordance with our Code of Conduct and Community Terms of Use, DO NOT post or attach the following:

  • Software files (compressed or uncompressed)
  • Files that require an End User License Agreement (EULA)
  • Confidential information
  • Personal data you do not want publicly available
  • Another’s personally identifiable information (PII)
  • Copyrighted materials without the permission of the copyright owner

Continued non-compliance may result in NetApp Community account restrictions or termination.

All Community Forums