Raw Disk Mapping (RDM) is a feature that can be used to provide various functionality in a virtualized environment, like VMware vSphere. But what is Raw Disk Mapping? Traditionally, the data storage system within a virtual machine uses a Virtual Disk File (VMDK) stored within the Virtual Machine File System (VMFS) volume. However, there may be a need to bypass this typical storage route sometimes, and RDM provides this flexibility.
Table of Contents
Raw Device Mapping: Modes, compatibility, and prerequisites
Essentially, RDM enables a virtual machine to interact directly with a physical storage device, creating a unique pathway for disk access performance.
RDM functions using two compatibility modes: physical compatibility mode and virtual compatibility mode. Physical compatibility mode or physical mode RDM mimics the presence of a physical SCSI device, effectively facilitating direct communication between the SCSI device and the guest operating system. This type of setup permits SAN snapshots and other layered applications to function.
Virtual compatibility mode, or virtual mode RDM, on the other hand, offers a compromise between direct access to the raw device and the benefits of VMFS file abstraction. It encapsulates SCSI commands and can work with standard file system operations.
Prerequisites and limitations
To set up a Raw Disk Mapping (RDM) with ESXi hosts on local storage, you need to satisfy these two prerequisites:
- The target device should be compatible with SCSI Inquiry Vital Data Product (VPD) page code 0x83. This code is integral in facilitating direct communication with the RDM devices. To deepen your understanding of SCSI sense codes, consider exploring the article, “Understanding SCSI Check Conditions in VMkernel logs during rescan operations (1010244).”
- The target device needs to exhibit a global serial number. This distinctive identifier allows the ESXi host to distinguish the device for RDM usage uniquely.
- RDM disks attached to a VM can introduce complexities when it comes to vMotion operations and other normal every day tasks for VI admins
It’s essential to mention that not all local controllers and their linked storage can act as an RDM due to these requirements. Therefore, contacting your hardware vendor to confirm if your controller complies with these conditions and to receive any technical assistance is advised.
Note. This capability to serve as an RDM may not be possible on some local controllers and their attached storage. Contact your hardware vendor to verify if your controller supports the required conditions and for any technical support.
You can also determine if raw disks presented to your ESXi host are capable of RDM support with the command:
esxcfg-scsidevs -l
Key Benefits of Raw Device Mapping
Raw device mapping offers several benefits that can enhance your virtual machines. For one, RDM supports SAN-aware applications within a virtual machine, creating opportunities for backup offloading systems and other solutions.
RDM enables physical-to-virtual clustering, including Microsoft Cluster Service (MSCS) configurations and Cluster in a Box. Moreover, direct access to raw physical storage devices leads to better disk access performance, a crucial factor in high-performance computing.
The Intersection of VMFS and RDM
While the Virtual Machine File System (VMFS) is an integral part of a virtual machine’s operation, there are times when it may be necessary to go beyond the VMFS volume. This intersection of VMFS and RDM is where the storage device directly interfaces with the virtual machine, bypassing the VMDK virtual disk file.
This configuration allows direct interaction with the underlying storage device, facilitating lower-level storage functions. Remembering that RDM does not entirely eliminate the VMFS layer is essential. Instead, a mapping file located on a VMFS volume redirects disk access to the raw device.
Configuring Raw Disk Mapping: A Step-by-Step Guide
Configuring a raw device mapping RDM involves several steps. First, you have to select a suitable storage logical unit number (LUN) for the raw device. Once the LUN is identified, the VMFS datastore can be chosen.
After that, the physical server’s Edit Settings option is used to add an RDM disk to the virtual machine configuration. During this process, an RDM file will be created, with a .vmdk extension, which acts as the symbolic link to the raw device.
Adding a RAW disk mapping is straightforward. If you want a virtual machine to have a RAW disk, you can select the Add new device menu and select RDM disk.
It will then have you select a Target LUN. Below I have a raw StarWind SAN LUN presented to the ESXi host.
You will see the disk added and designated with Physical LUN.
Disk Access Performance: RDM vs. Virtual Disk Files
When it comes to disk access performance, both RDM and VMDK virtual disk files have strengths and limitations. RDM offers the advantage of direct access to a SCSI device, thus improving performance, especially when used in physical compatibility mode. On the other hand, using VMDK virtual disk files can provide greater flexibility as the VMDK file can easily be moved, cloned, or snapshotted.
Advanced Raw Disk Mapping: Clustering and High-Performance Computing
RDM plays a significant role in supporting physical-to-virtual clustering, an essential part of high-performance computing. It supports both Microsoft Cluster Service (MSCS) cluster configurations, including Cluster in a Box and Cluster Across Boxes configurations.
Moreover, in advanced applications such as these, RDM’s support for distributed file locking, which is a feature of the VMFS filesystem, becomes critical.
RDM Limitations: Considerations for vSphere Administrators
While RDM offers unique advantages, certain limitations exist that administrators must consider. For instance, while RDM provides direct access to the physical storage device, it is not fully compatible with all file system utilities or operations. There can also be challenges with SAN snapshots when RDM is in use, and administrators must be prepared to manage these.
RDM Best Practices: Optimizing Your Setup
Optimizing your RDM setup involves several best practices. Choosing the correct SCSI device access modes, understanding the interaction between SAN snapshots and raw device mappings, and managing storage arrays effectively are all vital.
Remember, while RDM provides benefits, its use should be limited to necessary instances to avoid complexity in your virtual machine configuration.
Frequently Asked Questions
Can Raw Disk Mapping be used with any storage device?
Yes, RDM can be utilized with a wide array of SCSI devices. This includes direct-attached block devices and those accessed via a storage area network (SAN). However, each device’s specific characteristics and requirements and the guest OS should be considered for optimal disk access performance and compatibility.
Is there a performance difference between Physical Mode RDM and Virtual Mode RDM?
Physical mode RDM tends to have slightly better disk access performance due to its minimal SCSI virtualization. This direct approach reduces the layers of abstraction between the guest OS and the physical storage device. However, the difference may not be significant for all applications, and the additional functionality virtual mode offers may be advantageous in certain scenarios.
How does Raw Disk Mapping support high-performance computing?
RDM supports high-performance computing by allowing direct access to storage devices, which can enhance data retrieval and writing speed. This increase in disk access performance can be pivotal for large databases, big data analytics, or other intensive applications.
How do I handle backups in an environment utilizing RDM?
RDM supports SAN snapshot capabilities, which can be leveraged for data protection and backup. Some backup offloading systems are SAN-aware and can interact with the raw device through the RDM. However, when RDM is used in physical compatibility mode, it may bypass certain VM-level backup solutions, requiring an alternative strategy.
What is the relationship between the VMFS distributed locking feature and RDM?
In shared storage environments, multiple VMs can access the same SCSI device. To prevent data inconsistency or corruption, VMFS employs a distributed locking feature to ensure only one VM is writing to a disk at any given time. This VMFS distributed locking feature extends to RDM disks, providing the same level of data protection.
Can I convert a Raw Device Mapping disk to a virtual disk?
It’s possible to migrate data from an RDM disk to a virtual disk using tools like the vSphere vmkfstools command. But be aware that converting a physical mode RDM to a virtual disk may cause issues with SAN-aware applications or physical to virtual clustering setups.
Are there specific use-cases where RDM is recommended?
While RDM is not necessary for most general virtual machine setups, certain use-cases, such as Microsoft Cluster Service (MSCS) configurations or high-performance computing scenarios, can significantly benefit from RDM’s direct access to storage devices. It can also be essential when running SAN-aware applications that require direct interaction with the storage hardware.
Raw disk mapping: should you use it?
Using the Raw disk mapping functionality with ESXi and VMware vSphere provides interesting solutions to specific use cases where SAN functionality can be leverage for certain virtual machines in the environment. However, one needs to be aware of the prerequisites before configuring RDMs as well as the limitations when using it.