Cloudstack autoscaling

32
Auto Scaling with Apache CloudStack Paul Gosden Technical lead of networking services division [email protected] Twitter: @ShapeBlue

description

Auto scaling with cloudstack and Citrix netscaler.

Transcript of Cloudstack autoscaling

Page 1: Cloudstack autoscaling

Auto Scaling with Apache CloudStack

Paul GosdenTechnical lead of networking services division

[email protected]: @ShapeBlue

Page 2: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

What is AutoScale?AutoScale allows systems to dynamically react to a set of defined metrics and to scale resources accordingly.Providing : -

High AvailabilityCost SavingEnergy Saving

Overview

Page 3: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Applications or services that see elasticity in their demand.Launching a new website with unknown visitor numbersViral marketing campaigns, these can present unpredictable traffic loads as some work and some don’tAn analytical application might scale out the servers performing in a calculation process – using 20 machines for 1 hour, rather than 1 machine for 20 hours

Use Cases

Page 4: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

A new web company designs and builds an application based on a web service that supplies concert ticketsLow capital reserves – Limited resources for Compute platformDesigned their application to be statelessLimited budget for advertising so are using social media in the hope that it goes viral

Example Life Cycle

Page 5: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Initial Configuration

CloudStack

Application Template

Account Infrastructure

End user configures the CloudStack AutoScale policy on the network

End User

Netscaler

Page 6: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Initial Configuration

CloudStack

Application Template

Account Infrastructure

CloudStack configures the Netscaler via the NITRO API

Netscaler

Page 7: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Initial Configuration

CloudStack

Application Template

Account Infrastructure

Netscaler makes the API call back to CloudStack to launch the Minimum amount of instances in the policy

Netscaler

Page 8: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Initial Configuration

CloudStack

Application Template

Account Infrastructure

CloudStack launches the Instances from the Application Template

Netscaler

Page 9: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Process

CloudStack

Application Template

Account Infrastructure

The Netscaler will wait for the quiet period to finish to allow the servers to boot and bring the applications on-line

Netscaler

Page 10: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Process

CloudStack

Application Template

Account Infrastructure

The Netscaler binds the IP’s of the Instances to the service group hosted on the Netscaler

Netscaler

Page 11: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Lifecycle

CloudStack

Application Template

Account Infrastructure

Users start to visit the site and the Netscaler monitors the SNMP metrics from the instances

NetscalerUsers

Page 12: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Lifecycle

CloudStack

Application Template

Account Infrastructure

User count continues to rise and the server group starts to hit the metrics set in the auto scale policy

NetscalerUsers

Page 13: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Lifecycle

CloudStack

Application Template

Account Infrastructure

The Netscaler then uses its API command to contact CloudStack to launch more instances

NetscalerUsers

Page 14: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Lifecycle

CloudStack

Application Template

Account Infrastructure

The Instance is again given its quite time to boot and start the application

NetscalerUsers

Page 15: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Lifecycle

CloudStack

Application Template

Account Infrastructure

The instance is now running and registered to the NetScaler service group online and all servers are back under the counters for the Auto Scale

NetscalerUsers

Page 16: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Lifecycle

CloudStack

Application Template

Account Infrastructure

This process will be repeated as needed until the policy hits the max instances count

NetscalerUsers

Page 17: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Lifecycle

CloudStack

Application Template

Account Infrastructure

If user numbers reduce the server again hits the AutoScale scale down policy counters

NetscalerUsers

Page 18: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Lifecycle

CloudStack

Application Template

Account Infrastructure

The Netscaler sends the API command to the CloudStack Server to destroy under utilised instances

NetscalerUsers

Page 19: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Lifecycle

CloudStack

Application Template

Account Infrastructure

The System is now back to running the appropriate amount of instances as needed

NetscalerUsers

Page 20: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Should be driven by the end userVM Template with appropriate setupCustomer account with API enabledCustomer CloudStack Isolated Network stood up with a min of one VM running to provision the virtual router

User System Requirements

Page 21: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

SNMP needs to be enabled on boot and configured with community name and portIf needed allow port 161 for UDP access via the firewallApplication to be launched on first boot

For example on a web application the web server would need to be running and the application to be configured

with database settings to automatically join the pool.Alternative is to have a configuration management system configure the VM as a post-provisioning action E.G. Puppet or Chef

Creation of Templates

Page 22: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Adding the AutoScale Policy

Page 23: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

AutoScale Configuration Screen

Page 24: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

AutoScale Configuration Wizard

Selected template Compute offering for the selected instance. i.e. CPU, no of CPU’s, RAM etc. Min Instance – VMs count, if a VM is in a down state it is not counted in the min

count and the AutoScale feature will spin up another instance Max Instance – VMs count Remember that the domain limits on adding instances

needs to be large enough for this to scale as needed

Page 25: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Duration that the policy counters need to be at the specific range across the group

AutoScale Configuration Wizard

Page 26: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

AutoScale Configuration Wizard

Page 27: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

AutoScale Configuration Wizard

Polling Interval in seconds for the SNMP monitoring Quiet time to allow for boot and application registration

Page 28: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

API to list existing countershttp://192.168.21.76:8096/client/api/?command=listCounters

API to add a new counter (OID)http://192.168.21.76:8096/client/api?command=createCounter&name=WindowsCPUPercentage&source=snmp&value=1.3.6.1.2.1.25.3.3.1.2.2

Adding OIDS

Page 29: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Netscaler GUI checks

Page 30: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Apache CloudStack 4.1 +Citrix Netscaler 10.0 Build 71.6016.e +

Version Requirements

Page 31: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

Basic Zone needs NetScaler EIP and ELB as network offeringAdvanced Zone needs a Network offering utilising a NetScaler for load balancingSet Global Config Parameter "endpointe.url" with the management server IP or floating IP if load balanced

Administrator Considerations

Page 32: Cloudstack autoscaling

@ShapeBlue #CloudStack #CCCEU13

No special configuration is required on the NetScalerSetup the Citrix Netscaler with appropriate NSIPNetScaler should be added into CloudStack in the standard way, as an external device in either dedicated or shared modeA network offering will need to be created, utilising NetScaler as the Load Balancer

Configuration of the Citrix Netscaler