Storage – Azure Virtual Machines

Your Azure virtual machine requires storage to install the operating system files. We call this storage disks in Azure. This is like the hard disk you have in your computer, however, in a virtual form. All virtual machines have at least two disks: an OS disk and a temporary disk. You can have additional disks added to the virtual machines to store data; these additional disks are called data disks. All the disks use Azure Storage for storing the virtual hard disk (VHD) files. Figure 7.1 shows a graphical representation of the disks in an Azure VM.

FIGURE 7.1 Disks in Azure VM

Disks can be classified based on the type of data stored on them, the performance tiers, and how the disk is managed. Let’s see how you can categorize based on the type of data stored.

Type of Data

Disks can be classified based on data stored on them. For example, if the disk is containing OS files, then it’s an OS disk. The following are the disk classifications in Azure:

Operating System Disks (OS Disks)  Every virtual machine requires an operating system to run. Every virtual machine will have one disk that is labeled as an OS disk from which the VM boots. This will be the C: drive in Windows and /dev/sda (root is mounted to the sda1 partition) in Linux VMs.

Temporary Disks  These disks are used to store pages or swap files and are not intended to be a persistent storage for your critical files. The reason is that during a planned maintenance event, redeployment, or host change, the data stored in the temporary disk will be erased. Data will be available during normal reboots, though. Therefore, any data on the drive should not be critical to you as it is prone to loss. In Windows, the temporary disk will be labeled as the D: drive, and in Linux, the disk will be labeled as /dev/sdb.

Data Disks  Data disks are used to store application data or any other data that you don’t want to keep in the OS disk. These disks can be labeled with any letter in Windows, and in Linux data disks are labeled from /dev/sdc onward. The maximum supported size is 4 TB. The size of the virtual machine is what determines how many data disks can be attached to a VM.