# Bhyve RDMs and VMDKs



## sshaikh (Apr 13, 2016)

1) Does Bhyve have the equivalent of Raw Device Mapping? IE can I give a virtual machine direct and exclusive access to a physical disk?

2) Can Bhyve mount VMDK images?


----------



## mav@ (Apr 13, 2016)

AFAIK at this time bhyve only supports raw block devices and files for its disks. There is no VMDK support at this point.


----------



## usdmatt (Apr 13, 2016)

You can pass in something like -s 5,virtio-blk,/dev/adaX or -s 5,ahci-hd,/dev/adaX and it should work. I've tested that with an md device and it seemed to work fine. I don't know which performs better, and it's obviously still going through bhyve's device emulation.

bhyve does support PCI passthrough, although obviously you'd need to pass through the actual controller as the disks are not PCI devices themselves. For instance you could add something like an 8 port HBA, and pass that to a guest, so all disks on that controller are directly managed by the guest. (A lot of motherboards have multiple controllers, one included in the main chipset and an additional one they've added to give more ports, so you may find you can put OS disks on one and pass the other to a bhyve guest).

I believe NVMe disks show up as independent PCI devices, although I've no idea if they can be used with passthrough.

Work was started on additional image types, although I don't think it's got very far. At the moment you'd need to install the qemu tools and convert to raw, which is OK for a conversion but not so good if you just want to temporarily mount the disk but keep the original format.


----------



## mav@ (Apr 13, 2016)

usdmatt said:


> You can pass in something like -s 5,virtio-blk,/dev/adaX or -s 5,ahci-hd,/dev/adaX and it should work. I don't know which performs better, and it's obviously still going through bhyve's device emulation.



With present bhyve versions virtio-blk driver can be a bit faster (when it goes about hundreds of thousands IOPS), while ahci-hd driver is slightly more functional -- supports TRIM.


----------

