Configuring a Topology Policy to Select the GSLB Service Pool using
Avi Load Balancer
CLI

This section covers the configuration steps for topology policy to select the GSLB Service pool using
Avi Load Balancer
CLI.
To configure the topology policy to select the GSLB service pool:
  1. Enable topology policy at GSLB Service level by setting the topology_policy_enabled knob to True.
    [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-1 | | priority | 9 | | algorithm | GSLB_ALGORITHM_CONSISTENT_HASH | | 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 | | groups[2] | | | name | GS-1-pool-2 | | priority | 10 | | algorithm | GSLB_ALGORITHM_ROUND_ROBIN | | members[1] | | | ip | 10.10.10.3 | | ratio | 1 | | enabled | True | | resolve_fqdn_to_v6 | False | | preference_order | 1 | | members[2] | | | ip | 10.10.10.4 | | 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> topology_policy_enabled [admin:ctrl]: gslbservice> save
    The GSLB service is configured 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-1 | | priority | 9 | | algorithm | GSLB_ALGORITHM_CONSISTENT_HASH | | 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 | | groups[2] | | | name | GS-1-pool-2 | | priority | 10 | | algorithm | GSLB_ALGORITHM_ROUND_ROBIN | | members[1] | | | ip | 10.10.10.3 | | ratio | 1 | | enabled | True | | resolve_fqdn_to_v6 | False | | preference_order | 1 | | members[2] | | | ip | 10.10.10.4 | | 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 | | topology_policy_enabled | True | +----------------------------------+--------------------------------------------------+ [admin:ctrl]: >
  2. Configure topology policy rule for GSLB service group selection.
    1. Use the
      gs_group_selection
      command to select a GSLB service pool or group for matching DNS query.
    2. Use the
      group_name
      command to add GSLB service group name.
      [admin:ctrl]: > configure dnspolicy dns-vs-TopologyPolicy-0 Updating an existing object. Currently, the object is: +------------+------------------------------------------------+ | Field | Value | +------------+------------------------------------------------+ | uuid | dnspolicy-e3aae711-7617-439f-912a-dea3945d39e1 | | name | dns-vs-TopologyPolicy-0 | | tenant_ref | admin | +------------+------------------------------------------------+ [admin:ctrl]: dnspolicy> rule New object being created [admin:ctrl]: dnspolicy:rule> name "Rule 1" [admin:ctrl]: dnspolicy:rule> index 1 [admin:ctrl]: dnspolicy:rule> match [admin:ctrl]: dnspolicy:rule:match> geo_location [admin:ctrl]: dnspolicy:rule:match:geo_location> match_criteria IS_IN [admin:ctrl]: dnspolicy:rule:match:geo_location> geolocation_tag "East Coast" [admin:ctrl]: dnspolicy:rule:match:geo_location> save [admin:ctrl]: dnspolicy:rule:match> save [admin:ctrl]: dnspolicy:rule> action [admin:ctrl]: dnspolicy:rule:action> gs_group_selection [admin:ctrl]: dnspolicy:rule:action:gs_group_selection> group_name "GS-1-pool-2" [admin:ctrl]: dnspolicy:rule:action:gs_group_selection> save [admin:ctrl]: dnspolicy:rule:action> save [admin:ctrl]: dnspolicy:rule> save [admin:ctrl]: dnspolicy> save
The topology policy is configured as shown below:
+---------------------------------+------------------------------------------------+ | Field | Value | +---------------------------------+------------------------------------------------+ | uuid | dnspolicy-e3aae711-7617-439f-912a-dea3945d39e1 | | name | dns-vs-TopologyPolicy-0 | | rule[1] | | | name | Rule 1 | | index | 1 | | enable | True | | match | | | geo_location | | | match_criteria | IS_IN | | use_edns_client_subnet_ip | True | | geolocation_tag | East Coast | | action | | | gs_group_selection | | | group_name | GS-1-pool-2 | | tenant_ref | admin | +---------------------------------+------------------------------------------------+ [admin:ctrl]: >