The auto-rebalance feature helps in automatically migrating or scaling virtual services when the load on the Service Engines (SE) goes beyond or falls below the configured threshold.

The trigger types that aggregate at NSX Advanced Load Balancer Service Engine level are:

  • Packets per second (PPS)
  • Throughput in Mbps
  • Open connections
  • CPU

The minimum and the maximum threshold are configured along with one of these options for the trigger type. By default, auto-rebalance is based on CPU trigger type.

Configuring Auto-rebalance using the CLI

The following are the steps to configure auto-rebalance feature on the NSX Advanced Load Balancer Service Engine:

  1. Login to the NSX Advanced Load Balancer Controller CLI and enter the shell mode by using the shell command.

  2. On prompt, specify the Username and Password.

  3. Optionally, use the switch command to switch to the respective tenant or cloud for which auto_rebalance can be configured.

    switchto tenant tenant-name   
    switchto cloud cloud-name 
  4. The auto_rebalance option is set to False. To enable it, login to the Controller and set auto_rebalance to True.

    [admin:1-Controller-2]: > configure serviceenginegroup Default-Group
    [admin:1-Controller-2]: serviceenginegroup> auto_rebalance
    Overwriting the previously entered value for auto_rebalance
    [admin:1-Controller-2]: serviceenginegroup> save   
  5. Configure the auto-rebalance parameters.

    configure serviceenginegroup Default-Group
     auto_rebalance_interval interval-value 
     auto_rebalance_criteria option
     auto_rebalance_capacity_per_se integer-value

    The auto_rebalance_interval interval-value provides the interval for which the auto-rebalance will be triggered on reaching the configured threshold. The interval-value is in seconds and the recommended value is 300s. For instance, auto_rebalance_interval 300.

    The auto_rebalance_criteria option defines the auto-rebalance criteria. The options available are as follows:

    • se_auto_rebalance_cpu

    • se_auto_rebalance_mbps

    • se_auto_rebalance_open_conns

    • se_auto_rebalance_pps

    For instance, auto_rebalance_criteria se_auto_rebalance_cpu.

    The auto_rebalance_capacity_per_se integer-value defines the maximum allowed value for the specified criteria. For instance, the integer-value will be the maximum PPS in the case of se_auto_rebalance_pps and the maximum Mbps in the case of se_auto_rebalance_mbps. For instance, auto_rebalance_capacity_per_se 200000.

    Note: The auto_rebalance_capacity_per_se unit for the Service Engine group is set to MBps (megabits per second), and the throughput reported for the virtual service and service engine on the UI is in Mbps (megabytes per second). When entering an integer value for the auto_rebalance_capacity_per_se option, make sure to consider the correct unit of measurement.
  6. Enter Save to save the configuration.

Configuring Auto-rebalance Threshold

The auto-rebalance threshold can be configured based on the SE group. You can use the following commands to configure the maximum and minimum threshold values per SE groups.

Note:

The object used to configure thresholds is the same for all the trigger types (max_cpu_usage, min_cpu_usage) and is a part of the SE group configuration.

configure serviceenginegroup Default-Group
max_cpu_usage value
min_cpu_usage value
save 

The max_cpu_usage value defines the maximum threshold value for CPU. The value is in percentage. For instance, max_cpu_usage 70.

The min_cpu_usage value defines the minimum threshold value for CPU. The value is in percentage. For instance, min_cpu_usage 30.

Use Case Scenario

This section covers two possible scenarios and the associated configuration.

Scenario 1: Auto-rebalance is based on PPS trigger, with a scale out threshold of 70% (of 200,000 PPS, that is, when it exceeds 140,000 PPS) and a scale in the threshold of 30% (of 200,000 PPS, that is, when it reduces below 60,000 PPS).

switchto tenant Avi
switchto cloud azure
configure serviceenginegroup Default-Group
auto_rebalance_interval 300
auto_rebalance_criteria se_auto_rebalance_pps
auto_rebalance_capacity_per_se 200000
max_cpu_usage 70
min_cpu_usage 30
save

Scenario 2: Auto-rebalance is based on open connection triggers, with a scale out threshold of 60% (of 5,000 open connections, that is, when it exceeds 3,000 open connections) and a scale in threshold of 20% (of 5,000 open connections, that is, when it reduces below 1,000 open connections).

switchto tenant Avi-azure
switchto cloud azure
configure serviceenginegroup Default-Group
auto_rebalance_interval 300
auto_rebalance_criteria se_auto_rebalance_open_conns
auto_rebalance_capacity_per_se 5000
max_cpu_usage 60
min_cpu_usage 20
save