The vCenter inventory for clusters and datacenters is not displaying. It keeps on loading.
search cancel

The vCenter inventory for clusters and datacenters is not displaying. It keeps on loading.

book

Article ID: 411551

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

All vCenter services are operational. No crash has been detected.
 
The datacenters in the inventory continue to load without any clusters.
 

As per /var/log/vmware/vpxd.logm we see ODBC error as below:

Failed to get exclusive lock: P0001:1:ODBC error: (P0001) - ERROR
: Failed Lock
--> DETAIL: Failed to exclusive lock vCenter repository!;
--> Error while executing the query
 
XXXX-XX-XXT XX:XX:XX.152+02:00 error vpxd[19253] [Originator@6876 sub=Default] Unable to get exclusive access to vCenter repository. Please check if another vCenter instance is running against the same database schema.
XXXX-XX-XXT XX:XX:XX152+02:00 error vpxd[19253] [Originator@6876 sub=Main] Init failed. SystemError: N5Vmomi5Fault11SystemError9ExceptionE(Fault cause: vmodl.fault.SystemError
--> )
--> [context]zKq7AVECAQAAAKlaeQELdnB4ZAAAwuo3bGlidm1hY29yZS5zbwAAWYosANd9LQDf+jIBoTJydnB4ZAABZTRyAUNucgEQxHIBfRlyAocrAmxpYmMuc28uNgABYQ9y[/context]
XXXX-XX-XXT XX:XX:XX153+02:00 warning vpxd[19253] [Originator@6876 sub=VpxProfiler] ServerApp::Init [TotalTime] took 150185 ms
XXXX-XX-XXT XX:XX:XX.153+02:00 error vpxd[19253] [Originator@6876 sub=Default] Failed to intialize VMware VirtualCenter. Shutting down
XXXX-XX-XXT XX:XX:XX.153+02:00 info vpxd[19253] [Originator@6876 sub=SupportMgr] Wrote uptime information
XXXX-XX-XXT XX:XX:XX.153+02:00 info vpxd[19253] [Originator@6876 sub=Default] Forcing shutdown of VMware VirtualCenter now
 

Environment

vCenter 8.x

Cause

Problems caused by faulty VMs or ESXi hosts in the inventory can prevent the vCenter database from loading.

Resolution

  • Log in to the vSphere UI and create a snapshot of the vCenter VM. For vCenters in linked mode, perform an offline snapshot.
  • Use PowerCLI to connect to the vCenter:

    Connect-VIServer -Server <vCenter FQDN>

  • Retrieve the status of the hosts in the cluster by executing the command:

    Get-VMHost

Eg: 

<ESXI_FQDN> NotResponding Unknown

<ESXI_FQDN> NotResponding Unknown

<ESXI_FQDN> NotResponding Unknown

<ESXI_FQDN> NotResponding Unknown

<ESXI_FQDN> NotResponding Unknown

<ESXI_FQDN> Disconnected Unknown

<ESXI_FQDN> Disconnected Unknown

<ESXI_FQDN> Connected PoweredOn 24

<ESXI_FQDN> Disconnected Unknown

  • Stop the vpxd service : service-control --stop vpxd
  • Remove the disconnected hosts from the vCenter database :

    /opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres -c "UPDATE vpx_host SET enabled=0"

  • Execute the script mentioned in the KB article and then reconnect the hosts to the vCenter.

Reference KB : https://knowledge.broadcom.com/external/article/321930/disconnect-hosts-from-vcenter-via-databa.html

Note: All ESXi hosts must share the same root password.