Q: Is it true that there are different types of virtual machine (VM) shutdown in Windows Azure IaaS that affect the billing?

A: Yes. Previously with Windows Azure IaaS you were charged for the VM whether it was running or not. This was changed in June 2013 so that stopped VMs would no longer result in the user being charged. However, there are actually two different types of shutdown for a Windows Azure IaaS VM.

If you stop a VM from within the guest OS of the VM or you use the Stop-AzureVM cmdlet with the -StayProvisioned parameter, then the VM stays allocated in the Windows Azure fabric. This means the VM still has reserved resources, and it will keep the IP address it was dynamically assigned via DHCP (Dynamic IP or DIP).

A VM shutdown this way is considered Stopped, but not deallocated, which means it will continue to be billed. It shows as the following in the Windows Azure portal.

If you stop a VM from the Windows Azure portal by using the Shut Down button, then the VM is actually deallocated from Windows Azure resources.

It no longer has resources reserved, and it loses its network configuration--and therefore its IP address lease. When you start the VM, it's reprovisioned in Windows Azure, has resources assigned, network adapter added, and a new IP lease.

This type of deprovisioning also happens when the Stop-AzureVM cmdlet is used without the -StayProvisioned parameter. The VM will show as Stopped (Deallocated) and VMs in this status will not incur any billing.

An important point is that each cloud service has a Virtual IP (VIP), which is the external IP address. If every VM in a cloud service is in a Stopped (Deallocated) state, then the cloud service might lose its VIP and when VMs are restarted, it could get a new VIP. If consistency of the VIP is important, then ensure at least one VM in each cloud service stays provisioned.

To summarize:

  • Shutdown within the VM or Stop-AzureVM -StayProvisioned - Billing continues for the VM, and it keeps resources reserved, including keeping its leased IP address.
  • Shutdown from Windows Azure Portal or Stop-AzureVM without -StayProvisioned - Billing stops for the VM, and all resources are deprovisioned, including network adapters, which means IP address lease is lost.