LUN Numbers Misbehaving in Disk Management and Server Manager on Windows Server

Niket Kumar Singh 190 Reputation points
2024-03-21T04:26:59.05+00:00

m encountering issues with LUN numbers behaving unexpectedly in Disk Management and Server Manager Disk Properties on my Windows Server. Additionally, I'm experiencing challenges detaching disks from the Azure portal due to uncertainty about which LUN to detach. Here are the specific problems I'm facing:

Misbehaving LUN Numbers: The LUN numbers for existing disks are not displaying correctly in Disk Management and Server Manager Disk Properties. This inconsistency complicates storage management and identification of resources.

Missing LUN Numbers for Unallocated Disks: When disks are unallocated, the LUN numbers are completely absent from Disk Management. This absence makes it difficult to distinguish between unallocated disks and those already provisioned.

  1. Difficulty Detaching Disks from Azure Portal: I'm uncertain about which LUN corresponds to the disks I want to detach from the Azure portal. Without accurate LUN information, I'm hesitant to proceed with detaching disks to avoid potential data loss or disruption to services.

image

image

User's image

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,715 questions
Azure Disk Encryption
Azure Disk Encryption
An Azure service for virtual machines (VMs) that helps address organizational security and compliance requirements by encrypting the VM boot and data disks with keys and policies that are controlled in Azure Key Vault.
162 questions
Azure Disk Storage
Azure Disk Storage
A high-performance, durable block storage designed to be used with Azure Virtual Machines and Azure VMware Solution.
572 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Vinodh247-1375 11,216 Reputation points
    2024-03-21T06:42:51.7633333+00:00

    Hi Niket Kumar Singh,

    Thanks for reaching out to Microsoft Q&A.

    Have you tried all the basic troubleshooting steps below and still facing the issue?

    • Refresh Disk Management
    • Checking the Disk Properties
    • Updating the Disk Drivers
    • Rescanning the Disks
    • Checking the Storage Array configuration and if you’re using a storage array (SAN/NAS), verify the LUN configuration on the storage side. Incorrect mappings can lead to LUN misbehavior. Event Logs

    Missing LUN Numbers for Unallocated Disks:

    • When disks are unallocated (not yet provisioned), they won’t have LUN numbers assigned. This behavior is expected because LUNs are typically allocated during disk provisioning. To differentiate between unallocated disks and provisioned ones:
    1. Unallocated Disks: These will appear without LUN numbers in Disk Management. They are essentially raw storage waiting to be configured.
    2. Provisioned Disks: These will have LUN numbers assigned and can be further partitioned or formatted for use. and if you are provisioning new disks, allocate LUNs during the setup process. Once allocated, they should appear with LUN numbers in disk management.

    Please 'Upvote'(Thumbs-up) and 'Accept' as an answer if the reply was helpful. This will benefit other community members who face the same issue.


  2. Nehruji R 2,051 Reputation points Microsoft Vendor
    2024-03-21T07:19:03.03+00:00

    Hello Niket Kumar Singh,

    Greetings! Welcome to Microsoft Q&A Platform.

    I understand the challenges you’re facing with LUN numbers on your Windows Server and the uncertainty around detaching disks from the Azure portal.

    Please help to check the storage side first. Is the iSCSI target still enabled and connected to the initiator on the server side? If yes, please run services.msc and manually restart the Virtual Disk service on the windows server. Also see if disconnect/connect the target helps.

    Unfortunately, unallocated disks might not have explicit LUN numbers assigned refer - https://learn.microsoft.com/en-us/troubleshoot/windows-server/virtualization/vm-dda-luns-disappear-after-mpio-config

    However, you can still manage them based on other properties (such as size or disk type) and try to detaching the disks - https://learn.microsoft.com/en-us/azure/virtual-machines/windows/detach-disk

    Get-Disk to list the disks on a system and Get-Partition to list the partitions on a disk. You can then use the Number property of the Partition object to get the LUN number and the DriveLetter property to get the drive letter.

    Here is an example of how you can use these cmdlets to get the LUN number and drive letter for all disks and partitions on a system:

    $disks = Get-Disk

    foreach ($disk in $disks)

    {

    $partitions = Get-Partition -DiskNumber $disk.Number  
    
    foreach ($partition in $partitions)  
    
    {  
    
        Write-Output "LUN Number: $($partition.Number)"  
    
        Write-Output "Drive Letter: $($partition.DriveLetter)"  
    
    }  
    

    }

    This will output the LUN number and drive letter for each partition on each disk. You can also use the -FriendlyName and -Description properties of the Disk object to get more information about the disks.

    refer - https://learn.microsoft.com/en-us/azure/virtual-machines/windows/azure-to-guest-disk-mapping?tabs=azure-cli#finding-the-lun-for-the-azure-disks.

    Similar thread for reference - https://learn.microsoft.com/en-us/answers/questions/1190110/windows-server-2019-iscsi-connection-was-working-l

    Hope this answer helps! Please let us know if you have any further queries. I’m happy to assist you further.

    Please "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.