An Azure service that is used to provision Windows and Linux virtual machines.
Hi,
Because this VM is using NVMe, the SCSI Bus/Target values showing as 0 is expected and is not the best field to use.
For Azure remote NVMe disks on Windows, use SCSILogicalUnit. Microsoft documentation notes that for NVMe disks, the guest SCSILogicalUnit value is the Azure portal LUN value plus 1.
So the mapping is:
Azure LUN = SCSILogicalUnit - 1
You can try this from inside the VM:
$driveLetter = "F"
$partition = Get-Partition | Where-Object DriveLetter -eq $driveLetter
$guestDisk = Get-Disk -Number $partition.DiskNumber
$wmiDisk = Get-CimInstance Win32_DiskDrive | Where-Object { $_.Index -eq $guestDisk.Number }
[PSCustomObject]@{
DriveLetter = $driveLetter
WindowsDiskNo = $guestDisk.Number
Model = $wmiDisk.Model
SerialNumber = $wmiDisk.SerialNumber
SCSILogicalUnit = $wmiDisk.SCSILogicalUnit
AzureLun = $wmiDisk.SCSILogicalUnit - 1
}
Then from Azure PowerShell, match that LUN to the attached managed disk:
$vm = Get-AzVM -ResourceGroupName "<rg-name>" -Name "<vm-name>"
$vm.StorageProfile.DataDisks |
Select-Object Name, Lun, DiskSizeGB, @{n="ManagedDiskId";e={$_.ManagedDisk.Id}} |
Sort-Object Lun
After you identify the correct Azure disk, take a snapshot/backup first, then increase that managed disk size in Azure. After resizing, rescan disks in Windows Disk Management and extend the partition/volume for the drive letter.
If this drive is part of Storage Spaces or a spanned volume, do not resize based only on the drive letter. In that case, map the physical disks in the storage pool first, because one Windows volume may be backed by multiple Azure data disks.