Blog Post

Running SAP Applications on the Microsoft Platform
5 MIN READ

Converting Azure Virtual Machines running Windows from SCSI to NVMe

phleiten's avatar
phleiten
Icon for Microsoft rankMicrosoft
Jul 16, 2024

This is the Windows version of the blog article on converting Azure virtual machines from SCSI to NVMe.

The Linux version can be found here.

 

Introduction

In the ever-evolving world of cloud computing, maximizing performance and efficiency is crucial for businesses leveraging virtual machines (VMs) on platforms like Microsoft Azure, especially for high I/O workloads like SAP on Azure or database applications. One significant upgrade that can yield substantial performance improvements is converting your Azure VM from a SCSI (Small Computer System Interface) disk setup to NVMe (Non-Volatile Memory Express) using Azure Boost. This blog post will guide you through the process of making this conversion and explore the numerous advantages of NVMe over SCSI. 

 

Advantages of Azure Boost

Azure Boost is a powerful enhancement tool for Azure VMs, offering the following advantages:

  1. Accelerated Disk Performance: Azure Boost optimizes disk I/O operations, significantly increasing the speed and efficiency of your VM's storage.
  2. Seamless Integration: Easily integrates with existing Azure infrastructure, allowing for a smooth transition and immediate performance benefits.
  3. Cost-Effective Optimization: By enhancing the performance of existing VMs, Azure Boost helps reduce the need for more expensive hardware upgrades or additional resources.
 
 
 

To learn more about Azure Boost visit our documentation or the announcement blog.

 

What is changing for your VM?

Changing the host interface from SCSI to NVMe will not change the remote storage (OS disk or data disks), but change the way the operating systems sees the disks. Windows will present the OS disk and the remote storage as "Virtual_Disk NVMe Premium" devices.

 

 

Migrate your virtual machine (VM) from SCSI to NVMe

To migrate from SCSI to NVMe and benefit from higher performance some steps need to be followed:

 

  1. Check if your virtual machine series supports NVMe
  2. Check your operating system for NVMe readiness
  3. Convert your virtual machine to NVMe
  4. Check your operating system

 

1. Check if your virtual machine series supports NVMe

The supported virtual machine SKUs to support NVMe attached disks is available in our documentation and in the table below.

If your VM type is not listed below change the VM type.

 

Size Series Series Type Deployment Status
Dalsv6 General Purpose Preview
Easv6 Memory Optimized Preview
DCesv5 General Purpose Preview
ECesv5 Memory Optimized Preview
Mv3 Medium Memory High Memory to CPU Optimized Production
Falsv6/Famsv6 Compute Optimized Preview
Dlsv5 General Purpose Production
Dsv5 General Purpose Production
Esv5 Memory Optimized Production
Ebsv5 Managed disks optimized Production
Lsv3 Local storage optimized Production
Dplsv5 General Purpose Production
Dpsv5 General Purpose Production
Epsv5 Memory Optimized Production
Nvadsv5 GPU/AI workload optimized Production
HBv4 High Performance Compute (HPC) Production
HX High Performance Compute (HPC) Production

 

As the list of supported VM families may change over time, please check the up-to-date documentation.

 

2. Check your operating system for NVMe readiness

The operating system needs to support NVMe devices, Microsoft supports running Windows Server 2019 and newer with NVMe devices on Azure. Please make sure to have all updates installed before converting the VM. Older releases than Windows Server 2019 are NOT supporting NVMe devices. DO NOT APPLY THE PROCEDURES DESCRIBED IN THE ARTICLE TO WINDOWS SERVER 2016 OR OLDER WINDOWS SERVER RELEASES.

 

2.1 Check Controller Type of VM

 

2.1.1 Check Controller Type using PowerShell

PS C:\Users\user1> $vm = Get-AzVM -name nvme-win2022
PS C:\Users\user1> $vm.StorageProfile.DiskControllerType
SCSI
PS C:\Users\user1>

 

2.1.2 Check Controller Type using Azure CLI

$ az vm show --name nvme-win2022 --resource-group nvme-win2022
{
"additionalCapabilities": {
...
"storageProfile": {
...
"diskControllerType": "SCSI",
...

 

2.1.3 Check Controller Type using Azure Portal

 

2.2 Prepare Windows

To make Windows Server 2019 and newer ready for the conversion you need to delete a registry key. This is required as Windows Setup, when initially deploying the OS, marks the required drivers for the OS Disk. This means that only the storport driver for SCSI is loaded early during boot. While the NVMe driver is installed in all operating systems, it is not loaded early enough for the OS to start.

To make NVMe driver be part of the early start you need to run this command or delete the registry key path in regedit.

 

2.2.1 Delete/change registry using reg command

reg delete HKLM\SYSTEM\CurrentControlSet\Services\stornvme\StartOverride /f
reg ADD "HKLM\SYSTEM\CurrentControlSet\services\stornvme" /v "ErrorControl" /t REG_DWORD /d 0 /f
reg ADD "HKLM\SYSTEM\CurrentControlSet\services\stornvme\StartOverride" /v 0 /t REG_DWORD /d 0 /f

2.2.2. Manually delete the registry path

 

2.3. Shutdown Windows

Next step is to shutdown windows and convert the Virtual Machine.

 

3. VM SCSI to NVMe conversion

To convert the operating system multiple steps are required.

  • Change the metadata of the OS disk to include NVMe capabilities
  • Change the SCSI controller to NVMe

3.1 Download the PowerShell script

To download the PowerShell script from the GitHub repo use the following command:

Invoke-WebRequest -Uri "https://raw.githubusercontent.com/Azure/SAP-on-Azure-Scripts-and-Utilities/main/NVMe-Preflight-Check/azure-nvme-VM-update.ps1" -OutFile ".\azure-nvme-VM-update.ps1"

 

3.2. Convert the Virtual Machine

To convert run the script, detailed documentation is also available on the GitHub repository.

You can decide if e.g. the VM should automatically be started after the reconfiguration.

 PS D:\TEMP> .\azure-nvme-VM-update.ps1 -subscription_id 232XXXXX-XXXX-XXXX-88c0-75747223XXXX -resource_group_name NVMe-win2022 -vm_name NVMe-win2022 -disk_controller_change_to NVMe -start_vm_after_update $true -vm_size_change_to Standard_E4bds_v5
INFO - OS Disk found
INFO - Access token generated
INFO - Getting VM info
INFO - Getting all VM SKUs available in Region swedencentral
INFO - This will take about a minute ...
INFO - Checking for TrustedLaunch
INFO - Checking if VM is stopped and deallocated
INFO - Stopping VM

Tenant: 72f988bf-86f1-41af-91ab-2d7cd011db47
SubscriptionName SubscriptionId Account Environment
---------------- -------------- ------- -----------
XX-XX-XX-XXXXXXX 232bXXXX-XXXX-XXXX-XXXX-75747223XXXX xyz@microsoft.com AzureCloud
OperationId : 60bffc73-54a9-4d10-8246-881c506f23ee
Status : Succeeded
StartTime : 15.07.2024 17:23:47
EndTime : 15.07.2024 17:23:59
Error :
Name :
INFO - Setting OS Disk to SCSI/NVMe
INFO - Getting VM config to prepare new config
INFO - Setting new VM size
INFO - Setting disk controller for VM
INFO - Updating the VM configuration

RequestId :
IsSuccessStatusCode : True
StatusCode : OK
ReasonPhrase :

INFO - Waiting for 1 min before starting up
INFO - Starting VM

OperationId : aaedaa1d-968a-4e85-a795-979acddb7f83
Status : Succeeded
StartTime : 15.07.2024 17:25:35
EndTime : 15.07.2024 17:25:47
Error :
Name :

PS D:\TEMP>

 

3.3 Check the result

3.3.1 Check result in Azure Portal

 

3.3.2 Check result in PowerShell

PS C:\Users> $vm = Get-AzVM -name nvme-win2022
PS C:\Users> $vm.StorageProfile.DiskControllerType
NVMe
PS C:\Users>

 

4. Check your operating system

As a last step check your operating system and all the connected drives. Any existing file system will be available after the migration.

In Windows Device Manager you will see the new device specification. If your Azure Virtual Machine has a temporary disk/resource disk assigned, you will see one "Microsoft Virtual Disk" as those are still presented through the SCSI protocol. This is by design of Azure and can't be changed.

 

 

 

 

 

 

 

Updated Oct 30, 2024
Version 2.0
  • raindropsdev's avatar
    raindropsdev
    Iron Contributor

    If someone is having similar issues, you need to modify other registry keys:

    reg delete HKLM\SYSTEM\CurrentControlSet\Services\stornvme\StartOverride /f
    reg ADD "HKLM\SYSTEM\CurrentControlSet\services\stornvme" /v "ErrorControl" /t REG_DWORD /d 0 /f
    reg ADD "HKLM\SYSTEM\CurrentControlSet\services\stornvme\StartOverride" /v 0 /t REG_DWORD /d 0 /f

     

    Then shut down the machine from inside the OS, wait for it to be Shutdown, Deallocate it and then run the script.

     

    Source of the additional registry keys: https://www.reddit.com/r/pchelp/comments/11uxekv/windows_failed_repair_or_recovery_blue_screen/jcsz8dd/

    • tscondon's avatar
      tscondon
      Copper Contributor

      raindropsdev,

      I appreciate you finding the extra registry changes but did you ever happen to find any more registry changes that need made?

      We've attempted to change a Server 2019 VM from SCSI to NVMe using the three registry commands listed and while the script runs without any errors, the VM blue screens on start up - even though everything else appears to work prior.

      Thanks for your time.

      • phleiten's avatar
        phleiten
        Icon for Microsoft rankMicrosoft

        I'm working on a new version of the script which would run the commands using Az-RunCommand, this will make it easier to convert to NVMe.

  • raindropsdev's avatar
    raindropsdev
    Iron Contributor

    We're getting bluescreens after deleting the registry key and then using the powershell script to enable NVME on Windows 11 images:

    <INSTANCE CLASSNAME="BLUESCREEN">
    <PROPERTY NAME="STOPCODE" TYPE="string"><VALUE>"0x7B"</VALUE></PROPERTY><machine-info>

     

    The script doesn't seem to care about whether the image is supported or not and enables it anyway:

     

    Though this is a Windows 11 image which is indicated as supported in the documentation, so I'm a bit confused:

    Source image publisher: microsoftwindowsdesktop
    Source image offer: office-365
    Source image plan: win11-23h2-avd-m365

     

    Is there any way to address this? We have tested enabling NVME on both Windows 11 and Windows Server 2022 VMs and all of them have been getting this BSOD, despite deleting the reg key before shutdown.

     

    The only way we've succeeded in having a VM with NVME enable was deploying it as such from scratch, which is not really feasible for many of our workloads.