Cloud Articles and Resources

Powershell Script to Automatically Identify HV Cluster CSV Owner and Reclaim Space


I wrote up the attached script a few days ago to run the Invoke-NAHostVolumeSpaceReclaim cmdlet on all CSVs owned by a cluster node. I am still in the process of testing but so far it appears to work great! Before running this script, the OnTAP powershell toolkit must be installed on the server. The script itself is pretty simple, just a couple of for loops to iterate through all of the netapp volumes on the system and then identify which of those are CSVs owned by the cluster node.


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