# Bhyve uefi limitations



## pos (Mar 21, 2019)

Hi

I am testing bhyve as a possible replacement for KVM. 

I added a fourth (I had disk0, disk1 and disk2 that worked) disk (disk3) in my file server that did not show up in the guest OS. After looking at the vm-bhyve.log, I could see...


```
Mar 21 19:54:22: initialising
Mar 21 19:54:22:  [loader: none]
Mar 21 19:54:22:  [uefi: yes]
Mar 21 19:54:22:  [cpu: 2]
Mar 21 19:54:22:  [memory: 2048M]
Mar 21 19:54:22:  [hostbridge: standard]
Mar 21 19:54:22:  [com ports: com1]
Mar 21 19:54:22:  [uuid: bdc53f01-4c0a-11e9-6cd3-94c551ab81c1]
Mar 21 19:54:22:  [utctime: yes]
Mar 21 19:54:22:  [debug mode: no]
Mar 21 19:54:22:  [primary disk: /vms/vm/APOLLO-disk0.img]
Mar 21 19:54:22:  [primary disk dev: custom]
Mar 21 19:54:22: ending disks at disk2 due to UEFI firmware limitations
Mar 21 19:54:22: generated static mac 58:9c:fb:0b:ff:c8 (based on 'APOLLO:0:1553154462:0')
Mar 21 19:54:22: initialising network device tap0
Mar 21 19:54:22: adding tap0 -> vm-LAN (LAN addm)
Mar 21 19:54:23: bring up tap0 -> vm-LAN (LAN addm)
Mar 21 19:54:23: booting
Mar 21 19:54:23:  [bhyve options: -c 2 -m 2048M -Hwl bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -U bdc53f01-4c0a-11e9-8cd2-94c691ab81c1 -u]
Mar 21 19:54:23:  [bhyve devices: -s 0,hostbridge -s 31,lpc -s 4:0,virtio-blk,/vms/vm/APOLLO-disk0.img -s 5:0,virtio-blk,/vms/vm2/APOLLO-home-new.img -s 6:0,virtio-blk,/vms/vm2/APOLLO-data-new.img -s 7:0,virtio-net,tap0,mac=58:9c:fb:0b:ff:c8 -s 8:0,fbuf,tcp=192.168.0.35:5924]
Mar 21 19:54:23:  [bhyve console: -l com1,/dev/nmdm-APOLLO.1A]
Mar 21 19:54:23:  [bhyve iso device: -s 3:0,ahci-cd,/zroot/vm/.config/null.iso]
Mar 21 19:54:23: starting bhyve (run 1)
```

Is there any possibility to walk around this issue that it seems I can have max three disks?

Thanks

/Peo


----------



## abishai (Mar 21, 2019)

Comment out stuff that emits this message to see if UEFI firmware really has this limitation?


----------



## usdmatt (Mar 21, 2019)

camt Remember if it’s only supported in FreeBSD 12 but you should be able to use the following guest option to allow 8 disks on a single controller (with each controller using a slot)

ahci_device_limit=8

Up to 32 per controller should work.


----------



## pos (Mar 21, 2019)

I can see the docs says...

--snip--
# ahci_device_limit
# By default all ahci devices (ahci-hd/ahci-cd) are configured on independent
# slots with their own controller. In FreeBSD 12 it's possible to put up
# to 32 devices on each controller. This setting allows you to configure
# the number of devices vm-bhyve will allocate on each controller.
#
# Valid Options: 2-32
# Default: 1
#
ahci_device_limit="8"
--snip--

I guess then that I have three disk controllers that with the default: 1 gives me three disks... Or do I miss anything obvious here?

If so... Can I add an additional controller instead of more devices on the already existing ones..? Cannot find any options for that. Recommendation (except fewer bigger disks or ISCI) ?

/Peo


----------



## pos (Mar 21, 2019)

Addition... 

Increasing ahci_device_limit does not help


----------



## pos (Mar 21, 2019)

abishai said:


> Comment out stuff that emits this message to see if UEFI firmware really has this limitation?



No limitation message if I only have disk0,disk1 and disk2. If adding the third, this message show up in the log and the guest does not see this extra disk device. If there is no config setting that I am not yet aware of, it indeed seems to be what the message says... An UEFI limitation... 

/Peo


----------



## abishai (Mar 22, 2019)

Limitation code is in vm-bhyve








						vm-bhyve/vm-run at 5df10f2408bf4151875bba796b745222ef0c8d2b · churchers/vm-bhyve
					

Shell based, minimal dependency bhyve manager. Contribute to churchers/vm-bhyve development by creating an account on GitHub.




					github.com
				



As I said, comment it out, try if devices are visible and ask developer to refactor this code.


----------

