Comparing clouds: Billing for stopped machines
Tags: cloud, comparison, devops
Published: 2020-03-05 09:56:02

Public clouds have grown considerably in size, complexity and sheer number of features. This makes it hard to answer even simple questions, especially when you are trying to compare clouds.


At [Mist.io](https://mist.io) we hear such questions daily so we decided to do something about it. This is the first in a series of posts that compare clouds on a number of practical issues.


One of the questions we hear very often is some variation of the following:


**Does my cloud bill me for stopped machines, aka instances, linodes, droplets etc?**


The reasoning behind this question is quite simple. If I stop a machine, it means I’m not using it so I assume my cloud will not bill me for it. After all, public clouds are all about elasticity. If this is the case, then I could save a lot of money by stopping machines when they are not needed.


Unfortunately, things are not very straightforward.


Let’s go over, in alphabetical order, what is happening.


<table>
  <tr>
    <th>Service</th>
    <th>Bills for stopped machines?</th>
    <th>Notes</th>
  </tr>
  <tr>
    <td>Alibaba ECS</td>
    <td>Yes (by default)</td>
    <td>
      Instances are billed per second.<br><br>

      You could avoid billing for stopped instances connected to a VPC and which don’t have local disks. User action is required for that.<br><br>

      If you turn this feature on and stop an instance, you will be billed for any of the following that apply:<br><br>

      a) attached block storage<br>
      b) associated elastic IPs<br>
      c) bandwidth<br>
      d) images<br><br>

      For more details, check the official documentation for PAYG pricing <a href="https://www.alibabacloud.com/help/doc-detail/40653.htm">here</a> and specifically for stopped instances <a href="https://www.alibabacloud.com/help/doc-detail/63353.htm?spm=a2c63.p38356.b99.17.418a7470ZwN0bN">here</a>.
    </td>
  </tr>
  <tr>
    <td>Amazon EC2</td>
    <td>No</td>
    <td>
      Linux instances are billed per second with 60 seconds minimum. All others are billed per hour.<br><br>

      When you stop an instance, you will be billed for any of the following that apply:<br><br>

      a) attached block storage<br>
      b) associated elastic IPs<br><br>

      For more details, check the official documentation <a href="https://aws.amazon.com/ec2/pricing/on-demand/">here</a> and “Billing and purchase options” in this <a href="https://aws.amazon.com/ec2/faqs/">FAQ</a>.
    </td>
  </tr>
  <tr>
    <td>Digital Ocean</td>
    <td>Yes</td>
    <td>
      Droplets are billed per hour.<br><br>

      Check the relevant answers in their pricing <a href="https://www.digitalocean.com/pricing/#FAQs">FAQ</a>.
    </td>
  </tr>
  <tr>
    <td>Google Compute Engine</td>
    <td>No</td>
    <td>
      Instances are billed per second with 60 seconds minimum. Some premium images follow a different model.<br><br>

      When you stop an instance, you will be billed for any of the following that apply:<br><br>

      a) persistent storage attached<br>
      b) local SSDs<br>
      c) associated static IPs<br><br>

      For more details, check the official documentation <a href="https://cloud.google.com/compute/all-pricing">here</a>.
    </td>
  </tr>
  <tr>
    <td>IBM Cloud</td>
    <td>No</td>
    <td>
      Public Virtual Servers and billed per hour.<br><br>

      IBM offers “Suspended Billing”. Servers after Nov 1st 2018 include suspended billing. Most servers created before this date don’t offer it.<br><br>

      If suspended billing is available and you stop a server, then you will be charged for any of the following that apply:<br><br>

      a) storage<br>
      b) secondary public IP address<br><br>

      For more details, check the official documentation <a href="https://cloud.ibm.com/docs/vsi?topic=virtual-servers-requirements">here</a>.
    </td>
  </tr>
  <tr>
    <td>Linode</td>
    <td>Yes</td>
    <td>
      Linodes are billed per hour.<br><br>

      Check the relevant answers in their pricing <a href="https://www.linode.com/pricing/#row--faqs">FAQ</a>.
    </td>
  </tr>
  <tr>
    <td>Microsoft Azure</td>
    <td>Maybe</td>
    <td>
      Virtual Machines are billed per second and for the full number of minutes the machine was running. The documentation specifically mentions that if a machine was running for 6min and 45sec you will be charged for 6min.<br><br>

      If the machine status is “Stopped Deallocated”, you are not billed. If it is “Stopped” or “Stopped Allocated”, you are billed for allocated virtual cores but not for software licenses. Full details on virtual machine states are available <a href="https://docs.microsoft.com/en-us/azure/virtual-machines/windows/states-lifecycle">here</a>.<br><br>

      In order to get to "Stopped Deallocated" state, you have to stop the machine from within Azure's management portal or over the API using a specific deallocation parameter. If you stop the machine from within the OS it will go into “Stop Allocated” state.<br><br>

      If you manage to get to "Stopped Deallocated" state, please keep in mind that you are still billed for any of the following that apply:<br><br>

      a) attached Premium (SSD based) disks<br>
      b) Attached Standard (HDD based) disks<br>
      c) In ARM deployment model, you are billed for static public IP address unless it is part of the first five in the region. Read more regarding IPs under the FAQ section at the bottom of this <a href="https://azure.microsoft.com/en-us/pricing/details/ip-addresses/">page</a>.<br><br>

      For even more details, check the FAQ at the bottom of this <a href="https://azure.microsoft.com/en-us/pricing/details/virtual-machines/linux/">page</a>. The URL ends with /linux but you will also find the same FAQ under /windows…
    </td>
  </tr>
  <tr>
    <td>Vultr</td>
    <td>Yes</td>
    <td>
      Vultr cloud instances are billed per hour.<br><br>

      Check the relevant answers in their pricing <a href="https://www.vultr.com/resources/faq/">FAQ</a>.
    </td>
  </tr>
</table>


For easier reference, you can also view the table above in [Google Docs](https://docs.google.com/document/d/1E3l3nM8x6_LasUFvSLXYYtEySZsj46qYL9lx0jpY-NU/edit).


The comparison includes only services that offer cloud machines. There are also a number of services that offer dedicated hosts and/or bare metals. We didn’t include such services above because they are inherently different and, as expected, they charge you regardless of machine state.


Also, please keep in mind that the comparison refers to pay-as-you-go (PAYG) pricing. Alibaba, Amazon, Google, IBM and Microsoft offer reserved and spot pricing as well. In the case of reserved pricing, you will be billed even if you don’t use your reserved capacity. In spot, stopping a machine will usually release it and return it to the pool. Billing stops at that point, but you can no longer use the machine. This happens in Amazon, Google and Azure. In Alibaba and IBM, stopping a spot will not release it, but you will continue to incur charges until they either claim it back or you release it yourself.


If things were not complicated enough, you also need to take special usage discounts into account. Such discounts are:


*  Alibaba subscriptions
*  Amazon saving plans
*  Google committed-use and sustained-use discount


In the case of [Alibaba subscriptions](https://www.alibabacloud.com/help/doc-detail/56220.htm?spm=a2c63.p38356.b99.15.25cc166bYXiesi), things are rather simple. When you buy a subscription you pay a discounted price upfront for the entire billing cycle. Changing the status of the machine won't save you anything.


With [Amazon saving plans](https://aws.amazon.com/savingsplans/), things are simple too. You commit to certain usage over 1yr or 3yr term and get a discount. If you use it, you’re good. If you don’t use it, you still pay for it.


[Google’s committed-use discounts](https://cloud.google.com/compute/docs/instances/signing-up-committed-use-discounts) are very similar to Amazon saving plans.


[Google’s sustained-use discounts](https://cloud.google.com/compute/docs/sustained-use-discounts) are more complicated. First of all, Google follows an approach which they call [resource-based pricing](https://cloud.google.com/compute/resource-based-pricing). In this model, the base price of a machine is tied to the underlying resources it is using (vCPUs and memory). If during your billing cycle you continue to run the same total amount of resources, then you gradually earn a discount that’s increasing over time. This is the sustained-use discount. The discount is irrelevant to the actual machines you run, it ties only into the total amount of resources used. This discount doesn’t increase linearly over time. To understand it better we strongly recommend reading the documentation pages linked above.


Having said all of the above, let’s restate the initial question:


**Will I save money if I stop my cloud machines when they are not in use?**


The answer depends on a number of factors. To get to the bottom of this you need to:


1.  Check if your service will charge you for stopped machines and how.
2.  Check your reservations and long term commitments.
3.  Don’t take spot into account.
4.  If you are using Google Compute Engine, do the math for the sustained-use discount.


All these might sound disheartening, but you could potentially save a lot of money. Just to get a sense of ROI, one of our customers was recently able to reduce a 5-digit monthly bill for dev infrastructure by 50%. They did it by automatically tagging machines upon provisioning and then setting a schedule to stop them during off business hours.


Bottomline, the effort is well justified. Do your research and good luck!