8.8. Oracle VDI Centers and Failover

8.8.1. Changing the Replication Database Host
8.8.2. Changing the Primary Host in an Oracle VDI Center
8.8.3. Triggering Failover Manually
8.8.4. Removing an Unresponsive Host from an Oracle VDI Center
8.8.5. Tuning Automatic Failover
8.8.6. Configuring the Sun Ray Primary Server in an Oracle VDI Center
8.8.7. Synchronizing the Sun Ray Group Signature and Data Store Password

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 2.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 2.3.2, “Configuring Oracle VDI on a Primary Host”

Section 2.3.3, “Configuring Oracle VDI on a Secondary Host”

Section 2.3.4, “Reconfiguring 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 8.8.1, “Changing 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 8.8.2, “Changing the Primary Host in an Oracle VDI Center”.

The primary host in an Oracle VDI Center is also configured as the Sun Ray Software primary server in the Sun Ray failover group. During automatic failover, the host that is promoted to become the new primary in the Oracle VDI Center is also reconfigured to become the Sun Ray Software primary server. To change the Sun Ray primary server, or to disable the automatic reconfiguration of the Sun Ray primary, see Section 8.8.6, “Configuring the Sun Ray Primary Server 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.

8.8.1. Changing 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 8.8.2, “Changing 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>

    If you specify an empty <host>, 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

8.8.2. Changing 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 8.8.1, “Changing the Replication Database Host”. Follow these steps, to change the primary host.

Caution

By default, when you change the primary host, this causes an interruption to Sun Ray services and all Sun Ray Clients are disconnected.

Steps

  1. Change the primary host.

    Run the following command as root:

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

    Run the following command as root:

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

8.8.3. Triggering 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 8.8.2, “Changing the Primary Host in an Oracle VDI Center” for details.

8.8.4. Removing 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.

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 purge <host>
  2. Check that the change has taken effect.

    Run the following command as root:

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

8.8.5. Tuning 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 MySQL Server 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 8.8.1, “Changing 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.

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

8.8.6. Configuring the Sun Ray Primary Server in an Oracle VDI Center

By default, the primary host in an Oracle VDI Center is also configured as the Sun Ray primary server in the Sun Ray failover group. During automatic failover, the host that is promoted to become the new primary in the Oracle VDI Center is also reconfigured to become the Sun Ray Software primary server. Whenever the Sun Ray Software primary server is changed, this causes an interruption to Sun Ray services and all Sun Ray Clients are disconnected.

You can configure another host in the Oracle VDI Center to be the Sun Ray Software primary server and you can also disable the automatic reconfiguration of the Sun Ray primary server during failover.

If you change the Sun Ray primary server without disabling the automatic reconfiguration of the Sun Ray primary server, Oracle VDI still automatically reconfigures the Sun Ray primary server during failover.

If you disable the automatic reconfiguration of the Sun Ray primary server, Oracle VDI does not automatically reconfigure the Sun Ray primary server during failover. You must manually reconfigure the Sun Ray primary server.

Each Sun Ray server has its own local copy of the Sun Ray datastore, which is used to store information such as information about Sun Ray Clients and tokens. The Sun Ray primary server has read and write access to the datastore, while the Sun Ray secondary servers only have read access. Any changes to the datastore are first written on the primary server and the primary then replicates the changes to the secondaries. If the primary server is unavailable, changes to the datastore cannot be stored. In this situation, the overall Sun Ray system continues to work because most Sun Ray operations only require read access to the datastore, but some things, such as token registration, are not available.

Steps

To display the current Sun Ray primary server in the Oracle VDI Center, run the following command as root:

# /opt/SUNWvda/sbin/vda-center getprops -p srs.primary.host

To change the current Sun Ray primary server in the Oracle VDI Center, run the following command as root:

# /opt/SUNWvda/sbin/vda-center setprops -p srs.primary.host=<host>

To disable the automatic reconfiguration of the Sun Ray primary server, run the following command as root:

# /opt/SUNWvda/sbin/vda-center setprops -p srs.primary.autoconfig=false

8.8.7. Synchronizing the Sun Ray Group Signature and Data Store Password

The Sun Ray servers in an Oracle VDI Center have a group signature and a data store password. When you configure the primary host in an Oracle VDI Center, the group signature and password are created and stored in both the Oracle VDI Center and in the Sun Ray server configuration. The Oracle VDI Center Agent uses these values whenever it adds and removes hosts from the Oracle VDI Center.

It is possible to use the Sun Ray administration tools to change either the group signature or the data store password, but these tools do not update the Oracle VDI Center. If the Oracle VDI Center and the Sun Ray servers are not synchronized, you cannot add hosts to a Oracle VDI Center.

Caution

The following commands display the password and group signature in plain text. For security reasons, ensure that no-one is overlooking you when you run the commands.

To synchronize the data store password for an Oracle VDI Center, use the following command:

# echo <Password> | /opt/SUNWvda/sbin/vda-center setprops -s srs.password

To synchronize the group signature for an Oracle VDI Center, use the following command:

# echo <GroupSignature> | /opt/SUNWvda/sbin/vda-center setprops -s srs.group.signature

To verify that the data store password change has taken effect, run the following command on each host in the Oracle VDI Center:

# /opt/SUNWut/sbin/utpw -p

To verify that the group signature change has taken effect, run the following command on each host in the Oracle VDI Center:

# cat /etc/opt/SUNWut/gmSignature

You might have to perform a warm restart or a cold restart of Sun Ray services on each host in the Oracle VDI Center for the change to take effect. A warm restart temporarily disconnects users and might require them to log in again or unlock their screens. A cold restart terminates all Sun Ray sessions.

For a warm restart, run the following command on each host in the Oracle VDI Center:

# /opt/SUNWut/sbin/utstart

For a cold restart, run the following command on each host in the Oracle VDI Center:

# /opt/SUNWut/sbin/utstart -c