VMware Cloud Community
TheVMinator
Expert
Expert
Jump to solution

Include Mount Point Sizes in get-vm

I'd like to get a list of VMs, and list out each drive in the OS such as the C:\, D:\ and F:\ drives.  The problem is, that each hard disk has a number of mount points.  Even though D:\ drive itself for example, as reported by VMware, is only 5GB, it actually points to a mount point on an external NAS.  While the hard disk in VMware is only 5GB, the mount point associated with it is 10TB.  How can I do a get-vm, and list each hard disk, and then for each hard disk, list any mount points, and the size of the mount points themselves, not just the size of the c, d and e drives?

For example, see this article:

https://learn-powershell.net/2012/08/10/locating-mount-points-using-powershell/

Is there some way I could do a get-vm and pull each drive letter and then each mount point on the drive letter, get the sizes of all the mount points, drive letters, and hard disks for each vm, then export it to csv?  Can VMtools give me this info or can it reach into the OS somehow and give me this?

Thanks!

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Except for a number of very specific cases, there is no fool-proof method afaik, that maps a VM's harddisks to guest OS internal partitions and/or mount points.

In any case, the information you want to retrieve is internal to the guest OS, vSphere has no notion of this.

In case of a Windows OS, you can use WMI methods (remote or via Invoke-VMScript) to retrieve that information.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
3 Replies
TheVMinator
Expert
Expert
Jump to solution

LucD or anyone have any ideas on this?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Except for a number of very specific cases, there is no fool-proof method afaik, that maps a VM's harddisks to guest OS internal partitions and/or mount points.

In any case, the information you want to retrieve is internal to the guest OS, vSphere has no notion of this.

In case of a Windows OS, you can use WMI methods (remote or via Invoke-VMScript) to retrieve that information.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
TheVMinator
Expert
Expert
Jump to solution

Ok thanks!

Reply
0 Kudos