9.8. Oracle VDI Centers and Failover

9.8.1. How to Change the Replication Database Host
9.8.2. How to Change the Primary Host in an Oracle VDI Center
9.8.3. How to Trigger Failover Manually
9.8.4. How to Remove an Unresponsive Host from an Oracle VDI Center
9.8.5. How to Tune Automatic Failover

Failover enables an Oracle VDI Center to recover automatically from the loss of the primary host. Failover is available only when an Oracle VDI Center is configured for high availability. High availability is enabled automatically when you add the first secondary host to the Oracle VDI Center. See Section 3.1, “About Oracle VDI Centers and Hosts” for details of Oracle VDI Center configuration and high availability.

You add and remove hosts from an Oracle VDI Center with the vda-config command. See the following for more information:

Section 3.6, “How to Configure Oracle VDI on a Primary Host”

Section 3.7, “How to Configure Oracle VDI on a Secondary Host”

Section 3.9, “How to Reconfigure Oracle VDI on a Host”

Failover happens automatically and is triggered by a failure of the primary host in an Oracle VDI Center. During failover, the secondary host with the replication database is automatically promoted to become the new primary in the Oracle VDI Center. When connectivity to the original primary is restored, the original primary is reconfigured as a secondary host and it hosts the replication database.

An Oracle VDI Center can only have one replication database, all other secondary hosts have no database role. To change the replication host, see Section 9.8.1, “How to Change the Replication Database Host”. If you are using a remote database instead of the embedded MySQL Server database, high availability for the database is configured outside of Oracle VDI.

To change the primary host in an Oracle VDI Center manually, see Section 9.8.2, “How to Change the Primary Host in an Oracle VDI Center”.

The Oracle VDI Center Agent is the component that provides secure communication between Oracle VDI hosts and it handles automatic failover and other configuration changes to Oracle VDI Centers.

9.8.1. How to Change the Replication Database Host

If you are using the embedded MySQL Server database, the primary host in the Oracle VDI Center runs the Oracle VDI database (the master database). The first secondary host that is added to the Oracle VDI Center is configured to host the replication database (the slave database). Follow these steps, to change the replication database host. To change the host that runs the master database, see Section 9.8.2, “How to Change the Primary Host in an Oracle VDI Center”.

Oracle VDI Manager Steps

  1. Go to Settings → VDI Center.

  2. Go to the Database tab.

    A list of the Oracle VDI hosts in the VDI Center is displayed.

  3. Select an Oracle VDI host and click Activate VDI Database Replication.

    A message is displayed that says the new replication host is activated.

CLI Steps

  1. Change the replication host.

    Run the following command as root:

    # /opt/SUNWvda/sbin/vda-center setprops -p db.replication.host=<host name>

    If you specify an empty <host name>, you turn off replication and high availability.

  2. Check that the change has taken effect.

    Run the following command as root:

    # /opt/SUNWvda/sbin/vda-center status

9.8.2. How to Change the Primary Host in an Oracle VDI Center

The primary Oracle VDI host forms the Oracle VDI Center. When you change the primary host, the original primary is reconfigured as a secondary host and hosts the replication database (if you are using the embedded MySQL Server database). To change the replication database host, see Section 9.8.1, “How to Change the Replication Database Host”. Follow these steps, to change the primary host

CLI Steps

  1. Change the primary host.

    Run the following command as root:

    # /opt/SUNWvda/sbin/vda-center setprops -p vda.primary.host=<host name>
  2. Check that the change has taken effect.

    Run the following command as root:

    # /opt/SUNWvda/sbin/vda-center status

9.8.3. How to Trigger Failover Manually

In some circumstances you might want to trigger failover manually, for example if automatic failover is unsuccessful. To trigger failover manually, you change the secondary host that has the replication database to be the primary host in the Oracle VDI Center. See Section 9.8.2, “How to Change the Primary Host in an Oracle VDI Center” for details.

9.8.4. How to Remove an Unresponsive Host from an Oracle VDI Center

Normally you use the vda-config command to add and remove hosts from an Oracle VDI Center. However if a host becomes unresponsive, you might not be able use this command. In this situation, you can force the removal of the host from the Oracle VDI Center.

CLI Steps

  1. Remove the host from the Oracle VDI Center.

    Run the following command as root on any of the remaining hosts in the Oracle VDI Center:

    # /opt/SUNWvda/sbin/vda-center leave -l <log file> -s -f <host name>
  2. Check that the change has taken effect.

    Run the following command as root:

    # /opt/SUNWvda/sbin/vda-center status

9.8.5. How to Tune Automatic Failover

It is possible to adjust the properties for an Oracle VDI Center to tune the automatic failover behavior. The following table lists the available properties and what they control.

PropertyDescription

db.connection.timeout

The connection timeout in milliseconds for database connections.

The Oracle VDI Service reports a database error to the Oracle VDI Center Agent, if an attempt to connect to the Oracle VDI database takes longer than this timeout.

The default is 1000 milliseconds.

db.failover.timeout

The period of time in seconds that the Oracle VDI Center Agent waits before starting failover.

The Oracle VDI Center Agent monitors the database error reports from the Oracle VDI Service. If database errors are reported continuously for this period of time, the database is considered as failed. If the embedded Oracle VDI database is used, failover is triggered.

The default is 15 seconds.

db.replication.config

Whether the Oracle VDI Center Agent automatically configures database replication. The permitted values are true or false.

If set to true, the automatic configuration of the replication database on a secondary host takes place when the first secondary is added or a failover is performed.

If set to false, the automatic configuration of the replication database does not take place. High availability is disabled until an administrator manually configures a replication database host, see Section 9.8.1, “How to Change the Replication Database Host”. This provides you with more control over the host that is used for the replication database but means that high availability has to be configured manually..

The default is true.

CLI Steps

  1. Configure the required properties.

    Run the following command as root:

    # /opt/SUNWvda/sbin/vda-center setprops -p <key>=<value>

    For example:

    # /opt/SUNWvda/sbin/vda-center setprops -p db.failover.timeout=20
  2. Check that the change has taken effect.

    Run the following command as root:

    # /opt/SUNWvda/sbin/vda-center listprops