I tried to open up one of my VM's via the console and get an error that says "Virtual machine config file does not exist". Now I was cleaning up some files in the datastore and may have deleted something it is looking for. But there is a .vmx file in the datastore so I am not sure if I deleted the wrong one.
How can I fix this issue?
If you go into Edit Settings of the guest VM and select the option tab there is a box listing the location of the vmx file so you can see if that is the same vmx in your datastore or not. If not one option would be to remove that vm from inventory and then create a new VM using that existing disk file (vmdk). MAC might likely be different but otherwise should be the same machine.
It is possible to delete all the files pertaining to a VM except for the running vmdk and vmswp files. I have done this a few times myself. Unless you have a full backup of all the files, you are pretty much going to have to rebuild the VM configuration. Obviously if the VM is running now, there isn't a problem until you power it off.. then you won't be able to restart, but you should be fine until then.
Looks like the vmx file that is shown for the VM is the right one (or the one that is in the datastore). What are my options now?
Can you read the file, either cat it from the service console or download it from the datastore and see if you can open it in a text editor to make sure it isn't corrupt?
Yes, I was able to download it to my PC and edit it with notepad no problem.
There might be an easier or better way. But you could rename that vmx file so you still have a copy of it. Remove the VM from inventory (right click and select) then create a new VM with the same hardware config and select use existing disk and navigate to the vmdk for that VM. Should work but like I said there could be a better way I'm not aware of.
In order to remove from inventory I have to shut off the vm first right? the selection is greyed out right now. Was hoping to fix this without any downtime. The VM still works now and I was able to RDP to it.
Are you using the client to connect to virtual center server or to the host directly? Wonder if console network traffic is getting blocked some how.
Connecting to the virtual center directly. Thought this would be an easy fix. My other alternative is to wait for off hours and restore from a backup with vRanger.
Was hoping not to have to do that though (any downtime).
Ended up shutting down VM, removed from inventory then added back to inventory. I then chose to create new file and everything is back and working.