Azure Virtual Machine – Frequently asked questions – not easily answered


Abs07act


Azure Virtual Machine is one of the core IaaS compute offering of Azure world. It is very rich in features. I have hardly seen a customer who is using Azure but not using a single Azure VM. Even if you decide to be completely serverless, PaaS oriented; you end up using few Azure VMs for sure in many cases.

Azure documentation has been improving a lot and link here covers pretty good coverage on Azure VM FAQ - https://docs.microsoft.com/en-us/azure/virtual-machines/windows/faq

However I have seen many questions which are not answered on official documentation and answer for such questions is available in bits and pieces. Many times, we have to go through lot of documentation reading to get answer for a simple question.

This blog post addresses very common question-answer on Azure VM which are NOT covered in above FAQ.
I assume that you are working on Azure VMs already. This FAQ is not suitable for people who don’t know Azure yet!

Lets go!

Before we go into the question and answer series it is worth to show architecture of Single Azure VM.




As you can see above when you create Azure VM; you are required to create all the services mentioned in above diagram. For the above diagram I could derive below equation –




In Azure VM; we have compute and storage components de-coupled from each other. Hence even if we shutdown (de-allocate) azure VM and start again we get the same VM with same State and data again. Because all data and state is maintained in storage part.

With this important understanding let us go ahead with our actual questions and answers.

When you de-allocate Azure VM, you are releasing compute part. So you are not charged for “Cores and RAM”. However you never release storage part and hence storage components (managed and unmanaged disks – OS and Data disks) are always charged irrespective the status of Azure VM.


Below is the summary of VM status and Compute charges applicability –


<07 style="mso-yfti-firs07ow: yes; mso-yfti-irow: -1; mso-yfti-lastfirs07ow: yes;"> <07 style="mso-yfti-irow: 0;"> <07 style="mso-yfti-irow: 1;"> <07 style="mso-yfti-irow: 2;"> <07 style="mso-yfti-irow: 3;"> <07 style="mso-yfti-irow: 4;"> <07 style="mso-yfti-irow: 5;"> <07 style="mso-yfti-irow: 6;"> <07 style="mso-yfti-irow: 7;"> <07 style="mso-yfti-irow: 8;"> <07 style="mso-yfti-irow: 9; mso-yfti-las07ow: yes;">
#
Azure VM Status
Is Compute charged?
1
Starting
No
2
Running
Yes
3
Stopping
Yes
4
Stopped
Yes
5
De-allocating
No
6
De-allocated
No
7
Deleted
No
8
Provisioning succeeded
Yes
9
Failed
Yes
10
Updating
Yes


Public IP –


If you have Public IP assigned to VM; and it is “Static” then you are always charged irrespective the status of VM. If your public IP is “dynamic” and VM is in de-allocated state then you are not charged for public IP. In interested to know more, refer - https://sanganakauthority.blogspot.com/2017/05/azure-cost-optimization-send-unassigned.html.

Diagnostics -

Also; when you provision VM you have an option of configuring diagnostics for VM in storage account. These diagnostics settings include boot and guest OS diagnostics. The data of diagnostics is always stored in Azure storage account in Table storage. If you have data in this diagnostics storage account then you will be charged as per storage cost.

Backup -

If you have configured backup for VM in backup vault then it is also charged.

No. When you delete VM then only VM instance is deleted. Rest everything remains as it is.


NIC, NSG, Public IP, Disks, Diagnostics storage all remains as it is and will not be deleted unless you delete them explicitly. If you delete resource group which contains all components of VM then everything which is part of resource group is deleted.

No. VM can be added to availability sets only when you create it. If you want to move existing VM to availability sets then you need to delete the VM, retain OS disk and then re-provision VM from the same OS disk in availability set.


Of course you can. Availability sets and Load balancers are no way related. Availability sets is for HA configuration of your VM and load balancers are for dis07ibuting the 07affic. You can very well have VMs behind load balancer without availability sets. As a best practice it is recommended to have 2 or more VMs in availability sets and behind load balancer. [Here I assume – your application is capable of working in dis07ibuted mode.]


No. Availability sets is only for protecting your VMs from hardware failures and updates happening behind the scene on Azure. When you have availability sets with 2 or more VMs; during update it is guaranteed that only one VM at a given time will be restarted to support updates coming on Host machines.