How to Configure XenApp and XenDesktop 7.x for AlwaysOn configuration

How to Configure XenApp and XenDesktop 7.x for AlwaysOn configuration

book

Article ID: CTX216504

calendar_today

Updated On:

Description

This article describes how to reconfigure an already configured XenApp and XenDesktop Site to work on an AlwaysOn setup. It also provides generic instructions for changing the database connection strings used by XenApp and XenDesktop 7.x..


Instructions

- IMPORTANT: Take full database backup of XenDesktop database and snapshots of DDC server(s) before proceeding 

The procedure to reconfigure the controllers for AlwaysOn setup is as below:

1. Nullify all the SQL connection strings for all the FMA services on one controller
2  Reconfigure the SQL connection strings for all the FMA services.
3. Test the connection by executing the below powershell command let.
     a. asnp Citrix*.
     b. Get-command Get*servicestatus
     c.  Execute all the commands retrieved by Get*servicestatus to expect "OK" for all FMA services
4. If test fails for any of the services, follow: https://support.citrix.com/article/CTX212941.
5. Follow steps 1-4 for rest of the controllers in the site.

 Detailed description to perform the Above steps:

1. Nullify the connection strings on the controllers
Set-AnalyticsDBConnection -DBConnection $null -force             #  7.6 and newer
Set-AppLibDBConnection -DBConnection $null -force                  # 7.8 and newer
Set-OrchDBConnection -DBConnection $null -force                    #  7.11 and newer
Set-TrustDBConnection -DBConnection $null -force                    #  7.11 and newer

Set-HypDBConnection -DBConnection $null -force
Set-ProvDBConnection -DBConnection $null -force                     
Set-BrokerDBConnection -DBConnection $null -force
Set-EnvTestDBConnection -DBConnection $null -force
Set-SfDBConnection -DBConnection $null -force
Set-MonitorDBConnection -DataStore Monitor -DBConnection $null -force
Set-MonitorDBConnection -DBConnection $null -force
Set-LogDBConnection -DataStore Logging -DBConnection $null -force
Set-LogDBConnection -DBConnection $null -force
Set-ConfigDBConnection -DBConnection $null  -force
Set-AcctDBConnection -DBConnection $null -force
Set-AdminDBConnection -DBConnection $null -force


2. Set the connection strings for AlwaysOn setup:
 
## Replace <dbserver> with the New SQL server, and instance if present
## Replace <dbname> with the name of your restored Database
## Note: AdminDBConnection should be first

$ServerName="<SQL AlwayaOn Listener Name>"
$SiteDBName = "<DbName(case sensitive)>"
$LogDBName = "<LoggingDbName>"
$MonitorDBName = "<MonitorDbName>"
$cs="Server=$ServerName;Initial Catalog=$SiteDBName;Integrated Security=True;MultiSubnetFailover=True"
$csLogging= "Server=$ServerName;Initial Catalog=$LogDBName;Integrated Security=True;MultiSubnetFailover=True"
$csMonitoring = "Server=$ServerName;Initial Catalog=$MonitorDBName;Integrated Security=True;MultiSubnetFailover=True"

Set-AdminDBConnection -DBConnection $cs
Set-ConfigDBConnection -DBConnection $cs
Set-AcctDBConnection -DBConnection $cs
Set-AnalyticsDBConnection -DBConnection $cs               # 7.6 and newer
Set-HypDBConnection -DBConnection $cs              
Set-ProvDBConnection -DBConnection $cs
Set-AppLibDBConnection -DBConnection $cs                 #  7.8 and newer
Set-OrchDBConnection -DBConnection $cs                    # 7.11 and newer
Set-TrustDBConnection -DBConnection $cs                  #  7.11 and newer
Set-BrokerDBConnection -DBConnection $cs
Set-EnvTestDBConnection -DBConnection $cs
Set-SfDBConnection -DBConnection $cs
Set-LogDBConnection -DBConnection $cs
Set-LogDBConnection -DataStore Logging -DBConnection $csLogging
Set-MonitorDBConnection -DBConnection $cs
Set-MonitorDBConnection -DataStore Monitor -DBConnection $csMonitoring

 
Get-BrokerDBConnection should show the following output
 
User-added image

 

Environment

The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify 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 sample code 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 sample code 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 sample code. In no event should the code 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 SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.

Issue/Introduction

This article describes how to reconfigure an already configured XenApp and XenDesktop Site to work on an AlwaysOn setup. It also provides generic instructions for changing the database connection strings used by XenDesktop.

Additional Information

http://blogs.citrix.com/2014/10/29/updating-database-connection-strings-in-xendesktop-7-x/

https://msdn.microsoft.com/en-us/hh510230.aspx
 
http://blogs.citrix.com/2014/12/04/database-sizing-guidance-for-xendesktop-7-6/ 
 
http://blogs.citrix.com/2014/11/20/database-sizing-tool-for-xendesktop-7/
 

Updating Database Connection Strings in XenDesktop 7.x

Database sizing guidance for XenDesktop 7.6

Database Sizing Tool for XenDesktop 7