With vCloud Director 9.0, VMware introduced postgres as supported database for vCD. If you are planning to use postgres as DB, then you should install Postgres v 9.5 on a supported OS.
In our last Post I mentioned that I purposefully configured MSSQL as DB from my new vCD 9.0 installation, as I wanted to test the migration of vCDDB from MSSQL to Postgres. This post is focused on how to do so.
If you are new to postgres and do not know how to install it, then follow this blog for installation instructions which are pretty easy and straight forward.
Once you have installed postgres and started services, next is to create database for vCD. Follow below commands to do so
1: Create Database
1 2 |
postgres=# CREATE DATABASE vcloud; CREATE DATABASE |
2: Verify presence of newly created database
1 2 3 4 5 6 7 8 9 10 11 |
postgres=# l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+----------+----------+---------+-------+----------------------- postgres | postgres | UTF8 | C | C | template0 | postgres | UTF8 | C | C | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | UTF8 | C | C | =c/postgres + | | | | | postgres=CTc/postgres vcloud | postgres | UTF8 | C | C | (4 rows) |
3: Create vCloud user and assign password to user
1 2 3 4 5 |
postgres=# create user vcloud; CREATE ROLE postgres=# alter user vcloud password 'Telstra@123'; ALTER ROLE |
4: Enable the database owner to log in to the database
1 2 |
postgres=# alter role vcloud with login; ALTER ROLE |
5: Grant full permission to vCloud user to vCloud database
1 2 |
postgres=# grant all privileges on database vcloud to vcloud; GRANT |
6: Test the vcloud user access to database