Find a vCenter server virtual machine in VCDB (vCenter Database)
search cancel

Find a vCenter server virtual machine in VCDB (vCenter Database)

book

Article ID: 382142

calendar_today

Updated On: 01-14-2025

Products

VMware vCenter Server

Issue/Introduction

It becomes difficult for an administrator to find the vCenter server VM to take a snapshot, especially when vc itself is unavailable.

Finding the vCenter server virtual machine in a large environment consisting of several hosts to take a snapshot prior to troubleshooting.

Environment

vCenter server 6.0.x
vCenter server 7.0.x
vCenter server 8.0.x

 

Cause

When the vCenter server virtual machine is down/unavailable due to some underlying issues on its internal services, it helps in finding the vCenter server VM amongst all available hosts in a large environment.

Resolution

  • Take a SSH to the vCenter server.
  • Connect to the VCDB (vCenter server database) using below command. 

/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres

 

  • Search for the vCenter server vm in the table vpx_vm using its dns_name or ip_address

VCDB=# select dns_name, ip_address, host_id from vpx_vm where dns_name like '%vcenter%';


          dns_name          |  ip_address  | host_id
----------------------------+--------------+---------
 vcenter.server.local       | 192.168.x.x  | xxxx  
(1 row)

 

  • To confirm, which host has the vCenter server VM running.. We corelate the above information and find the dns_name , ip_address of the respective ESXi host using its associated host_id.

VCDB=# select dns_name, ip_address from vpx_host where id = xxxx;
         dns_name         | ip_address
--------------------------+-------------
 esxi1.server.local       | 10.10.x.x
(1 row)

 

  • To safely exit from the VCDB, use below command. 

VCDB=# \q