# Can I move freeBSD-9 to ESXI and still boot from zfs?



## bejkon (Oct 17, 2012)

I'm running FreeBSD-9 and want to move the complete installation to an ESXI-5 server. I have two zfs pools one raidz2 for storage and one zfs-mirror for boot (using gpt).

The storage pool shouldn't be an issue, but I'm concerned about my root pool.

I don't think I can boot directly to my zfs disks (with direct disk access), or can I? I'm not interested running zfs on top of ESXI's storage pool. Any ideas on how to do this?


----------



## Sebulon (Oct 18, 2012)

Well, where/what is ESX installed on? Like, a HD,SSD,USB(?) in the same box, or is the ESX another separate machine altogether?

HavenÂ´t played with direct access in ESX, but I have installed numerous FreeBSD VMÂ´s that have had virtual disks that boots on ZFS.

http://www.baconorbeercan.com/

/Sebulon


----------



## dave (Oct 18, 2012)

It is possible to configure certain PCI devices for passthrough in ESXi, excluding the controller on which the ESXi primary datastore lives.  So, as long as your pool is connected via an adapter other than the ESXi boot controller, you can probably pull it off.  Check for hardware compatibility, of course. :stud


----------



## bejkon (Oct 18, 2012)

dave said:
			
		

> It is possible to configure certain PCI devices for passthrough in ESXi, excluding the controller on which the ESXi primary datastore lives.  So, as long as your pool is connected via an adapter other than the ESXi boot controller, you can probably pull it off.  Check for hardware compatibility, of course. :stud



Ok, so I need to have a datatore to save the machine configs on, but no need to create a virtual drive? And then connect all zfs-disks to my controller, and just start it up?


----------



## dave (Oct 18, 2012)

bejkon said:
			
		

> Ok, so I need to have a datatore to save the machine configs on, but no need to create a virtual drive? And then connect all zfs-disks to my controller, and just start it up?



Yes, I think so, but... just to be clear, you need to have not just a separate datastore, but a separate controller, because you will configure passthrough at the PCI level.


----------



## bejkon (Oct 18, 2012)

dave said:
			
		

> Yes, I think so, but... just to be clear, you need to have not just a separate datastore, but a separate controller, because you will configure passthrough at the PCI level.



I've tryed and it won't boot. I can't find where to select the pci-controller as a boot device, passthrough is enabled. Can I create a virtual disk that boots and then loads the zfs-root?


----------



## dave (Oct 18, 2012)

bejkon said:
			
		

> I've tryed and it won't boot. I can't find where to select the pci-controller as a boot device, passthrough is enabled. Can I create a virtual disk that boots and then loads the zfs-root?



This is beyond the scope of a FreeBSD forum, and really belongs in a VMware forum, but here are some tips...

Go into Virtual Machine Properties and click on Options tab, and increase the Power On Boot Delay, and then go into the virtual machine BIOS, and check the boot options there.  Do you see the passed-through controller in the VM startup?  Also, is your controller on the ESXi hardware compatibility list?  Are there ESXi-specific drivers for your controller?


----------



## bejkon (Oct 18, 2012)

dave said:
			
		

> This is beyond the scope of a FreeBSD forum, and really belongs in a VMware forum, but here are some tips...
> 
> Go into Virtual Machine Properties and click on Options tab, and increase the Power On Boot Delay, and then go into the virtual machine BIOS, and check the boot options there.  Do you see the passed-through controller in the VM startup?  Also, is your controller on the ESXi hardware compatibility list?  Are there ESXi-specific drivers for your controller?



I can't see the controller in esxi bios. But when I boot into freebsd live-cd I can se all my disks and pools.

I have tried to create a freebsd-boot partition on a virtual drive but I can't figure out how to make it load my zroot pool.


----------



## bejkon (Oct 20, 2012)

I solved it by creating an ufs boot on a virtual disk that loads zfs. This is not the optimal soulution but until VMware makes it possible to boot directly to a passthrough disk it's good enough.


----------

