Sunday, 10 May 2015

Azure Auto Scaling Virtual Machine

As IT industry is growing day by day, the requirement of an organization is also widening in terms of automating the services that is being delivered to the customer in more efficient and scalable way.
In this blog, we will be having a look on how to auto scale the VM’s residing on Azure depending upon the loads mounting on VM in adhoc manner and how easily VM balances the load by scaling up/down VM.
To demonstrate the same, I have used the following steps:

1. Deployed 5 VM’s under virtual network “SQUONS-NETWORK



2. Make sure all 5 VM’s resides in same cloud service “SQUONS” so that we can add them in availability set so as to achieve high availability.



3. I have created availability set “SQUONS-AS”.



4. Now to configure auto scale feature, go to 'cloud service' under 'scale' tab and click on 'set up schedule times' as depicted below.

Here, I am selecting “Different scale settings for weekdays and weekends” considering the scenario where VM’s load goes on peak during weekends and normal during weekdays.





5. After setting up schedule time, it allows us to edit the scale setting for schedule. Here you will get two options (Weekday/Weekend) for which you can set the scale settings.



6. I have first configured the Weekday scale setting as depicted below, where minimum 1 VM will be running & maximum 5, and when average CPU% increase above 60% then 1 additional VM will get added, whereas when average CPU% decreases below 40% then 1 VM will be removed. This addition/removal of VM depends upon the scale up/down wait time, i.e. after a particular interval of time the VM gets added/removed.



7. Next moving towards configuring Weekend scale setting, I have configured in such a way that minimum 3 VM’s will be running & maximum 5, and when average CPU% increase above 60% then 1 additional VM will get added, whereas when average CPU% decreases below 40% then 1 VM will be removed. This addition/removal of VM depends upon the scale up/down wait time, i.e. after a particular interval of time the VM gets added/removed.



8. After saving the scale setting for schedule, the number of VM’s will settle down to minimum number of VM that has to be functioning on weekday/weekend by removing the VM one by one with every scale up/down wait time.

To test functionally auto scale feature of Microsoft Azure, after settling down the VM I increased the CPU utilization of running VM using “CPU Stress” tool as my scale by metric is CPU so that a VM will be added after scale up wait time.

CPU Stress” is available at http://blogs.msdn.com/b/vijaysk/archive/2012/10/27/tools-to-simulate-cpu-memory-disk-load.aspx




Following picture depict the number of VM's running during weekdays and weekends.






This kind of solution is provided to the customer whose business application and/or services touches the peak consumption during weekday/weekend. It is a cost effective and efficient way to achieve ones requirement without investing for bulk resources for particular period of time and hardly utilize thereafter. As one cannot predict how much hit/load will their application and/or services will get and when, so here we can use auto scaling feature and company needs to pay only for what they have used.


No comments:

Post a Comment