I accidentally deleted some files from a running VM.
Followed some instructions to recreate the descriptor file. I still had the flat file and the .vswp files.
Got the guts to try a reboot from within the OS, and it worked.
Then went to ESXi and restarted the VM from there. That worked too!
However when I check the data store I don't see some of the files that are in other VM folders. (.nvram, etc.) Of course there a no log files.
I never rebooted this machine while the descriptor was gone, but now I have no idea if it is really fixed.
Are a couple of reboots all I need to check?
This is the only thing in the VM's data store.
-rw------- 1 root root 12.0G Mar 15 16:41 Apps-938afc05.vswp
-rw------- 1 root root 200.0G Jul 31 20:56 Apps-flat.vmdk
-rw------- 1 root root 497 Jul 31 20:21 Apps.vmdk
-rw------- 1 root root 0 Mar 15 16:41 Apps.vmx.lck
-rw------- 1 root root 110.0M Mar 15 16:40 vmx-Apps-2475359237-1.vswp
Lets assume you have just created a new VM.
The directory will have this files:
name.vmx
name.nvram
name.vmdk
name-flat.vmdk
If you power on this VM the content of the directory will be:
name.vmx
name.nvram
name.vmdk
name-flat.vmdk
name.vmx.lck
name*.vswp
Now lets do some sabotage and delete everything that we can. The content of the directory will have:
name-flat.vmdk
name.vmx.lck
name*.vswp
When you reboot this VM it will work as all the missing files are cached.
If you power off this VM and after a while try to start it again you will not be able to do so.
If the vmx is still cached you will receive the error that name.vmdk is missing.
If the vmx is no longer cached you can not start the VM as the VM will be invalid / orphaned.
---------------------------------------------------------------------------------------------------------
Was it helpful? Let us know by completing this short survey here.
the NVRAM file is the saved version of the BIOS - I'd be concerned that the VM is functioning without a working BIOS.
Consider creating a new "shell" VM and repointing the VMDKs,etc. in the VMX file.
Great.
How do I create a 'shell' VM and repoint the nvram files?
I opened an existing nvram file and its binary.
Also I don't have the vmx file so I can't copy the VM from that.
The vswp files appear to be old and are no longer necessary at all.
The missing nvram is no problem at all - nvram files will be created from scratch if they are missing.
> Then went to ESXi and restarted the VM from there. That worked too!
That is strange - in the directory there is no vmx-file and without vmx there is no VM that can be started.
nvram files weren't created after either restart. I had read that, but I'm curious as to when it happens.
The only thing I haven't tried is powering off, waiting awhile, and then starting. Both were restarts, so perhaps vmx isn't used or is cached somewhere / somehow?
Lets assume you have just created a new VM.
The directory will have this files:
name.vmx
name.nvram
name.vmdk
name-flat.vmdk
If you power on this VM the content of the directory will be:
name.vmx
name.nvram
name.vmdk
name-flat.vmdk
name.vmx.lck
name*.vswp
Now lets do some sabotage and delete everything that we can. The content of the directory will have:
name-flat.vmdk
name.vmx.lck
name*.vswp
When you reboot this VM it will work as all the missing files are cached.
If you power off this VM and after a while try to start it again you will not be able to do so.
If the vmx is still cached you will receive the error that name.vmdk is missing.
If the vmx is no longer cached you can not start the VM as the VM will be invalid / orphaned.
---------------------------------------------------------------------------------------------------------
Was it helpful? Let us know by completing this short survey here.
Thanks.
That's pretty much where I'm at.
I've created a vmx file from another VM and edited it in vi. Not sure if that will work. I'll have to try after 5pm.
This VM is running a print server and some other management software. Nothing critical, but I don't want to rebuild from scratch.
Lucked out and found a backup offsite.
Shut down the VM, and started another one to test.
Got asked if the VM had been moved or copied. Chose copied. Took a bit longer to restart, but it works.
I still had to create a vmxf file to get a veeam job to run. Just found another vmxf file & renamed it to match.
My manually created files did work.
Many lessons learned.