Recover VMware VM From Flat File | An Easy Solution
- arjun5792
- Oct 22, 2022
- 2 min read
This article offers a straightforward method for recovering a VMware VM from a flat file. We at Skynats can take care of your VMDK issues with our Server Management Services.
How can a VMware VM be recovered from a flat file?
VMware advises creating routine Full Image Backups of crucial virtual machines to quickly restore functionality in the event of a loss. VMware additionally advises attempting to recover the missing descriptor file from the backup. This prevents the creation of an encrypted disc descriptor file.
Make sure the Flat file is copied or backed up to a different location if the affected virtual machine does not already have a complete backup. Here, the descriptor file for the virtual machine is all that is being concentrated on. Since changing or editing the Flat File's content could lead to data loss, we advise against doing so. Because the virtual machine might not boot, this method cannot be used with virtual discs set up in the virtual machine with a Para-virtualized SCSI controller.
Let's now examine how to restore a VMware virtual machine from a flat file:
1. To access the ESXi host command line via SSH, log in as root.
2. Use the command below to navigate to the datastore that contains the flat file:
cd /vmfs/volumes/DATASTORE_NAME/VM_NAME
3. Once more look over the file list and note the actual size of the -flat file.
ls -l vmdisk0-flat.vmdk
4. To create new.vmdk files, run the vmkfstools script.
# vmkfstools -c (Size of the file) -d thin temp.vmdk
The result of this is the creation of the files temp.vmdk and temp-flat.vmdk.
5. Now we can delete temp-flat. VMDK, as we no longer require it. To continue recovering VMware VM from a flat file, run the following command:
rm -i temp-flat.vmdk
6. To correspond with the original VM name. vmdk, rename temp.vmdk to the required name.
mv -i temp.vmdk orignalvmname().vmdk
7. Afterwards, edit the originalvmname.vmdk. Find the line that says "RW, and you can replace it with file temp.vmdk to originalvmname.vmdk," and then read it.
8. Start the virtual machine and verify that it boots properly.
Conclution
To recover a VMware virtual machine from a flat file, we've provided an 8-step process. For quick recovery, VMware always suggests performing regular Full Image Backups of the crucial virtual machines.
Comments