Let’s look at how to add a standalone host with an ESXi hypervisor to the VMware vCenter Server (vCSA) for centralized management and use in clustered configurations.
Connect to the vCenter Server by opening the vSphere Client URL in your browser ( https://vcenter_server_fqdg_or_ip/ui ).
Select the datacenter, folder, or cluster to which you want to add the new ESXi host:
If you connect to the ESXi console using SSH, you can check the current SHA1 certificate fingerprint:
# openssl x509 -in /etc/vmware/ssl/rui.crt -fingerprint -sha1 -noout
The vpxa agent service is installed on ESXi for host management from the vCenter Server (the hostd service on the vCenter Server sends control commands to the vpxa, which in turn passes them on to the local hostd service).
The new ESXi host appears in the vCenter inventory after a few seconds.
On an ESXi host, you can use the CLI to check which vCenter it is connected to:# configstorecli config current get -c esx -g services -k vpxa_solution_user_config |grep -i server_ip
If you need to add multiple ESXi hosts to vCenter at once, you can use PowerShell to help automate this.
Install VMware.PowerCLI module on the administrator’s computer:
Install-Module -Name VMware.PowerCLI
# Ignore self-signed certificates:
Set-PowerCLIConfiguration -Scope AllUsers -InvalidCertificateAction Warn
Connect to vCenter:
connect-viserver -server vcsa1.woshub.loc
To add an ESXi host to the vCenter Server, use the command:
Add-VMHost -Name 192.168.11.95 -Location HQDC -Force
Type the ESXi host root password:
Check that the host is connected to vCenter:
Use this script if you need to add multiple ESXi hosts to vCenter at once:
$ESXiHosts = "esxi1.woshub.loc", "esxi2.woshub.loc"
$Location = "HQDC"
$credentials = Get-Credential -UserName root -Message "Enter ESXi password"
Foreach ($ESXiHost in $ESXiHosts) Add-VMHost -Name $ESXiHost -Location $Location -User $credentials.UserName -Password $credentials.GetNetworkCredential().Password -RunAsync -force
Write-Host -ForegroundColor GREEN "Adding $ESXiHost to vCenter"
>