Raw Device Mapping for local storage
search cancel

Raw Device Mapping for local storage

book

Article ID: 344431

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides steps to configure local datasores as RDM.


Symptoms:
When attempting to configure a local datastore as a Raw Device Mapping (RDM), you experience these symptoms:
  • The option to create an RDM is grayed out
  • You cannot add a local volume to a virtual machine as a raw device mapping


Environment

VMware ESXi 4.1.x Installable
VMware vSphere ESXi 5.5
VMware ESXi 4.0.x Installable
VMware vSphere ESXi 5.1
VMware vSphere ESXi 8.0
VMware vSphere ESXi 6.0
VMware ESX Server 3.0.x
VMware vSphere ESXi 7.0.0
VMware ESXi 4.0.x Embedded
VMware vSphere ESXi 5.0
VMware ESX 4.1.x
VMware ESXi 4.1.x Embedded
VMware ESX 4.0.x
VMware ESX Server 3.5.x
VMware vSphere ESXi 6.5
VMware ESXi 3.5.x Installable
VMware vSphere ESXi 6.7
VMware ESXi 3.5.x Embedded

Cause

By default, local storage devices are disabled as potential RDM candidates on an ESXi host due to most existing local controllers not meeting the hardware requirements to correctly address and communicate with an RDM disk.

Resolution

To configure an RDM on local storage with ESXi hosts, both of these conditions are required:
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.
 
If you have a suitable controller, you can configure the local device as an RDM. Configuration of a local storage device as an RDM must be done using the Command Line Interface (CLI), it cannot be done through the vSphere Client.
 
To configure a local device as an RDM disk:
  1. Open an SSH session to the ESXi host.
  2. Run this command to list the disks that are attached to the ESXi host:

    ls -l /vmfs/devices/disks
     
  3. From the list, identify the local device you want to configure as an RDM and copy the device name.

    Note: The device name is likely be prefixed with t10. and look similar to:

    t10.F405E46494C4540046F455B64787D285941707D203F45765
     
  4. To configure the device as an RDM and output the RDM pointer file to your chosen destination, run this command:

    vmkfstools -z /vmfs/devices/disks/diskname /vmfs/volumes/datastorename/vmfolder/vmname.vmdk

    For example:

    vmkfstools -z /vmfs/devices/disks/t10.F405E46494C4540046F455B64787D285941707D203F45765 /vmfs/volumes/Datastore2/localrdm1/localrdm1.vmdk

    Note: The size of the newly created RDM pointer file appears to be the same size and the Raw Device it it mapped to, this is a dummy file and is not consuming any storage space.
     
  5. When you have created the RDM pointer file, attach the RDM to a virtual machine using the vSphere Client:
     
    1. Right click the virtual machine you want to add an RDM disk to.
    2. Click Edit Settings.
    3. Click Add.
    4. Select Hard Disk.
    5. Select Use an existing virtual disk.
    6. Browse to the directory you saved the RDM pointer to in step 5 and select the RDM pointer file and click Next.
    7. Select the virtual SCSI controller you want to attach the disk to and click Next.
    8. Click Finish.
       
  6. You should now see your new hard disk in the virtual machine inventory as Mapped Raw LUN.
Notes:
  • As this virtual machine now has an attached local disk migration, using vMotion is not possible.
  • If you need to remove the local RDM mapping from the virtual machine, just apply the same process you would with a shared storage RDM. In the vSphere Client: right-click the virtual machine, click Edit settings, select the RDM disk and then click delete from disk. This does not delete the data on the disk, it only deletes the RDM mapping file.


Additional Information