From owner-freebsd-virtualization@freebsd.org Tue Aug 11 04:17:03 2020 Return-Path: Delivered-To: freebsd-virtualization@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5121B3793E0 for ; Tue, 11 Aug 2020 04:17:03 +0000 (UTC) (envelope-from wanpengqian@gmail.com) Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BQfg23kz7z402g for ; Tue, 11 Aug 2020 04:17:02 +0000 (UTC) (envelope-from wanpengqian@gmail.com) Received: by mail-qt1-x841.google.com with SMTP id w9so8548726qts.6 for ; Mon, 10 Aug 2020 21:17:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7EcV0FEAq1gl33QS0zAC7wUyfTO0Y07eoRiuKbDjIxQ=; b=qJ1gSwrTrncIZ/jYh97ouWAO1xJFQv8HDzd9YvNQ7aVdENLdlaj2dhVyttQU1spA4e uaLeHKJY6FOkWBrvfStWnhdd8uydUVWVzNDB/R/Bft2dlqB78kZL4dIXKWbW49AuqqHn 0Bql3gExItTX2yYrAUvtu9nhWj9Y6xRQW/PYpCU4pM2w3tEpCXhffSq5T9ENN44oYnfk jsDeDYduq9RgJxk3BVuZhb06zcnOanNmAQNnEvi4SHWDIjXa9wh/Tnu2NJkX9vpONj6W /2AxjB8hpgacz+Pdi2pZqFx+mI7Jh2DbhVwl7m/aMoellrLUNWtboiRgz3z/v5dyQTN0 3rTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7EcV0FEAq1gl33QS0zAC7wUyfTO0Y07eoRiuKbDjIxQ=; b=srJIN2wSYQtAJggWQa5OJBFwrGRKEJ4ie8EIQD65wxcx75jmVpMkJrDl5tPoMkY7SA TNT+ZcW30m2uGVLNcG1v+bkrTkUcePJKIoVd7JeG5Vt1k3gJ1ESAm/7t3Y1fnn5kxIxL 78VF+1/Rjht78DJezQWPby1CC5s6ZScrfNYjAzi5hlUvK4Pn/p2QCJmhJoiyZxi2GR4c KwCIKpI2bOwuweTFB2xX9nRxj962GSc4L2NMgPEQS+nTYhvuQNttRks/vepLW4AKjDDx KiYjF+mTOwFBqsPs7o9+Xlmvy6xAjzQ4ecsz4DAJbS1kq9XCGby9rWAd+BHZJD7j1p32 vRyA== X-Gm-Message-State: AOAM531aP06aXsrAIm0auSJto/565x0sYPB8qrMOTrR6QZI/yTD25QKh PrdrNSiaZVjGra1QVhIfoS8oYoxPWPLsf5s72fTfeb1A X-Google-Smtp-Source: ABdhPJwPyyMi3BicxyhoWsMRYVpQ91RronmJso/KfB8zA9BV20AdB2wPpaOvE1LNr5XmD5/PTruSj5I7ToDubxdJe6c= X-Received: by 2002:ac8:4741:: with SMTP id k1mr31347554qtp.41.1597119421287; Mon, 10 Aug 2020 21:17:01 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Wanpeng Qian Date: Tue, 11 Aug 2020 13:16:50 +0900 Message-ID: Subject: Re: Can bhyve pass disk vendor, model and serial values to guests? To: Rob Roy Gregg Cc: FreeBSD virtualization Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BQfg23kz7z402g X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=qJ1gSwrT; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of wanpengqian@gmail.com designates 2607:f8b0:4864:20::841 as permitted sender) smtp.mailfrom=wanpengqian@gmail.com X-Spamd-Result: default: False [-1.69 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.01)[-1.006]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-virtualization@freebsd.org]; NEURAL_HAM_LONG(-1.01)[-1.007]; NEURAL_SPAM_SHORT(0.33)[0.328]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::841:from]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[gmail.com]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Aug 2020 04:17:03 -0000 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 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 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.