VMware Cloud Community
joeblo1
Contributor
Contributor

Deleted vmx and vmdk files

So I did a very dumb thing...  I had a VM that was renamed to a different name, and when I saw this old host in the datastore, I tried to delete it.  Since the VM is running, the flat files did not get deleted thankfully, and the VM is currently still up and running, but the vmx and vmdk files are gone.  If this VM shuts down, it will not turn back on again.

My question is, what can I do with the VM will it's still up and running?  It is a domain controller, so I am worried about simply doing a backup and restore, which I think could cause something to break on the OS level.  I have seen some suggestions about creating a new VM with the same characteristics and then using the resulting vmx and vmdk files, which I am willing to try.  I can also go to Advanced settings and see a lot of the parameters in the settings.  I am just nervous about turning this host off and never getting it back!!

I'll appreciate anyone's brilliant insights.  Thank you!

0 Kudos
4 Replies
scott28tt
VMware Employee
VMware Employee

If it's only a DC, why not just blow it away and build a new one? Does it have some FSMO roles or run some other services?

I guess you don't have a VM-level backup.

 


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
0 Kudos
joeblo1
Contributor
Contributor

There is other stuff on here too, like our 2FA agent and DFS services.  It's not the end of the world if i have to start over, but ideally I just replace these files.  We have cloud based backups that use an Acronis agent.  I don't know if that qualifies as VM level or not, but I have options to restore to VM or physical server, which implies to me that some hardware IDs on a VM level would change if I tried to do a restore

0 Kudos
IRIX201110141
Champion
Champion

Not a real problem.

  1. Create a new VM and name it _New with the same specs.. but no vDisks
  2. Recreate the missing descriptor like in KB https://kb.vmware.com/s/article/1026353 or https://kb.vmware.com/s/article/76600 . Hint i do it always in the following way: Create a Dummy VM with the vDisk with the same size and scsi controller. Than i copy the dummy descriptor into the right place and edit the content.

Regards,
Joerg

0 Kudos
joeblo1
Contributor
Contributor

Thank you.  I've done largely as you've suggested already and waiting for the weekend to turn the host off and on again to make sure all is well.

I followed this KB:

https://kb.vmware.com/s/article/1002511

which appears to be the manual equivalent of what the script in your KB does, which would've been nice to have come across first.

One thing I've also done since i have a running VM was to get the UUID from the host and replace the reproduced vmx file with the original uuid.  I don't know if a new windows guid would have hurt anything, but I feel it's a good thing to preserve if I have the opportunity.  I followed these instructions for that:

https://www.teimouri.net/find-convert-compare-vmware-virtual-machine-windows-guest-uuid/

 

 

0 Kudos