While doing a “mini-healthcheck” at a customer site I noticed a specific Datastore with less than 2% of free diskspace. After a bit of research an orphaned VMDK was found. Orphaned vmdk’s are virtual hard-disks that are not connected to a VM. Probably because they were removed from the inventory without deleting the files.
You can easily find these orphaned vmdk’s via the Service Console:
find -iname “*-flat.vmdk” -mtime +7
For those that don’t like using the Service Console you can also check this with Powershell Ad van Bokhoven created a nice script which he describes as follows:
This script asks the virtual center what the disk are of each VM and puts this into an array. After this, it reads all files on all datastores. If the file is a vmdk file, it will check wheter this file is in the array. If it’s not, you’ve found a orphaned vmd.
I would advise to regularly check your environment on orphaned disks, it can save precious diskspace.