Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Aug 2020 13:16:50 +0900
From:      Wanpeng Qian <wanpengqian@gmail.com>
To:        Rob Roy Gregg <rr@robroygregg.com>
Cc:        FreeBSD virtualization <freebsd-virtualization@freebsd.org>
Subject:   Re: Can bhyve pass disk vendor, model and serial values to guests?
Message-ID:  <CANBJ%2BxS0mz6ujKujacC3zsPhXOO-B683_EhsPh7BfqOftnNgdw@mail.gmail.com>
In-Reply-To: <CANBJ%2BxS-SC8_TZv6MF0WwgqJEvqWqx9DnqbUGNQUv6n=y5nHXQ@mail.gmail.com>
References:  <alpine.BSF.2.21.99999.352.2006191614450.33962@beak.h.net> <alpine.BSF.2.21.99999.352.2007241659150.76168@beak.h.net> <CANBJ%2BxS-SC8_TZv6MF0WwgqJEvqWqx9DnqbUGNQUv6n=y5nHXQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I have figured out why the vendor field is ATA.

It seems that linux will treat the first field as VENDOR when the
MODEL field has space.
so MODEL field is
"INTEL SSDSCKHB340G4M"
the linux output will be
VENDOR   MODEL
INTEL  SSDSCKHB340G4M

While a MODEL field without space will make VENDOR as ATA.

Unfortunately, when there is a space in the command line, bhyve will
not parse correctly.
We have to figure out how to solve this problem.

On Mon, Jul 27, 2020 at 11:27 AM Wanpeng Qian <wanpengqian@gmail.com> wrote:
>
> Hi Rob
>
> >    linux_in_bhyve# lsblk --output vendor,model,serial /dev/sda
> >    VENDOR   MODEL            SERIAL
> >    ATA      OPEN-V-CM        410109
>
> The output sounds great.
>
> > I think it's happy with the model field now, but it's seeing "ATA" for the
> > vendor and it wants "HITACHI."
>
> In ATA specification, there is nowhere setting the VENDOR field.
>
> In fact, from the real hardware, the output is similar.
>
> lsblk --output vendor,model,serial /dev/sda
> VENDOR   MODEL            SERIAL
> ATA      ST1000NX0423     XXXXXXXXXXX
>
> It also outputs ATA in the VENDOR field.
> so I think the bhyve's output is reasonable.
>
> >
> > I'm guessing that ATA itself may not really support this vendor field.  I
> > noticed that the ESXi VM has a virtual SCSI HBA instead.
>
> >
> > Do you know how I can make this disk's vendor field "HITACHI" instead of
> > "ATA," in a bhyve guest?
>
> If you want the VENDOR field, we have to go virtual-scsi or virtual-blk.
> but currently there are no patches for these.
>
> If your software works on real SATA devices. but not bhyve SATA HDD,
> it may check other fields too. you have to find out.
> (did it work on VMware?)
>
> BTW: your vm-bhyve config can be improved by these.
>
> disk1_type="ahci-hd"
> disk1_name="/dev/da4"
> disk1_dev="custom"
> disk1_opts="ser=410109,model=OPEN-V-CM""
>
> Regards.
>
> Qian
>
> On Sat, Jul 25, 2020 at 9:23 AM Rob Roy Gregg <rr@robroygregg.com> wrote:
> >
> >
> > On Sat, 20 Jun 2020, Wanpeng Qian wrote:
> >
> > > On Fri, 19 Jun 2020, Rob Roy Gregg wrote:
> > >
> > >> FreeBSD Friends,
> > >>
> > >> I tried the forums and thought I'd ask here next; here's the thread:
> > >>
> > >> https://forums.freebsd.org/threads/can-bhyve-pass-disk-vendor-model-and-serial-values-to-guests.75851/
> > >>
> > >> 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 values (as viewed from inside of the guest)?
> > >>
> > >> Here's how a passed-in disk looks inside the guest with ahci-hd
> > >> emulation:
> > >>
> > >>  linux_in_bhyve# lsblk --output vendor,model,serial /dev/sda
> > >>  VENDOR   MODEL            SERIAL
> > >>  ATA      BHYVE SATA DISK  BHYVE-FC87-ABA5-711B
> > >>
> > >> And with virtio-blk emulation:
> > >>
> > >>  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; this is what I'd like to see in
> > >> the bhyve guest also:
> > >>
> > >>  linux_in_esxi# lsblk -o vendor,model,serial /dev/sdb
> > >>  VENDOR   MODEL            SERIAL
> > >>  HITACHI  OPEN-V-CM        60060e801602a100000102a100000bba
> > >>
> > >> Thank you!
> > >
> > > Hi Gregg
> > >
> > > There is a patch for this, but you have to apply manually for 12.1R
> > >
> > > You can get it here
> > >
> > > https://reviews.freebsd.org/D24174
> >
> > Wanpeng, thank you!
> >
> > I installed FreeBSD-13.0-CURRENT-amd64-20200709-r363032-disc1.iso, applied
> > your patch, and used this vm-bhyve config:
> >
> >    disk1_type="ahci-hd"
> >    disk1_name="/dev/da4,ser=410109,model=OPEN-V-CM"
> >    disk1_dev="custom"
> >
> > Which made this bhyve argument:
> >
> >    -s 5:0,ahci-hd,/dev/da4,ser=410109,model=OPEN-V-CM
> >
> > Which made the disk look like this in the guest:
> >
> >    linux_in_bhyve# lsblk --output vendor,model,serial /dev/sda
> >    VENDOR   MODEL            SERIAL
> >    ATA      OPEN-V-CM        410109
> >
> > This is really neat.  Thanks for your patch.
> >
> > Unfortunately, the software I'm using checks both the vendor and model
> > fields.
> >
> > I think it's happy with the model field now, but it's seeing "ATA" for the
> > vendor and it wants "HITACHI."
> >
> > I'm guessing that ATA itself may not really support this vendor field.  I
> > noticed that the ESXi VM has a virtual SCSI HBA instead.
> >
> > Do you know how I can make this disk's vendor field "HITACHI" instead of
> > "ATA," in a bhyve guest?
> >
> > Thank you again for your patch Wanpeng.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANBJ%2BxS0mz6ujKujacC3zsPhXOO-B683_EhsPh7BfqOftnNgdw>