Search for host ID from vCenter.
search cancel

Search for host ID from vCenter.

book

Article ID: 423874

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

This article introduces how to search for host ID from vCenter.

Resolution

  1. SSH to vCenter with root account.
  2. Execute command. Host ID would be printed at first column.
    /opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres -c "select id,name from vpx_entity where type_id=1;"

 

Example

root@vCenter [ / ]# /opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres -c "select id,name from vpx_entity where type_id=1;"
  id   |     name
-------+--------------
00001 | ESXi-1.com
00002 | ESXi-2.com
00003 | ESXi-3.com
(3 rows)