Preference Order Load Balancing Algorithm

Overview

Starting from version 22.1.1, NSX Advanced Load Balancer has added a new algorithm called preference order within the GSLB Service pool. This algorithm can be used to load balance the traffic among the GSLB pool members.

To use this algorithm, you must assign the preference order to each pool member. Once preference order is assigned, NSX Advanced Load Balancer will direct the traffic to the first available member in ordered list specified by user as per the preference order.

Lower the preference order, high is the preference which means that the DNS Service chooses the member with the lowest preference that is operationally up.

Configuring Preference Order Algorithm to Add Priority to GSLB Pools

Using the UI

  1. Navigate to Applications > GSLB Services.

  2. Click Create or edit icon to open the Edit GSLB Service window. For complete configuration steps, see GSLB Service Configuration.

  3. Enter the GSLB service details as shown below: create key

  4. Under GSLB pool, click Add Pool to open New GSLB Pool window.

  5. Enter the GSLB pool details. For more details, see GSLB Pool Editor.

  6. Select Preference Order from the Pool Members Load Balancing Algorithm drop-down menu.

  7. Under Pool Member, enter a Preference Order value ranging from 1 to 128. Preference Order

  8. Click Done to save the New GSLB Pool configuration.

  9. Click Save.

Using the CLI

  1. Set the GSLB service pool algorithm to gslb_algorithm_preference_order.
    
     [admin:ctrl]: > configure gslbservice GS-1
     Updating an existing object. Currently, the object is:
     +----------------------------------+--------------------------------------------------+
     | Field                            | Value                                            |
     +----------------------------------+--------------------------------------------------+
     | uuid                             | gslbservice-88ad049f-e188-40f3-90de-235c6cb676a2 |
     | name                             | GS-1                                             |
     | domain_names[1]                  | foo.avi.com                                      |
     | groups[1]                        |                                                  |
     |   name                           | GS-1-pool                                        |
     |   priority                       | 9                                                |
     |   algorithm                      | GSLB_ALGORITHM_ROUND_ROBIN                       |
     |   members[1]                     |                                                  |
     |     ip                           | 10.10.10.1                                       |
     |     ratio                        | 1                                                |
     |     enabled                      | True                                             |
     |     resolve_fqdn_to_v6           | False                                            |
     |     preference_order             | 1                                                |
     |   members[2]                     |                                                  |
     |     ip                           | 10.10.10.2                                          |
     |     ratio                        | 1                                                |
     |     enabled                      | True                                             |
     |     resolve_fqdn_to_v6           | False                                            |
     |     preference_order             | 1                                                |
     |   enabled                        | True                                             |
     | down_response                    |                                                  |
     |   type                           | GSLB_SERVICE_DOWN_RESPONSE_NONE                  |
     | controller_health_status_enabled | True                                             |
     | health_monitor_scope             | GSLB_SERVICE_HEALTH_MONITOR_ALL_MEMBERS          |
     | enabled                          | True                                             |
     | use_edns_client_subnet           | True                                             |
     | wildcard_match                   | False                                            |
     | site_persistence_enabled         | False                                            |
     | pool_algorithm                   | GSLB_SERVICE_ALGORITHM_PRIORITY                  |
     | min_members                      | 0                                                |
     | resolve_cname                    | False                                            |
     | is_federated                     | True                                             |
     | tenant_ref                       | admin                                            |
     +----------------------------------+--------------------------------------------------+
     [admin:ctrl]: gslbservice> groups index 1
     [admin:ctrl]: gslbservice:groups> algorithm gslb_algorithm_preference_order
     Overwriting the previously entered value for algorithm
     
  2. Configure preference_order value at GSLB service pool member level.
    
     [admin:ctrl]: gslbservice:groups> members index 1
     [admin:ctrl]: gslbservice:groups:members> preference_order 2
     Overwriting the previously entered value for preference_order
     [admin:ctrl]: gslbservice:groups:members> save
     [admin:ctrl]: gslbservice:groups> members index 2
     [admin:ctrl]: gslbservice:groups:members> preference_order 4
     Overwriting the previously entered value for preference_order
     [admin:ctrl]: gslbservice:groups:members> save
     save[admin:ctrl]: gslbservice:groups> save
     [admin:ctrl]: gslbservice> save
     

    The overall configuration is as shown below:

    
     +----------------------------------+--------------------------------------------------+
     | Field                            | Value                                            |
     +----------------------------------+--------------------------------------------------+
     | uuid                             | gslbservice-88ad049f-e188-40f3-90de-235c6cb676a2 |
     | name                             | GS-1                                             |
     | domain_names[1]                  | foo.avi.com                                      |
     | groups[1]                        |                                                  |
     |   name                           | GS-1-pool                                        |
     |   priority                       | 9                                                |
     |   algorithm                      | GSLB_ALGORITHM_PREFERENCE_ORDER                  |
     |   members[1]                     |                                                  |
     |     ip                           | 10.10.10.1                                       |
     |     ratio                        | 1                                                |
     |     enabled                      | True                                             |
     |     resolve_fqdn_to_v6           | False                                            |
     |     preference_order             | 2                                                |
     |   members[2]                     |                                                  |
     |     ip                           | 10.10.10.2                                          |
     |     ratio                        | 1                                                |
     |     enabled                      | True                                             |
     |     resolve_fqdn_to_v6           | False                                            |
     |     preference_order             | 4                                                |
     |   enabled                        | True                                             |
     | down_response                    |                                                  |
     |   type                           | GSLB_SERVICE_DOWN_RESPONSE_NONE                  |
     | controller_health_status_enabled | True                                             |
     | health_monitor_scope             | GSLB_SERVICE_HEALTH_MONITOR_ALL_MEMBERS          |
     | enabled                          | True                                             |
     | use_edns_client_subnet           | True                                             |
     | wildcard_match                   | False                                            |
     | site_persistence_enabled         | False                                            |
     | pool_algorithm                   | GSLB_SERVICE_ALGORITHM_PRIORITY                  |
     | min_members                      | 0                                                |
     | resolve_cname                    | False                                            |
     | is_federated                     | True                                             |
     | tenant_ref                       | admin                                            |
     +----------------------------------+--------------------------------------------------+
     [admin:ctrl]: >
     

Reference

GSLB Service Configuration

Document Revision History

s
Date Change Summary
January 31, 2023Updated Configuring Preference Order Algorithm to Add Priority to GSLB Pools section (version 22.1.3)
July 15, 2022 Created the article for Preference Order Load Balancing Algorithm (version 22.1.1)