In today’s post, we will look at how to connect to embedded vCenter 6.5 Postgres database via pgAdmin. Postgres database is the default choice of the database in vCenter 6.5 for both the Windows and the appliance.
Note: This method is not officially supported by VMware, so perform this at your own risk.
pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.
The application may be used on Linux, FreeBSD, Solaris, MacOS and Windows platforms to manage PostgreSQL 9.2 and above running on any platform.
pgAdmin can be used to connect to embedded vCenter server 6.5 Postgres database and run queries as we do in Microsoft SQL Management Studio.
Enabling the incoming port 5432 on the vCenter Appliance:
First, you will have to log into the VCSA 6.5 appliance using the root account by taking an SSH session.
Type shell to get into appliance shell.
Run the below command to accept incoming connections on the port 5432.
iptables -I INPUT 1 -p tcp --dport 5432 -j ACCEPT
Edit the pg_hba.conf to accept connections:
By default, Postgres database server remote access disabled for security reasons. To enable this, you will have to allow certain network or IP Addresses to connect to the server.
Edit the pg_hba.conf file and add the following line.
host all all 192.168.1.0/24 trust
By using the above, we are basically allowing all the IP addresses in the network 192.168.1.0 with the subnet mask of 255.255.255.0.
Next, restart the Postgres service on the appliance using the below command.
/usr/lib/vmware-vmon/vmon-cli -r vmware-vpostgres
Connecting to embedded vCenter 6.5 Postgres database:
Firstly, you will have to download the latest version of the pgAdmin from the URL https://www.pgadmin.org/download/windows4.php and install of the remote machine that you are trying to connect from.
Once installed, open pgAdmin, click on Servers > Create > Server
Fill the below details as seen below.
- Name: VCDB
- Host: Appliance IP Address or FQDN(
- Port: 5432
- Maintenance DB: postgres
- Username: vc
- Password: <copy password from vcdb.properties located at C:\ProgramData\VMware\vCenterServer\cfg\vmware-vpx for vCenter Server /etc/vmware-vpx/vcdb.properties for the vCenter Appliance>
- Group: Servers
- SSL Mode: Prefer
Click on Save to start connecting to the Postgres Database. Once a successful connection is established, Expand ‘Server’ > ‘VCDB’ > ‘Databases’ > ‘VCDB’ to see the contents of the database.
I hope this has been informative and thank you for reading!