If the upgrade of your VMware Cloud Director appliance fails, you can use the snapshot of the appliance that you took before the upgrade and roll back the VMware Cloud Director appliance.
Before you begin the rollback, use the VMware Cloud Director appliance API to make a note of the node IDs of the standby nodes in the cluster. See the VMware Cloud Director Appliance API Schema Reference.
- Revert the primary VMware Cloud Director appliance to the snapshot that you took before you started the upgrade.
Read how to restore virtual machine snapshots by using the revert options. See Restore VM Snapshots Using Revert in the vSphere Virtual Machine Administration Guide.
- Power on the primary VMware Cloud Director appliance cell.
- Log in directly or by using an SSH client to the OS of each VMware Cloud Director appliance cell. You must log in as a root user.
- Stop the VMware Cloud Director services on all appliance cells.
service vmware-vcd stop
- Use the primary VMware Cloud Director cell to unregister the secondary nodes in the cluster.
- Log in directly or by using an SSH client to the OS of the primary cell as root.
- Change the user to postgres.
sudo -i -u postgres
- Run the command to unregister a standby appliance cell.
To unregister a standby node that is not running, you must provide the node ID.
/opt/vmware/vpostgres/current/bin/repmgr standby unregister --node-id=node ID -f /opt/vmware/vpostgres/current/etc/repmgr.conf
- Repeat 5.c to unregister the other standby appliance cell.
- In the vSphere Client, shut down and delete all standby appliances.
- Verify that the repmgr tool suite and the embedded PostgreSQL database of the primary VMware Cloud Director appliance cell are working properly.
- Change the user to postgres.
sudo -i -u postgres
- Run the command to check the cluster status.
/opt/vmware/vpostgres/current/bin/repmgr cluster show
The console output shows information about the only node in the cluster.ID | Name | Role | Status | Upstream | Location | Connection string --------+----------+---------+----------------+------------+----------+------------------------ Node 1 | Node name | primary | *running | | default | host=host IP address user=repmgr dbname=repmgr
- Change the user to postgres.
- Redeploy the secondary appliances. See Deploy Your VMware Cloud Director Appliance by Using the vSphere Client.
- Log in directly or by using an SSH client to the OS of each VMware Cloud Director appliance cell. You must log in as a root user.
- Start the VMware Cloud Director services.
service vmware-vcd start