RDM (raw disk mapping) with Local Disks

I wanted to virtualize my home storage server with five 1 TB drives in software raid 5 configuration (linux mdadm). The main reason was to use the server not only for CIFS (samba) shares, but also for block storage (iSCSI) access with HP LeftHand VSA and similar ESX appliances. I have around 3.5 TB of data so copying it somewhere to rebuild the storage was not an option. So I decided to use RDM. I created the virtual machine (Red Hat Enterprise Linux) and added the 1TB local disks as RDM disks. Although this is not supported configuration it works both on ESX and ESXi. The advantage is that if I decide I want to go back to physical I can easily migrate the RDM disks.

To create the RDM local drives console access is needed. As I am using ESXi this must be done with the UNSUPPORTED method.

Next step is to find how are the disks seen and linked by ESX.

ls -la /vmfs/devices/disks

...
---------    0 root     root               1984 Jan  1  1970 vml.0100000000202020202057442d574341534a32333638383631574443205744 ->  10.ATA_____WDC_WD1000FYPS2D01ZKB1________________________WD2DWCASJ2368861
---------    0 root     root               1984 Jan  1  1970 vml.0100000000202020202057442d574341534a32333638383631574443205744:1 -> t10.ATA_____WDC_WD1000FYPS2D01ZKB1________________________WD2DWCASJ2368861:1
...

These are two symbolic links to a drive (we can see its type and serial number) and its only partition. We need to remember the vml.0… long name.

Then we create the rdm links in the VM directory:

vmkfstools -r /vmfs/devices/disks/vml.0100000000202020202057442d574341534a32333638383631574443205744 /vmfs/volumes/datastore1/FileServer/rdm_disk1.vmdk

In my case I created 5 such links.

The last step is to add the rdm links to the virtual machine (Add – Hard Disk – Use an existing virtual disk and browse to rdm_disk1.vmdk}.

Here is the final screenshot.

5 thoughts on “RDM (raw disk mapping) with Local Disks

  1. Thanks so much for this info! This is exactly what I wanted to do, and couldn’t find anywhere else. I’m just running a very modest home server and wanted to play with virtualization without having to reconfigure everything (or anything really). Previously physical server boots as a virtual first try!

  2. Thanks for your info. I made a sata disk available to my ESXi 5.1 server without converting it. Good info.

  3. thx =) im interested in if spin down on RDM Devcies is supported then… means from Nas4Free for example to than rdm devices.

    Ive an ASROCK 8 Core Board here with 16 GB of mem, 12x sata and want to do a esxi 5.5 environment – energy saving (8 core Avoton ATOM) but need to have a win server 2012 beside that nas4free thing…
    Would be perfect to set the zfs raid 5 from the nas4free vm to sleep if not required… but i dont know of the rdm of esxi blocks the spin down.

  4. Are you booting ESXi from USB? If so, where are the RDM mapping files located? I thought vm datastore on USB is not supported.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.