A Raw Disk Mapping (RDM) can be used to present a LUN directly to a virtual machine from a SAN. Rather than creating a virtual disk (VMDK) on a LUN, which is generally shared with other VMs and virtual disks.
- With RDM, the VMkernel doesn't format the LUN; instead, the VM guest OS formats the LUN.
- Each RDM is a single VM hard disk and is usually attached to a single VM.
- An RDM takes the place of a VMDK file for a VM.
- The biggest limitation with RDMs is that the one LUN is only one VM disk.
- ESXi server can only handle 255 LUNs. RDMs means there is only room for 254 RDM VM disks, plus one data store for the VM files.
- With VMFS data stores, the 255 LUNs could hold thousands of VM disks.
The advantage of VMFS is that a single disk -- logical unit number(LUN) in storage-area network (SAN) terms -- can hold multiple virtual machines.
A single LUN can assign an average number of a dozen VM.
The reasons for doing this should purley be for functional and management reasons, NOT performance. There is a mis-understanding that RDMs offer greater performance compared to VMDK's on a VMFS datastore. I've seen lots of vSphere environments that have gone over kill on RDMs for SQL servers and the like for "performance reasons", its difficult to manage! If your looking for improved storage performance look into the VMware Paravirtual SCSI (PVSCSI) adaptor.
The main reason for using an RDM should be as follows:
- To utilize native SAN tools and commands
- Big VM disks. The largest VMDK file you can create is 2TB, but a single RDM can be up to 64TB
- If using Microsoft Cluster Services (MSCS), Failover Clusters or other clustering solution
- Disaster Rcovery -connect RDM to another physical host.
- RDM will not included in snapshot if physical compatibility mode is used
LUNs presented from FC, FCoE and iSCSI are supported for RDMs.
There are two RDM modes to be aware of:
• Virtual compatability mode provides vSphere snapshots of this virtual disk.
• Physical compatability mode allows the VM to pass SCSI commands direct to the storage system LUN. This allows it to leverage SAN specific features such as interation with the SANs own snapshot functions.
Create a Raw Device Mapping Disk on a Virtual Machine
1. The first step to adding a RDM to a virtual machine is to assign an unused LUN to your ESXi Servers. This will vary depending on the type of SAN in use (consult the SAN vendors documentation on how to do this).
2. For the new LUN to become available, Rescan the HBAs on all your ESXi servers.
3. The virtual machine that the RDM is going to be added to needs to be shut down first, the RDM cannot be added while it is running.
4. On the hardware tab, click "Add" and choose "Hard Disk".
5. For the disk type choose "Raw Device Mapping" (RDM). Click Next.
6. Choose the LUN. Click Next.
7. Choose "Store with
virtual machine" or if you want store the link to the RDM in a specific
datastore. Click Next.
8. RDM volumes can be created in either "Physical" or "Virtual" compatability mode:
Virtual compatability mode provides vSphere snapshots of this virtual disk.
Physical compatability mode allows the VM to pass SCSI commands direct to the storage system LUN. This allows it to leverage SAN specific features such as interation with the SANs own snapshot functions.
9. The RDM must be located on a seperate SCSI controller.
Choose a Virtual Device Node that is on a different SCSI bus to the current virtual disks (e.g. SCSI 1:0).Click next.
10. Confirm settings and choose finish.
11. A new SCSI controller and hard disk is added to the virtual machine configuration. Now boot your VM. Depending on the OS check for new disks and format/mount the disk.