VMware Cloud Community
Masenko
Contributor
Contributor

Disconnected Host in vcenter. Vm's are still on and running. How to register the vm's on a different host

Hello all,

We have a problem with one of our hosts in our enviroment.

De host is disconnected, the vm's are still running on it, but we cant reconnect the host to vcenter.

We can't connect to the host anymore with ssh and if we use the ALT + F1 function then no prompt appears.

So if we have read all the articles correctly the only thing left for us to do is disconnect the host from vcenter (if this is still even possible) en then re-register the vms on a different host.

Our concern with this step is what will happen with the vm's that are running on the host when we say: remove in vcenter.

Will the machines keep on running? and even though they are running on the removed host can we re-register them on a host that is still in the cluster ?.

Cause we thought this should be the procedure:

1. remove the host from vcenter

2. re-register the vm's on different host(s)

3. Turn of the machine that is running on the disconnected host

4. Turn on the machine re-regsitered on the cluster host(s)

Can anyone have a read through this and give us a little hope that this will have a good percentage of succeeding..?

Thanks in advance for any assistance.

11 Replies
Masenko
Contributor
Contributor

We are running 4.1.0 vcenter/esx, drs & ha are enabled. shared storage indeedy. disconnected vm's registered to a host that has become inaccessible. (also disconnected)

The reason i specificly asked for the register part is because i've read several posts that state, that i won't be able to re-register them because they are up and running on the inaccessible host. or will the greyed out part dissappear after i have removed the host from vcenter ?

I wanna be sure i have the affected vm's already registered on the cluster hosts so that when i say: shutdown on the vm on the inaccessible host. i know i can start them on the clustered hosts.

Reply
0 Kudos
abhilashhb
VMware Employee
VMware Employee

What error does it give when you try to connect it again to vcenter?

Abhilash B
LinkedIn : https://www.linkedin.com/in/abhilashhb/

Reply
0 Kudos
abhilashhb
VMware Employee
VMware Employee

Are you able to connect to the host directly using vSphere client?

Abhilash B
LinkedIn : https://www.linkedin.com/in/abhilashhb/

Reply
0 Kudos
Masenko
Contributor
Contributor

No every attempt to connect using, ssh or the vsphere client doesnt work.error_connect.png And this is the error.

Reply
0 Kudos
admin
Immortal
Immortal

Since locks exists you might not be able to register the VMs to another host while is connected to another host.
But if you can afford the downtime for your VMs  PowerOff the ESXi host, so that HA will restart all your VMs on other hosts if resources are available.

But have look at the following KB which helps you to diagnose the connection problems... VMware KB: Diagnosing an ESXi/ESX host that is disconnected or not responding in vCenter Server

~dGeorgey

Reply
0 Kudos
devnull4
Contributor
Contributor

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=200100...

sajustice
Contributor
Contributor

I can verify that the solution listed by devnull4 does work.

SSH to a different host in the cluster and use the vim-cmd solo/registervm /vmfs/volumes/DataStore/VM/vmname.vmx command to register the VM on the new host.  Once you do this the Host will inform Vcenter and the machine will be accessible again.  Now go back to Vcenter and power on the VM and you are good to go.

jcspino
Contributor
Contributor

devnull4 you just saved the day over here! Your process worked like a charm to get the VMs re registered on another host and then I just had to change the port to get the vm reconnected to my dVS. Thank YOU!

Reply
0 Kudos
hfigueredo
Contributor
Contributor

Thank you. His help has been invaluable.

Reply
0 Kudos
michal_ol
Contributor
Contributor

Hi,

Slightly easier version. Instead of using ssh you can just connect to another esxi host directly using root user with Vsphere Client. Browse datastore find vm and vmx file and use option add to inventory. Vcenter will pick up that VM has been started on another host from cluster and VM will be available again.

Regards

Michal

Reply
0 Kudos
daz_fast
Contributor
Contributor

Not if it's locked, and that was the problem...

Reply
0 Kudos