VMware Cloud Community
ygao
Contributor
Contributor

How to link VMs to their corresponding folder in storage

I inherited an environment that have few large Datastore with about 50 VM folders in them. But there are only 25 servers on the ESX, so the other 25 are extra folders (some might be the D:/E: drives which I verified) that are left overs, probably someone just delete the server from inventory, not from the disk.

so my question is that is there a fast way (scipts?) that I can run against the datastore that I can figure out which folders aren't being used? I can do it manually, but it will take a long time.

Any thoughts? Thanks in advance!

0 Kudos
1 Reply
HannaL
Enthusiast
Enthusiast

I don't know of any scripts but it wouldn't take that long to figure out which disks go with which VM's and then figure out if the VM's are registered or not. I think it would be worth it to verify for sure so no important data is accidentally removed.

The summary tab of each VM will show all the datastores that VM is using. Browsing the datastores you can look at the time stamps of files such as the vmware.log file to see if it has been used recently or not.

the command I use to see all the vmdk files referenced by all the vmx files on a particular system is

cd /vmfs/volumes

grep -r vmdk //*.vmx | more

Hope that helps.

Hanna

Hope that helps, Hanna --- BSCS, VCP2, VCP VI3, VCP vSphere, VCP 5 https://www.ibm.com/developerworks/mydeveloperworks/blogs/vmware-support-ibm
0 Kudos