While this is an older posting, I thought I'd response since I saw it while trying to fix a disconnect VM. I hope this helps those that take the time to get to the end of this posting.
My situation is as follows......
We are running a vSphere 5.5u1, 8 node cluster, with all hosts at ESXi 5.5 (HA wasn't enabled unfortunately) using Avamar backup and Nimble storage. During a maintenance window, several of the VMs exhibited the same behavior as described in KB2001004 (link at the bottom). While migrating several VMs around in order to evacuate hosts for patching, one of the host failed, in the middle of the problem VM recovering from a failure to migrate. Hoping to get the VM fixed before the end of the maintenance window, I began looking for a way to get the VM moved to another host. The host wasn't completely dead because the VM was still running on it. So I had footwork to do.
Paying close attention to this link Help, my hosts/VM’s are disconnected | VMware Support Insider - VMware Blogs I determined there was no way to get the VM off through the parent host as the host was kaput. Next step was to create snapshots on the Nimble for a safety-net, and shutdown the VM from the OS gracefully. I did hope that the VM would be available after the shutdown and reset of the failed ESX host. Certainly it wasn't the case or I wouldn't write this response. Paying close attention to KB2001004 and VMware KB: Investigating virtual machine file locks on ESXi/ESX I realized that the locks existed, but didn't want to cause any self-inflicted wounds by removing or editing files. I still had hope I would find an answer from google-land.
Next was to follow the VMware vCLI documentation and postings found on the InterWebs. I downloaded, installed vCLI and rebooted my virtualdesktop because I thought it would be a great way to solve the problem. I tried to list the VMs and unregister the disconnect VM with the vmare-cmd -H vcenter -U me -P stoopid --vihost esxhost.dummy.net -s unregister -v command.
I don't care for Windows, but dealt with and got the commands to spit me out some errors. Basically, the command is to high-level to do more than look on an existing host for the VM to be running. This was unsuccessful because the parent died already!! Nor could I unregister it from vCenter or another ESXi host. Perhaps trying to register it would have worked, but I was already fed up with the vCLI interface on Windows and moved on. I didn't have the time to waste downloading and configuring the vMA, so back to the CLI on the ESXi host I wanted the VM to reside on.
I couldn't find any esxcli command to help, but I didn't fade just yet. I did think about enabling HA. Not sure if it would have solved the problem, outside of preventing it in the first place. My thoughts were that during HA configuration, the problem VM was not available at the time so it wouldn't have been started.
Long story short, this is how to solve the problem. On the desired parent host with shared access to the datastore, I ran the following command:
vim-cmd solo/registervm /vmfs/path/to/the/vm/vmxfile.vmx
The response was the new value/ID for the newly registered VM of... 42
I validated success by running the following command:
vim-cmd vmsvc/getallvms
Upon validation, I yelled at my keyboard and painfully bright LED screen. Next I checked the fatclient and webclient, which both showed the VM connected and available. I powered it up and all is well again.
I do not know when the namespace was included in ESXi, but know it works. I did search and find many solutions, but none were this easy. I didn't edit or delete files. Nor did I cause other headaches. Just ran one command!
HTH
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2001004