# ZFS and VMware



## xy16644 (Sep 12, 2014)

I have a machine I'd like to turn into an ESXi VMware server. I will have several guests including a couple of FreeBSD 10 servers that use ZFS. I know ZFS needs to have full control of the disks for it to work properly so it got me thinking: 

What is the best way to present the disks to the guest so that ZFS can have full control of it so that it works 100%? I would assume that having the guests virtual disk files sitting on top of a VMFS datastore is not a good idea as ZFS would *not* then have full control of the disks.

I don't mind the Windows guests using the VMFS datastore but how does I configure (or present) the disks to FreeBSD so that I can use ZFS correctly? Can it be done?

Thanks.


----------



## SirDice (Sep 15, 2014)

ZFS should be able to handle a virtual disk. For all intents and purposes ZFS doesn't even know it's running on a disk image. The VM software simply presents a "disk" to the OS and ZFS will happily use it.

I have a XEN based VPS running on a virtual disk using ZFS. It all works as it should. Added bonus, if the storage is enlarged and ZFS has autoexpand turned on the added space will immediately become available.


----------



## Jimmy (Sep 19, 2014)

You could use Raw Device Mappings (RDM) which tunnels most of the native disk IO through to the Guest OS.


----------



## ilemur (Sep 25, 2014)

Best option would be using a passthrough controller to FreeBSD guest.


----------



## hedon (Sep 28, 2014)

hi,

Exactly so. This is the best practice


----------

