Citrix StoreFront High Availability and Aggregation – A dual site Active Active design

I am currently working on a XenDesktop 7 project where the requirement is to have an Active Active dual design with NetScaler GSLB and StoreFront.

Below I have detailed how I have configured StoreFront for this setup.

In the example there are two XenDesktop Farms, FarmA in the UK and FarmB somewhere in the EU. Both will host common and also unique applications.

Click on images to enlarge

StoreFront High Availablity and Aggregation
StoreFront  High Availability and Aggregation (lets call it HAA from now on) can only be configured using the StoreFront XML config files and cannot be done through the GUI.

You start by configuring your StoreFront as normal to talk to the different XenDesktop farms. Without configuring StoreFront HAA, StoreFront would contact both farms when a user logs in and show them all the apps they have been permissioned with from both farms, even if some of the apps are exactly the same.

Once you have configured HAA properly, StoreFront will show only 1 icon for apps that have exactly the same names and when users click on that icon they will be directed to a particular farm based on the settings that you have specified.

This means that you can always direct users to one particular farm unless for whatever reason the application cannot be launched within that farm. This can then also be overridden on an application by application basis by using StoreFront KEYWORDS in the application description.

StoreFront 2.1 High Availability is discussed in this Citrix eDocs article with an example configuration found in this eDocs article.

So to summaries this is what we want to achieve

Local StoreFront deployments enumerate applications from both farms that are in geographically different locations.
Based on Active Directory groups the user launches HAA applications in their home farm first.
If an HAA application has the Primary keyword it should launch first regardless of rule number 2.
If an HAA application is unavailable in Primary farm for whatever reason, the application should launch in the Backup farm
Non HAA applications from both farms must also be enumerated.
StoreFront High Availability and Aggregation Flow
I created this diagram to explain how the logon process works when HAA is involved.

Keywords can be used in the description of individual published Desktops or Applications to override the default behaviour configured in HAA.

This means if you have configured Farm A as Primary and Farm B as Backup and you published Word in both farms but in Farm A you set KEYWORDS:Secondary and in Farm B you set KEYWORDS:Primary in the application description, Word will always try to launch first in Farm B.

Note: You must set the KEYWORDS in the description of both applications. Only setting it in one farm and not the other does not work.

Session Sharing
Session sharing is only considered after the HAA rules and the KEYWORD rules have been evaluated and does not override any of them.


Farm A primary
Farm B secondary
Excel published in both farms
Word published in both farms
Word set to be Primary in Farm B
In this instance if a user were to launch both Excel and Word they launch on the separate farms rather than session sharing as would be the normal case.

Multiple Mapping Groups
If you have added a user to multiple AD groups that are specified in different userFarmMapping portions of web.config then you will get some inconsistent results. Application icons are still aggregated but the Primary and Backup rules are not followed.

Before you Start
Configure your StoreFront Store’s Farm and Delivery controller settings exactly how you want them.

Once you have made manual changes to web.config, Studio prevents you from making further changes via the GUI.

If you click on a Store and then click Manage Delivery Controllers you will see the message

To configure delivery controllers and servers for this store, use PowerShell scripts

Install Microsoft XML Notepad which is free and about 100 times easier than editing XML files in normal Notepad

Create four Active Directory groups, one domain global and one domain local for UK and one domain global and one domain local for EU (following the AGDLP rule we nest global into local).

From an Active Directory domain controller load Active Directory Module for Windows PowerShell and run the following command to get the domain local group’ SIDs

Get-ADGroup -Identity ADGroupName
All StoreFront store configurations can be found in the respective web.config file  .inetpubwwwrootCitrix\web.config.

This is where we add the configuration for StoreFront High availability.

To make things more simple I made a backup copy of each web.config file and then opened the web.config file via the admin share on the StoreFront server \<storefrontserver>c$inetpub<storename>web.config

As you will be making a lot of changes it is much simpler to edit the file direct on the server and not have to keep copying it back and forth to your machine each time.

I recommend you copy the example configuration from Citrix (link in previous section above)

Then in XML notepad, expand citrix.deliveryservices –> resourcesCommon and delete anything underneath resourcesCommon

Then right click citrix.deliveryservices and click paste.

Your web.config should now look like this

For this example we only have 2 farms so we only require 2 equivalentFarmSet nodes so we will delete one of the equivalentFarmSet nodes.

If you then expand out the configuration you will see this

In this example we have two farms so we only require 2 farm nodes for the PrimaryFarmRefs and 1 for backupFarmRefs for the first equalentFarmSet and 1 farm for the PrimaryFarmRefs and no farms for the backupFarmRefs for the second equalentFarmSet.

The reason we have 2 equivilentFarmSets (the second one with no backupFarmRefs) is if we did not have the second one, StoreFront would only enumerate applications from FarmB if FarmA was not available, whereas we want StoreFront to also enumerate applications from FarmB so that we get the unqiue, non-HAA applications from FarmB at each logon.

After deleting the unrequired nodes in the XML files your config should now look like this

Now expand out the configuration and start filling in the details with the groups and SIDs that you got earlier and the farm names. Remember the farm names need to match what you have configured in your StoreFront configuration.

The name used in the aggregationGroup setting must be the same in each equalentFarmSet, this is what ensures that duplicate published application icons are not displayed.

Now copy the userFarmMapping node you have just configured, paste it again at the same level as the other one and reverse the configuration so that DL_FarmBUsers primary farm is FarmB, backup is FarmA etc.

Save your web.config and make sure you make the same changes to all of your StoreFront servers in the deployment.

You can test your configuration by publishing 4 applications. 1 unique application on each farm and 1 with the same name on each farm.

Add yourself to one of the Global Groups you created (that are nested in the local groups).

When you log into Receiver it should aggregate the applications so you see an icon for each of the unique applications but only 1 icon for the application that is the same in both farms.

When you launch one of the HAA apps it should direct you to the primary farm relating to the AD group you are in.

If you then place the servers or delivery group in the Primary farm in maintenance mode you should then get directed to the Backup farm when you try to launch the application again (make sure it is fully closed down though, session reconnection will occur even if servers are in maintenance mode).

Cannot complete your request

If you get this error after logging onto StoreFront or NetScaler Gateway take a look in the event logs on your StoreFront servers.

If you find

Event ID 7 –  Unhandled exception thrown for route “DazzleResources/List”

Take a look in the detail of the event and it will have the text

Missing farms for names: [FarmA]

This means that a farm name that you have configured in equivalentFarmSet in your web.config could not be found in the list of farms configured in the Manage Delivery Controllers section of the Store.

Book a free consultation
and discuss your IT challenges with us