How to Recover Deleted VMDK Files from a VMware Datastore Accidentally deleting a Virtual Machine Disk (VMDK) file from an ESXi datastore can be a catastrophic event for any IT administrator. However, depending on how the file was deleted and whether its underlying data blocks have been overwritten, recovery may still be possible. The first and most critical rule of recovery is to stop all write operations to that datastore immediately. The longer the host remains active, the higher the risk that the "deleted" space will be reused for new data, making the original VMDK unrecoverable. 1. Distinguishing Between Descriptor and Data Files Before attempting recovery, it is vital to understand that a VMware virtual disk typically consists of two files: The Descriptor File ( vmname.vmdk ): A small text file containing configuration metadata. The Flat File ( vmname-flat.vmdk ): The actual data file containing the virtual machine's binary content. If you have only deleted the small descriptor file but the -flat.vmdk still exists in the datastore, recovery is straightforward and involves recreating the descriptor manually. If the flat file itself is gone, you will 2. Manual Recovery: Recreating a Missing Descriptor File If the -flat.vmdk is still present, you can recreate the missing .vmdk descriptor using the command line: Enable SSH on your ESXi host and connect via a terminal client like PuTTY. Identify the exact size of the flat file by navigating to the datastore directory: ls -l /vmfs/volumes/DATASTORE_NAME/VM_NAME/ . Create a temporary disk of the exact same size as the original: vmkfstools -c [SIZE_IN_BYTES] -a lsilogic -d thin temp.vmdk . Modify the descriptor : Use the new temp.vmdk as a template, renaming it and pointing it to your original -flat.vmdk file. 3. Restoring from Backups and Snapshots The most reliable recovery method is always a pre-existing backup or snapshot. Accidentally deleted .vmdk, anyway to recover the files?
: Connect the physical storage (DAS/RAID) to a Windows machine, run a "Full Recovery" scan, and preview recovered files before saving them to a different location. Hetman RAID Recovery : Useful if the datastore was on a RAID array; it can virtually rebuild damaged RAIDs to locate lost virtual machine folders. BitRecover VMFS Recovery Tool : Offers specific modes for deleted and formatted VMFS partition recovery. Reddit +7 4. Recovery via Snapshots (For Running VMs) If a VM is still running but its base VMDK was deleted, you may be able to use existing snapshots to rebuild the disk: Broadcom Community +1 Consolidate Snapshots
Lost and Found: Recovering a Deleted VMDK File from a VMware Datastore Few things strike fear into the heart of a VMware administrator like the realization that a critical VMDK (Virtual Machine Disk) file has been deleted from a datastore. Whether it was a mistyped rm command, an overzealous cleanup script, or an accidental click in the vSphere Client, the result is the same: a virtual machine that refuses to start. But before you panic, understand this: deletion does not mean immediate destruction. Recovery is often possible, but success depends entirely on how fast and how carefully you act. The Immediate Steps (Do NOT Reboot) The moment you realize a VMDK is missing from a datastore (typically VM power-on fails with "File not found" ), follow the golden rule of data recovery: stop all write operations to that datastore.
Do not create new VMs on that datastore. Do not migrate VMs onto it. Do not power on other VMs that might write logs or swap files there. If the datastore is on shared storage (SAN/NAS), consider putting it into maintenance mode if possible. recover deleted vmdk file from datastore
Every write operation risks overwriting the sectors that once held your VMDK’s metadata and data blocks. Understanding the Scenario: How Was the VMDK Deleted? Recovery strategy depends on the deletion method:
Deleted via vSphere Client (Datastore Browser): The file is moved to a hidden "trash" folder ( .vSphere-HA or ... ). Often, a simple "Undelete" is possible. Deleted via SSH/ESXi Shell ( rm command): The file is unlinked immediately. Recovery requires low-level tools. Deleted via Storage Array snapshot rollback: More complex; requires storage-level recovery.
Method 1: The Quick Win – Hidden .vSphere-HA Folder VMware ESXi has a safety net for deletions performed through the datastore browser. Files are not instantly purged but moved to a hidden directory. How to Recover Deleted VMDK Files from a
Connect to ESXi via SSH or use the Datastore Browser in "Show Hidden Files" mode. Navigate to the root of the datastore. Look for a folder named .vSphere-HA or .DS_Store (depending on version). Inside, you may find your deleted VMDK and its descriptor file ( vmname.vmdk and vmname-flat.vmdk ). Simply move them back to the original VM folder and re-add the disk to the VM.
Success rate: High if no datastore cleanup has occurred. Method 2: Using ESXi Command Line – vmkfstools Recovery If the file was deleted via SSH or isn’t in the hidden folder, vmkfstools (the native VMware disk utility) offers a last-resort recovery option for recently deleted VMDKs, but only if the disk was eager-zeroed thick or thin-provisioned and the blocks remain untouched. Procedure via SSH:
Identify the datastore path: /vmfs/volumes/DatastoreName/VMname/ Try to recover the descriptor: vmkfstools -x recover /vmfs/volumes/.../missing.vmdk If that fails, attempt to recreate the descriptor file manually if the flat VMDK ( -flat.vmdk ) still exists. The longer the host remains active, the higher
Limitation: This rarely works for fully deleted files. It is more useful for repairing corrupted descriptors. Method 3: Third-Party Recovery Tools (Most Reliable) For true "I deleted the VMDK and emptied the trash" scenarios, specialized VM recovery software is your best bet. These tools scan the raw VMFS datastore partition for file signatures. Popular options:
R-Studio for VMware – Scans VMFS volumes, reconstructs deleted VMDKs. UFS Explorer RAID Recovery – Excellent for complex VMFS structures. DiskInternals VMFS Recovery – Offers a step-by-step wizard. Klennix VMFS Recovery – Lightweight and efficient.