VMware Cloud Community
tseanf
Contributor
Contributor
Jump to solution

Missing VMX file...

Hello,

While cleaning up my data store I accidentally removed a VMX file for a running machine.

The machine is still running (I can remote to it etc), but working with the VM in VIC continually prompts with an error that the file is missing. Although I can go into "Edit Settings" and it shows everything correctly, until I click OK and it errors again.

Is there anyway to build a new VMX file from the running config?

Thanks, any help would be appreciated.

0 Kudos
1 Solution

Accepted Solutions
Dave_Mishchenko
Immortal
Immortal
Jump to solution

Hi there, the main this is that the vmdk (and -flat.vmdk) files still exist. You'll basically need to know the amount of memory, number of NICs, number of virtual CPUs and also the SCSI controller that the VM is using (LSI logic or Buslogic). What OS is the VM running?

Then do the following after you power the current VM down. ESX may have a problem closing the process related to the VM, so if you shut down the VM from within the VM, open a session to ESX and run esxtop to see if the process for the VM actually terminates. That way you'll ensure that nothing is still locking the vmdk for the VM.

1) Create a new VM with the specs you want and a small HD.

2) Edit the VM and remove the HD.

3) Copy the VMDK over from the source to new folder with vmkfstools -i /source_path/source.vmdk /dest_path/destination.vmdk

4) Edit the VM, add a HD and use an existing VMDK file - select the new VMDK that was created.

5) Power on the VM

You may need to reset your IP addresses in the VM after that.

View solution in original post

0 Kudos
8 Replies
Santhosh_vmware
Jump to solution

Hi,

Create a new VM with identical configuration and use the exisiting disks.

regards

santhosh

tseanf
Contributor
Contributor
Jump to solution

How do I do that, do I just create a new VM, have it create an identical size disk, then copy the other one over it?

0 Kudos
Dave_Mishchenko
Immortal
Immortal
Jump to solution

Hi there, the main this is that the vmdk (and -flat.vmdk) files still exist. You'll basically need to know the amount of memory, number of NICs, number of virtual CPUs and also the SCSI controller that the VM is using (LSI logic or Buslogic). What OS is the VM running?

Then do the following after you power the current VM down. ESX may have a problem closing the process related to the VM, so if you shut down the VM from within the VM, open a session to ESX and run esxtop to see if the process for the VM actually terminates. That way you'll ensure that nothing is still locking the vmdk for the VM.

1) Create a new VM with the specs you want and a small HD.

2) Edit the VM and remove the HD.

3) Copy the VMDK over from the source to new folder with vmkfstools -i /source_path/source.vmdk /dest_path/destination.vmdk

4) Edit the VM, add a HD and use an existing VMDK file - select the new VMDK that was created.

5) Power on the VM

You may need to reset your IP addresses in the VM after that.

0 Kudos
Dave_Mishchenko
Immortal
Immortal
Jump to solution

You don't want to overwrite the existing VMDK files and regardless of the method you use, first run vmkfstools -i to make a copy of the virtual disk. That way if anything goes wrong you'll have a backup.

When you add a virtual disk to a VM you have the option to use an existing disk or to create a new one. Choose the existing disk option and then browse to your vmdk file.

tseanf
Contributor
Contributor
Jump to solution

This worked well, thanks!

0 Kudos
vincej2022
Contributor
Contributor
Jump to solution

Will this work if there are snapshots?

0 Kudos
vincej2022
Contributor
Contributor
Jump to solution

Will this work if there are snapshots?

Tags (1)
0 Kudos
continuum
Immortal
Immortal
Jump to solution

No - it is better to extract the vmx-file from a recent vmware.log.
If you lost both the vmware.logs and the vmx-file then post the vmdk-descriptorfiles ( use WinSCP to download them )
then we can create a vmx for you.

Ulli


________________________________________________
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