churchers / vm-bhyve

Shell based, minimal dependency bhyve manager
BSD 2-Clause "Simplified" License
825 stars 174 forks source link

vm-bhyve ignoring zvol/custom disks on device.map? #539

Open mfoacs opened 10 months ago

mfoacs commented 10 months ago

I've been using vm-bhyve to manage Debian guest, with 2 additional custom disks.

The logs are show the configuration disks being correctly parsed and vm-bhyve creating the device.map on the fly before booting the vm:

Dec 04 21:31:59: booting

Dec 04 21:31:59: create file /zstorage/vm/xxxx-vm/device.map

Dec 04 21:31:59:  -> (hd0) /zstorage/vm/xxxx-vm/disk0.img

Dec 04 21:31:59:  -> (hd1) /dev/zvol/zdata/disk1

Dec 04 21:31:59:  -> (hd2) /dev/zvol/zstorage/vm/xxxx-vm/disk2

And that's correct, both volumes exist in the respective directories. However, the disks are not present on the vm initialization:

Dec 04 21:31:59: /usr/local/sbin/grub-bhyve -m /zstorage/vm/xxxx-vm/device.map -M 256G -r hd0,msdos1 xxxx-vm

Dec 04 21:32:05:  [bhyve options: -c 24 -m 256G -AHP -U xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -u]

Dec 04 21:32:05:  [bhyve devices: -s 0,hostbridge -s 31,lpc -s 4:0,virtio-blk,/zstorage/vm/xxxx-vm/disk0.img -s 5:0,virtio-net,tap0,mac=xxxxxxxxxxxx]

Dec 04 21:32:05:  [bhyve console: -l com1,stdio]

Dec 04 21:32:05: starting bhyve (run 1)

And, naturally, the devices do not exist from within the guest.

The host is 14.0-RELEASE-p1. vm-bhyve: Bhyve virtual machine management v1.5 (rev. 105102)

mfoacs commented 9 months ago

I confirm that I can start the vm manually with:

sudo /usr/local/sbin/grub-bhyve -m /zstorage/vm/xxxx-vm/device.map -M 256G -r hd0,msdos1 xxxx-vm ; sudo bhyve -c 24 -m 256G -AHP -U xxxxxxxxxxxxxxxx -u -s 0,hostbridge -s 31,lpc -s 4:0,virtio-blk,/zstorage/vm/xxxx-vm/disk0.img -s 6:0,virtio-blk,/dev/zvol/zdata/disk1 -s 7:0,virtio-blk,/dev/zvol/zstorage/vm/xxxx-vm/disk2 -s 5:0,virtio-net,tapX,mac=xxxx-xxxx-xxxx-xxxx -s 30,xhci,tablet -l com1,stdio xxxx-vm

The guest OS sees the disks and has full access to it.

Is this a limitation of vm-bhyve or there's something else going on?