Discrepancy between datastore "Used Space" and the actual size of active VM disks.
Necessity to identify and delete unmapped virtual disks that were not removed during previous VM hardware reconfigurations.
Need to reclaim storage by purging detached virtual disks that are no longer providing value to the production environment.
"Zombie" or "Ghost" disks in the Datastore Browser that do not appear in any VM's Edit Settings menu.
vSphere vCenter 8.0
vSphere ESXi 8.0
Orphaned VM disk files may be left behind on a datastore following an incomplete Storage vMotion or disk cloning operation.
Note: Before deleting any files, it is critical to verify the content to ensure no data loss occurs. Follow these steps to safely identify and reclaim the space:
To obtain a list of all disks attached to a specific Virtual Machine (VM) using both the User Interface (UI) and Command Line (CLI) for both vCenter and an ESXi host.
1. vCenter UI (vSphere Client)
2. ESXi UI (VMware Host Client)
If you are directly logged into the ESXi host where the VM is registered:
3. ESXi Command Line (SSH / ESXi Shell)
SSH directly into the ESXi host
Using vim-cmd (Queries the active VM registration)
# vim-cmd vmsvc/getallvms | grep -i "YourVMName"
(Note the number in the very first column. This is your VMID).
# vim-cmd vmsvc/device.getdevices <VMID> | grep -A 4 -i "VirtualDisk"
# less *.vmx | grep -i vmdk
This will print the Virtual Disk blocks, showing the fileName which contains the datastore path.
Refer to this article to retrieve all VM and template disk paths and determine if a specific VMDK is currently in use - To verify if a VMDK in a datastore is attached to any virtual machine or template
Clean up Snapshots and "Ghost" Files
If the disk is verified as unnecessary:
Consolidate Snapshots: If the VM attached to that datastore has active snapshots, perform a Delete All Snapshots to merge data and release locked blocks.
Storage vMotion: The most effective way to clear "leftover" files is to migrate the active VM to a different datastore.
Right-click the VM > Migrate > Change Storage Only.
VMware will only move files explicitly listed in the .vmx file.
Any files remaining on the Source Datastore after the migration are confirmed "orphans" and can be safely deleted.
Steps for Deletion via Datastore Browser once the vmdk is confirmed to be an orphaned disk no longer required and not attached to any VM's:
Open the Datastore Browser.
Locate and open the folder containing the orphaned files.
Select the target .vmdk file
Click Delete (or right-click and select Delete File).
Warning: Always ensure you have a valid full backup of the environment before manually deleting files from a datastore. If the file is a "Base" disk for a linked clone, deleting it could corrupt multiple VMs.