Two sites were far enough along that a global service had a reason to exist. Each had a VCF 9.1.1 stack and an Avi 32.1.3 controller cluster, built on the site-local design from the platform story. What they did not have was a tested answer to “if this site is gone, does the name still resolve to the other one?” Blue had no GSLB at all. GSLB was the answer, and the order of the build was most of the work.
The Design
GSLB was designed before the controllers existed: a DNS service running as a virtual service on Service Engines at both sites, each with its own VIP; a subdomain delegated from the corporate DNS; a deliberate choice of leader site; and controller-to-controller HTTPS across the datacenter interconnect. Two lines from that design held up all the way through. The delegation is the single most common thing missed, because it’s a change on the corporate DNS servers rather than in Avi. And the TTL is the failover time.
One documentation gap was worth writing down: GSLB has 73 pages in the Avi 32.1 product guide and none in the Avi for VCF 9.1 guide. We asked Broadcom for a written support position.
The Gates
We built it in the order Broadcom’s GSLB guide uses: DNS engine group, DNS virtual service at each site, leader and follower sites, GSLB services, and the corporate DNS delegation last. Nothing in GSLB is worth configuring until both controllers can see each other and DNS is a real service on each side, not a checkbox.
- A local
gslbaccount on both controllers. Not the day-to-day admin account reused because it was already open. VCF Operations manages and rotates theadminandvcfops-adminpasswords, and 9.1.1 enforces password expiry, so a GSLB site credential on either account would eventually break. - A dedicated DNS Service Engine group per site. Broadcom says DNS and local load-balancing services shouldn’t share a group. Virtual services per engine: 1 (the default is 10). Buffer engines: 0, because with one virtual service per engine a buffer of 1 means a second, idle engine at each site, 4 licence units across both sites instead of 2. Per-app mode off, since Broadcom doesn’t support per-app licensing for DNS virtual services. Override Management Network left empty: known issue AV-269617, it has no effect in an NSX cloud.
- A DNS application profile per controller. TTL 30 and negative TTL 30. The GSLB subdomain set as an authoritative domain, so Avi answers SOA queries. Invalid queries set to respond, not drop. The second site was left on Drop at first, and
nslookupstalled two seconds on every query. - A DNS virtual service per site on UDP 53, plus TCP 53 with a TCP proxy override, and no pool. Its VIP is never deleted or recreated, because the delegation points at it.
- Sites. The first site is the leader, added by its controller cluster VIP. The second is an active follower. From then on, every GSLB change is made on the leader.
- The first GSLB service, for a test application, not for the first production name. One GSLB pool per site, and each pool’s only member is that site’s virtual service. Priority-based: the first site at 20, the second at 10, and the higher number wins. Two mistakes were caught here. The member type defaults to IP address; pointing it at the servers would mean the leader’s pool never goes down, so failover never happens. A GSLB pool member is always a site’s virtual service, never its servers. And at one point the application name was typed as “gslb”, which would have produced
gslb.gslb.example.com. - The AD DNS side. A records for the two DNS servers’ names. New Delegation, not New Domain, for the
gslbsubdomain: New Domain makes AD itself authoritative for it, and AD would then answer “doesn’t exist” for every GSLB name. Then a CNAME from the application name to its GSLB name. - Failover and failback proved against those DNS virtual services, from outside either controller UI.
Step 8 is the gate. If the test name does not move when the leader is failed, and move back when it returns, the production names stay where they are. Delegation and firewall rules for the real names come after that proof, not before. A name that the corporate resolvers cannot reach is not a completed GSLB service. It is a lab.
What the Proof Found
A routing gap at the second site. Its copy of the test service was unreachable from the WAN. The site’s core switch had only a summary route to Null0 and no route for the VIP network. The jump host had hidden this, because it reached the site through NSX’s inter-site path. This was bigger than one test service: any client whose path crossed the WAN couldn’t reach any VIP at that site. The route was added, and making it permanent in BGP went to the customer’s network team.
The failover itself. Stopping the web servers at the first site moved the name to the second, and restarting them moved it back. Failback took about 20 seconds of health checks, a few seconds for GSLB, and up to 30 seconds of TTL. One caveat went with the result: stopping the web servers simulates losing the first site’s servers, not the first site.
Answers alternating between the sites while both were up. Found after the failover test: both virtual services had been placed in one GSLB group, which round-robins. The fix was one group per site, and every later service follows the same pattern. After the split, repeated lookups answered the first site consistently from both DNS services.
How a Name Resolves
- A client asks its domain controller.
- The domain controller sees that
gslbis delegated and asks an Avi DNS service. - Avi answers the first site’s VIP, or the second site’s if the first site’s member is down.
- The domain controller relays the answer and caches it for 30 seconds.
Failover takes about a minute. About 30 seconds is detection (three failed checks, 10 seconds apart); the rest is the TTL running out. If every member is down, GSLB answers with every site’s address rather than none, so a monitoring fault such as a firewall change can’t take an application out of DNS by itself.
After the Proof
Three things were deliberately left for later, and written next to the service rather than in a chat log. A second DNS engine per site. The second site as a manual backup leader: with two sites and one interconnect, a cut link looks like a site failure from both ends, so automatic promotion could leave you with two leaders. And the upgrade order, followers first and the leader last; the follower and the leader are not interchangeable during an upgrade window.
Loss of the leader site is a planned event, not a surprise. The follower has to be able to take leadership without a person who remembers which screen that lives on. If that procedure was not exercised at step 8, it is not a procedure.
What Stays Out of the Write-Up
The values sheet for a two-site GSLB build is site data: VIPs, SE group names, the application that goes on last. None of that belongs in a public note. The reusable part is the order. NSX Federation across the same two sites is a separate decision: Federation does not create GSLB, and GSLB does not require you to publish the federation uplink design to make the load-balancer story true. Keep those documents apart.
Lessons Learned
GSLB is mostly DNS. Delegate, don’t create a domain. A pool member is a site’s virtual service, never its servers. One group per site. Respond to queries you don’t handle. UDP and TCP 53. The DNS service on its own engine group. And wildcards answer a subdomain until it is delegated: the domain controller export later turned up two wildcard records answering the not-yet-delegated GSLB subdomains with blue’s addresses, because a delegation takes precedence over a wildcard, but only once it exists.
Getting Started
This post is the order. The commands that read the state of every name, without writing, are in the same repository as the migration tool. Build the GSLB services with converge; the names come from discover and the domain controller export.
python3 avi_migrate.py selftest
python3 avi_migrate.py status --config env.essential.yaml
python3 avi_migrate.py converge --config env.essential.yaml
Stand up the GSLB account, the DNS profile, the SE group, and the DNS virtual service on both controllers before you declare a leader. Prove failover and failback from outside either UI. Then, and only then, put a production name on the service. The tool that moves the virtual services and builds one GSLB service per application, and refuses to write back to the source, is avi-blue-green. Run its offline self-test before the first converge.
Conclusion
GSLB is an order, not a checkbox. Prove the name can move. Then move the names that matter.
Repository: github.com/noahfarshad/avi-blue-green
Related Stories:
- Avi 32.1.3 Under NSX Federation: One Controller Per Site, Local Objects Only — the controllers, the licensing and the supported design this GSLB sits on
- Moving Avi from Blue to Green Without Ever Writing Back to Blue — the converge this design hands off to
