Upgrade to 9.7 is little bit more complicated, because you need to upgrade (if you are using it) PostgreSQL.
Step-by-step guide
- Put vCloud Director + PostgreSQL DB vm’s into maintenance in monitoring system.
- SSH to vCloud VM and shutdown services:
/etc/init.d/vmware-vcd stop
- Start nginx or apache to show temporary web page (this needs to be configured ahead). It’s just for cases, that users are trying to connect and you don’t want to have a lot of calls/tickets why the vCloud is not running/etc/init.d/nginx start
- Check that the temporary page is visible.
-
Do + check a vCloud vm + vCloud DB vm backup
do a PostgreDB backup
- check free spacedf -hsu – postgrespg_dump vcloud > /var/lib/pgsql/vcloud-backup_20200202.sql
- check that backup is not zerols -la /var/lib/pgsql/vcloud-backup_20200202.sql
- output must look similar to this:-rw-r–r– 1 postgres postgres 4114824617 Feb 2 22:03 /var/lib/pgsql/vcloud-backup_20200202.sql
- check free spacedf -hsu – postgrespg_dump vcloud > /var/lib/pgsql/vcloud-backup_20200202.sql
- Do snapshots on both VMs “vCloud Director” + “PostgreSQL DB”
-
Installation and upgrade PostgreSQL DB to v.10
yum install postgresql10-server
sudo systemctl stop postgresql-9.6.service && sudo systemctl stop postgresql-10.service
systemctl stop postgresql-9.6.service
su postgres
/usr/pgsql-10/bin/initdb -E UTF8 –locale=en_US.UTF-8 -D /var/lib/pgsql/10/data/
/usr/pgsql-10/bin/pg_upgrade –old-datadir /var/lib/pgsql/9.6/data/ –new-datadir /var/lib/pgsql/10/data/ –old-bindir /usr/pgsql-9.6/bin/ –new-bindir /usr/pgsql-10/bin/
change /var/lib/pgsql/10/data/pg_hba.conf same as /var/lib/pgsql/9.6/data/pg_hba.conf# TYPE DATABASE USER ADDRESS METHOD
# “local” is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication all trust
#host replication all 127.0.0.1/32 trust
#host replication all ::1/128 trust
host all all 0.0.0.0/0 md5
vi /var/lib/pgsql/10/data/postgresql.conf
listen_addresses = ‘*’
Disable PostgreSQL 9.6 and enable and start PostgreSQL 10
systemctl disable postgresql-9.6.service
systemctl enable postgresql-10.service
systemctl start postgresql-10.service
su postgres
./analyze_new_cluster.sh
./delete_old_cluster.sh
Remove old PostgreSQL service
yum remove postgresql96-server
-
Check that vcloud DB user is owner of the DB in the postgress!!
su postgres
psql
#list DB’s
\l
- if not change owner of DB “vcloud” to user “vcloud” :ALTER DATABASE vcloud OWNER TO vcloud;
\l
\q
- optional you can do second DB backup on new PostgreSQL version
pg_dump vcloud > /var/lib/pgsql/vcloud-backup_pg10_20190505.sql
- if not change owner of DB “vcloud” to user “vcloud” :ALTER DATABASE vcloud OWNER TO vcloud;
- upgrade vCloud to 9.7
- Upload new version/patch to vCloud VM ( ./vmware-vcloud-director-distribution-9.7.0-14535248.bin )
ensure that file is executable +x flag
chmod a+x vmware-vcloud-director-distribution-9.7.0-14535248.bin
- Run the installation bin file
./vmware-vcloud-director-distribution-9.7.0-14535248.bin
- run upgrade script
/opt/vmware/vcloud-director/bin/upgrade
- Dont start vCloudDriector services after upgrade DB. Manually started Nginx is running!
/etc/init.d/nginx stop
/etc/init.d/vmware-vcd start
- Reboot vCloud Director VM
shutdown -r -t 1
- Check vCloud Director: https://_VCLOUD.DOMAIN/
- Run script for checking edge VM
/opt/vmware/vcloud-director/bin/cell-management-tool edge-ip-allocation-updates –host vcloud.domain.xyz –user administrator –status/opt/vmware/vcloud-director/bin/cell-management-tool edge-ip-allocation-updates –host vcloud.domain.xyz –user administrator –update-ip-allocations
- After 1-2 business days delete snapshots + DB backup file.