VMware Cloud Community
flipovich
Contributor
Contributor

Script RDM Free Space

I know how to pull the RDM listing from the VMWare side of the house, which gives me the full listing of RDMs, their canonical ID, their SCSI ID, and total size.  What it doesn't give me is total used/free space from the Windows side of the house, obviously.  I know how to pull very generic space usage information from the Windows side of the house, but what I can't figure out is how to tie that to the VMWare script so that I can say RDM 1 is tied to the G: drive on VM1 and has 100GB total capacity of which only 30GB is used, leaving 70GB of free space.

Here's a basic way to pull drive space information in PowerShell: 

gwmi win32_volume -Filter 'drivetype = 3' | select driveletter, label, @{LABEL='GBfreespace';EXPRESSION={$_.freespace/1GB} }

I'm sure this has probably been done before, I just can't seem to find it anywhere.  I've been searching for a couple of days now and all I can find is generic RDM scripts on the VMWare side giving the total capacity of the RDM only, plus generic scripts on the Windows Server side, non-RDM related that I cannot figure out how to tie together with the information I get from VMWare.  All I need is a scripted way to figure out all of the RDM's used or free capacity.  Any assistance you're able to provide with this is much appreciated.  Thank you.

0 Kudos
1 Reply
flipovich
Contributor
Contributor

I forgot to mention that I also found this handy script, but it doesn't give the free space associated with any drives that do not have a drive letter associated with them, which none of my RDMs have drive letter mappings.  Thanks in advance to anyone who can help!

Which Disk is that volume on? | Geoff @ UVM

0 Kudos