Cloud server autoscaling is a new feature in NSX Advanced Load Balancer platform that enables infrastructure administrators, operators, and application developers to use the NSX Advanced Load Balancer server auto scaling solution in concert with cloud auto scaling groups.

Auto scaling groups in the AWS are referred to as external autoscaling groups in NSX Advanced Load Balancer because they are an external entity to NSX Advanced Load Balancer. With this feature, more fine-grained scaling policies can be applied, based on NSX Advanced Load Balancer Controller collected metrics and AWS CloudWatch metrics.

Metrics used for Server Autoscaling

Metrics collected from SE, and AWS cloud enable NSX Advanced Load Balancer to take action regarding scale-out or scale-in events. The NSX Advanced Load Balancer SE collects metrics for services hosted on an SE. AWS CloudWatch collects metrics from the Server instance (virtual machine) level metrics.

The Service Engine collects the following metrics:

  • Level 4 metrics

  • Level 7 metrics

  • Service Engine metrics

  • Insight metrics

For the complete list of metrics collected by NSX Advanced Load Balancer, see SE Metrics Metrics in the VMware NSX Advanced Load Balancer Monitoring and Operability Guide.

Metrics collected by AWS

Infrastructure-related metrics for server instances such as CPU usage, network usage, and so on, are fetched from CloudWatch by NSX Advanced Load Balancer. AWS collects the following metrics.

  • vm_stats.avg_cpu_usage

  • vm_stats.avg_disk_read

  • vm_stats.avg_disk_write

  • vm_stats.avg_disk_io

  • vm_stats.avg_net_usage

Configuring Autoscale Policy and Autoscale Launch

The metrics mentioned above are fetched for a pool when the pool is enabled for autoscale orchestration. The metrics mentioned in the previous section are fetched for a pool when the pool is enabled for autoscaling. For server autoscaling to work, the pool must be enabled with an autoscale policy and an autoscale launch configuration.

Autoscale Policy

An autoscale policy is a set of rules to configure and trigger an alert using the above-mentioned metrics. To create or choose an existing autoscale policy, navigate to Applications > Pools and click the edit icon for the desired pool. Select the AutoScale Policy option in the Profiles/Policies tab to add a new autoscale policy or to use an existing one.

Autoscale Launch Configuration

An autoscale launch configuration must be associated with the pool for server autoscaling to work.

Setting the value for use-external-asg to true instructs the Autoscale Manager to start orchestrating scale-in or scale-out activities for the associated pool. The value for the use-external-asg flag is set to true for the default autoscale launch configuration (default-autoscalelaunchconfig).

To enable Use External ASG, navigate to Applications > Pools, and click the edit icon for the desired pool. Select the desired name from the drop-down menu of Autoscale Launch Config field in the Profiles/Policies tab.

AZ Aware Autoscaling

While scaling in, NSX Advanced Load Balancer autoscale will ensure the balance of servers across different AWS availability zones. For instance, if there are four servers in a pool (two servers each in AZ1 and AZ2), and scale-in happens for two servers, you will be left with two servers (one in each AZ).

Note:

This feature is available only for AWS.

Configuring Pool for Server Autoscaling

The following are the steps to configure pool for server autoscaling:

  1. Navigate to Applications > Pools. Click Create Pool and select the required cloud.

  2. Click Profiles/Policies tab.

  3. Create an Autoscale Policy by clicking the three dots and selecting near AutoScale Policy drop-down menu.



  4. On the New Server AutoScale Policy page, provide the desired name, and minimum and maximum instances for the pool. You can also provide Server Garbage Collection Delaydetails.

    1. Select the Intelligent (Machine Learning) and Use Predicted Load options.



  5. Select the required alerts for server autoscaling from the Alerts dropdown menu in the Scale-Out section. Also specify the Cooldown Period, Adjustment Step, and Intelligent Margin.

    1. Alerts: It enables the alert to trigger server autoscale policy. If this checkbox is selected, then on the alert generation event, it will also check if any server autoscale policy exists that uses it and subsequently triggers server autoscale. Currently, this feature is supported only on the AWS cloud.

    2. Cooldown Period: During this period no new scale-out event is triggered to allow the previous scale-out to complete.

    3. Adjustment Step: Maximum number of servers to scale-in simultaneously. This number is chosen such that the target number of servers is always more than or equal to the min_size.

    4. Intelligent Margin: Minimum extra capacity as percentage of load used by the intelligent scheme. Scale-out is triggered when the available capacity is less than this margin. Whereas, Scale-in is triggered when the available capacity is more than this margin.



  6. Select the required alerts for server autoscaling from the Alerts dropdown menu in the Scale-In section. Also specify the Cooldown Period and Adjustment Step and Intelligent Margin.

  7. After specifying the necessary details, click Save.

  8. Navigate to Applications > Pools and select the drop-down menu for AutoScale Launch Config to create a new autoscale launch configuration. Specify the name for autoscale launch.

  9. Click Save.

  10. Create a virtual service for the configured pool with an autoscaling group.

Autoscale Activities and Events

Autoscale alerts are generated and pool members scale-out when configured metrics exceed the threshold values. The following are the events generated by the pool for a scale-in and scale-out activity.

The following are the events generated for scale-out activity:

  1. SERVER_AUTOSCALE_OUT: An autoscale scale-out alert is generated by the alerts manager.

  2. SERVER_AUTOSCALE_OUT_TRIGGERED: The autoscale manager triggers scale-out activity on the pool.

  3. CONFIG_UPDATE: The pool is updated with the new member.

  4. AWS_ASG_NOTIFICATION_INSTANCE_ADDED: An instance is added to AWS auto scaling group.

  5. SERVER_AUTOSCALE_OUT_COMPLETE: The autoscale manager triggers this event when the scale-out activity is complete. This indicates scale out is successfully complete.

  6. SERVER_UP: This indicates the newly added server is ready to serve traffic.

Navigate to Templates > Events to check alerts generated for scale-out or scale-in events.

The following are the events generated for scale-in activity,

  1. SERVER_AUTOSCALE_IN: An autoscale scale-in alert is generated by the alerts manager.

  2. SERVER_AUTOSCALE_IN_TRIGGERED: The autoscale manager triggers the scale-in activity on the pool.

  3. CONFIG_UPDATE: The pool was updated and the scaled-in pool member is deleted.

  4. AWS_ASG_NOTIFICATION_INSTANCE_REMOVED: Indicates an instance has been removed from AWS auto scaling group.

  5. SERVER_AUTOSCALE_IN_COMPLETE: The autoscale manager triggers this event when the scale-in activity is complete. This indicates scale-in activity is successfully completed.

Note:

Burstable Performance Instance types are not supported for CPU utilization based autoscaling. Burstable Performance Instance types are AWS instance types with their names starting with T2, such as, T2.micro, T2.large, and so on.