vm-bhyve icon indicating copy to clipboard operation
vm-bhyve copied to clipboard

only the first disk is passed to bhyveload

Open avg-I opened this issue 1 year ago • 3 comments

It looks like vm-bhyve passes only the first configured disk to bhyveload via its -d option. Is there a way to pass all disks to bhyveload?

I think that the current / default behavior makes sense for the typilcal VM configurations. But passing all disks can be useful for things like booting from ZFS mirror or raidz.

As a side question, is it possible to boot FreeBSD guests with loader="uefi-cms" ?

Thank you.

avg-I avatar Jul 29 '22 09:07 avg-I

Yes you should be able to use uefi-csm as a loader option, although I'm never had much luck with it.

I can't find any info on passing multiple disks to bhyveload? The man page just lists it as the option for the boot disk. I may be completely wrong but I was always under the impression that the initial boot loader was read from a single disk? In the case of real ZFS pools you'd just put boot code on every disk so it can boot from the first one it finds...

churchers avatar Jul 29 '22 11:07 churchers

-d option can be used multiple times and each disk is passed to bhyveload. When the loader runs it sees only disks that BIOS (on real hardware) or bhyveload (under bhyve) provides. The simplest boot stage like gptzfsboot is read from a raw partition, but other ZFS pool data needs all disks that constitute a ZFS pool.

avg-I avatar Jul 29 '22 12:07 avg-I

I came here with the exact same problem but I found a solution. The code of vm bhyve includes a reference to a bhyveload_args variable, so I’ve added this in my vm config file and it worked perfectly:

bhyveload_args="-d /sas/vm/freebsd13-zraid1-refactor/disk1.img -d /sas/vm/freebsd13-zraid1-refactor/disk2.img -d /sas/vm/freebsd13-zraid1-refactor/disk3.img"

disk0.img is added by default and bhyveload_args makes it possible to add more disks (here a 4 disks Zraid1)

p4tpr0 avatar Apr 18 '24 21:04 p4tpr0