Disk

Disk to LUN Mapping for a Windows VM using Microsoft Storage Spaces in Azure

disks.jpg

When multiple data disks are attached to a Windows VM using Microsoft Storage Spaces in Azure it can be difficult to identify the LUN a disk belongs to. This is especially troublesome when there is a need to delete, clone, or migrate a specific disk(s) from on VM to another VM in Azure. A scenario where this may come in handy is if you need to migrate only 1 or 2 disks associated with Microsoft Storage Spaces while leaving other disks in place on the VM.

When a disk is not associated with a storage pool the disk’s LUN can easily be seen in Location property of the general tab on the disk’s properties under the “Disk Management” utility.

When a disk is associated with a storage pool the disk will not show up in the “Disk Management” utility and the LUN is not easily viewable because of this.

The following can help identify the Disk to LUN Mapping on your Windows VM in Azure when Microsoft Storage Spaces are used.

We will collect some information on some of the disks displayed in Device Manager. Use this information to identify the LUNs of the disks you would like to delete, clone, or migrate. You will need to do these steps for each of the “Microsoft Storage Space Device” objects in the “Disks drives” object in the Device Manager utility.

  • Physical Device Object Name – Can be used as the unique identifier for the “Microsoft Storage Space Device”.
  • Volume and Drive Letter(s) – Will show what volumes are associated with the storage space device.
  • Volume Capacity – This is optional but helpful to see.
  • Power relations – Identifies uniquely each “Microsoft Virtual Disk” used by the “Microsoft Storage Space Device”.
  • LUN ID(s) – This derived by manually converting the last 6 characters of each of the “Power Relations” values (see above) from HEX to Decimal.

1. Open Device Manager

a. Remote Desktop into your Azure VM that has the disks you would like to delete, clone, or migrate.

b. Right-Click Start Menu –> Select “Device Manager”

2. Get properties of the “Disk drives” object.

Note: This will need to be done for each of the “Microsoft Storage Space Device”

a. Right Click on the “Microsoft Storage Space Device” object and select properties.

01-DeviceManager

 

3. Get the “Microsoft Storage Space Device” object’s “Physical Device Object name” property.

a. Select the “Details” tab of the “Microsoft Storage Space Device” properties window.

b. Select the “Physical Device Object name” property in the “Property” field dropdown menu.

c. Write down the “Physical Device Object Name” value for this “Microsoft Storage Space Device”.

Sample Value: “\Device\Space1”

03-DeviceManagerDevicePropertiesDetails-Physical Device Object name

4. Get the Volumes associated with the “Microsoft Storage Space Device”.

a. Select the “Volumes” tab of the “Microsoft Storage Space Device” properties window.

b. Click the “Populate” button to retrieve all volume information for this “Microsoft Storage Space Device”.

02a-DeviceManagerDevicePropertiesVolumes-Unpopulated

c. For each volume in the “Microsoft Storage Space Device” make note of the “Volume” and “Capacity” fields.

Sample Value “Volume”: “volume-on-pool-a (M:)”

Sample Value “Capacity”: “2016MB”

02b-DeviceManagerDevicePropertiesVolumes-Populated

 

5. Get the “Power relations” properties for the “Microsoft Storage Space Device”.

a. Select the “Details” tab of the “Microsoft Storage Space Device” properties window.

b. Select the “Power relations” property in the “Property” field dropdown menu.

c. Write down the “Power relations” value(s) for this “Microsoft Storage Space Device”.

Sample “Power relations” Value(s):

SCSI\Disk&Ven_Msft&Prod_Virtual_Disk\000001

SCSI\Disk&Ven_Msft&Prod_Virtual_Disk\000000

 

04-DeviceManagerDevicePropertiesDetails-Power relations

6. Identify the LUN information in the “Power relations” Value string(s) and convert from HEX to Decimal.

Note: The LUN information is stored in hexadecimal format as the last 6 characters on the “Power relations” Value string(s). At this time this will need to be manually identified and converted to a decimal format for LUN identification. See this sample data below:

Sample “Power relations” value: “SCSI\Disk&Ven_Msft&Prod_Virtual_Disk\00001c

Sample Hexadecimal value (last six characters from above):00001c

Sample LUN ID (converted from HEX): “28”

a. Get the last 6 characters of the “Power relation” string(s).

b. Convert the last 6 characters from hexadecimal to decimal using Calc.exe (in Programmer mode). This is the LUN ID.

c. Note down the LUN ID with the other collected information.

 

Below are some example tables that were created using the method above. These can be used to aggregate the data when multiple disks are involved.

 

Volumes Table

Microsoft Storage Space Device (Physical Device Object Name)

Drive Letter

Volume Name

Capacity

\Device\Space1

M:

volume-on-pool-a (M:)

2016 MB

\Device\Space2

N:

volume-on-pool-b (N:)

2016 MB

 

Power Relations Table (LUNs)

Microsoft Storage Space Device (Physical Device Object Name)

Power relations

HEX (Manual - Last 6 of Power Relations)

LUN (Manual - Convert Hex to Decimal)

\Device\Space1                                         

SCSI\Disk&Ven_Msft&Prod_Virtual_Disk\000001

000001

1

\Device\Space1

SCSI\Disk&Ven_Msft&Prod_Virtual_Disk\000000

000000

0

\Device\Space2

SCSI\Disk&Ven_Msft&Prod_Virtual_Disk\000003

000003

3

\Device\Space2

SCSI\Disk&Ven_Msft&Prod_Virtual_Disk\000002

000002

2