This article introduces how to search for host ID from vCenter.
/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)