If you care having problems connecting to an ESXi host, your first port of call should be to check the host’s configuration. Things to check include:
- Physical connectivity
- IP/subnet mask
- VLAN on the vSwitch
- VLAN configuration on the physical switch
You can use the ‘Test Management Network’ option in the DCUI to test basic connectivity:
If the network connectivity tests succeed, but the host is still unable to be managed by vCenter or connected to with the vSphere client, then it may be that the hosts management agents need to be restarted. Bear in mind that restarting the management agents on a host may impact tasks that are running on host. You can get a list of running tasks by running the following command at the CLI:
# vim-cmd vimsvc/task_list
Investigating the tasks that are running is covered in this VMware KB article. After reviewing the running tasks, you can decide whether to proceed with restarting the host’s management agents.
Restarting the Management Agents on an ESXi Host
There are a couple of ways in which you can restart a ESXi host’s management agents. You can either use the DCUI or restart the agents via the CLI. Using the DCUI it is just a case of using the ‘Restart Management Agents’ menu option, which can be found under ‘Troubleshooting Options’:
To restart the management agents using the CLI, establish a connection via SSH or use the local console. Run the following commands to restart the vpxa agent and hostd:
/etc/init.d/hostd restart
/etc/init.d/vpxa restart
To restart all management agents on the host, run the command:
services.sh restart
This will restart all ESXi services including vpxa and hostd:
/sbin # services.sh restart Running vmtoolsd stop watchdog-vmtoolsd: Terminating watchdog process with PID 72671 vmtoolsd stopped Running wsman stop Stopping openwsmand Running sfcbd stop ................
The services that will be restarted can be seen if you run ‘chkconfig -io’:
/sbin # chkconfig -io /etc/init.d/lwiod /etc/init.d/SSH /etc/init.d/DCUI /etc/init.d/ESXShell /etc/init.d/usbarbitrator /etc/init.d/lbtd /etc/init.d/vprobed /etc/init.d/storageRM /etc/init.d/hostd /etc/init.d/sensord /etc/init.d/slpd /etc/init.d/memscrubd /etc/init.d/dcbd /etc/init.d/cdp /etc/init.d/vobd /etc/init.d/vpxa /etc/init.d/sfcbd-watchdog /etc/init.d/sfcbd /etc/init.d/wsman /etc/init.d/vmtoolsd
You can see which services are set to start by running ‘chkconfig –list’:
/sbin # chkconfig --list lsassd off netlogond off lwiod on ntpd off SSH on iked off DCUI on ESXShell on usbarbitrator on lbtd on vprobed on storageRM on hostd on sensord on slpd on memscrubd on dcbd on cdp on vobd on vpxa on sfcbd-watchdog on sfcbd on wsman on vmtoolsd on vmware-fdm off
Resetting the Management Network/Interface
Rather than restarting the managements, it may be worth trying a reset on the management interface. To do so, run the following command:
esxcli network ip interface set -e false -i vmk0; esxcli network ip interface set -e true -i vmk0
This command is actually in two parts, the bit before the ‘;’ will disable the interface, while the bit after the ‘;’ will immediately enable it again, thereby performing a ‘reset’.