If you have a production-ready VCD installation, you must create it with a database HA cluster that provides failover capabilities to the VCD database (deployments without database HA are not supported by VMware). The VMware Cloud Director appliance includes an embedded PostgreSQL database. The embedded PostgreSQL database includes the Replication Manager (repmgr) tool suite, which provides a high availability (HA) function to a cluster of PostgreSQL servers. To configure HA for the VCD database in a VCD server group, you configure a database HA cluster by deploying one primary and two standby instances of the VCD appliance.
If the primary database service fails, you can activate VCD to perform an automatic failover to a new primary. The automatic failover eliminates the need for an administrator to initiate the failover action if the primary database service fails to perform its functions for any reason. By default, the failover mode is set to manual.
In this post, I’ll demonstrate how to configure VCD failover mode.
To configure automatic failover, we use the VCD appliance API:
curl -X POST -H "Accept: application/json" -H "Authorization: Basic [[basicHash]]" -H "Accept: application/json" "https://vcd-appliance-ip:5480/api/1.0.0/nodes/failover/automatic"
To configure manual failover, we use the following API call:
curl -X POST -H "Accept: application/json" -H "Authorization: Basic [[basicHash]]" -H "Accept: application/json" "https://vcd-appliance-ip:5480/api/1.0.0/nodes/failover/manual"
It doesn’t matter which appliance instance we use, the configuration will be applied on all appliances in the server group automatically.
Upon success, both calls return a status 202 with empty response body. The response includes the Location header with the URL to the related task-id, e.g. https:
.//
vcd-appliance-ip:5480/api/1.0.0/task/
You can also monitor the cluster status by using the VCD appliance management user interface.
Log in as root to the appliance management UI at https:
.//
vcd-appliance-ip:5480
In the left panel, select Embedded DB Availability. Verify the configured failover mode at the bottom of the page.
Leave a Reply