How to change the default password of VMware vCenter Server embedded vpostgres database on Windows
search cancel

How to change the default password of VMware vCenter Server embedded vpostgres database on Windows

book

Article ID: 322829

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

This article provide steps to change the default password of VMware vCenter Server (windows) database.

Environment

VMware vCenter Server 6.0.x
VMware vCenter Server 6.7.x
VMware vCenter Server 6.5.x

Resolution

To change the vCenter Server user password in embedded vpostgres database:
  1. Connect to the Windows OS installed in vCenter Server.
  2. Open the command prompt and stop all services by running this command to avoid inconsistency (downtime start):
"C:\Program Files\VMware\vCenter Server\bin\service-control" --stop --all
  1. Start the vPostgress service:
"C:\Program Files\VMware\vCenter Server\bin\service-control" --start vPostgres
  1. Change the vc user password, if needed:
    1. Go to the C:\ProgramData\VMware\vCenterServer\cfg\vmware-vpx\vcdb.properties folder and make a note of vc user password.
    2. Go to C:\Program Files\VMware\vCenter Server\vPostgres\bin\ directory in the command prompt.
    3. Log into the vpostgres database as vc user by running this command and use the password from step #a:
psql -d VCDB -U vpostgres
  1. Use this command to change the password:
\password
  1. Run this command and enter the "new-password" when prompted:
"C:\Program Files\VMware\vCenter Server\vpxd\vpxd.exe" -p

Note: If you want to change vpostgres user password, follow below steps. If not skip to step #5.
  1. Change the postgres user password, if needed:
    1. Go to the C:\Windows\System32\config\systemprofile\AppData\Roaming\postgresql\pgpass.conf file and make a note of postgres user password.
    2. Go to C:\Program Files\VMware\vCenter Server\vPostgres\bin\ directory in the command prompt.
    3. Login in the database as postgres user with password from step #a:
 psql -d postgres -U postgres

Example: Default port is 5432, in case of custom port is in use like 5433 or any other port try below syntax:
 psql.exe -d postgres -U postgres --port=5433
  1. Change password:
\password
  1. Edit the pgpass.conf file with the new postgres user password.
 
  1. After all user password changes stop the vpostgres service and start all after that (downtime ends).
"C:\Program Files\VMware\vCenter Server\bin\service-control" --stop vPostgres
"C:\Program Files\VMware\vCenter Server\bin\service-control" --start --all


Additional Information

Impact/Risks:
This procedure modifies the database. Ensure to take a backup of the database before proceeding.