Clone and roll out template fail with “failed to connect to host”

Recently I implemented ESX 3.5 with VirtualCenter 2.5. After I installed the ESX Hosts and the VirtualCenter server the customer told me that I had to change the ip-addresses of the service console. I removed the ESX hosts from the VirtualCenter server, removed the vswif of both hosts with “esxcfg-vswif -d” and created it again with the correct ip-address and subnet. I added both hosts to the cluster again and every thing seemed to work again… until I decided to rollout a template. It took over 10 minutes before the error “failed to connect to host” appeared. Also cloning a VM gave me this same error. Weird thing is that creating, removing and starting VM’s worked fine. So I checked if I was able to clone via vmkfstools from the service console, this also worked. Weird… checked the host files, resolv.conf, sysconfig/network… everything okay.

After a couple of nights sleep I found it: /etc/opt/vmware/vpxa/vpxa.cfg contained the old ip-address in the field “hostIp”. I tried editing the file, but when ever I initiated a clone the hostIp was changed again to the old value. There was not much time left and I suspected the VirtualCenter database so I wiped it out with “vpxd.exe -b”. (Run this command on the VMware VirtualCenter server!) I created the Datacenter and Cluster again, added the hosts and started cloning… everything worked fine again. If any knows a better solution to the problem, because wiping out the VirtualCenter database isn’t my favorite solution, let me know!

13 Responses to “ Clone and roll out template fail with “failed to connect to host” ”

  1. Dus toch de database….hmmm gebeurt iets te vaak de laatste tijd. Vraag me af of het iets met SQL 2005 te maken heeft….

  2. Echt niet normaal, het moest wel zoiets zijn… maar ja ga maar eens zoeken in welke bestand het oude IP adres is blijven hangen. En inderdaad, het “wipen” van de VC DB is niet wat je heel graag doet……..

  3. Had a similliar issue with the same error message when trying storage vmotion.
    wiping the virtual center was not possible.
    What I did was the following:
    - assured the DNS stuff was setup correctly
    - removed the host fom the vc server
    - removed the vpxa.cfg on the host (acctually renamed it)
    - rejoined the host to the vc server (this got me a new vpxa.cfg generated with the correct IP)

  4. Nice one Romeo!
    That works a treat!! You saved me a rebuild of the ESX servers there.
    Cheers! ;-)

  5. I ave found this to work too:
    Stop the VMware VirtualCenter Server service
    Edit the /etc/opt/vmware/vpxa/vpxa.cfg
    Run this script on the database:

    ———–
    UPDATE [VCDB].[dbo].[VPX_HOST]
    SET [IP_ADDRESS] = ‘w.x.y.z’
    WHERE [DNS_NAME] = ‘name of esx host as it is listed in the table’
    ———–

    Of course w.x.y.z above is the new ip address

    Start the VMware VirtualCenter Server service

    The vpxa.cfg file might not have to be edited as it probably would have been changed by the VirtualCenter Service anyway, but I didn’t test that. I just know the above worked for me.

  6. If you check the file has has a different IP, I did the following to correct:

    1. Removed the ESX host from Virtual Center.
    2. Add the host again to Virtual Center.
    3. Check the file, should reflect new IP.

    Note: My error was “Failed to connect to Host”, occured when I tried to clone a VM.

  7. Al’s solution worked for me.

  8. Al, Thanks for the great tip. This worked for me as well.

    1. Put the host in maintenance mode
    2. Remove host from cluster
    3. Add host back to cluster
    4. Exit maintenance mode
    5. Deploy VM from template
    6. All is well.

  9. v4nilla’s steps resolved my issue.. Thanks a lot!!

  10. Thanks to all. Al’s solution worked for me.
    First VM from a template is being deployed now.

  11. We experienced similar, however, simply Disconnecting (not Removing), and then Connecting was sufficient. This updated the VC tables and vpxa configuration on the host.

    If you Remove, you lose all VM history, permissions, etc. I’d prefer not to discard all the history.

  12. I just stopped the service(service vmware-vpxa stop)
    edited vpxa.cfg
    then restarted the service (service vmware-vpxa start)

    and everyting worked great after that.

    Hope this helps

  13. BigRollTide… thank you. Works like a charm.

Leave a Reply