How to preserve Disk Drive letter - Migrate to Azure

This is something always been asked and faced during migration as Drive Letter D is occupied by the temporary disk inside Azure VM hence when we migrate on-prem VM to Azure drive letter of additional data disk may change from their previous value.

There is a way by which you can retain the drive letter of attached storage devices when you import or migrate a VM via ASR to Azure.

By default , Drive D: is used by the temp disk on the Azure VM because of this drive assignment all other attached storage drive assignment incremented by one letter. e.g. If there is a data drive D: for application installation this drive would become E: on Azure ( increment by one letter).

Above discussed situation can be controlled by setting SAN policy to "OnlineAll".  Once you change the SAN policy , the setting causes Azure to assign the next free drive letter to its temporary volume.
 In this situation, the data drive maintains the drive D designation, and the Azure temporary drive is assigned drive E.


To view the current SAN policy from the guest system there are 2 ways : PS and CMD


PS : To check the policy and set the policy below are the PS commands :

Get-StorageSetting | select NewDiskPolicy

Set-StorageSetting -NewDiskPolicy omlineAll



CMD :
  1. On the VM (not on the host server), open an elevated Command Prompt window.
  2. Type diskpart.
  3. Type SAN.

If the drive letter of the guest operating system is not maintained, this command returns either "Offline All" or "Offline Shared." To make it online run below cmd -

SAN POLICY=onlineAll




No comments:

Post a Comment

MS Defenders

 Microsoft Defender offers a wide range of security solutions, similar to the ones we've discussed (Defender for Containers, Defender fo...