Determining the VML, LUN ID, and unique identifier of a missing RDM disk
search cancel

Determining the VML, LUN ID, and unique identifier of a missing RDM disk

book

Article ID: 307899

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms:

  • If a LUN being used as a Raw Device Mapping (RDM) disk changes or disappears, the virtual machine which has the RDM configured will fail to boot with one of these errors:

    • No Such Device
    • Cannot open the disk [path] or one of the snapshot disks it depends on

  • When you check the properties of the RDM disk from the Edit Settings menu on the virtual machine, the RDM now shows as a virtual disk with a size of zero bytes.
  • When you click on Manage Paths from the RDM disk in the Edit Settings menu on the virtual machine, you do not see the LUN ID, VML ID, or naa (or other unique identifier).
  • Manually querying the RDM descriptor file with the vmkfstools -q rdmdescriptor.vmdk command from a host console or SSH session returns the error:

    Failed to open '[rdmdescriptor.vmdk]' : No such device (1245193)



Environment

VMware vSphere 7.x
VMware vSphere 8.x

Cause

This issue occurs when there has been a change on the SAN, host, or environment such as:
  • The LUN has been represented with a different LUN ID.
  • There have been upgrades or changes to the storage array.
  • There have been upgrades to the host.
This will result in the disk identifier (known as a VML ID) being changed from its previous value. When a RDM is created it is tied to the VML identifier at the time the RDM was first created. If the VML changes at any time, the RDM pointer will not know which LUN to use.

Resolution

To obtain the VML Device ID from the ESXi command line:

Note: This procedure is only applicable if the virtual machine has not been un-registered from the ESXi host and re-registered since the RDM went missing.

To find the VML identifiers of the RDM devices from the ESX/ESXi command line:

  1. Open a ssh putty session to the ESXi host.

  2. Obtain the VMid for the virtual machine which has the RDM attached to it.

    # vim-cmd vmsvc/getallvms |grep <vmname>

    For example, with a virtual machine named ABC:

    # vim-cmd vmsvc/getallvms |grep ABC
    45 ABC [DATASTORE] ABC/ABC.vmx winNetEnterpriseGuest vmx-08

    In this example, the VMid for the virtual machine ABC is 45.

  3. Using the obtained VMid, query the virtual machine to see what disks have been configured on it:

    # vim-cmd vmsvc/device.getdevices VMid |grep -v parent |grep -A8 RawDisk

    For example, using VMid = 45:

    # vim-cmd vmsvc/device.getdevices 45 |grep -v parent |grep -A8 RawDisk

    The output will be similar to:

    backing = (vim.vm.device.VirtualDisk.RawDiskMappingVer1BackingInfo) {
    dynamicType = <unset>,
    fileName = "[DATASTORE] ABC/ABC_1.vmdk",
    datastore = 'vim.Datastore:4c1bbd6b-f0debcbd-####-################',
    lunUuid = "########################################################",
    deviceName = "vml.######################################################",
    compatibilityMode = "physicalMode",
    diskMode = "independent_persistent",
    uuid = <unset>,
    backing = (vim.vm.device.VirtualDisk.RawDiskMappingVer1BackingInfo) {
    dynamicType = <unset>,
    fileName = "[DATASTORE] ABC/ABC_2.vmdk",
    datastore = 'vim.Datastore:########-########-####-############',
    lunUuid = "######################################################",
    deviceName = "vml.####################################################",
    compatibilityMode = "physicalMode",
    diskMode = "independent_persistent",
    uuid = <unset>,

    From the output you can see that:
    1. deviceName  VML identifier 
    2. compatibilityMode is  physicalMode ( means device is RDM )  

  4. You can also run command to list all registered and powered on VMs :

    # esxcli vm process list  | grep "Config File:"
       Config File: /vmfs/volumes/62f65e58-8d4f8afe-XXXX-6805caa6eab8/ABC/ABC.vmx

    # cat /vmfs/volumes/62f65e58-8d4f8afe-XXXX-6805caa6eab8/ABC/ABC.vmx | grep -i vmdk
    scsi0:0.fileName = "ABC.vmdk"
    scsi1:1.fileName = "ABC_1.vmdk"

    # cd  /vmfs/volumes/62f65e58-8d4f8afe-XXXX-6805caa6eab8/ABC/

    # vmkfstools -q "ABC_1.vmdk"
    Disk ABC_1.vmdk is a Passthrough Raw Device Mapping
    Maps to: vml.02000000006000eb33d6ca1e330000000000001267695343534944

    # cat "ABC_1.vmdk" | grep createType  
    createType="vmfsRawDeviceMap"  or "vmfsPassthroughRawDeviceMap"   >> Means the device is RDM.

    Using the above vml ID of the VMDK we can find the associated Device ID on storage . 

  5. Decode the VML identifier to find the LUN number associated with the VML. Below is an example with arbitrary alpha-numeric values to assist with decoding process:

    vml.02000000006000eb33d6ca1e330000000000001267695343534944

    The portion of the VML in red is the LUN number. In this example, the missing LUN is LUN number 0. This value is in Hex so converting it to Decimal will give you the LUN ID.

    The portion of the VML in pink is the unique ID (NAA/EUI/T10). In this example, the unique ID is 6000eb33d6ca1e330000000000001267

    The same vml ID can be identified in below commands  with associated device ID 

    # esxcli storage core device list | egrep "Devfs\ Path:|Other\ UIDs:"  | sed -e 'N;s/\n//g'  | grep vml.02000000006000eb33d6ca1e330000000000001267695343534944
    Devfs Path: /vmfs/devices/disks/naa.6000eb33d6ca1e330000000000001267   Other UIDs: vml.02000000006000eb33d6ca1e330000000000001267695343534944
    .


  6. Use the LUN number or other unique ID information to locate and re-present the RDM LUN, or re-create the RDM.

 

Additional Information

You may run the below command on the ESXi host where VM is placed and get information of the VMDK
 
# vmware-vimdump -o /tmp/vmware-vimdump.txt

# less /tmp/vmware-vimdump.txt  -i | grep -A30   '(vim.vm.device.VirtualDisk)'   | egrep -i   "vim.vm.device.VirtualDisk|fileName|compatibilityMode|diskMode|label"    | sed -e 'N;N;N;N;s/\n//g' | sed 's/^\s*//;s/\s*$//;s/\s+/ /'

EXAMPLE OUTPUT:
(vim.vm.device.VirtualDisk) {label = 'Hard disk 1',                        backing = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) {                           fileName = '[DATASTORE] ########-####-####-####-############/ABC.vmdk',                           diskMode = 'persistent',
(vim.vm.device.VirtualDisk) {label = 'Hard disk 2',                        backing = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) {                           fileName = '[DATASTORE] ########-####-####-####-############/ABC_1.vmdk',                           diskMode = 'persistent',
(vim.vm.device.VirtualDisk) {label = 'Hard disk 1',                        backing = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) {                           fileName = '[DATASTORE] #######-####-####-####-############/ABC_3.vmdk',                           diskMode = 'persistent',