Azure / Azure/SAP-on-Azure-Scripts-and-Utilities

Azure-NVMe-Conversion.ps1: SCSI -> NVMe temp disk conversion always reports "Mismatch in resource disk support" even though both VM sizes have a local temp disk

Open
#149 1 comment 1 reaction 2 assignees Claimed by @msftphleiten View on GitHub
Dominant language
PowerShell
Stars
168
Forks
103
Avg merge
1m
Merged PRs (30d)
1

Description

## What I did

Converted a Windows VM from `Standard_D2ds_v4` to `Standard_D2ds_v6` with script version `2026082514`. The subscription is not registered for `Microsoft.Compute/VMTempDiskResizePreview`.

```powershell
.\Azure-NVMe-Conversion.ps1 -ResourceGroupName "" -VMName "" `
-NewControllerType NVMe -VMSize "Standard_D2ds_v6" -StartVM -WriteLogfile
```

## What happened

```
00:10 - INFO - Checking resource disk support for Windows VMs
00:10 - ERROR - Mismatch in resource disk support between original VM size (Standard_D2ds_v4) and new VM size (Standard_D2ds_v6).
00:10 - ERROR - The Azure subscription is not registered for the feature VMTempDiskResizePreview which is required for resizing the resource disk when converting between VM sizes with different resource disk support
00:10 - ERROR - Please register the subscription for the feature using the following command and try again:
00:10 - ERROR - Register-AzProviderFeature -FeatureName VMTempDiskResizePreview -ProviderNamespace Microsoft.Compute
00:10 - ERROR - The feature is auto-approved, script will exit, please wait 10 minutes and then try again.
```

## Why this is confusing

Both `Standard_D2ds_v4` and `Standard_D2ds_v6` have a local temp disk — the difference is that v4 exposes it over SCSI and v6 over NVMe. Per [Temp NVMe disks FAQ](https://learn.microsoft.com/en-us/azure/virtual-machines/enable-nvme-temp-faqs#what-changes-should-i-prepare-for-when-configuring-my-vms-with-temp-nvme-disks-), the two are reported through different SKU capabilities:

> For Azure virtual machines, SCSI-based local storage is a temporary resource disk, and the `MaxResourceVolumeMB` value specifies the size of this disk. In contrast, the `NVMeDiskSizeInMiB` value specifies the size of NVMe-based local storage.

The script reads only `MaxResourceVolumeMB`, for both the source and the target size ([L873-L881](https://github.com/Azure/SAP-on-Azure-Scripts-and-Utilities/blob/main/Azure-NVMe-Utils/Azure-NVMe-Conversion.ps1#L873-L881)):

```powershell
873: # MaxResourceVolumeMB > 0 means the SKU has a local temporary/resource disk.
874: $_originalResourceVolumeMB = [int64]((($_VMSKUs |
875: Where-Object { $_.Name -eq $script:_original_vm_size } |
876: Select-Object -First 1).Capabilities |
877: Where-Object { $_.Name -eq "MaxResourceVolumeMB" }).Value)
878: $_newResourceVolumeMB = [int64](($_VMSKU.Capabilities |
879: Where-Object { $_.Name -eq "MaxResourceVolumeMB" }).Value)
880: $_originalVMHasResourceDisk = $_originalResourceVolumeMB -gt 0
881: $_newVMHasResourceDisk = $_newResourceVolumeMB -gt 0
```

As a result, every SCSI temp disk -> NVMe temp disk conversion takes the mismatch branch on line 888, and the resulting messages state that the target size has no resource disk. The block at [L911-L915](https://github.com/Azure/SAP-on-Azure-Scripts-and-Utilities/blob/main/Azure-NVMe-Utils/Azure-NVMe-Conversion.ps1#L911-L915) contradicts itself for the same reason:

```
Original VM size Standard_D2ds_v4 has resource disk support, but new VM size Standard_D2ds_v6 does not have resource disk support.
Please make sure to adjust your swap space / pagefile configuration after migration.
Local temporary disks will show up as RAW disks in the new VM.
```

Line 912 says the target has no resource disk; line 914 says its local temp disks will show up as RAW.

## Questions

1. Is `VMTempDiskResizePreview` genuinely required for a SCSI temp disk -> NVMe temp disk resize — i.e. does the Azure platform classify a v6 SKU with NVMe local storage as a non-resource-disk size, as the `OperationNotAllowed` error in #130 suggests? Or is this check over-triggering because `NVMeDiskSizeInMiB` is not taken into account?
2. Either way, could the messages distinguish "no local temp disk at all" from "local temp disk moved from SCSI to NVMe"? As written, users reading line 893 and line 912 conclude that `Standard_D2ds_v6` has no temp disk, which is not the case.

## Environment

- Script: `Azure-NVMe-Utils/Azure-NVMe-Conversion.ps1`, version `2026082514`
- Source: `Standard_D2ds_v4` (SCSI temp disk), Target: `Standard_D2ds_v6` (NVMe temp disk)
- Guest OS: Windows Server
- Related: #130

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.