Other Can bhyve pass disk vendor, model and serial values to guests?

FreeBSD Friends,

This is on 12.1-RELEASE-p6.

Can bhyve pass disks to guests in a way that preserves the disk's actual vendor, model and serial number values (as viewed from inside of the guest)?

When I pass a disk with ahci-hd emulation, it looks like this in the guest:
Code:
linux_in_bhyve# lsblk --output vendor,model,serial /dev/sda
VENDOR   MODEL            SERIAL
ATA      BHYVE SATA DISK  BHYVE-FC87-ABA5-711B

Or, when using virtio-blk emulation:
Code:
linux_in_bhyve# lsblk -o vendor,model,serial /dev/vdb
VENDOR MODEL SERIAL
0x1af4

Meanwhile, a similar disk configured on ESXi 5.5 U3b as a "pass-through RDM" looks like this in the guest:
Code:
linux_in_esxi# lsblk -o vendor,model,serial /dev/sdb
VENDOR   MODEL            SERIAL
HITACHI  OPEN-V-CM        60060e801602a100000102a100000bba

Thank you!
 
As far as I know FreeBSD bhyve passthru is based on PCI address.
For instance a NVMe is a PCIe device and you can pass it thru. and it is recognized in the VM.
So for a SAS/SATA disk drive I would try and pass thru a HBA with the disk attached.
I think that is the best approach.
Perhaps you could pass through a motherboard interface depending on the SATA PCIe bus address arrangment.
 
Phishfry, thank you. I'd be tempted to try that, but the HBA's actually used by other things also (like ZFS on the host); I think bhyve would want the HBA all to itself if HBA pass-through were set.
 
Yes that would be the drawback. You would have to dedicate the whole device to the cause.

Here is the output for motherboard SATA on a SuperMicro X9 board.
Code:
ahci0@pci0:0:31:2:    class=0x010601 card=0x066915d9 chip=0x1d028086 rev=0x06 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'C600/X79 series chipset 6-Port SATA AHCI Controller'
    class      = mass storage
    subclass   = SATA
So you could pass thru this device to the VM.
I use NVMe to boot/host from so my SATA controller is unused and would be a prime candidate.
 
I tried passing thru the onboard SATA controller above with bad results.
From /var/log/messages:
Code:
 bhyve: passthru device 0/31/2 BAR 5: base 0xc7f00000 or size 0x800 not page aligned

That seems to be the same issue aragats was referencing here:

Seems motherboard peripheries have some issues with BAR page length.

I will try another LSI controller in this test virt box to see how a passed thru disk works.
 
That seems to be the same issue @aragats was referencing here
I thought the "page not aligned" problem was fixed: before I've seen it with many devices, but recently I set up pass-thru of USB and NVMe controllers in several boxes without any problem, including the devices I experienced that issue with before.
 
Back
Top