How to Configure Auto-rebalance Using Avi CLI

Background

The auto-rebalance feature helps in automatically migrating or scaling the virtual services when the load on the Service Engines goes beyond or falls below the configured threshold. The following are few of the trigger types aggregated at an Avi Service Engine level :

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

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

Instructions

Follow the steps given below to configure auto-rebalance feature on an Avi SE.

Login to Avi Controller CLI and enter the shell mode by using the shell command.

On prompt, enter the username and password.

Optional: Use the switchto command to switch to the respective tenant or cloud for which auto-rebalance can be configured.


switchto tenant tenant-name 
switchto cloud cloud-name 
  • Configure the auto-rebalance parameters using the following commands:
	
configure serviceenginegroup Default-Group
auto_rebalance_interval interval-value 
auto_rebalance_criteria option
auto_rebalance_capacity_per_se integer-value
switchto cloud cloud-name 

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.

Example: auto_rebalance_interval 300

auto_rebalance_criteria option – Defines the auto-rebalance criteria. The options available are:

  • se_auto_rebalance_cpu
  • se_auto_rebalance_mbps
  • se_auto_rebalance_open_conns
  • se_auto_rebalance_pps

Example: auto_rebalance_criteria se_auto_rebalance_cpu

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.

Example: auto_rebalance_capacity_per_se 200000

  • 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 

max_cpu_usage value – Defines the maximum threshold value for CPU. The value is in percentage.

Example: max_cpu_usage 70

min_cpu_usage value – Defines the minimum threshold value for CPU. The value is in percentage. Example: min_cpu_usage 30

Additional Information

Use Case Scenarios

This section covers two possible scenarios and the associated configuration.

  • Auto-rebalance is based on PPS trigger, with a scale out threshold of 70% (of 200,000 PPS - i.e., when it exceeds 140,000 PPS) and a scale in the threshold of 30% (of 200,000 PPS - i.e., 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
  • Auto-rebalance is based on open connections trigger, with a scale out threshold of 60% (of 5,000 connections per second - i.e., when it exceeds 3,000 connections per sec) and a scale in threshold of 20% (of 5,000 connections per second - i.e., when it reduces below 1,000 connections per sec).

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