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:
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:
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:
Provide more details or call me via skype.
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.