How to get the stopped virtual machines pricing for hours or seconds ?

Eugene Huang 5 Reputation points
2023-09-12T07:51:00.1766667+00:00

From the API documentation,a virtual machine which is stopped but not deallocated means that resources are still attached and I am still getting charged for the resources.

And I want to know if there is any api or documentation to show the price of the stopped vms for every hours or seconds?

Thanks.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,789 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. TP 90,151 Reputation points
    2023-09-12T07:56:44.8233333+00:00

    Hi,

    The Compute price for VM in Stopped state is the same as VM in Running state. In other words, since the host resources are allocated and thus not usable by a another customer you are charged even if the VM isn't running. If I'm not understanding your question properly please add a comment to clarify.

    Please click Accept Answer if the above was useful.

    Thanks.

    -TP


  2. Dillon Silzer 57,231 Reputation points
    2023-09-13T05:32:48.13+00:00

    Hello Eugene,

    Just to give some more information on the states please see:

    The virtual machine resource - power states and billing

    The state of the virtual machine impacts whether the virtual machine resource is being billed or not, in relation to the virtual machine resource and its reliance and use of underlying hardware.

    Running - The virtual machine is powered up and working, and currently being billed for.

    Stopped - The VM has been shut down from within the guest operating system or using PowerOff APIs. The VM will be showing as Stopped. This does not release the lease that the VM has on the underlying hardware, which means the hardware is unavailable for other customers. In this state, the virtual machine is still billed for.

    Deallocated - The VM has released the lease on the underlying hardware and is completely powered off, so the virtual machine resource is not billed. It will appear in the Azure portal as Stopped (Deallocated).

    Cited from https://techcommunity.microsoft.com/t5/itops-talk-blog/am-i-billed-for-an-azure-virtual-machine-if-it-s-shut-down/ba-p/2456669


    If this is helpful please accept answer.

    0 comments No comments

  3. vipullag-MSFT 26,211 Reputation points
    2023-09-13T08:25:38.85+00:00

    Hello Eugene Huang
    We noticed your have rated low on one of the answer as not helpful. Thank you for taking time to share feedback.

    If the virtual machine is deallocated, it should not incur any compute charges. However, storage charges may still apply for the disks attached to the VM.

    Regarding the cost difference between a stopped VM and a running VM of the same type during the same time period, there could be several factors that contribute to the difference in cost. For example, if the VM is part of a virtual machine scale set, the cost may vary depending on the number of instances running at any given time. Additionally, if the VM is using premium storage, the cost may be higher than if it were using standard storage.

    To figure out the cost of a VM, you can use the Azure Pricing Calculator. The calculator allows you to estimate the cost of running a VM based on factors such as the VM size, storage type and size, and the region where the VM is located. You can also use the Azure Cost Management and Billing service to monitor and analyze your Azure spending. The service provides detailed reports and insights into your usage and costs, and allows you to set budgets and alerts to help you manage your spending.

    I hope this helps.
    If the answer is helpful, request you to take a resurvey.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.