Disconnected VM templates

April 19th, 2009 by jason Leave a reply »

I woke up in this morning to two failed Veeam backups in my email inbox. The two VMs were both templates I had recently created.

I launched the Virtual Infrastructure Client to see if the VMs had an open snapshot which can cause Veeam backup jobs to fail (it’s a VMware issue, not really a Veeam issue). No snapshots, but the problem was immediately obvious: the VMs were shown as “disconnected“. Typically a disconnected VM immediately ties back to a disconnected host. Not in this case. A quick look at the ESX host that was the owner of the VM showed that it was connected, online, and running powered on VMs.

New territory. How to fix? Right clicking on the VM showed no option to re-“Connect” the VM. Right clicking showed no option to remove from inventory and re-register it.  Hmm.

Solution. I placed the ESX host into maintenance mode which migrated off the running VMs to a different host in the cluster. The only two VMs left were the two disconnected templates. I then right clicked on the host and disconnected it. Immediately after being disconnected, I right clicked on the host and connected it. Both the host and VM templates changed from a disconnected to a connected state. Of course the final step was to remove the host from maintenance mode.

Update: 11/12/10:  Following is an entry from the vCalendar which has a few more options to resolve this issue:

Got a disconnected template? Several solutions exist to resolve the problem:
-Disconnect and reconnect the ESX host which owns the template
-Restart the mgmt-vmware service in the ESX Service Console
-Restart the vCenter service

Advertisement

No comments

  1. Christian says:

    Jason, I ran across the same issue .. since this is kinda stupid to do every week or so, I searched for some solutions. Luckily one of my readers pointed me at a better solution. Simply restart the mgmt-vmware service as root on the ESX box in question. Find the full story at http://blog.barfoo.org/2009/02/04/vmware-vcenter-is-not-connected/.

  2. jason says:

    Thank you for the comment. That is a faster solution if maintenance mode is not used, however, recycling mgmt-vmware has been known to produce ugly results and thus I no longer trust doing so in a production environment with running VMs. Maintenance mode is mandatory. Maybe not in the lab, but in production, I think so.

  3. Eric G says:

    Restarting vcenter service can also reconnect your disconnected templates.

  4. Great post Jason. Also cheers Epic G for teaching me another nifty trick 😀

  5. C Stewart says:

    Hi Jason

    We used to get this happening a lot with our templates, just like you say the hosts did not appear to have disconnected.

    We simply removed the disconnected template entry from the inventory, browse to the datastore and right click the VMTX file and select add to inventory

    This may help avoid maintenance mode and restaring the management services. Especially if you have a change management team who don’t understand VMware ;o)

  6. Allen says:

    You can also just disconnect the host and reconnect the host if you don’t want to do maintenance mode. No need to remove the template and re-register it. Too many of our templates have been renamed, so it is often hard to find which one it is without some manual research prior to removing it. I don’t generally do maintenance mode, but I guess if I had major problems reconnecting the host I would have wished I did…

  7. dunxd says:

    Can confirm that disconnect then reconnect worked for us, and doesn’t disrupt the VMs.

  8. christian b says:

    Great solultion – worked fine for our 3.5.x environment for particalur template.

  9. Lily says:

    Great solution, also worked for our 3.5.x environment. Thanks!