Identifying Virtual Machines with Raw Device Mappings (RDMs)
search cancel

Identifying Virtual Machines with Raw Device Mappings (RDMs)

book

Article ID: 332510

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides steps to identify Raw Device Mappings (RDMs) attached to registered Virtual Machines.

Environment

VMware vSphere ESXi 6.5.x
VMware vSphere ESXi 6.7.x
VMware vSphere ESXi 7.x
VMware vSphere ESXi 8.x
VMware vSphere ESXi 9.x

Resolution

Via vSphere Client:

1.) Determine which RDM LUNs are part of a VM cluster. From the vSphere Client, select a Virtual Machine that has a mapping to the RDM devices.

2.) Edit the Virtual Machine settings and navigate to the Mapped RAW LUNs.

As shown in the Example below: For Hard disk 2, the RDM Physical path is identified via the VML ID as shown in example below:

 

3.) To identify the physical drive associated for the VML ID, SSH to the host where the Virtual Machine is running and execute "esxcli storage core device list"

Example: 

# esxcli storage core device list


 

Via ESXi CLI:

1.) Open an SSH session on the host where the Virtual Machine is running

2.) Run the following command:

# find /vmfs/volumes/ -type f -name '*.vmdk' -size -1024k -exec grep -l '^createType=.*RawDeviceMap' {} \; > /tmp/rdmsluns.txt
for i in `cat /tmp/rdmsluns.txt`; do vmkfstools -q $i; done

Example output: Virtual Mode RDM (virtualrdm.vmdk):

  • Physical Mode RDM (physicalrdm.vmdk):

Via PowerCLI:

1.) Open the vSphere PowerCLI command-line

2.) Execute:

Get-VM | Get-HardDisk -DiskType "RawPhysical","RawVirtual" | Select Parent,Name,DiskType,ScsiCanonicalName,DeviceName | fl

This command produces a list of Virtual Machines with RDMs, along with the backing SCSI device for the RDMs. An output looks similar the below.
Identify the backing SCSI device from either the ScsiCanonicalName or DeviceName identifiers. 

Note: To save the output to a file:

Get-VM | Get-HardDisk -DiskType "RawPhysical","RawVirtual" | Select Parent,Name,DiskType,ScsiCanonicalName,DeviceName | fl | Out-File –FilePath RDM-list.txt

Additional Information