Azure Automation with runbooks- Why NOT enough to reduce Azure bill?

by INVOKE Team


Posted on October 28, 2019 at 12:00 AM


Azure Automation Run Books

image courtesy http://surviveyourchildsaddiction.com/one-size-not-fit/

Cloud runs on per second billing. When companies rent servers from Microsoft Azure, they will get billed for every second (except for windows OS servers) they keep their Azure VM up and running irrespective of whether anyone accesses the applications hosted on them or not. Microsoft Azure billing engine doesn’t pay attention to whether Azure VM is being utilized 100% or not . If it is in “running” state, it will be charged for compute hours.

Companies who know about cloud economics use better tools to reduce Azure VM bill  and enjoy true benefit of cloud hosting. If you have not already started practicing the cloud cost optimization, you should do it now. Looking for help? Talk to us, we are happy to help.

Recent studies suggest that Azure VMs are the top used resources in Microsoft Azure Cloud. If you are using Azure VMs for running applications in cloud, optimizing Azure VM usage and reducing the Idle time of these VMs could tremendously help in reducing your Azure Cloud bill. Some of the optimizations used by teams are “right sizing”, Azure Automation using run books to turn off the servers during nights and weekends.

    Right Capacity Sizing

Right sizing means use the Azure VMs with “actual required capacity” with some buffer instead of “assumed required capacity”. What this means is, if application hosted on a server can run on B2MS, launch B2MS instead of B3MS. The price difference between these types of VMs is almost double. 

Right sizing VMs is most overlooked and underestimated cost optimization technique. Teams can get benefit by using tools like Azure Advisor to understand the resource usage and appropriately provision the Azure cloud resources.

Azure Cloud Automation (or) Azure Runbooks

Based on  Azure Automation documentation , The Azure automation is a Microsoft Azure-provided solution that enables customers to easily configure custom start and stop schedules for their VMs using “runbooks” and Azure Run As Account authentication method.

Not only Azure Automation, lately you might have observed that a lot of companies introducing different flavors of schedulers like AI based schedules, smart schedules etc., to reduce Azure VM bill.

What is wrong with Azure Automation ?

Azure Automation comes with multiple challenges. Some are on technical implementation details like you need to learn how to configure Azure Run account, Log Analytics account and corresponding permissions/custom roles. Not only the configuration issues, the biggest limitation is "NO cross subscription VM management". Azure automation runbook solution at this point can manage VMs in same subscription (though the VMs can be across regions). We will cover these hurdles in separate a blog post soon. In this blog, I will focus on non-technical hurdles.

Azure Automation comes with multiple challenges. Some are on technical implementation details like you need to learn how to configure Azure Run account, Log Analytics account and corresponding permissions/custom roles. Not only the configuration issues, the biggest limitation is "NO cross subscription VM management". Azure automation runbook solution at this point can manage VMs in same subscription (though the VMs can be across regions). We will cover these hurdles in separate a blog post soon. In this blog, I will focus on non-technical hurdles.

Why is identifying a schedule for a resource is a tough task? You might be thinking that  it is very easy and can come up with a schedule saying XX AM to YY PM. Well, in cloud deployments, defining a broad schedule like that will not help with cost optimizations. Following are few scenarios why it might not help:

1) One team handles multiple applications

In a typical software development company, it is not uncommon for one team to handle more than one application. Assume one application owner validating two applications, 4 hours one & 4 hours on other VMs. In this case, we need instance UP only for 4 hours in a given day

If this business using Azure run books and scheduled to bring these 2 instances every day at 7 AM and bring them down at 6 PM, which means Microsoft Azure VMs are up for 11 hours.

With schedulers, the cost company pay per year would be:  11 hrs * 5days * 4 weeks*12 month * $0.0928 (B2MS) * 2 (Azure VMs) = $490/Year  What you will be paying for Microsoft Azure is around $490. There are multiple problems with this solution:

A) Availability

How about if the product owner wants to check something after 6 PM? Can he/she access the application? NO, because servers are brought down by schedulers. Someone needs to bring them up and remember to shutdown when done. PAIN.

B) Each of the Azure VMs are used ONLY 4 hours in a day, but they are up for 11 hours. Which means around 7 hours of Idle instances which is cloud spend wasted.

3) Users could be AWAY for the day, still schedule brings up the servers (resource waste). It is estimated that on an average employees take 2 day off per month.

Every day 1 hour for lunch break, coffee and smoke breaks.

4) Jungling between meetings & application access

Depends on the case, but users will be pulled into meetings frequently and during those hours we are unnecessarily paying for compute resources.

5) Teams could be spread across different time zones

6) More than one server is needed to run applications 

This very common use case in application development. Database could be hosted on different host while web server is hosted on another instance. Identifying these instances together and applying the same schedule is a tedious task. Azure Automation has “tag” based approach to solve this approach, but NOT as efficient as it should be.

These are some of the prevalent use cases occur in the workplace and each of these use cases will leave Azure Virtual Machines in idle state and cause cloud spend waste. Right Scale study identified that in year 2017 alone $10B of cloud spend was wasted and main reason was, leaving Microsoft Azure Virtual Machines idle. Scheduler based solutions, be it AI based or smart scheduled based, we clearly cannot avoid idle instances and help in reducing Microsoft Azure bill .

In a dynamic and agile world, users do multitasking and access servers or applications on-demand need basis. Associating a schedule to anything which is need basis would severely limit the capabilities and effect outcomes.

    What is the solution?

The solution is to use tools like INVOKE Cloud, which brings up the servers on-demand, ONLY when users need to access the applications hosted on those servers. If we take the above example and calculate cost after using INVOKE Cloud.

The application owner logged in at 8 AM and started using application1. INVOKE Cloud will bring up the server at that moment (instead of 7 AM like Azure Automation). He/She used application till 12 PM and went for lunch.

    Application1 Cost

4 hrs * 5 days * 4 weeks * 12 month * $0.0928 (B2MS) * 1 (Azure VM) = $89/Year

Came back from lunch around 1 PM and started using application2. INVOKE Cloud will bring up the server at that moment (instead of 7 AM like Azure Runbooks). He/She used application till 5 PM and logged off for the day.

    Application2 Cost

4 hrs * 5 days * 4 weeks * 12 month * $0.0928 (B2MS) * 1 (Azure VM) = $89/Year

Total cost for 2 boxes per year would be around $180. There is a clear cost savings of $310 by using on-demand solutions like INVOKE Cloud.

In a nutshell, companies who are conscious about cloud economics, but using scheduler based solutions are not really enjoying the cost benefits. You should start using on-demand tools like INVOKE Cloud to reduce your Azure hosting costs and save more money. Have more questions? Talk to us , we could help you.