VMware Cloud Community
joenatan
Contributor
Contributor

Restore VM from -flat.vmdk file only

Hi,

I'm posting a solution to an issue of missing .vmx files, because in tracking down an answer I found many unresolved similar threads, and no one with this exact description. HOW the files got lost in the first place is another question, and I'd be happy to get any ideas there, as the only thing out of the ordinary was an almost-full datastore.

When I try to open console window for CentOS VM in vSphere Client I get:

Unable to connect to the MKS: Virtual machine config file does not exist.

This happens for two of my VMs, all other work fine. The odd thing is, I can still access the VM via Putty, SSH and HTTP. When I look in the datastore of one of them, there are only two files:

vmname-flat.vmdk

vmname.vmsd

The *-flat.vmdk file is the data file containing the whole VM disk. The vmsd file contains metadata about snapshots.

However, a VM needs two vmdk files:

vmname-flat.vmdk - containing data

vmname.vmdk  - descriptor file, containing meta data about the disk

To create a new descriptor file, see KB article 1002511:

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=100251...

Note that because you don't have the vmx file you need to know the SCSI controller to use. I found it by guessing that it was the same as another machine with the same OS (lsilogic) right-clicking the VM, choose Edit Settings, ticking the box Show All Devices and clicking SCSI Controller 0.

After recreating the descriptor file, create a new VM, with the exact same specifications as the old one. Choose custom and when you get to disk, choose to use an existing disk, then retrieve the disk from the previous step. Guide here:

http://techhead.co/vmware-esx-how-to-easily-recreate-a-missing-or-corrupt-vmx-file/

Tags (1)
0 Kudos
5 Replies
Shahrami
Contributor
Contributor

I did all of the steps but doesn't work for me . It doesn't boot up waits for booting.Please Someone help me

0 Kudos
continuum
Immortal
Immortal

Provide more  details or call me via skype.


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

0 Kudos
ashishsingh1508
Enthusiast
Enthusiast

you can not re-create VM_Name-flat.vmdk, you can only recover descriptor file VM_Name.vmdk

Before you do that please make sure you have flat file already present.

Ashish Singh VCP-6.5, VCP-NV 6, VCIX-6,VCIX-6.5, vCAP-DCV, vCAP-DCD
0 Kudos
dwathi
Contributor
Contributor

Hi,

I have facing the same issue i have one one file with flat.vmdk no other file exist, how do i recover the VM

0 Kudos
ashilkrishnan
VMware Employee
VMware Employee

Hi @dwathi ,

VM needs a base vmdk file in order to point it to a flat.vmdk file. Create a new vmdk  file and point it to your flat.vmdk file.

Please refer instructions here --> Re-creating missing VM descriptor file 

Attach the newly created vmdk to your VM.

Hope that helps

0 Kudos