What is RDM (Raw Device Mapping)?
Raw Device Mapping (RDM) is VMware’s virtualization technology that allows a virtual machine (VM) to access a logical unit number (LUN) directly. IT administrators can then format the LUN using any file system, such as New Technology File System (NTFS) for Windows, eliminating the need to use the virtual machine file system (VMFS).
RDM is beneficial in cluster configurations like VM-to-VM or physical-to-VM and storage area network (SAN) snapshots. However, it also has limitations: It doesn’t map disk partitions and may not work on direct-attached block devices.
Definition and Characteristics of RDM
As the name suggests, Raw Device Mapping is a mapping file that maps a LUN directly to a VM. In other words, RDM allows VMs to bypass VMFS—VMware’s default storage management interface—and access the storage device directly. This way, an RDM acts as a proxy for a raw LUN residing in a VMFS volume.
As a proxy, RDM consists of metadata that manages and redirects the VM to the raw physical storage devices. When vSphere administrators configure the VM’s virtual disk (vDisk) to point directly to a LUN on a storage array, an RDM file gets created within the VMFS volume. With an RDM in place, any VM within the cluster can access the storage array, just like any other disk.
A VM reads the mapping file, which resides in the VMFS volume. As a proxy for the raw LUN, an RDM contains the physical storage device’s raw ID. When the VM learns of the storage array’s raw ID, it automatically sends the data it reads and writes to the storage device and no longer references the VMFS datastore.
This way, the VM perceives the RDM as a Small Computer System Interface (SCSI) device, available for the usual file operations.
RDM Metadata
RDM contains metadata that specifies the following:
- Compatibility modes. There are two modes: physical and virtual. With physical mode, you get minimal SCSI virtualization of the raw LUN, appropriate for SAN-aware agents in the VM. Virtual mode, in contrast, specifies the full virtualization of the raw LUN. You can use the virtual model for operations such as SAN snapshots and advanced file locking.
- Dynamic name resolution. RDM stores unique identification data about each raw LUN. The VMFS, in turn, resolves the metadata based on the current SCSI device, irrespective of changes in the server’s configurations such as device location, adapter changes, and path changes.
- RDM with VM clusters. Your setup resembles a VM cluster accessing the same vDisk file in this case, but with the mapping file replacing the vdisk file. VMware recommends this approach for VM clusters that needs to access the same SCSI device for failover scenarios.
- SCSI device access modes. You can access a SCSI device using three methods: vDisk file on the VMFS datastore, physical mode RDM, and virtual mode RDM.
Types of RDM
RDM has two modes: physical and virtual. The option you choose depends largely on the virtualization features you want to achieve.
Physical RDM
Physical RDM—also called pass-through RDM (pRDM)—exposes the SCSI device’s physical properties to the guest OS within the VM. Apart from the REPORT LUNs command, which gets virtualized, all other SCSI commands go directly to the guest OS. This allows the VM to take advantage of the lower-level storage features of the SCSI device.
Physical RDM is preferable in the following scenarios:
- Running SAN management agents and other SCSI-based software in the VM.
- Cost-effective virtual-to-physical clustering.
- Physical-to-virtual clustering.
Virtual RDM
As the name suggests, a virtual RDM (vRDM) virtualizes all the SCSI devices’ underlying physical properties. As such, the device appears the same way a vDisk file would appear on a VMFS volume. Because of the SCSI device’s full virtualization, all commands get virtualized except read and write, which are passed directly to the raw LUN.
vRDM is preferable in the following scenarios:
- Cluster-in-a-box and cluster-across-boxes
- VM snapshots
- VM cloning
- File locking
Benefits of RDM
RDM is beneficial in various use cases, including guest OS clustering, distributed file locking, SAN snapshots, and user-friendly persistent names, among others.
Guest OS clustering. Raw device mapping provides three different ways of implementing clusters using VMs:
- Cluster-in-a-box (CIB). When you have two virtual machines running on the same ESX/ESXi host, you can configure them as a cluster. This approach is useful in testing and development scenarios.
- Cluster-across-boxes (CAB). When you have VMs on different ESX/ESXi hosts, you can use vRDM to configure them as a cluster using CAB.
- Physical-to-virtual cluster. With this approach, you get the benefits of both physical and virtual clustering, even though you can’t use vRDM with this method.
Distributed file locking. You can use VMFS distributed locking feature for SCSI devices with RDM. With distributed file locking, you can use a shared raw LUN without worrying about data loss.
SAN snapshots. vRDM allows the guest OS to treat the mapping file more like a vdisk file. Including RDMs in vSphere snapshots is simpler.
User-friendly persistent names. With RDM, you determine which names you would like to use for your SCSI devices. Once you create the mapping name, you don’t need to use the device’s name to refer to it.
File system operations. RDM allows the VM to leverage file system utilities with the raw LUN. You can use most ordinary file operations with RDM files that operate on the SCSI device.
Limitations of RDM
Despite the RDM’s benefits, some limitations exist, such as:
- You cannot use RDMs with direct-attached block devices and some redundant array of independent disks (RAID) devices. RDMs use serial numbers to identify the SCSI device, which direct-attached block and RAID devices don’t support.
- You cannot use the SAN snapshot with the physical compatibility mode. The VM can only manage its own storage and other mirroring operations when using physical compatibility mode.
- You cannot redirect to a partition. RDMs need a whole LUN and not a part of it.
- You have to maintain consistent LUN IDs for mapping across all the participating hosts while migrating VMs with vMotion.
Parallels RAS supports VMware Vsphere
Server virtualization is a robust tool that can minimize an organization’s administrative overhead while increasing scalability, efficiency, and cost optimization. VMware ESXi can help you consolidate your IT infrastructure while saving money and time. However, to reap maximum benefits from VMware ESXi, you also need to maximize resource usage in terms of accessibility, workforce mobility, flexibility, and security.
Parallels® Remote Application Server (RAS) is a fully-functional virtual desktop infrastructure (VDI) solution that organizations can use to maximize their IT resource consumption. IT administrators can leverage Parallels RAS to publish virtual desktops and applications, which in turn get hosted on VMs managed by hypervisors such as VMware ESXi.
Employees can access such desktops and applications anytime, anywhere on multiple endpoints—including any HTML5-compliant browser. Parallels RAS is hypervisor-agnostic. Besides VMware ESXi, Parallels RAS integrates with Hyper-V and other hyper-converged infrastructures (HCIs) such as Scale Computing HC3 and Nutanix Acropolis.
This flexibility minimizes entry barriers for organizations that wish to adopt VDI solutions without worrying about vendor lock-in challenges. Most importantly, Parallels RAS supports multiple hypervisors under the same infrastructure, providing flexibility if you want to manage VDIs from a single pane of glass.
Test drive virtual machine management!