Windows Cluster Shared Volumes – How to interrogate information with PowerShell
/Recently my colleague Ben Evans and I came across a requirement of finding how much space was being consumed by the VMs across all cluster shared volumes. As a result I have compiled the information below and thought I’d share with you all.
To simply list the Cluster Shared Volumes, whether they are online and what hosts “own” them you can simply run the following command: Get-ClusterSharedVolume
PS C:\Windows\system32> Get-ClusterSharedVolume
Name | State | Node |
LUN001 | Online | HOST01 |
LUN002 | Online | HOST01 |
LUN003 | Online | HOST03 |
LUN004 | Online | HOST04 |
LUN005 | Online | HOST02 |
If you wish to obtain more in-depth information such as the Cluster Storage path, size of the LUN, percentage free, etc then please see below.
The below information was extracted by running a PowerShell script found at the following URL: https://blogs.msdn.microsoft.com/clustering/2010/06/18/powershell-for-failover-clustering-csv-free-disk-space-and-other-info/
PS C:\Windows\system32> \\xyz\user1\psscripts\DisplayCSVInfo2.ps1
Name | Path | Size (GB) | FreeSpace (GB) | UsedSpace (GB) | PercentFree |
LUN001 | c:\ClusterStorage \C001 | 99.87 | 79.10 | 20.78 | 79.20 |
LUN002 | c:\ClusterStorage \C002 | 1,023.87 | 298.40 | 725.47 | 29.14 |
LUN003 | c:\ClusterStorage \C003 | 3,071.87 | 2,602.57 | 469.30 | 84.72 |
LUN004 | c:\ClusterStorage \C004 | 3,071.87 | 1,288.86 | 1,783.01 | 41.96 |
LUN005 | c:\ClusterStorage \C005 | 2,047.87 | 1,679.65 | 368.22 | 82.02 |
You can then export the information from PowerShell to a .csv file by adding >C:\csv1.csv to the end of the command being ran (see below):