If the upgrade of a 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 on http://code.vmware.com.

  1. 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.

  2. Power on the primary VMware Cloud Director appliance cell.
  3. 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.
  4. Stop the VMware Cloud Director services on all appliance cells.
    service vmware-vcd stop
  5. Use the primary VMware Cloud Director cell to unregister the secondary nodes in the cluster.
    1. Log in directly or by using an SSH client to the OS of the primary cell as root.
    2. Change the user to postgres.
      sudo -i -u postgres
    3. 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
    4. Repeat 5.c to unregister the other standby appliance cell.
  6. In the vSphere Client, shut down and delete all standby appliances.
    1. In the vSphere Client, navigate to the standby appliances.
    2. Right-click a standby appliance and click Power > Shut Down Guest OS.
    3. Right-click the appliance and click Delete From Disk.
    4. Repeat 6.a through 6.c for the other standby appliance cell.
  7. Verify that the repmgr tool suite and the embedded PostgreSQL database of the primary VMware Cloud Director appliance cell are working properly.
    1. Change the user to postgres.
      sudo -i -u postgres
    2. 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
      
  8. Redeploy the secondary appliances. See Deploy the VMware Cloud Director Appliance by Using the vSphere Client.
  9. 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.
  10. Start the VMware Cloud Director services.
    service vmware-vcd start