Plan to manage costs for virtual machines

This article describes how you plan for and manage costs for virtual machines. Before you deploy the service, you can use the Azure pricing calculator to estimate costs for virtual machines. Later, as you deploy Azure resources, review the estimated costs.

If you'd like to learn how to monitor costs for virtual machines, see Monitor costs for virtual machines. If you'd like to review the best practices for virtual machine cost optimization, see Best practices for virtual machine cost optimization.

In this article, you'll:

  • Gain an understanding of the billing model for virtual machines

Prerequisites

Cost analysis in Cost Management supports most Azure account types but not all of them. To view the full list of supported account types, see Understand Cost Management data. To view cost data, you need at least read access for an Azure account. For information about assigning access to Microsoft Cost Management data, see Assign access to data.

Understand the full billing model for virtual machines

Virtual machines run on Azure infrastructure that accrues costs when you deploy new resources. It's important to understand that there could be other infrastructure costs that might accrue.

How you're charged for virtual machines

When you create or use virtual machines resources, you might get charged for the following meters:

  • Virtual machines - You're charged for it based on the number of hours per VM.
    • The price also changes based on your VM size.
    • The price also changes based on the region where your virtual machine is located.
    • As virtual machine instances go through different states, they're billed differently.
  • Storage - Pricing changes based on multiple factors, including disk types, transactions, and configurations.
  • Virtual network - You're charged for it based on the number of GBs of data transferred.
  • Bandwidth - You're charged for it based on the number of GBs of data transferred.
  • Azure Monitor - You're charged for it based on the number of GBs of data ingested.
  • Azure Bastion - You're charged for it based on the number of GBs of data transferred.
  • Azure DNS - You're charged for it based on the number of DNS zones hosted in Azure and the number of DNS queries received.
  • Load balancer, if used - You're charged for it based on the number of rulesets, hours used, and GB of data processed.

Any premium software from the Azure Marketplace comes with its own billing meters.

At the end of your billing cycle, the charges for each meter are summed. Your bill or invoice shows a section for all virtual machines costs. There's a separate line item for each meter.

Other costs that might accrue with virtual machines

When you create resources for virtual machines, resources for other Azure services are also created. They include:

For more information, see the Parts of a VM and how they're billed section of the virtual machines documentation overview.

Costs might accrue after resource deletion

After you delete virtual machines resources, the following resources might continue to exist. They continue to accrue costs until you delete them.

  • Any disks deployed other than the OS and local disks
  • Virtual network
    • Your virtual NIC and public IP, if applicable, can be set to delete along with your virtual machine
  • Bandwidth
  • Load balancer

If your OS disk isn't deleted with your VM, it likely incurs P10 disk costs even in a stopped state. The OS disk size is smaller by default for some images and incurs lower costs accordingly.

For virtual networks, one virtual network is billed per subscription and per region. Virtual networks can't span regions or subscriptions. Setting up private endpoints in vNet setups may also incur charges.

Bandwidth is charged by usage; the more data transferred, the more you're charged.

Using a savings plan with virtual machines

You can choose to spend a fixed hourly amount for your virtual machines, unlocking lower prices until you reach your hourly commitment. These savings plans are available in one- and three-year options.

Screenshot of virtual machine savings plans on pricing calculator.

Using Azure Prepayment with virtual machines

You can pay for virtual machines charges with your Azure Prepayment credit. However, you can't use Azure Prepayment credit to pay for charges for third party products and services including those from the Azure Marketplace.

When you prepay for virtual machines, you're purchasing reserved instances. Committing to a reserved VM instance can save you money. The reservation discount is applied automatically to the number of running virtual machines that match the reservation scope and attributes. Reserved instances are available in one- and three-year plans.

Screenshot of virtual machine prepayment options on pricing calculator.

For more information, see Save costs with Azure Reserved VM Instances.

Next steps

In this article, you learned about estimating costs of virtual machines, the virtual machine billing model, and reviewing virtual machine costs in the Azure portal.

For more information on virtual machine cost optimization, see the following articles: