Softlayer Autoscaling

One thing I am using more and more in my Softlayer environments is the autoscaling feature. Having the ability to meet compute demands in peak times, and reduce costs when it’s quiet is invaluable. Sounds good right? So what actually is Softlayers autoscaling feature?

Autoscale is a free service configured from the Softlayer portal or the Softlayer API. It allows you to scale in and out based on different healthcheck style policies. More commonly than not, the autoscale pool will be behind a local or global load balancer. However, this is not a requirement. Applications that can scale in a cluster can be done in a pool without any load balancing.

I recently setup an autoscale pool for a project I am working on codenamed ‘Pheonix’. It is incredibly simple to do and along with some pre defined scripts and images (which I will show below). When scaling out, there is 0 manual intervention involved when a server is added.

Hit the link below for a walkthrough!

From the softlayer portal, go to Devices > Auto Scale

Screen Shot 2015-09-18 at 12.07.01 pm

This will take you to the autoscale page, from here you can configure your pool.

Screen Shot 2015-09-18 at 12.08.59 pm

Select Add Auto Scale Group. This will take you to the config page

Screen Shot 2015-09-18 at 11.52.25 am

Firstly name your cluster, something easy to identify. Select your region and datacentre. This is where your compute is going to sit. My servers are in Toronto.

The Termination policy is which servers to shut down first when scaling down. I generally go with newest as I run a very small server as my base, the reason is simple. In quiet times I am only paying for a small 1 Core 2 GB RAM server. I can scale up on a schedule when I know it will be busy, or as I am showing below. When servers are unexpectedly busy.

Screen Shot 2015-09-18 at 11.52.35 am

Next select the vLAN you want to provision your servers in. I am just provisioning mine into the automatically created public vLAN for my account. There are some options I am not using

Private Network Only – This provisions servers on a private vLAN with no public facing interfaces. This is a great option for servers like databases. The one caveat with this option is that you cannot associate a load balancer with a private autoscaling pool.

Balance Across Multiple vLANs – This allows you to scale in multiple DC’s, or more than one vLAN in the one DC.

Screen Shot 2015-09-18 at 11.52.41 am

Next you select the minimum and maximum amount of servers in the pool. This prevents the automation from creating hundreds of servers in the case of a massive influx of traffic or activity. A secondary measure for this is the cooldown period. This setting defines how long to wait after provisioning a new server before adding another. This setting allows a new server to take effect and prevent over provisioning.

Screen Shot 2015-09-18 at 11.55.30 am

Next you define your hostname and domain. The hostname will have a value dynamically assigned during scaling (eg. pheonix1, pheonix2 etc)

Screen Shot 2015-09-18 at 11.55.35 am

Next specify the size of the VM’s you want to provision, I scale with medium-large servers, 4 Cores and 16 GB RAM.

Screen Shot 2015-09-18 at 11.55.40 am

Select your OS. You can use a stock install of any Softlayer licensed VM, as well as Softlayer Public images. In my case, I have an image template of a LAMP Server (on CentOS) that I use as my base for scaling.

Screen Shot 2015-09-18 at 11.55.45 am

Select your storage, because I am using an image template my disk size is predetermined, however if you are scaling with a vanilla OS you can specify disk size.

Screen Shot 2015-09-18 at 11.55.50 am

This is an optional step, however I have a python script that I kick off during provisioning that sets up a few things, does some updates and starts some daemons. This means that a server automatically comes into service without any manual intervention

Screen Shot 2015-09-18 at 11.56.34 am

Now we set up our scaling policies. In my case I add a server if my current servers are over 80 percent CPU use for 30 mins. I add 1 server if this criteria is met.

Screen Shot 2015-09-18 at 11.57.13 am

I have a second policy that starts removing servers if CPU usage is under 30% for 90 minutes. This is a reasonably conservative setting, but I hate slow websites.

Screen Shot 2015-09-18 at 12.00.57 pm

Finally you can associate a load balancer with VIP. I am using my own load balancing (Softlayers Netscaler) so I am not associating one with this group.

Done!

You now have your autoscaling set up and ready to roll. Enjoy one of the most powerful capabilities of cloud based IaaS!

Leave a comment