Reconnecting or adding an VMware ESXi host to VMware vCenter Server fails with the error: Agent can't send heartbeats because socket address structure initialization is failing
search cancel

Reconnecting or adding an VMware ESXi host to VMware vCenter Server fails with the error: Agent can't send heartbeats because socket address structure initialization is failing

book

Article ID: 327840

calendar_today

Updated On:

Products

VMware vSphere ESXi VMware vCenter Server

Issue/Introduction

Symptoms:

  • Reconnecting or adding VMware ESXi host to VMware vCenter Server displays the error:
    Agent can't send heartbeats because socket address structure initialization is failing.

  • The vpxa.cfg file at /etc/vmware/vpx/vpxa.cfg on the affected host contains the fully qualified domain name (FQDN) of the vCenter Server.
    Example:
    <vpxa>
    <hostIp>host-ip</hostIp>
    <hostKey>xxxxxxx-xxx-xxxxxxx-xxxxxxxxxx</hostKey>
    <hostPort>443</hostPort>
    <licenseExpiryNotificationThreshold>15</licenseExpiryNotificationThreshold>
    <memoryCheckerTimeInSecs>30</memoryCheckerTimeInSecs>
    <serverIp>FQDNofvCenterServer</serverIp>
    <serverPort>902</serverPort>
    </vpxa>

  • The vpxa.log file at /var/log/vpxa/log on the affected host displays an error similar to:
    YYYY-MM-DD_TIME [FFC991A0 error 'Heartbeat' opID=SWI-885de201] Unable to get the socket address structure for the server address :FQDNofvCenterServer

Environment

VMware vCenter Server 6.5.x
VMware vCenter Server 6.7.x
VMware vCenter Server 7.x
VMware vCenter Server 8.x

Cause

This issue occurs when the vpxa.cfg file is created on the ESXi host using the fully qualified domain name of the vCenter Server from the managed_ip value within the vCenter Server database. This value is expected to be an IP address.
 
During the initial connection, vCenter Server connects to the ESXi host through the hostd process. Upon configuration, vCenter Server applies the necessary settings for the vpxa process used by vCenter Server to communicate to the host.

Resolution

To resolve this issue:
  • Verify that the ESXi hosts are able to resolve the fully qualified domain name of the vCenter Server in which they are connected.
  • Verify that the vCenter Server Managed IP address is correct. For more information, see Verifying the VMware vCenter Server Managed IP Address.

Additional Information

To verify the vCenter Server Managed IP address within the vCenter Server database:
 
1. Connect to the vCenter Embedded vPostgres Database from the vCenter Server Appliance:
$ /opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
 
2. Execute this SQL query:
$ select id,dns_name,management_ip from vpx_host where dns_name like 'vCenterFQDN'
 
To update the Managed IP address directly within the vCenter Server database:

1. Take a backup of the vCenter Server database. See Back up and restore vCenter Server Appliance/vCenter Server 6.x vPostgres database

2. Stop the vCenter vpxd service:
  $ service-control --stop vmware-vpxd

3. Execute this SQL query:
  update vpx_host set management_ip = 'Correct vCenter Server IP Address'

4. Start the vCenter Server service.
  $ service-control --start vmware-vpxd

5. Reconnect the ESXi host via the vCenter GUI.