Introduction

Auto Scaling allows you to scale up or scale down back-end services or application virtual machines(guest VMs) based on various conditions you define and thereby ensure optimum use of virtual resources. Conditions for triggering a scale up or scale down action can vary from a simple use case like monitoring the CPU usage of a server to a complex use case say of monitoring a combination of server's responsiveness and its cpu usage. Loadbalancers like NetScaler are well placed to monitor all aspects of a server’s health and work in unison with Cloud Orchestration products like CloudStack to initiate scale up or scale down actions. This feature is an extension to ELB support and currently supported only in NetScaler 10.0

Purpose

This is the functional specification for the LB rule based AutoScale feature of CloudStack.

Document History

S.No.

Version

Date

Author

Remarks

1

1

13 June 2012

Deepak

First Draft of FS

2

1.1

02 July 2012

Ram Ganesh

second draft version. Revised various sections

3.

1.2

10 July 2012

Vijay Venkat

Updated with list and delete commands and added account info in create commands

4.

1.3

18 July 2012

Vijay Venkat

Introduced with defaults and update APIs

5.

1.4

8 Aug 2012

Vijay Venkat

Added recommended steps and more text to update commands.

Glossary

Counter

Performance counters to be used  for monitoring the health of the back-end services(guest VMs) which are being load balanced by load balancers such as NetScaler. These counters can be either SNMP based counters or the counters supported by loadbalancers. We could ship CloudStack with a set of built-in popular counters.

Condition

Conditions express criteria for triggering an autoscale action. It uses the counters defined above.

AutoScale Policy

AutoScale Policy defines a policy for taking an autoscale action by combining conditions defined above with an autoscale action such a scaleup or scaledown

AutoScale Vm Profile

AutoScale Vm Profile is a container for various settings to be used while taking scale up or scale down action. Settings could be what template id to use,what service offerings to use etc

AutoScale Vm Group

AutoScale Vm Group associates scaleup and scaledown policies with a loadbalancing  rule. It also defines the size of the Autoscale'd vm group.

Feature Specifications

Auto Scaling allows you to scale up or scale down back-end services or application virtual machines(guest VMs) based on various conditions you define and thereby ensure optimum use of virtual resources. 
Use cases

Architecture and Design description

Collector/Monitor: This module is responsible for gathering metrics from various guest VMs. Timers wakes up a collector/monitor periodically for metric collection purpose. Periodicity of timer is configurable.Monitoring framework in NetScaler is rich in protocol support varying from L3 to L7 with deep packet inspection capabilities.

Aggregator: This module aggregates the collected metric values based on various algorithms such as average,minimum,maximum etc. In NetScaler this is part of the monitoring infrastructure.

Trigger/Alarm Generator: Timer based triggers monitors the output of aggregators,evaluates autoscale conditions and generates a trigger/alarm if the condition is evaluated to true.In NetScaler this is part of powerful policy based infrastructure responsible for various expression evalutions and actions.

Trigger/Alarm Handler: Trigger/Alarm Handlers acts on the trigger/alarm and initiates a scaleup/scale down action working in unison with Cloud orchestration products such as CloudStack.This is a web service residing in the NetScaler management plane and acts as a glue between CloudStack management server and NetScaler data plane.

In the current implementation all the above 4 modules reside inside NetScaler system. The interaction between Trigger Generator and Handler is based on standard json payload over HTTP.

Following are the proposed APIs for this feature. For all the APIs defined corresponding delete and list* commands will also be provided

createCounter

Available to ROOT admin only

Request parameters

New tables

deleteCounter

Available to ROOT admin only

Request parameters

listCounters

Available to all users

Request parameters

createCondition

Request parameters

New tables

deleteCondition

Request parameters

listConditions

Request parameters

createAutoScaleVmProfile

Request parameters

New tables

updateAutoScaleVmProfile

Request parameters

NOTE: An autoscale vm profile can be updated only if all the VM Groups it is associated with are in disabled state. disableAutoScaleVmGroup has to be called to all Vm Groups associated with this profile before issuing this command.

deleteAutoScaleVmProfile

Request parameters

listAutoScaleVmProfiles

Request parameters

createAutoScalePolicy

Request parameters

New tables

updateAutoScalePolicy

Request parameters

NOTE: An autoscale policy can be updated only if all the VM Groups it is associated with are in disabled state. disableAutoScaleVmGroup has to be called to all Vm Groups associated with this policy before issuing this command.
* The conditionids are always reset, no addition or deletion of policies is possible. Meaning, in order to add one more to the list, pass the existing and the new ones. In order to delete one, remove the one to be deleted from the existing list and pass the remaining.

deleteAutoScalePolicy

Request parameters

listAutoScalePolicies

Request parameters

createAutoScaleVmGroup

Request parameters

New tables

updateAutoScaleVmGroup

Request parameters

NOTE: An autoscale vm group can be updated only if it is in disabled state. disableAutoScaleVmGroup has to be called to first before issuing this command.

deleteAutoScaleVmGroup

Request parameters

listAutoScaleVmGroups

Request parameters

disableAutoScaleVmGroup

Request parameters

This API is used to disable autoscaling on a AutoScaled Vm Group. By default on creation, autoscaling is enabled on an Autoscale Vm Group. A user could disable AutoScaling in a Vm Group for 2 reasons.
1. A need to update the autoscale config. An autoscale config here means updation of policy parameters, addition/deletion of new conditions in a scaleup or scale down policy or updation of autoscale vm profile parameters or updation of vm group parameter itself.
2. For performing a maintenance operation on his fleet. This will enable the user to bring down/up any members of his fleet, during which autoscaling should be disabled. Meaning, no operation like scale up / down would happen.

enableAutoScaleVmGroup

Request parameters

This command is used to enable autoscaling on a AutoScale Vm Group. By default autoscaling is enabled on a autoscaled Vm Group during creation. A user could have disabled AutoScaling in a Vm Group for several reasons, this API is called to enable the AutoScale Vm Group back to autoscaling. Once this is done the fleet with scale up and down depending on the policies configured.

Event Types

COUNTER.CREATE
COUNTER.DELETE
CONDITION.CREATE
CONDITION.DELETE
AUTOSCALEPOLICY.CREATE
AUTOSCALEPOLICY.DELETE
AUTOSCALEPOLICY.UPDATE
AUTOSCALEVMPROFILE.CREATE
AUTOSCALEVMPROFILE.UPDATE
AUTOSCALEVMPROFILE.DELETE

AUTOSCALEVMGROUP.CREATE
AUTOSCALEVMGROUP.DELETE
AUTOSCALEVMGROUP.UPDATE

AUTOSCALEVMGROUP.ENABLE

AUTOSCALEVMGROUP.DISABLE

Operations not supported

Quality Risks

external*: CloudStack API calls made outside the context  of Autoscale

Logging and  Debugging

Run-time environment requirements

Performance considerations

Evaluation of possible security attacks against the feature 

Interoperability and compatibility requirements

UI flow:

A basic idea of the UI.

On clicking the configure button, a configuration window will popup allowing an admin to configure AutoScale feature .