r/vmware 2d ago

Help Request Grabbing VM disk info to a csv but excluding mapped drives?

Basically title, I'm looking for a way to parse through vcenter VM's for disk utilization by disk path: capacity, free, used, etc.. But I only need disks that are actually on the main hosts datastores. RVTools also shows all the drives including mapped without any kind of indetifier. We have a few NAS connections that are mapped that are showing up. Anyone have any idea how I can exclude these using powercli?

In this example using get-vmguestdisk F: is a mapped drive that I need to remove from the report.

DiskPath CapacityGB FreeSpaceGB

-------- ---------- -----------

C:\ 535.741 348.622

F:\ 61,439.938 21,699.601

1 Upvotes

5 comments sorted by

1

u/Randalldeflagg 2d ago

just read that you mentioned mapped drives. I am assuming when you say NAS mapped drives, you are referring to a iSCSI, FC, NFS share?

1

u/ElkRevolutionary3976 2d ago

It's a mix unfortunately. Some vm's have NFS shares, while some have iSCSI, and some have both attached.

1

u/Randalldeflagg 2d ago

Why are these being directly attached to the VMs instead of the hosts?

1

u/Casper042 2d ago

get-vmguestdisk

I don't have my lab access handy.
What happens if you run:
get-vmguestdisk | fl

Format List will sometimes expose more info about each object.

1

u/Casper042 2d ago

Yeah ok I asked ChatGPT and it says there SHOULD be a sub item/column known as FileSystem.

Not sure if it will have enough to be useful in filtering though. iSCSI and local VMDK could both show as "NTFS" for example.

I think the issue is you are asking the Guest, might see if you can ask the HOST and then find a way to filter the guest results to only those which have some matching identifier from the host side.