Raw Device Mapping (RDM)


RDM is a mapping file in a separate VMFS volume that acts as a proxy for a raw physical storage device. The RDM allows a virtual machine to directly access and use the storage device. The RDM contains metadata for managing and redirecting disk access to the physical device.

The file gives you some of the advantages of direct access to a physical device while keeping some advantages of a virtual disk in VMFS. As a result, it merges VMFS manageability with raw device access.

RDMs can be described in terms such as mapping a raw device into a datastore, mapping a system LUN, or mapping a disk file to a physical disk volume. All these terms refer to RDMs.
Raw Device Mapping




Although VMware recommends that you use VMFS datastores for most virtual disk storage, on certain occasions, you might need to use raw LUNs or logical disks located in a SAN.

For example, you need to use raw LUNs with RDMs in the following situations:
When SAN snapshot or other layered applications are run in the virtual machine. The RDM better enables scalable backup offloading systems by using features inherent to the SAN.
In any MSCS clustering scenario that spans physical hosts — virtual-to-virtual clusters as well as physical-to-virtual clusters. In this case, cluster data and quorum disks should be configured as RDMs rather than as files on a shared VMFS.

Think of an RDM as a symbolic link from a VMFS volume to a raw LUN. The mapping makes LUNs appear as files in a VMFS volume. The RDM, not the raw LUN, is referenced in the virtual machine configuration. The RDM contains a reference to the raw LUN.

Using RDMs, you can:
Use vMotion to migrate virtual machines using raw LUNs.
Add raw LUNs to virtual machines using the vSphere Client.
Use file system features such as distributed file locking, permissions, and naming.

Two compatibility modes are available for RDMs:
Virtual compatibility mode allows an RDM to act exactly like a virtual disk file, including the use of snapshots.
Physical compatibility mode allows direct access of the SCSI device for those applications that need lower level control.

Benefits of Raw Device Mapping
An RDM provides a number of benefits, but it should not be used in every situation. In general, virtual disk files are preferable to RDMs for manageability. However, when you need raw devices, you must use the RDM.
RDM offers several benefits.
User-Friendly Persistent Names
Provides a user-friendly name for a mapped device. When you use an RDM, you do not need to refer to the device by its device name. You refer to it by the name of the mapping file, for example:
/vmfs/volumes/myVolume/myVMDirectory/myRawDisk.vmdk
Dynamic Name Resolution
Stores unique identification information for each mapped device. VMFS associates each RDM with its current SCSI device, regardless of changes in the physical configuration of the server because of adapter hardware changes, path changes, device relocation, and so on.
Distributed File Locking
Makes it possible to use VMFS distributed locking for raw SCSI devices. Distributed locking on an RDM makes it safe to use a shared raw LUN without losing data when two virtual machines on different servers try to access the same LUN.
File Permissions
Makes file permissions possible. The permissions of the mapping file are enforced at file-open time to protect the mapped volume.
File System Operations
Makes it possible to use file system utilities to work with a mapped volume, using the mapping file as a proxy. Most operations that are valid for an ordinary file can be applied to the mapping file and are redirected to operate on the mapped device.
Snapshots
Makes it possible to use virtual machine snapshots on a mapped volume. Snapshots are not available when the RDM is used in physical compatibility mode.
vMotion
Lets you migrate a virtual machine with vMotion. The mapping file acts as a proxy to allow vCenter Server to migrate the virtual machine by using the same mechanism that exists for migrating virtual disk files.
vMotion of a Virtual Machine Using Raw Device Mapping



SAN Management Agents
Makes it possible to run some SAN management agents inside a virtual machine. Similarly, any software that needs to access a device by using hardware-specific SCSI commands can be run in a virtual machine. This kind of software is called SCSI target-based software. When you use SAN management agents, select a physical compatibility mode for the RDM.
N-Port ID Virtualization (NPIV)
Makes it possible to use the NPIV technology that allows a single Fibre Channel HBA port to register with the Fibre Channel fabric using several worldwide port names (WWPNs). This ability makes the HBA port appear as multiple virtual ports, each having its own ID and virtual port name. Virtual machines can then claim each of these virtual ports and use them for all RDM traffic.
Note
You can use NPIV only for virtual machines with RDM disks.

VMware works with vendors of storage management software to ensure that their software functions correctly in environments that include ESX. Some applications of this kind are:
SAN management software
Storage resource management (SRM) software
Snapshot software
Replication software
Such software uses a physical compatibility mode for RDMs so that the software can access SCSI devices directly.
Various management products are best run centrally (not on the ESX machine), while others run well on the service console or on the virtual machines. VMware does not certify these applications or provide a compatibility matrix. To find out whether a SAN management application is supported in an ESX environment, contact the SAN management software provider.

Limitations of Raw Device Mapping

Certain limitations exist when you use RDMs.

Not available for block devices or certain RAID devices – RDM uses a SCSI serial number to identify the mapped device. Because block devices and some direct-attach RAID devices do not export serial numbers, they cannot be used with RDMs.
Available with VMFS-2 and VMFS-3 volumes only – RDM requires the VMFS-2 or VMFS-3 format. In ESX, the VMFS-2 file system is read only. Upgrade it to VMFS-3 to use the files that VMFS-2 stores.
No snapshots in physical compatibility mode – If you are using an RDM in physical compatibility mode, you cannot use a snapshot with the disk. Physical compatibility mode allows the virtual machine to manage its own snapshot or mirroring operations.
Snapshots are available in virtual mode.
No partition mapping – RDM requires the mapped device to be a whole LUN. Mapping to a partition is not supported.


No comments:

Post a Comment