VMware Raw Device Mapping for local storage
Written by: J Dawg
Here is an excellent write up on mapping a RAW device to a VM within ESX/Vsphere. What I was trying to do was map a local drive that had NTFS partitions on it to a Windows 8 VM. Going thru the “Edit Settings” menu for the VM showed “RAW Device Mappings” grayed out on the Add Hardisk submenu.
- The option to create an RDM is grayed out
- You cannot add a local volume to a virtual machine as a raw device mapping
This article provides steps to configure local datasores as RDM.
By default, local storage devices are disabled as potential RDM candidates on an ESXi/ESX host due to most existing local controllers not meeting the hardware requirements to correctly address and communicate with an RDM disk.
- The candidate device must support SCSI Inquiry Vital Data Product (VPD) page code 0x83, which is used to directly address and communicate with RDM devices.For more information on SCSI sense code, see Understanding SCSI Check Conditions in VMkernel logs during rescan operations (1010244).
- The candidate device must export a global serial number, which enables the ESXi/ESX host to uniquely identify the device for use as an RDM.
- Open an SSH session to the ESXi/ESX host.
- Run this command to list the disks that are attached to the ESXi host:# ls -l /vmfs/devices/disks
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:
- 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
# 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.
- When you have created the RDM pointer file, attach the RDM to a virtual machine using the vSphere Client:
- Right click the virtual machine you want to add an RDM disk to.
- Click Edit Settings.
- Click Add.
- Select Hard Disk.
- Select Use an existing virtual disk.
- Browse to the directory you saved the RDM pointer to in step 5 and select the RDM pointer file and click Next.
- Select the virtual SCSI controller you want to attach the disk to and click Next.
- Click Finish.
- You should now see your new hard disk in the virtual machine inventory as Mapped Raw LUN.
- 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.
This article was originally found on VMware Knowledge Base.
Leave a Reply
You must be logged in to post a comment.