VMware RDM Configuration: When Should Virtual Machines “Bypass” to Access Physical Storage?

VMware tutorial - IT technology blog
VMware tutorial - IT technology blog

Quick Start: Map an RDM Disk in 5 Minutes

Imagine you’re in the server room at 2 AM. SQL Server is constantly reporting I/O timeouts. You need to quickly map a LUN from the SAN to a virtual machine (VM) without going through the VMFS layer. Here is the standard procedure for a quick fix.

1. Locate the NAA ID

Don’t waste time looking through the vSphere interface because dozens of disks will look identical. SSH into the ESXi host and use the following command to accurately list the devices:

esxcli storage core device list | grep -A 1 "Display Name:"

You will receive a long string starting with naa.600.... Copy this code. This is the “ID card” for the disk you need.

2. Create the Pointer File

RDM is essentially a .vmdk file acting as a “guide.” It doesn’t contain data but simply forwards I/O commands to the physical disk. Navigate to the VM’s directory and run the command:

# Use Physical Mode (Full Pass-through)
vmkfstools -z /vmfs/devices/disks/naa.600123456789... /vmfs/volumes/Datastore_Data/SQL_VM/rdm_disk_01.vmdk

3. Attach the Disk to the Virtual Machine

  1. Right-click the VM and select Edit Settings.
  2. Under Add New Device, select Existing Hard Disk.
  3. Point directly to the rdm_disk_01.vmdk file created in the previous step.

That’s it. The guest operating system will now recognize the disk as a directly attached physical SCSI device.


Decoding: Why Use RDM Instead of VMFS?

In my experience managing clusters of 8 ESXi hosts, I usually prefer traditional VMDK files for their flexibility. However, RDM is the trump card in these three specific scenarios.

Applications Requiring Deep Control

Some storage management or backup software needs to communicate directly with the SAN controller via specific SCSI commands. The VMFS layer often blocks these commands for system protection. RDM (Physical Mode) opens the door for these commands to pass through without barriers.

Building Clusters (WSFC)

If you are setting up a Windows Server Failover Cluster across VMs on different hosts, you need a Quorum disk or Shared Storage. To support SCSI-3 Persistent Reservations, RDM is almost a mandatory choice.

Managing Massive Data

For databases reaching 20-30TB, formatting VMFS and creating VMDK files can sometimes make administrators worry about metadata scan times. RDM helps completely isolate this data from the VMware file system.


Physical Mode (pRDM) vs. Virtual Mode (vRDM)

Confusion here often leads to Snapshot errors or vMotion failures.

  • Physical Mode (-z): Highest performance. ESXi barely interferes with SCSI commands. Note: You cannot take VM snapshots in this mode.
  • Virtual Mode (-r): ESXi still provides some virtualization. This mode allows Snapshots and Cloning while still mapping to a physical disk.

Optimizing I/O: Don’t Let RDM Crawl

RDM is not a silver bullet. If the path is misconfigured, performance will still be poor. The difference between RDM and VMFS 6 today is only about 1-3% in terms of CPU overhead.

Check your Path Selection Policy (PSP). If you are using a SAN from Dell Unity or NetApp, switch to Round Robin to maximize HBA card bandwidth:

# Switch to Round Robin for path optimization
esxcli storage nmp device set --device naa.600... --psp VMW_PSP_RR

Real-world Experience

I once handled a database with severe bottlenecks. When switching to RDM, Disk Latency dropped from 50ms to 5ms. The secret wasn’t that RDM is inherently faster, but because that VM was given its own dedicated LUN on the SAN. It no longer had to compete for Queue Depth with 20 other VMs on the same Datastore.

Crucial Considerations:

  1. vMotion: You can still migrate the VM to another host, provided the destination host is mapped to the exact same LUN with the same NAA ID.
  2. Storage vMotion Caution: If you aren’t careful, VMware might automatically convert the RDM file into a standard VMDK file during data migration.
  3. Capacity Expansion: When increasing LUN size on the storage side, you must perform a Rescan Storage on ESXi. Sometimes you need to reboot the VM for the OS to recognize the new capacity.

In conclusion: Don’t overuse RDM. Only use it when you truly need to bypass the VMFS layer or for clustering. For 90% of other needs, VMFS remains the best choice due to its management flexibility.

Share: