Easy way to List ESXi Hosts associated with VCenter : Postgres

0
C1EBBEB0-0B6C-465F-A476-B335A103A064

Have a situation where your VCenter is offline but you need to get a list of hosts to triage since the VCenter is now AWOL? Quick solution assuming you can SSH to the VCenter.

  1. Putty to the VCenter.
  2. start postgres query by typing : “/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
    (You will now find yourself at a new prompt that looks like : VCDB=#)
  3. Type “VCDB=# select * from vpx_entity where type_id=1;
    You should now be presented with a list of hosts.
  4. You can exit by simply typing, EXIT.

Good luck!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.