Migrating from vCD 8.20 on Oracle DB to VCD 9.7.0.5

I didn’t expect this to show on my doorsteps, however, it did and I am glad it did as I learned new things :).

Before going through the migration flow and phases, you should know that this output was not produced before validating interoperability matrices, supported upgrade paths, and product interdependencies, and as such, this is purely tied to Cloud Director and presumes that you have taken care of the holistic upgrade planning in terms of the infrastructure and solutions consuming/supporting VCD.

The Migration Workflow

Phase [1] – Upgrade to 9.1.0.4

  1.  Prerequisites:
    1. Backup the VCD cells, NFS VM and DB VM.
    2. Snapshot the VCD cells, NFS VM and DB VM.
    3. Take a database dump.
    4. Download VMware vCloud Director 9.1.0.4 binary [vmware-vcloud-director-distribution-9.1.0-16217122.bin].
  2. Upgrade Process:
    1. Shutdown the VCD services:
      • /opt/vmware/vcloud-director/bin/cell-management-tool -u <SYSTEM ADMINISTRATOR> cell –quiesce true
      • /opt/vmware/vcloud-director/bin/cell-management-tool -u <SYSTEM ADMINISTRATOR> cell –shutdown
    2. Upload the new binary to the cells and chmod it to 777.
    3. Install the new VCD version on all cells:
      • ./vmware-vcloud-director-distribution-9.1.0-16217122.bin
      • Do not start the VCD services.
    4. Upgrade the database schema (one of the cells only):
      • /opt/vmware/vcloud-director/bin/upgrade
      • Once the database schema is upgraded start the VCD services:
      • On all cells -> service vmware-vcd start
      • systemctl daemon-reload
      • Login to the VCD portal and verify.
  3. Problem accessing /cloud/saml/login/alias/vcd. Reason: Server Error:
    1.  Add to the VCD URL /cloud/login.jsp -> Administration -> Federation -> Untick Use SAML Identity Provider and Apply.

Phase [2] – Transit Database Migration to PostgreSQL

  1. Prerequisites:
    1. Backup the VCD cells, NFS VM and DB VM.
    2. Snapshot the VCD cells, NFS VM and DB VM.
    3. Take a database dump.
    4. 1 x temporary IP in the same range of the database server and reachable from the VCD cells (communication matrix may need to be revised and a change might be required).
  2. Migration Process:
  3. Create a Transit PostgreSQL Database VM:
    1. Provision a CentOS 8 VM and perform initial configuration.
  4. Install PostgreSQL:
    1. dnf module list postgresql -> make sure 10 is the default.
    2. dnf install postgresql-server
    3. postgresql-setup –initdb
    4. systemctl enable postgresql
    5. systemctl start postgresql
  5.  Configure PostgreSQL:
    1.  su – postgres
    2.  psql
    3. \password <- Set password to access PSQL (optional if you’re doing this in one shot, otherwise its better to set it).
    4. vi /var/lib/pgsql/10/data/pg_hba.conf
      •  Modify -> local all all  peer to local all all  md5
      •  Add -> host all all 0.0.0.0/0 md5
    5. vi /var/lib/pgsql/10/data/ postgresql.conf
      • Modify listen_addresses -> remove # and change localhost to *
  6. Create Cloud Director Transit DB:
    1. su – postgres
    2. create user vcloud with password ‘PASSWORD’;
    3. create database vcloud owner vcloud;
    4. alter role vcloud with login.
  7. Migrate VCD 9.1 database to external PostgreSQL:
    1. SSH to all VCD cells.
    2. service vmware-vcd stop
    3. /opt/vmware/vcloud-director/bin/cell-management-tool dbmigrate -dbhost <External PostgreSQL IP> -dbport 5432 -dbuser vcd-dba -dbname vcloud -dbpassword PASSWORD –private-key-path /vcloud/.ssh/id_rsa
      Text Description automatically generated
  8. service vmware-vcd stop
  9. service vmware-vcd start
  10. Double check on all cells that reponse.properties is now pointing to the external PostgreSQL DB server.
  11. Shutdown the Oracle Database Server.

Phase [3] – Upgrade from VCD 9.1.0.4 to VCD 9.7.0.5

  1. Prerequisites:
    1. Backup the VCD cells, NFS VM and DB VM.
    2. Snapshot the VCD cells, NFS VM and DB VM.
    3. Download VMware Cloud Director 9.7.0.5 Binaries [vmware-vcloud-director-distribution-9.7.0-16082348.bin].
    4. Attain VCD 9.7 licenses.
  2. Upgrade Process:
    1. Shutdown the VCD services:
      1.  /opt/vmware/vcloud-director/bin/cell-management-tool -u <SYSTEM ADMINISTRATOR> cell –quiesce true
      2.  /opt/vmware/vcloud-director/bin/cell-management-tool -u <SYSTEM ADMINISTRATOR> cell –shutdown
    2. Upload the new binary to the cells and chmod it to 777.
    3. Install the new VCD version on all cells:
      1. ./vmware-vcloud-director-distribution-9.7.0-16082348.bin
      2. Do not start the VCD services.
    4. Upgrade the database schema (one of the cells only):
      1. /opt/vmware/vcloud-director/bin/upgrade
    5. Once the database schema is upgraded start the VCD services:
      1. On all cells -> service vmware-vcd start
      2. systemctl daemon-reload
  3. Login to the VCD portal and verify.          

Phase [4] – Migrate to VCD 9.7.0.5 Appliance

  1. Prerequisites:
    1. Backup the VCD cells, NFS VM and DB VM.
    2. Snapshot the VCD cells, NFS VM and DB VM.
    3. A new VXLAN to be used for VCD backend.
    4. Download VMware Cloud Director 9.7.0.5 Virtual Appliance [VMware_vCloud_Director-9.7.0.4862-16082348_OVF10.ova].
    5. Create a new NFS export and add permissions to all IPs (including the temporary one) to both old and new NFS shares.
  2. Create a PostreSQL database dump:
    1. SSH to the transit database server.
    2. mkdir /db-backup && chmod 777 /db-backup
    3. su – postgres
    4. /usr/bin/pg_dump -Fc vcloud -W > /db-backup/vcloud_db_dump
  3. Configuration Files Backup (Old Primary):
    1. Backup the global.properties, responses.properties, certificates, proxycertificates and truststore from -> /opt/vmware/vcloud-director/etc/
  4. Copy the old Java keystore to the new appliance.
  5. Shutdown all current VCD cell VMs.
  6. Deploy a VCD 9.7.0.6 Appliance:
    1. Deploy a VCD 9.7.0.6 appliance via OVA and use the primary IP of the first cell for the eth0 and an IP from the new VXLAN for eth1 (backend).
    2. Once the 9.7 is up, SSH to it and stop the VCD service -> service vmware-vcd stop.
    3.  Upload the database dump and configuration backup files to the new appliance.
  7. Migrating the database:
    1. Copy the database dump to /tmp
    2. chmod 777 /tmp/database_dump
    3. Drop the default vcloud database -> sudo -i -u postgres /opt/vmware/vpostgres/current/bin/psql -c ‘DROP DATABASE vcloud;’
    4. Restore the database from the dump -> sudo -u postgres /opt/vmware/vpostgres/current/bin/pg_restore -C -d postgres /tmp/database_dump
  8. Configuration Files Backup (New Primary):
    1. Backup the global.properties, responses.properties, certificates, proxycertificates and truststore from -> /opt/vmware/vcloud-director/etc/
    2. Copy the default Java KeyStore (/opt/vmware/vcloud-director/certificates.ks).
  9. Restore the configuration files that were captured from the old primary appliance to the new primary appliance (without the certificate KeyStore as this will replaced later for all cells) -> /opt/vmware/vcloud-director/etc/
  10. Reconfigure the new primary:
    1. /opt/vmware/vcloud-director/bin/configure –unattended-installation –database-type postgres –database-user vcloud –database-password db_password_new_primary –database-host eth1_ip_new_primary –database-port 5432 –database-name vcloud –database-ssl true –uuid –keystore /opt/vmware/vcloud-director/certificates.ks –keystore-password root_password_new_primary –primary-ip appliance_eth0_ip –console-proxy-ip appliance_eth0_ip –console-proxy-port-https 8443
      • The –keystore-password value matches the initial root password of this appliance.
      • The –database-password value matches the database password that you set during the appliance deployment.
      • The –database-host value matches the eth1 network IP address of the primary appliance.
      • The –primary-ip value matches the eth0 network IP address of the appliance.
      • The –console-proxy-ip value matches the eth0 network IP address of the appliance.
      • The –console-proxy-port value matches the appliance console proxy port 8443.
  11. Start the VCD services -> service vmware-vcd start
  12. Connect to the VCD portal, wait for a period of 10 minutes or less and then delete all of the disconnected cells.

Phase [5] Expand the VCD Cluster

  1. Deploy two new appliances using the old IPs of the other cells.
  2. Make sure that all of database status is healthy and up and running.
  3. Replace the Java KeyStore on all cells with the old one -> /opt/vmware/vcloud-director/bin/cell-management-tool certificates -j -p –keystore /opt/vmware/vcloud-director/data/transfer/certificates.ks –keystore-password PASSWORD
  4. Make sure to modify the ConsoleProxy address to the eth0 FQDN in Public Addresses.

References:

  • https://docs.vmware.com/en/VMware-Cloud-Director/9.1/com.vmware.vcloud.admin.doc/GUID-30090914-3BB8-4743-BD8B-C29FA863C034.html
  • https://docs.vmware.com/en/VMware-Cloud-Director/9.7/com.vmware.vcloud.install.doc/GUID-D8D2BB80-E9C0-44A8-9531-5F36FAE1F0C1.html
  • https://www.postgresql.org/download/linux/redhat/

2486 Total Views 1 Views Today

Abdullah

Knowledge is limitless.

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.