How to Configure XenDesktop for SQL Database Mirroring

How to Configure XenDesktop for SQL Database Mirroring

book

Article ID: CTX127359

calendar_today

Updated On:

Description

This article describes how to perform the following tasks:

  • Configure a XenDesktop site with a mirrored SQL Server database.

  • Join a XenDesktop controller to an existing site that is configured to use a mirrored SQL server database.

  • Remove a XenDesktop controller from an existing site that is configured to use a mirrored SQL server database.

    Note: Configuring mirroring on a database for a deployed XenDesktop site requires the execution of PowerShell and database scripts. This is outside the scope of this article.

    Refer to eDoc link for information on configuring XenDesktop 7.x.


Instructions

Configuring a Site for Use with a Mirrored Database

To configure a XenDesktop site for use with a mirrored SQL Server database, complete the following steps:

  1. Create an empty database on the principal with the "Latin1_General_100_CI_AS_KS" collation sequence.

    Note: If you plan to change the location of your secondary databases (Configuration Logging and Monitoring databases), you can create two more empty databases as above.

  2. Configure the mirror and notice that it starts mirroring. For more information, see How to: Prepare a Mirror Database for Mirroring (Transact-SQL)

  3. Deploy Desktop Studio using Advanced Deployment in one of the following ways:

    1. Create the database automatically; mirroring is detected without user intervention.

    2. Create the database manually; two scripts are generated: one to be executed on the principal and one to be executed on the mirror. If you are executing the scripts using SQL Server Management Studio, enable the SQLCMD mode before executing the scripts. After executing the scripts, test the database connection by clicking Test connection and continue through the remainder of the wizard.

To verify mirroring after the wizard has completed, run the PowerShell cmdlet get-configdbconnection and ensure that the Failover Partner is set in the connection string to the mirror.

Note: If you created separate database locations for the Secondary databases, you can follow the instructions at http://docs.citrix.com/en-us/xenapp-and-xendesktop/7-5/cds-install-config-intro/cds-change-db-location.html to change the location of Configuration Logging and Monitoring database. At this point the main database along with the secondary databases are in the same location.

Consideration for configuring Mirrored Database on SQL 2016 servers:
If the mirroring is configured using SQL Server 2016, we would not get correct values under ExtraInfo while running Test-DBconnection unless we provide sysadmin server role to DDC machine accounts on SQL server. This is a known limitation observed due to changes in permission models of SQL form 2016 on wards and is not required on SQL 2008 R2 setups. Public role works correctly in testing the access to Mirror Server on 2008 R2 Servers.

Connection for Mirror Server is shown as Failed under ExtraInfo, when tests on DBConnection strings are run:
 

Database.Server.0.Name            <Principal Server Name>,Port
Database.Server.0.ConnectionResult Success
Database.Server.1.Name            <Mirror Server Name>
Database.Server.1.ConnectionResult Fail

Post providing sysadmin role to controller account on SQL, the information would look like:
Database.Server.0.Name            <Principal Server Name>,Port
Database.Server.0.ConnectionResult Success
Database.Server.1.Name            <Mirror Server Name>
Database.Server.1.ConnectionResult Success


Joining a Controller

To join a XenDesktop controller to an existing site that is configured to use a mirrored SQL server database, run the Join Existing Site wizard in one of the following ways:

  • Update the database automatically; mirroring is detected without user intervention.

  • Update the database manually; two scripts are generated: one to be executed on the principal and one to be executed on the mirror. If you are executing the scripts using SQL Server Management Studio, enable the SQLCMD mode before executing the scripts.

To verify mirroring after the wizard has completed, run the PowerShell cmdlet get-configdbconnection and ensure that the Failover Partner has been set in the connection string to the mirror.

Removing a Controller

To remove a XenDesktop controller from an existing site that is configured to use a mirrored SQL server database, run the Remove Controller wizard in one of the following ways:

  • Update the database automatically; mirroring is detected without user intervention.

  • Update the database manually; two scripts are generated: one to be executed on the principal and one to be executed on the mirror. If you are executing the scripts using SQL Server Management Studio, enable the SQLCMD mode before executing the scripts.

Environment

This software application is provided to you as is with no representations, warranties or conditions of any kind. You may use and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that: (a) the software application may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the software application fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the software application. In no event should the software application be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SOFTWARE APPLICATION, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the software application.

Issue/Introduction

This article describes how to configure a XenDesktop site for use with a mirrored SQL server database.