Creating Raw Disk Mappings for VMware ESXi

What are Raw Disk Mappings?

In VMware you can create a Raw Disk Mapping to assign a physical hard drive directly to a virtual machine. This bypasses a VMFS datastore and allows you to dedicate a whole drive to a VM. One use for this would be to create a software RAID on a VM for a ESXi host that doesn’t have a supported RAID controller. Or if you are converting a physical machine to a virtual one and want to access the data without running VMware Converter.

How to create a RDM

  1. Ensure you don’t have a datastore on the drive you want to create a RDM.
  2. Get the Identifier of the drive from vSphere web client or the vSphere client
    Web Client:
    ID
    Software Client:
    ID
  3. Enable the ESXi shell by following these directions if you haven’t already done so.
  4. Open the ESXi shell.
  5. Determine the VML identifier for the disk by finding the matching VML. The VML ID will be used in the command to create the RDM.
    # ls /dev/disks/ -l
    total 5860592008
    -rw------- 1 root root 500107862016 Sep 11 23:42 t10.ATA_____ST3500630AS_________________________________________9QG6WSE4
    lrwxrwxrwx 1 root root 72 Sep 11 23:42 vml.01000000002020202020202020202020203951473657534534535433353030 -> t10.ATA_____ST3500630AS_________________________________________9QG6WSE4
  6. Change the working directory to an existing datastore.
    # cd /vmfs/volumes/datastore/
  7. Create the RDM
    Virtual RDM: (Able to create snapshots)

    # vmkfstools -r /vmfs/devices/disks/vml.01000000002020202020202020202020203951473657534534535433353030 RDM.vmdk -a lsilogic

    Physical RDM: (Nearly all SCSI commands are passed directly to the disk rather being handled by the VMkernel)

    # vmkfstools -z /vmfs/devices/disks/vml.01000000002020202020202020202020203951473657534534535433353030 RDM.vmdk -a lsilogic
  8. Add the created RDM.vmdk file to a virtual machine and enjoy.

Share This:

Leave a Reply

Your email address will not be published. Required fields are marked *