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.

Advertisements