In the previous blogs I’ve explained you “How to: Install and configure Microsoft SQL Server 2016 Standard multi-subnet Basic Availability Groups for Citrix XenDesktop and XenMobile” and “Microsoft SQL and Microsoft SQL AlwaysOn basics for Citrix Admins”. 

In the next series of blogs I will explain to you how to configure “Citrix XenApp/XenDesktop” and “Citrix XenMobile” using SQL MultiSubnetFailover.
This blog starts with “How to configure Citrix Provisioning Services using MS SQL MultiSubnetFailover (Basic) Availability groups”. This is the most easiest one of the three I will describe in my blog.
During the customers project I’ve created the following Citrix Provisioning Services configuration:

  • One PVS Farm called: “PBO”
  • This PVS Farm contains two PVS sites

  • Amersfoort with PVS Servers:
    • PBO-PVS01
    • PBO-PVS02
  • Nijkerk with PVS Servers
    • PBO-PVS03
    • PBO-PVS04
  • Both sites having their own PVS-Targets. Since this is a multi-subnet environment, the PVS targets communicate to PVS Servers in their own site.

Logical overview:

Note: Site-to-site network latency is 4ms.

Create initial database

Before we can join the Citrix Provisioning Services database to a (Basic) Availability Group, we need to create a database to one of the SQL Servers. This how-to is describing it using the “Provisioning Services Configuration Wizard”. So this blog can also be used to move from a single SQL database to a (Basic) AlwaysOn Availability Group if you’re already in production.

1.    Mount the Citrix Provisioning Services ISO and install “Console” and then “Server”:

2.    Assuming you’ve already installed PVS before, I will skip the Installation instructions:

3.    Our SQL environment currently doesn’t have a Citrix Provisioning Services Database:

4.    When the “PVS Server Installation” finishes, the “Citrix Provisioning Services Configuration Wizard” is started automatically. Click next:

5.    Select DHCP properties for your environment. Click next:

6.    If you want to use PXE-services, configure it for your PVS Environment. Click next:

7.    Select “Create Farm” as we want to create a new Farm here. Click next:

8.    Enter the direct server name of your primary/first SQL server. Do not use a listener address here, we will configure AlwaysOn and MultiSubnetFailover later in this procedure. Click next:

9.    Enter new names for the SQL Database and PVS environment, click next:

10.    Enter details for the new vDisk store, click Next:

11.    Enter the configuration to your Citrix License server, click Next:

12.    Enter the credentials for your Citrix Provisioning Services service Account, click Next:

13.    Leave default, click next

14.    Configure the PVS network configuration according to your design. Click next

15.    Enable TFTP services. Click next:

16.    Configure bootstrap according to your design. Click next

17.    Configure SOAP SSL if you have a valid certificate. Otherwise click next

18.    If you want to use problem reporting. Please provide your MyCitrix credentials (optional):

19.    Press Finish to configure PVS and create a new database, click next:

20.    Creating Services and database right now:

21.    New SQL database created on “PBO-SQL01” and not on “PBO-SQL02”:

Joining the Citrix Provisioning Services database to a (Basic) AlwaysOn Group

At this point, we want to join the “CTX-PVS” database to a new Microsoft SQL MultiSubnet Basic AlwaysOn Availability Group (BAG). When you have a Citrix Provisioning Services environment running without using BAG, you can also follow these steps to move to BAG.

1.    Stop all the “Citrix Provisioning Services” services on all of your Citrix Provisioning Servers. This will stop all communication to the Provisioning Services database:

2.    In the SQL Management Studio, right click the new Citrix Provisioning Services database (CTX-PVS) and click Properties:

3.    Go to Options. And select Full as the recovery model for the database:

4.    Right click the PVS database again and click Tasks –> Back Up..

5.    Create a backup of the database:

6.    In SQL Management Studio, go to: AlwaysOn High Availability –> Availability Groups. Right click and choose: “New Availability Group Wizard

7.    At the Welcome Wizard, click Next

8.    Enter the name of the new Availability group. I.e.: BAG-CTX-PVS and click Next:

9.    Select the Citrix Provisioning Services database (CTX-PVS) and click Next:

10.    Click Add Replica:

11.    Login to your second SQL server, click Connect:

12.    Both servers are added. Select “Automatic Failover” and make sure “Synchronous Commit” is configured. Click Listener tab:

13.    Seed database using a temporary SMB share, click next:

14.    When the availability group validation is successful, click next

15.    Verify configuration and click next

16.    Creating the availability group:

17.    Creation of availability group is successful, click Close

18.    Availability group from a SQL point of view:

Reconfigure Citrix Provisioning Services to use the MultiSubnetFailover availability group

The Citrix Provisioning Server services are still stopped on all of your Citrix Provisioning Services Servers at this point. Reconfigure Citrix Provisioning Services to use the Microsoft SQL MultiSubnet (Basic) Availability group as follows:

1.    Run this procedure on all of your Provisioning Services Servers one by one
2.    On the Citrix Provisioning Services Server start “Provisioning Services Configuration Wizard

3.    I’ve skipped some default steps of the wizard.
4.    On the “Farm Configuration Screen” choose: Join existing farm and click next

5.    Enter the SQL listener FQDN of the BAG created in SQL and enable “Enable MultiSubnetFailover for SQL Server Always On”. Click Next

6.    Select Farm:

7.    Choose the correct PVS Site for this PVS Server

8.    Choose the correct Store for vDisks and click Next

9.    Citrix Provisioning Services services are reconfigured and Provisioning Services started, click Done:

10.    Farm properties in Provisioning Services Console: