Bug 220790

Summary: [Hyper-V]Fail to install on Hyper-V GEN2 VM on win2012r2 or win2016
Product: Base System Reporter: Hongjiang <honzhan>
Component: kernAssignee: freebsd-virtualization (Nobody) <virtualization>
Status: Closed FIXED    
Severity: Affects Only Me CC: decui, gonzo, kyliel, sephe
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Boot log of installation failure for GEN2 VM none

Description Hongjiang 2017-07-17 08:51:52 UTC
Created attachment 184422 [details]
Boot log of installation failure for GEN2 VM

If you want to install FreeBSD 11.1 or 12-current on win2012r2 or win2016 Hyper-V GEN2 mode, you may encounter the failure to attach CD/DVD ROM. See the attachment.
Comment 1 Dexuan Cui 2017-07-17 20:13:33 UTC
It looks the issue doesn't repro if the DVD is connected to the first SCSI adapter (this is the default configuration when we create a GEN2 VM).

It only happens when the DVD is connected to the second SCSI adapter.
Comment 2 Hongjiang 2017-07-18 01:09:22 UTC
(In reply to Dexuan Cui from comment #1)
Yes, in addition, if there is a SCSI Hard Disk attached before the DVD, the issue will not show up.

I have a local fix for this issue. If it passed all tests, I'll create a code review.
Comment 3 Hongjiang 2017-07-18 03:01:53 UTC
The patch is ready: https://reviews.freebsd.org/D11634
Comment 4 commit-hook freebsd_committer freebsd_triage 2017-07-20 07:13:54 UTC
A commit references this bug:

Author: sephe
Date: Thu Jul 20 07:13:26 UTC 2017
New revision: 321286
URL: https://svnweb.freebsd.org/changeset/base/321286

Log:
  hyperv/storvsc: Force SPC3 for CDROM attached.

  This unbreaks the CDROM attaching on GEN2 VMs.  On GEN1 VMs, CDROM is
  attached to emulated ATA controller.

  PR:		220790
  Submitted by:	Hongjiang Zhang <honzhan microsoft com>
  MFC after:	3 days
  Sponsored by:	Microsoft
  Differential Revision:	https://reviews.freebsd.org/D11634

Changes:
  head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
Comment 5 commit-hook freebsd_committer freebsd_triage 2017-07-24 01:40:44 UTC
A commit references this bug:

Author: sephe
Date: Mon Jul 24 01:39:58 UTC 2017
New revision: 321404
URL: https://svnweb.freebsd.org/changeset/base/321404

Log:
  MFC 321286

      hyperv/storvsc: Force SPC3 for CDROM attached.

      This unbreaks the CDROM attaching on GEN2 VMs.  On GEN1 VMs, CDROM is
      attached to emulated ATA controller.

      PR:             220790
      Submitted by:   Hongjiang Zhang <honzhan microsoft com>
      Sponsored by:   Microsoft
      Differential Revision:  https://reviews.freebsd.org/D11634

Changes:
_U  stable/11/
  stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
Comment 6 commit-hook freebsd_committer freebsd_triage 2017-07-24 02:14:12 UTC
A commit references this bug:

Author: sephe
Date: Mon Jul 24 02:13:47 UTC 2017
New revision: 321405
URL: https://svnweb.freebsd.org/changeset/base/321405

Log:
  MFC 321286

      hyperv/storvsc: Force SPC3 for CDROM attached.

      This unbreaks the CDROM attaching on GEN2 VMs.  On GEN1 VMs, CDROM is
      attached to emulated ATA controller.

      PR:             220790
      Submitted by:   Hongjiang Zhang <honzhan microsoft com>
      Sponsored by:   Microsoft
      Differential Revision:  https://reviews.freebsd.org/D11634

Changes:
_U  stable/10/
  stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
Comment 7 Oleksandr Tymoshenko freebsd_committer freebsd_triage 2019-01-21 21:40:29 UTC
There is a commit referencing this PR, but it's still not closed and has been inactive for some time. Closing the PR as fixed but feel free to re-open it if the issue hasn't been completely resolved.

Thanks