Advisory · Projects · Speaking LinkedIn GitHub Credly IT EN

Access · Citrix

Citrix and Nutanix active-active across two data centers: the design for a major Italian bank

Table of contents
  1. The goals
  2. The architecture at a glance
  3. Nutanix: two clusters, two failure domains
  4. Citrix: one site, two zones
  5. Access: NetScaler in GSLB
  6. StoreFront and WEM in each zone
  7. Profiles and data: Nutanix Files with Smart DR
  8. Three ways to deliver the desktop
  9. When a data center goes down
  10. My checklist
  11. References

For one of Italy’s leading banks I designed, installed and configured a virtual desktop platform that runs across two data centers at the same time: every day both sites serve users, and if one of them goes down the other takes over. In this article I walk through the architecture layer by layer, from Nutanix up to user access, and the choices that make it truly active-active.

The goals

Four requirements drove the whole design:

  • Both sites at work. No passive site waiting for a disaster: both data centers serve users every day, 50% each.
  • A single point of access. Users don’t pick a site and never change address: the platform decides where to open the session.
  • Surviving the loss of a data center. Users of shared desktops start again on the surviving site; developers get their own dedicated machine back, with no data loss.
  • The profile follows the user. Whichever site the session opens on, users find the same profile and the same folders.

The architecture at a glance

The two data centers mirror each other: each site runs the same stack, from infrastructure to access.

LayerIn each data center
InfrastructureOne 6-node Nutanix cluster
File serverNutanix Files with 3 FSVMs, for user profiles and shared folders
Citrix Virtual Apps and DesktopsOne zone of the same site: 2 Delivery Controllers, 2 StoreFront servers, 2 WEM servers
AccessA NetScaler HA pair, in GSLB with the other site
Static VDI50% of the developers’ VDIs, plus the synchronous replica of the other site’s
Pooled VDI and Hosted Shared Desktops50% of the capacity, in the same Delivery Groups as the other site

Two things are replicated between the sites, each with the right tool: the developers’ VDIs, with Nutanix synchronous replication, and user profiles, with Nutanix Files Smart DR. The Citrix configuration doesn’t need replicating, because there is only one site.

Architecture diagram: two mirrored data centers, each with a NetScaler HA pair, a zone of the Citrix CVAD site, static and pooled VDIs, Nutanix Files and a 6-node Nutanix cluster; between the sites GSLB, Smart DR for profiles and synchronous replication for static VDIs
The two data centers: one Citrix site with two zones, two Nutanix clusters. Click the image to enlarge it.

Nutanix: two clusters, two failure domains

At the base there are two independent 6-node Nutanix clusters, one per data center, with Prism Central orchestrating replication. Each cluster hosts the Citrix components of its zone, the desktops of its site and the replicas of the other site’s static VDIs. A failure, an upgrade or a configuration mistake stays confined to one site.

  • Capacity for two. Each cluster needs headroom for a node failure (N+1) and, if one site has to carry the other’s load too, room for the desktops coming over from the lost site. This is the most important sizing decision: a 50% active-active that can’t absorb the other 50% is just half a service.
  • Room for the replicas. Each cluster keeps a full copy of the other site’s static VDIs, and that space has to be counted from day one.
  • The network between the sites. Synchronous replication requires a round-trip latency of 5 ms or less between the two clusters. The same link also carries profile replication, the traffic between the two Citrix zones and profile access from the remote site.

Citrix: one site, two zones

On the Citrix side I chose a single Citrix Virtual Apps and Desktops site with two zones, one per data center, instead of the two independent twin sites I have used in other two-data-center continuity projects. A single site gives you one Delivery Group for both locations, one console and one configuration; the zones keep each data center self-sufficient in day-to-day work.

Each zone has two Delivery Controllers, two StoreFront servers and two WEM servers. One of them is the primary zone, the one holding the site database; the other is a satellite.

  • Local registration. VDAs register with the Delivery Controllers in their own zone. If no controller in the satellite zone responds, its VDAs fall back to the primary zone’s.
  • Local Host Cache per zone. If a zone loses contact with the database, its Delivery Controllers switch to Local Host Cache and keep brokering connections, provided there is a StoreFront server in the same zone: that’s why each site has its own.
  • Local resources. Each zone has its own hosting connection to the Nutanix cluster in its data center, and each site’s Machine Catalogs belong to the matching zone.

The site database and the limits of Local Host Cache

Local Host Cache keeps connections going, but it isn’t a disaster recovery plan. During an LHC event you can’t use Studio, change the configuration or make new assignments, and there is no power management; users can only connect to VDAs registered in the elected broker’s zone. Multi-session VDAs and static VDIs stay available, while power-managed pooled ones, by default, do not.

That’s why the site database deserves the same protection as the desktops. If the data center of the primary zone goes down, database availability decides whether the surviving site runs at full capacity or in emergency mode.

Access: NetScaler in GSLB

Each data center has its own NetScaler HA pair, and the pairs of the two sites are configured in GSLB. There is a single access name, and the NetScaler appliances, acting as authoritative DNS, answer with the address of one of the two sites. Under normal conditions load balancing spreads users across both; if a site fails its health checks, GSLB stops returning it and all new connections go to the other one.

A few details make the difference between active-active on paper and active-active that works:

  • GSLB sites and MEP. Each data center has its local GSLB site, with the other configured as remote. The two sites exchange metrics and state over the Metric Exchange Protocol, on TCP port 3011 or 3009, which must be open on the firewalls between the data centers.
  • Persistence. A user must stay on the same site from authentication to session launch. GSLB persistence, by source IP or with cookie-based site persistence, overrides the load balancing method and must be configured on all sites.
  • Matching STAs. Every STA listed in StoreFront must also be listed on the Gateway virtual server: if one is missing, launches can fail.
  • HDX routing. With zones, StoreFront Optimal HDX Routing maps each zone to its own Gateway. HDX traffic then comes in through the NetScaler of the site where the VDA runs, instead of entering at one site and crossing the inter-data-center link to reach the other.
  • Short TTLs. The TTL of GSLB responses decides how quickly clients stop looking for the lost site: keep it low.

StoreFront and WEM in each zone

  • StoreFront. Citrix recommends keeping the members of a server group in the same location, and advises against stretching a group across two sites as a disaster recovery strategy. So each site has its own StoreFront servers, reached through the same access name: the two deployments must share the same base URL and the same configuration. StoreFront doesn’t synchronize configuration between separate server groups, so keeping them aligned takes discipline, ideally a script.
  • WEM. Each zone has two WEM infrastructure servers, so each site has its own service even without the other. If an agent can’t reach the service, it applies settings from its local cache thanks to offline mode: Citrix recommends not disabling it and keeping the cache in a persistent location.

Profiles and data: Nutanix Files with Smart DR

In each data center Nutanix Files runs with three FSVMs and exposes the shares for user profiles and shared folders. Profiles use the Citrix Profile Management profile container: the whole profile lives in one VHDX disk per user, mounted at logon, instead of being copied file by file.

  • Distributed shares. For Citrix Profile Management containers Nutanix recommends distributed shares, which spread the top-level folders, one per user, across the FSVMs and balance their load. They require at least three FSVMs, exactly the size chosen for each site, and allow no files in the root of the share.
  • Smart DR. The two file servers are replicated with Smart DR, with a policy dedicated to the EUC profile shares. The policy works at share level: it defines the source file server, the target file server and the replication frequency. The target share stays read-only until failover, which is orchestrated from Prism Central; in a planned failover, replication can restart on its own in the opposite direction.
  • One path per user. This leads to a rule: a profile share is writable on one site at a time, so each user has a single profile path, regardless of the site where the session opens. When the session runs in the other data center, the container’s I/O crosses the inter-site link: one more reason to keep it fast.
  • Non-zero RPO. Smart DR replicates asynchronously: after a failover you restart from the last replica, and containers that were open at that moment are copied in whatever state they were in. For profiles that’s an acceptable trade-off; for developers’ machines it isn’t, which is why they get a different kind of protection.

Three ways to deliver the desktop

Static VDI for developers: synchronous replication

Developers have a static VDI, dedicated and persistent: tools, settings and work in progress live on the machine, which has to survive the loss of a data center. The VDIs are split 50/50 between the two sites, and each machine is replicated synchronously to the cluster in the other data center, with zero RPO: a write is acknowledged only once it has reached both sites.

  • The price of synchrony. Every write waits for the remote site’s acknowledgment, so the latency between the data centers adds up to the storage latency. That’s why Nutanix sets the 5 ms limit, and why synchronous replication should be kept for the workloads that really need it: here, only the static VDIs.
  • Automatic or deliberate failover. With a Witness in a third site, failover can be automatic; without a Witness, recovery is started by hand, with a recovery plan. Before being a technical choice, it’s a governance one: it settles who declares a data center lost.
  • On the Citrix side. The VM restarts on the surviving site with the same disks, the same Active Directory identity and the same user assignment: to Citrix it’s the same VDA, which only needs to register again. Catalog zone, hosting connection and the list of Delivery Controllers have to be designed so that registration works without the lost site. The procedure must be written down and tested, keeping in mind that with the site database unreachable, Studio isn’t available and the configuration can’t be changed.

Pooled VDI and Hosted Shared Desktops: one Delivery Group for two sites

For less demanding use cases the site publishes pooled VDI and Hosted Shared Desktops, also split 50/50 between the two data centers. Each data center has its own Machine Catalogs, created on its own hosting connection, and the catalogs of both sit in the same Delivery Group: users see a single icon, and the broker decides which data center opens the session.

  • No zone preference. Citrix picks the preferred zone in this order: application home zone, user home zone, user location. If none is defined, the VDA and the zone are chosen at random: exactly the behavior you need to spread users across both sites without making them choose.
  • If you ever need to steer. User location can come from NetScaler, by mapping IP address ranges to zones and passing that information through StoreFront: that’s the lever to pull if one day you want to send each user to the nearest site.
  • Aligned images. The catalogs of both sites must be built from the same master image and updated together: if the experience differed from one site to the other, users would notice the first time they log on to the other site.
  • When a site goes down. The Delivery Group keeps working with the machines of the surviving site: users relaunch the desktop from the same icon and find it on the other side. Hosted Shared Desktops stay available even during Local Host Cache; power-managed pooled VDIs don’t, unless you enable them explicitly, accepting that a session may find data left by the previous one.

When a data center goes down

Putting the pieces together, this is what happens when a site is lost:

  1. GSLB sees the site as down and answers only with the other site’s address: all new connections reach the surviving site.
  2. Sessions open on the lost site drop. Pooled VDI and Hosted Shared Desktop users relaunch from the same icon and land on the other site’s machines.
  3. If the profile shares were active on the lost site, the Smart DR failover makes them writable on the other file server.
  4. The lost site’s static VDIs restart on the surviving cluster, with no data loss, and register again: developers get their own machine back.
  5. The surviving site carries the whole load: this is when the sizing done at the start shows what it’s worth.

My checklist

  1. Two independent Nutanix clusters, sized so that one site can absorb the other, replicas included.
  2. Latency between the sites within 5 ms, measured before promising zero RPO.
  3. One site with two zones, each with its own Delivery Controllers, StoreFront servers and WEM servers.
  4. Site database protected across both data centers, because Local Host Cache isn’t a disaster recovery plan.
  5. Active-active GSLB with persistence, MEP open between the sites, matching STAs and Optimal HDX Routing per zone.
  6. StoreFront with the same base URL and the same configuration on both sites.
  7. Citrix Profile Management profile containers on Nutanix Files distributed shares.
  8. Smart DR for the profile shares, with a single profile path per user.
  9. Synchronous replication only where it’s needed: the developers’ static VDIs.
  10. The catalogs of both sites in the same Delivery Group, with no zone preference and aligned images.
  11. A failover procedure that is written down and tested, static VDIs included.

You don’t get active-active by switching on two sites: you get it by deciding, layer by layer, what happens when the other one disappears. In this project every layer has its own answer and its own tool: synchronous replication where nothing can be lost, asynchronous replication where an RPO of a few minutes is acceptable, and a single site that sees both data centers as one service.

References