Thursday, August 6, 2009

Raw Disk Mapping of Local Storage on ESXi

ESXi does not officially support Raw Disk Mapping of local storage devices. It means if you attach a SCSI array box to ESXi host, you are not able to use it as a physical disk in VM because the Raw Disk Mapping option is greyed out. Here is the workaround.

The workaround is to create a RDM virtual disk file inside mounted vmfs. Then add this virtual disk file to a VM.

The VM's system partition should be on vmfs, use RDM disk for data storage only.

After creating the VM in the conventional way with one virtual disk on vmfs, in SSH session or console, type this command:

vmkfstools -r /vmfs/devices/disks/vmhba2:1:0:0 /vmfs/volumes/datastore1/testvm

Substitute vmhba2:1:0:0 with your actual physical disk path. You can find the path in Storage Adapters. Click on the SCSI adapter, in Details frame, SCSI Target should list all the paths. The path list here omits multiple 0, so if you see vmhba2:1:0, the actual path that the command will take is vmhba2:1:0:0.

The rdm virtual disk file should be created in vmfs folder of the VM.

Finally, the physical local disk to map must not be added as storage device. In other words, you should not see it in Storage, only present in Storage Adapters.

If this command is successful, add a new hard disk to VM, choose Existing virtual disk, then browse to the rdm1.vmdk file just created.

Select Independent Mode - Persistent when prompted.

1 comment:

Unknown said...

Thank you !!! I was looking for solution on this everywhere

small comment: instead of testvm use testvm.vmdk otherwise when adding the virtual disk you won't be able to see it in datastore1 - it filters automatically for standard virtual disk extensions and you cannot override it