Azure Virtual Machine – Disk Management

Spread the love

We are going to talk about different aspects of the virtual machine disk management. Disk a separate resource on Azure platform. It incurs the cost even the Virtual Machine is deallocated or in shutdown state. When VM is deallocated state it doesn’t incur compute cost. But data/state are stored on VM disks and it will cost storage cost. Below are the topics we are going to discuss in the article. Below are important points with respect to Disk Manamgent. Please watch Video for demo.

Disk Type

There are three types of disks are created when Virtual Machine is provisioned. Below are brief detail about them:

  • OS Disk : This is disk created by default when VM is provisioned. Every image has its default disk size, it all depends on which VM image we selected at first step. But it can be selected any other available size too.
  • Data Disk: This is an optional disk, but can be added during provisioning or can be added later.
  • Temporary Disk: It is temporary disk shown as D: drive which can hold the data as long as VM is running. As soon as it shut down and deallocated, data are deleted and vanished. It doesn’t recover after VM restarts. Default size in 14 gb.

All these are Azure managed disk and has three replica in the datacenter. In case if any one disk dies data still available. There are three different Disk from hardware prospective and will cost different based on that. These are:

  • Premium SSD v2: Production and performance-sensitive workloads that consistently require low latency and high IOPS and throughput
  • Peminum SSD: Production and performance sensitive workloads.
  • Standard SSD : Web Servers, or light used application.
  • Standard HDD : for It has lowest throughput and IPOs. Can be used for back up and infrequent access.
  • Ultra Disk: This is new type of disk added. It can be used for IO-intensive workloads, top tier databases (for example, SQL, Oracle), and other transaction-heavy workloads. It cannot be used as OS disk, only data disk, and start empty. It has some limitations such as, no support for availability sets etc. You can find more detail at here.

Shutdown Vs Deallocate

Shutdown means VM is stopped but still in allocated state. non-static public IP will remain same when you start the VM. Also as it stopped but still in allocated state, it will incur compute cost. However, it is deallocated then it will deallocate non-static public IP and it will create new IP when comes back online. Also it will not incur compute cost.

Disk Encryption

By default all disk create in VM are encrypted with Azure Manage Keys. But it allows us to encrypt with our (client) managed keys. Those secrets need to be stored in Azure Key Vault. Please check Video how to do that.

Disk Snapshot

Disk snapshot allows us to create snapshot of one disk from one VM and create new Disk with that snapshot and attach to new VM. That way if we want multiple VMs provisioned to have with same files in the group.

Azure Shared Disk

We can create one single Disk and it can be shared between multiple VMs. Each VM will have islolated space on the disk and cannot see other VM’s data. They shares the space but not the data.