Virtual Machine
  • 24 Dec 2024
  • 8 Minutes to read
  • Contributors
  • Dark
    Light

Virtual Machine

  • Dark
    Light

Article summary

Factors that affect cost


  • Virtual Machine size and characteristics

  • Operating system

  • Any licensing included with the VM

  • Region specific prices

Things to Think about


Related Costs

Your virtual machine does not live on its own in isolation.  It will work with other resources that that provide the application of solution it is part of.  You need to consider the bigger picture and the costs related to those other items, some of these will be related to meters within the VM billing item and some of them will be separate billing items on their own related to other Azure resources.  Some of these include:

  • Storage & Disks

  • Networking / Load Balancers / NAT Gateways / IP Addresses

  • Security features such as defender

  • Monitoring costs

  • Backup costs

  • Bandwidth and data transfer

You can read more about some of the considerations for these on some of the pages below:

Pay & Go vs Reservation vs Savings Plan vs Spot Instance

When you set up the VM, there are decisions to make that can help optimize costs.  Pay & Go is the default which gives you lots of flexibility.  If your workload is low priority and can fail, then a spot instance can give you options to get big discounts at a trade-off for reliability (see more info below in the optimization section).  If you know that your VM may be around for a longer period then you have options to use a reservation or savings plan depending on how much flexibility you need.

Lift & Shift Mistakes

When doing a lift and shift cloud migration, a common mistake is to create VM’s which end up being significantly oversized and then not look back to see if there is any wasted costs.  Everyone moves on to the next project and doesnt monitor costs.

Making sure to have regular and effective cost reviews can help make rightsizing corrections.

Operating System Costs

VM’s running windows are typically more expensive than VM’s running Linux in a like for like scenario.  Choosing an appropriate VM image for your workload is needed here.

Do you need a VM or a VM Scaleset

If your workload needs scale out scenarios it might be possible to use a VM scaleset rather than a VM which would allow you to create rules to easily scale out and in.  This inflate / deflate capability will allow you to operate scaling at an effective cost because usage is driving the cost.

Bring your own license

There are options to bring your own license for things like SQL where you can save some money by having your own license applied.

Do you really need a VM?

Some workloads might have alternative options to a VM which might be viable.  Remember that not all costs are just the Azure Billing line, there are also other costs within your total cost of ownership such as people costs.  Sometimes you maybe able to use a PaaS service like SQL Azure Database or SQL Managed Instance rather than a virtual machine with SQL which could give you better value for money if it would work for your workload.

Common Optimizations


Spot Instances

A spot instance type of VM can be used to get a significant cost reduction.  Spot instances use spare capacity at the data centre but you need to make sure the workloads associated with them are workloads where you can handle interruptions and unplanned terminations.  Potential candidates for spot instances are:

  • Build agents

  • Replayable Batch processing

  • Test environments

  • Stateless applications

Rightsizing

Rightsizing is the activity of picking the right sized VM for the usage of the service.  Reviewing performance metrics such as CPU and memory and if there is space capacity on the current sku you may downgrade or if the VM does not have enough resource you may upgrade.

Often customers provision resources which are much bigger than needed then don’t review them later to find out if they can be downgraded.

Reservations

If you have VM’s which are used constantly and are stable then a reservation can be used to get significant discounts.

Savings Plans

When you have resources which may need to change in size regularly then a reservation may not be the best choice as it might limit your flexibility.  In these cases you can consider a Savings Plan for Compute which will allow you to make commitments about the type of compute you will use but you have more flexibility to apply this to different types of resources and resources which can be changed in size over time.

Turn off when not used

One common optimization is to turn off or downgrade resources when they are not used.  If you have reservations which are scoped at the right level or savings plans then you can still pause resources and have those commitments be applied to other resources if they match the reservation for example.

Hybrid Benefit

If you have your own licenses then you can bring your own and apply the hybrid license benefit which can save some money.

How can Turbo360 help


Cost Visibility & Transparency

There are a number of different ways you might want to look at your VM costs.  You might want to look at them holistically across the entire environment, or you might want to allocate different teams to business units or teams and then look at VMs just within that scope.  You may also want to let those teams look after their own VM costs.  Turbo360 lets you cover all of these scenarios, and also you can delegate management to the team, meeting the key FinOps principle of letting the team who look after the application manage the costs for it.

Reservations Management

When it comes to reservations it is possible to get good visibility of resources which have a reservation applied to them and which resources could benefit from a reservation.

You can also see details of reservations to help you work out if there are places where the reservation might be missing opportunities.

Rightsizing

Turbo360 makes it easy for you to identify resources which might be over provisioned.  Below you can see resources which can be downgraded.  You can even dig deeper into these resources to see their metrics to help you evaluate them and if you are happy with the recommendation you can execute them from Turbo360.

Adding Recommendations to your Plan

Sometimes you can not immediately execute your rightsizing recommendations.  In Turbo360 you can push out the recommendations that you want to execute later to tools like Azure DevOps and Service Now so that you can put them into your typical work plans and get someone to implement the change later.

Scheduled Turn Off/On & Resizing

In Turbo360, you can use the scheduler feature.  This allows you to create a schedule to manage a number of virtual machines and other resources and to reconfigure them at specific times.  An example might be:

  • Turn off of my VM at 6 pm

  • Turn on my VM at 8 am

Turbo360 supports turn off and turn on in addition to options like scale up and scale down.

Customers love this feature especially for non production environments where they can “turn off the lights” when the environment is not being used.

FAQ


Below are some common questions from customers.


FAQ

What if we want to change the reservations for a virtual machine

“If we decide to reserve a group of VMs on a specific sku. Weather its 1 vm or 10 we have them reserved. All of a sudden someone asks us to upgrade the SKU for these: Can we upgrade the SKU and will the reservation carry over to the new SKU for all those vms?”

The answer to this question depends on a few factors about how you stand in terms of the reservations you purchased and what you want to do.

Check the scope of your reservation

When you purchase a reservation it will be applied a scope which can be shared, resource group, subscription and so on.

If you purchase a reservation for a VM sku at the scope of a single subscription and you have 3 VM’s in that subscription matching the SKU then the reservation will be applied to one of those VM’s.  If you resize the VM that the reservation is being applied to to a size that does not match the reservation then the reservation will be applied to one of the other 2 VM’s instead.  If you then shut down that VM the reservation will be applied to the 3rd VM.  The reservations are applied based on the VM’s that are available at each point in time.  If all VM’s are turned off for an hour then that hour of the reservation is lost but when the VM is back on then the reservation is being applied again.

In the case of the question, if there are other VM’s of the appropriate size that fall within the scope of the reservation and you resize one of the 10 VM’s in the question then the reservation will automatically just apply to another VM.

Reservation Flexibility

When you purchase the reservation initially you can choose to optimize for “capacity priority” or “Instance size flexibility”.  If you prioritized for instance size flexibility then if you upgrade the VM to a size in the same flexibility group then you can make the upgrade and the reservation will apply to that VM or part of it.  There is more info and some examples of that on this page.

https://learn.microsoft.com/en-us/azure/virtual-machines/reserved-vm-instance-size-flexibility#examples

Exchanges and Refunds

If you are changing your VM to a size that will not be supported by the reservation flexibility or you do not have that option available then you may be able to exchange or refund a reservation.  There are some constraints and limitations around this process and its worth reading the below page for more info.

https://learn.microsoft.com/en-us/azure/cost-management-billing/reservations/exchange-and-refund-azure-reservations

https://learn.microsoft.com/en-us/azure/cost-management-billing/reservations/reservation-exchange-policy-changes#example-scenarios

Consider Savings Plan for Compute

A savings plan is intended for scenarios where workloads are evolving and are likely to change where as a reservation is intended for workloads that run continuously and are highly stable.

If you are moving to a different VM sku or are anticipating future changes then it might be worth trading off a potentially lower discount for increased flexibility.

A savings plan can be used for more types of resources and sku’s but the flexibility means you have less to worry about in terms of changing things.

You can also trade in a reservation to move to a savings plan.  More info is available on the below link:

https://learn.microsoft.com/en-us/azure/cost-management-billing/savings-plan/reservation-trade-in


Was this article helpful?

ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence