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

by on ‎2012-08-23 11:33 AM

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.



This NetApp Community is public and open website that is indexed by search engines such as Google. Participation in the NetApp Community is voluntary. All content posted on the NetApp Community is publicly viewable and available. This includes the rich text editor which is not encrypted for https.

In accordance to 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
  • Copyrighted materials without the permission of the copyright owner

Files and content that do not abide by the Community Terms of Use or Code of Conduct will be removed. Continued non-compliance may result in NetApp Community account restrictions or termination.