Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Azure virtual machines (VMs) support two storage controller interfaces: Small Computer System Interface (SCSI) and NVM Express (NVMe). SCSI is a legacy standard that provides physical connectivity and data transfer between computers and peripheral devices. NVMe provides similar connectivity, but is a faster and more efficient interface for data transfer between servers and storage systems.
This article shows you how to convert an Azure VM from a SCSI disk controller to NVMe by using Azure Boost and the Azure NVMe Conversion script. The same script and procedure apply to:
- Linux and Windows VMs.
- VMs with or without data disks and a temporary disk.
Azure continues to support the SCSI interface on the VM offerings that provide SCSI storage. However, not all new VM series include SCSI as an option going forward.
What's changing for your VM?
Changing the host interface from SCSI to NVMe doesn't change the remote storage (OS disk or data disks). It changes the way the operating system uses the disks.
| Disk | SCSI VM | NVMe VM (v5 with temp disk) | NVMe VM (v6) |
|---|---|---|---|
| OS disk | /dev/sda | /dev/nvme0n1 | /dev/nvme0n1 |
| Temp disk | /dev/sdb | /dev/sda | /dev/nvme1n1 |
| First data disk | /dev/sdc | /dev/nvme0n2 | /dev/nvme0n2 |
Converting your Azure VM from SCSI to NVMe by using Azure Boost can help you take full advantage of these performance improvements and maintain a competitive edge in the cloud computing landscape.
Migrate a Linux VM from SCSI to NVMe
To migrate from SCSI to NVMe, follow these high-level steps:
- Check that your VM series supports NVMe.
- Check the prerequisites for your operating system.
- Convert your VM to NVMe.
- Verify the conversion.
1. Check if your virtual machine series supports NVMe
The Azure Boost availability table lists the VM sizes that support NVMe attached disks.
2. Check the prerequisites
Before you begin, make sure you have the following prerequisites:
- An Azure subscription and a virtual machine that you need to convert from SCSI to NVMe or from NVMe to SCSI
- PowerShell and the Az module installed and configured
- Appropriate permissions to execute scripts on Azure resources
3. Usage
To run the script, open PowerShell as an administrator and follow these steps:
- Install PowerShell or run the script on Azure Cloud Shell.
Tip
Install PowerShell by using the PowerShell documentation.
- Allow unsigned PowerShell script files.
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
- Connect to your Azure account by using
Connect-AzAccount.
Connect-AzAccount
- Make sure that you're connected to your subscription. To change the subscription, use
Set-AzContext.
Select-AzSubscription -Subscription xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
- Download the script.
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/Azure/SAP-on-Azure-Scripts-and-Utilities/refs/heads/main/Azure-NVMe-Utils/Azure-NVMe-Conversion.ps1" -OutFile ".\Azure-NVMe-Conversion.ps1"
- Run the conversion script.
.\Azure-NVMe-Conversion.ps1
Note
If you're converting between VM sizes with different resource (temporary) disk support, your Azure subscription must be registered for the VMTempDiskResizePreview feature. If the feature isn't registered, the script exits with an error. Register the feature by using the following command, wait 10 minutes for the auto-approval to take effect, and then rerun the script.
Register-AzProviderFeature -FeatureName VMTempDiskResizePreview -ProviderNamespace Microsoft.Compute
Example
.\Azure-NVMe-Conversion.ps1 -ResourceGroupName <your-RG> -VMName <your-VMname> -NewControllerType <NVMe/SCSI> -VMSize <new-VM-SKU> -StartVM
The script has the following parameters.
| Parameter | Description | Required |
|---|---|---|
-ResourceGroupName |
The resource group name for your VM. | Yes |
-VMName |
The name of your VM on Azure. | Yes |
-NewControllerType |
The storage controller type to convert the VM to (NVMe or SCSI). | Yes |
-VMSize |
The Azure VM SKU to convert the VM to. | Yes |
-StartVM |
Start the VM after conversion. | No |
-FixOperatingSystemSettings |
Automatically fix the OS settings by using Azure Run Commands. | No |
-WriteLogfile |
Create a log file. | No |
-IgnoreSKUCheck |
Ignore the check of the VM SKU. | No |
-IgnoreWindowsVersionCheck |
Ignore the Windows version check. | No |
-IgnoreAzureModuleCheck |
Don't run the check for installed Azure modules. | No |
-IgnoreOSCheck |
Don't check for OS readiness. The expectation is that the OS is ready. | No |
-SleepSeconds |
The time for Azure to settle changes before starting the VM. | No |
The script performs the following steps:
- Validates Az module versions, VM existence, OS type, generation, current controller type, and NVMe capability of the target VM SKU.
- With
-FixOperatingSystemSettings, validates and configures the guest OS for NVMe by using Azure Run Command:- On Linux, checks that the NVMe driver is in
initrd/initramfs, setsnvme_core.io_timeout=240, and checks/etc/fstabfor deprecated device names. - On Windows, configures the
stornvmedriver to start at boot (sc.exe config stornvme start=boot).
- On Linux, checks that the NVMe driver is in
- Stops and deallocates the VM.
- Updates
supportedCapabilities.diskControllerTypestoSCSI, NVMeon the OS disk. - Resizes the VM to the target SKU and sets the disk controller type to NVMe.
- Starts the VM (with
-StartVM).
4. Verify the conversion
Confirm by using PowerShell
After the VM restarts, confirm that the disk controller type changed successfully.
$vm = Get-AzVM -ResourceGroupName "<resource-group-name>" -VMName "<vm-name>"
$vm.StorageProfile.DiskControllerType
Check the result inside the guest
Check the devices by using the nvme command. If the nvme command is missing, install the nvme-cli package.
nvme list
The output shows the OS disk and the data disks.
Tip
You can always revert to SCSI. The script provides a command at the end of a successful run to revert to your original configuration. Save that command before you close the session.
If you need to roll back, rerun the script with -NewControllerType SCSI and the original VM SKU:
.\Azure-NVMe-Conversion.ps1 -ResourceGroupName <your-RG> -VMName <your-VMname> -NewControllerType SCSI -VMSize <original-SKU> -StartVM