SALES: 1-800-867-1380

About Virtual Machine Disks in Azure

Updated: July 14, 2014

Just like any other computer, virtual machines in Azure use disks as a place to store an operating system, applications, and data.

All Azure virtual machines have at least two disks – an operating system disk and a temporary disk. They also can have one or more data disks. The following diagram shows how these three types of disks appear from within a Windows virtual machine.

Manage disks in Windows Server

The operating system disk and all data disks are actually virtual hard disks (VHDs) located in an Azure storage account. (For details, see About VHDs in Azure). The temporary disk is not stored in Azure storage.

Information about each type of disk is as follows:

  • Operating system disk - Every virtual machine has one attached operating system disk. It’s registered as a SATA drive and labeled as the C drive. This disk has a maximum capacity of 127 GB. When Azure creates an operating system disk, three copies of the disk are created for high durability. Additionally, if you configure the virtual machine for geo-replication, your VHD is also replicated at a distance of greater than 400 miles.

    When troubleshooting issues on an operating system disk, you can attach the disk as a data disk to another running virtual machine to access the data on the disk and diagnose problems using the logs.

  • The temporary disk is automatically created for you. On Windows virtual machines, this disk is labeled as the D drive. On Linux virtual machines, the disk is typically /dev/sdb and is formatted and mounted to /mnt/resource by the Azure Linux Agent.

    Don’t store data on the temporary disk. This disk provides temporary storage for applications and processes and is used to store data that you don’t need to keep, such as page or swap files. To remap this disk for a Windows VM, see Change the drive letter of the Windows temporary disk.

  • Data disk – A data disk is a VHD that can be attached to a running virtual machine to store application data, or other data that you need to keep. The maximum size of a data disk is 1 TB. Data disks are registered as SCSI drives and are labeled with a letter that you choose. The size of the virtual machine determines the number of disks that you can attach to it. For more information, see Virtual Machine Sizes for Windows Azure

    For instructions on adding and removing data disks, see the following:

You choose from multiple ways to create disks depending on the needs of your application. For example, a typical way to create a disk is to use an image from the Image Gallery when you create a virtual machine and an operating system disk is created for you. A typical way for you to create a data disk is to attach an empty disk to a virtual machine and a new data disk is created for you. You can create a disk by using a .vhd file that has been uploaded or copied to a storage account that is related to your subscription. You can’t use the portal to upload .vhd files, but you can use other tools that work with Azure storage to upload or copy the file.

You can upload a VHD that can be used as an operating system disk, or you can create a virtual machine from an image and a disk is created for you. This disk is a copy of a source .vhd file and the new copy is registered as an operating system disk.

You can upload and attach a data disk that already contains data to the virtual machine, or you can attach an empty disk to the machine.

Following are some considerations about disks in Azure.

The operating system disk and data disk each have a host caching setting (sometimes called host-cache mode) that can improve performance under some circumstances. However, these settings can negatively affect performance in other circumstances, depending on the application. Host caching is OFF by default for both read operations and write operations for data disks. Host-caching is ON by default for read and write operations for operating system disks. To change the setting in data disks, use the Set-AzureDataDisk cmdlet. To change it in operating system disks, use the Set-AzureOSDisk cmdlet.

Data loss may occur if you use striped volumes (Windows or Linux) in geo-replicated storage accounts. If a storage outage occurs that requires restoring data from a replicated copy, there is no guarantee that the write order of the stripe disk set would be intact once restored.

For both operating system disks and data disks, you can view a list of disks, add and delete disks, and update disks.

You can find the disks that are attached to a virtual machine by using either the dashboard or the Disks page of Virtual Machines in the Management Portal.

  1. If you have not already done so, sign in to the Azure Management Portal.

  2. Click Virtual Machines, and then select the appropriate virtual machine.

  3. Click Dashboard. On the dashboard for the virtual machine, you can find the number of attached disks and the names of the disks. The following example shows one data disk attached to a virtual machine:

    Find the attached data disks
    The temporary local disk is not listed in the disks section.

  1. If you have not already done so, sign in to the Azure Management Portal.

  2. Click Virtual Machines, and then click Disks. This page shows a list of all disks that are available to use with virtual machines, and it shows the disks that are being used by virtual machines. The list is a combination of operating system disks and data disks. To differentiate between the two types of disks, review disk information in the dashboard.

    When you attach a new data disk to a virtual machine, you can provide a name for the .vhd file that is used for the disk, but Azure provides a name for the disk. The name consists of the cloud service name, the virtual machine name, and a numeric identifier.

You can delete operating system disks and data disks if you do not need them anymore. To delete an operating system disk, you can delete it when you delete the virtual machine. You can delete a data disk after you detach it from the virtual machine, unless you’re also deleting the virtual machine.

  1. If you have not already done so, sign in to the Azure Management Portal.

  2. Click Virtual Machines, and then click Disks.

  3. Select the disk that you want to delete, and then click Delete Disk.

See the following resources for more information about managing disks:

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft