PSC Load Balancing with NSX

Reading Time: 6 minutes

In this blog post, I want to describe the manual steps on how to deploy and configure an NSX load balancer for the Platform Service Controllers (PSC). Hey wait, weren’t you doing PowerNSX automation stuff before? Yes and I still mean to do so. But with automation comes checking if the procedure actually works before attempting to automate that procedure. Garbage in is a lot of garbage out with automation….

Implementing NSX for desktop, whether for micro-segmentation or Load Balancing, takes time and effort to design and implement, that’s why I started the HorizonJumpstart to help with a starting point and hopefully some guidance. This post is about the Load Balancing part and the start-up of some additions to NSXHorizonJumpstart to include NSX Edge Gateway Load Balancers.

Load Balancers in EUC

Depending on what we do in or for the EUC stack, or how our deployment model is, there can be quite a few load balancing requirements:

  • Platform Services Controllers (PSC)
  • Connection Servers
  • Unified Access Gateways (UAG)
  • Identity Manager (vIDM) internally and proxied via Identity Manager Proxy for external connections
  • App Volumes
  • AirWatch Device Servers
  • vROPS for Horizon UI

And you will probably do this from more than one block/pod. But like said, first deploy manual before automating.

Manual Implementing a PSC NSX Load Balancer pair

Deploying an NSX Edge Gateway is two-fold, first, you first have to deploy the appliance HA pair and secondly, you will enable and configure Load balancing for this application.


Before deploying Edges it is required to have one vCenter (that will be repointed later to the PSC LB name) and an NSX Manager for that cluster. And a proper NSX License installed. Next, the hosts need to be prepared.

Furthermore, some information will also come in handy:

  • ESG Name
  • IP Address (primary ESG Uplink address)
  • HA IP (internal network, /30 IPs)
  • LB Name
  • LB IP (secondary ESG Uplink address)
  • Uplink vDPortgroup, Place to deploy, HA vDPortgroup, Size, ESG Admin CLI password to set.
  • DNS Registration of the VIP names and IPs (forward and reverse).

Specifically for the PSC the following should be in order:

And next, deploy and configure the NSX Load Balancer. The next paragraphs have their origin in the following VMware KB:

Configure the NSX Load Balancer

Deploy a new NSX Edge

  1. Navigate to Networking & Security > NSX Edges.
  2. Click the + icon.
  3. Select Install Type Edge Services Gateway.
  4. Enter the name.
  5. Select Deploy NSX Edge.
  6. Select Enable High Availability. (or you can do this after the Edge is deployed, doesn’t really matter)
  7. Click Next.


  1. Enter the username and the password.
  2. Enable or Disable SSH Access.
  3. Set desired logging level.
  4. Click Next.

Configure Deployment

  1. Select the Datacenter location.
  2. Select the Appliance Size depending on your environment.
  3. Click the + icon and select the Cluster, Datastore, ESXi Host and the folder to deploy to.
  4. Click OK, Next.

Configure Interfaces

  1. Click the + icon.
  2. Provide a name for the interface.
  3. Select Type Uplink.
  4. Click Select next to Connected to and select the port group.
  5. Click the icon and enter the IP Address and Prefix Length for the Edge Appliance and a secondary IP for the PSC VIP. Or use the same for both.
  6. Click OK, click Next.
  7. Enter the default gateway for the PSC VIP.
  8. Click Next.
  9. Repeat this for the HA internal interface. However, you don’t need to put an IP here.

Firewall and HA

  1. Select Configure Firewall default policy.
  2. Change the Set Default Traffic Policy to Accept.
  3. Under Configure HA Parameters, select the HA internal vNIC.
  4. Set the Management IPS (in a /30 subnet)
  5. Click Next.

Ready to complete.

You will see two new NSX Edge virtual machines being deployed in the environment. If you have DRS an anti-affinity rule between the edges will be created as well. The new NSX Edge will appear as Deployed in the NSX edges listing.

Enable Edge Load Balancer

  1. Double-Click the deployed Edge.
  2. Navigate to Manage > Load Balancer.
  3. Click Edit.
  4. Select Enable Load Balancer.
  5. Select Logging and set the required logging level.
  6. Click OK.

Application Profiles

  1. Select Application Profiles.
  2. Click the + icon.
  3. Enter the name.
  4. Select type TCP. If you want to include an HTTP SSL offloading Application Profile at the NSX Edge, you can follow the steps in this scenario.
  5. Under Persistence, select Source IP.
  6. Click OK.
    The Application Profile must be displayed in the list of profiles.

Application Profile


  1. Select Pools.
  2. Click the + icon.
  3. Enter the name.
  4. Select the ROUND-ROBIN algorithm.
  5. Select the default_tcp_monitor.
  6. Click the + icon.
  7. Enter the name for the node member.
  8. Enter the IP Address of the First PSC node.
  9. Ensure Port is left blank.
  10. Enter Monitor Port 443.
  11. Click OK.
  12. Add a second member for the Additional PSC node. You must have two members listed.
  13. Click OK.

Virtual Servers

  1. Select Virtual Servers.
  2. Click the + icon.
  3. In the Application Profile, select the PSC Application Profile just created.
  4. Enter the name, I normally add the VIP FQDN name (replace the . with -)
  5. Enter the PSC HA VIP IP Address.
  6. Select the TCP protocol.
  7. Enter these 443,389,636,2012,2014,2020 port numbers. Note: If you would only allow secure LDAP, don’t add the 389 in the range.
  8. In the Default Pool, select the PSC Pool just created
  9. Click OK. The Virtual Server is displayed in the list.

Test if you can reach the PSC LB VIP name via HTTPS for example.

Completing the PSC Load Balancing configuration

The PSC configuration needs to be finished to fully use the PSC in a Load Balancing set-up. Steps on the PSC:

Note: New vCenter instances can be pointed from the installer to the PSC LB name.

  • Repoint the NSX Lookup to the PSC LB. From within the home of the NSX Manager, go to Manage vCenter Registration. Edit the Lookup Service URL to the PSC LB VIP Name.
  • Check if it is connected correctly

Done, now your PSC is load balanced via the NSX Edge and the vCenter and NSX are repointed to the PSC load balanced name.

Scripting the Edge Deployment

I will go a little more in-depth on this part in a next blog post, but just a little sneak preview what I am working on. If you want to take a peek or contribute go there: NSXHorizonJumpstart you are looking for the Paikke-EdgeLB branch (well if it is still there, else look in the master branch ;)). The script is momentarily only deploying the edge appliance (and just the first as no High Availability is yet configured).

And little peak (see more at GitHub):

$NSXConnection = Connect-NsxServer -vCenterServer $nsxManager -username $nsxUser -Password $nsxPass #-DefaultConnection:$false

### NSX Edge
# Build the uplink specifications
$uplink = New-NsxEdgeInterfaceSpec -Name UplinkVDI -Type Uplink -ConnectedTo (Get-vDPortgroup -Name $uplinkpg) -PrimaryAddress $uplinkaddress -SubnetPrefixLength 24 -Index 0

# Then Build the internal specifications
$internal1 = New-NsxEdgeInterfaceSpec -Name haint -Type Internal -ConnectedTo (Get-vDPortgroup -Name $uplinkpg) -Index 1

# New Large
New-NsxEdge -Name $edgename -Datastore (Get-Datastore -Name $edgedatastore) -cluster (Get-Cluster -Name $cluster) -Username admin -Password VMware1!VMware1! -FormFactor Large -AutoGenerateRules -FwEnabled -Interface $uplink,$internal1 -Connection $NSXConnection

In short, it connects and builds the Uplink and internal interface specifications where these are in settings variables like which port group to use. As some parameters take ID’s as input there are some (Get-) cmdlets. The New-NsxEdge takes these specifications along with other settings variables and kicks off creating the Edge in Large format.

The script currently takes its parameter settings from the script itself or human input (vCenter, password and such). I have begun to think about the YAML structure for input (just like the DFW rules) but not nearly there.

Hope this helps your PSC Load Balancing as well

Well if you were here only looking for the procedure to add a PSC load balancer to NSX I hope you could cope a bit with my ramblings about PowerNSX and the NSXHorizonJumpstart.

If you have ideas or other input to NSXHorizonJumpstart or NSX for Desktop, please do get in touch here or on GitHub. Looking forward to that!

– Enjoy your load balancers!


One thought to “PSC Load Balancing with NSX”

Leave a Reply

Your email address will not be published.