Bobcares

Recover VMware VM From Flat File | An 8-Step Solution

by | Oct 21, 2022

This article provides an easy way to recover VMware VM from a flat file. At Bobcares, with our Server Management Services, we can handle your VMDK issues.

How to recover VMware VM from a flat file?

VMware suggests performing regular Full Image Backups of essential virtual machines in order to easily recover in case of a loss. VMware also suggests trying to restore the missing descriptor file from the backup. An encrypted disc descriptor file cannot be recreated using this approach.

Recover VMware VM from flat file

If the affected virtual machine does not have a full backup, ensure that the Flat file is copied or backed up to a separate location. Here, we are only focused on recreating the virtual machine’s descriptor file. We recommend not editing or changing the content of the Flat File as this may result in data loss. This approach will not work on virtual discs configured in the virtual machine with a Para-virtualized SCSI controller because the virtual machine may not boot.

Now, let’s look at how to recover VMware VM from a flat file:

  1. Log in as root to access to the ESXi host command line via SSH.
  2. Go to the datastore where the flat file is present using the below command:
    cd /vmfs/volumes/DATASTORE_NAME/VM_NAME

     

  3. Examine the file list again and make a note of the real size of the -flat file.
    ls -l vmdisk0-flat.vmdk

     

  4. Run the vmkfstools script to generate new.vmdk files.
    # vmkfstools -c (Size of the file) -d thin temp.vmdk

     

    This creates the files temp.vmdk and temp-flat.vmdk as result.

  5. We may now delete temp-flat.vmdk because we don’t need it anymore. Then execute the following command to continue recovering VMware VM from a flat file:
    rm -i temp-flat.vmdk

     

  6. To match the original VM name.vmdk, rename temp.vmdk to the needed name.
    mv -i temp.vmdk orignalvmname().vmdk

     

  7. Then edit the originalvmname.vmdklook for the line “RW, and you can replace it with file temp.vmdk to originalvmname.vmdk”.
  8. Start the VM and check to see if it boots properly.

[Need assistance with another VM issue? We’re happy to help.]

Conclusion

We have provided an 8-step method to recover VMware VM from a flat file. VMware always advises a regular Full Image Backup of the critical virtual machines for an easy recovery.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.