How to map Azure Disks to Windows VM guest disks

Applies to: ✔️ Windows VMs

You may need to determine the Azure Disks that back a VM's guest disks. In some scenarios, you can compare the disk or volume size to the size of the attached Azure Disks. In scenarios where there are multiple Azure Disks of the same size attached to the VM you need to use the Logical Unit Number (LUN) of the data disks.

What is a LUN?

A Logical Unit Number (LUN) is a number that is used to identify a specific storage device. Each storage device is assigned a unique numeric identifier, starting at zero. The full path to a device is represented by the bus number, target ID number, and Logical Unit Number (LUN).

For example: Bus Number 0, Target ID 0, LUN 3

For our exercise, you only need to use the LUN.

Finding the LUN

There are two methods to finding the LUN, which one you choose will depend on if you are using Storage Spaces or not.

Disk Management

If you are not using Storage Pools, you can use Disk Management to find the LUN.

  1. Connect to the VM and open Disk Management a. Right-click on the Start button and choose "Disk Management" a. You can also type diskmgmt.msc into the Start Search box
  2. In the lower pane, right-click any of the Disks and choose "Properties"
  3. The LUN will be listed in the "Location" property on the "General" tab

Storage Pools

  1. Connect to the VM and open Server Manager
  2. Select "File and Storage Services", "Volumes", "Storage Pools"
  3. In the bottom-right corner of Server Manager, there will be a "Physical Disks" section. The disks that make up the Storage Pool are listed here as well as the LUN for each disk.

Finding the LUN for the Azure Disks

You can locate the LUN for an Azure Disk using the Azure portal, Azure CLI, or Azure PowerShell

Finding an Azure Disk's LUN in the Azure portal

  1. In the Azure portal, select "Virtual Machines" to display a list of your Virtual Machines
  2. Select the Virtual Machine
  3. Select "Disks"
  4. Select a data disk from the list of attached disks.
  5. The LUN of the disk will be displayed in the disk detail pane. The LUN displayed here correlates to the LUNs that were looked up in the Guest using Device Manager or Server Manager.

Finding an Azure Disk's LUN using Azure CLI or Azure PowerShell

az vm show -g myResourceGroup -n myVM --query "storageProfile.dataDisks"