In this blog, we would provide you three ways to Optimize and save cost whenever you’re using Azure Virtual Machines. Before getting started let us understand pricing for Azure VMs. Let’s Get Started.
Azure virtual machine pricing & understanding the hourly rate.
Windows Virtual Machines in Microsoft Azure are by default running in a Consumption-Based model. This means that each hour a Virtual Machine is “Running” it is billed at an hourly rate. If a VM is Stopped (deallocated), then there is no hourly charge during that time.
The hourly rate for each VM varies based on the Type and Series of VM and the specific Size within that Series. There are plenty of options to choose from depending on workload, so it is best to narrow the options based on expected resource utilization, then test a few options and measure actual utilization and performance vs. resource capacity.
The hourly rate for each VM in a Pay-as-you-Go model is made up of 2 different costs.
- Compute Cost – This is the base cost to run the Virtual Machine. In different terms, think of this as the “Hardware Cost.” Microsoft is essentially charging an hourly rate to rent hardware (chopped up into Virtual Machines) in their datacenters.
- Operating System Cost – Of course, Microsoft has always been/will always be a Software company, and the foundation of all software is the Operating System. So if you are running a Virtual Machine with Windows Server installed, Microsoft charges an hourly Operating System rate.
With understanding of of the hourly rate of virtual machines (VM’s) in Microsoft Azure, we can now explore the three specific ways to optimize and save costs.
1 – Right Size VM’s:
In the most simple terms, Rightsizing is the action of identifying the best long term fit for VM Instance (Type, Series, Size). Ideally, this would be finding a perfect match of resource capacity vs. actual needs. However, this can be especially difficult when initially deploying VM’s because there is no historical data to show resource utilization vs. capacity. In such cases, we recommend narrowing potential VM’s to a few good options then testing these for a few days at a time while monitoring utilization vs. capacity. In cases where VM’s have been running for weeks or months already, Rightsizing should be much more precise as long as historical data is analyzed. In reviewing resource utilization vs. capacity while also factoring real-world feedback from users and future growth/changes, the appropriate VM size can be selected.
2 – Utilize Azure Hybrid Benefits:
When looking at the hourly cost of a Windows Virtual Machine in Azure, there is the Compute Cost and the Operating System (OS) Cost. The OS cost is essentially renting the Operating System software at an hourly rate. Azure Hybrid Benefits provides an OFF switch for the Windows OS cost (also applies to other OS types i.e., SQL). To flip the OFF switch, you are essentially declaring that you will be bringing your own approved Windows Server license, Windows OS with Software Assurance, or Subscription. If you do not already own or subscribe to Windows Server, then an analysis should be done to evaluate the potential long term cost savings of the Bring-Your-Own model vs. Pay-as-you-Go. Ultimately the size of the VM and the runtime hours determine the long term ROI in this model.
3 – Reserve VM Instances:
The other half of the hourly cost of a Windows Virtual Machine in Azure is the Compute Cost. Reserved Instances are a term commitment (1 or 3 years) to use a specific VM type. In exchange for the commitment, Microsoft offers a fixed discounted price for the use of that VM. Since the rate is fixed for the entirety of the term, there is no longer an hourly compute cost. Additionally, it is a use-it or lose-it model, so there are no additional cost savings for turning OFF virtual machines.
Now that we’ve covered these 3 steps for cost optimization let’s look at an example. Let’s assume that we have already gone through a right-sizing exercise and settled on the D8v3 VM size in East US datacenter and this VM is running 24X7:
| Runtime Hours | Pay-as-you-go | 1 Year RI | with AHB |
| 730 | $ 548.96 | $ 435.81 | $ 167.17 |
| 21% Savings | 70% Savings | ||
| Runtime Hours | Pay-as-you-go | 3 Year RI | AHB |
| 730 | $ 548.96 | $ 376.22 | $ 107.58 |
| 31% Savings | 80% Savings |
You can see that 80% cost savings is truly attainable, but this assumes that you already own Windows Server with SA/Subscription and that the runtime of the VM is 24X7 (never turned off). If you need to purchase new Windows Server licenses and/or your VM will be scheduled to turn on/off automatically, additional analysis is needed to calculate cost savings and ROI. Stay tuned and do subscribe to our blog to keep getting all updates regarding our new blogs.