|Summary:||[Hyper-V] FreeBSD 10.2 Disks not found on Hyper-V Windows Server 2008R2, preventing installation|
|Product:||Base System||Reporter:||Kristoffer Eriksson <ske-89>|
|Component:||kern||Assignee:||freebsd-virtualization mailing list <virtualization>|
|Severity:||Affects Some People||CC:||decui, honzhan, horst.leitenmueller, kyliel, merchop, sepherosa|
Description Kristoffer Eriksson 2016-03-23 15:03:33 UTC
To reproduce, I download any FreeBSD 10.2 RELEASE ISO and attach it as DVD to a virtual machine in Hyper-V on Windows Server 2008R2 Standard SP1 64-bit. The virtual machine has one virtual IDE hard disk attached, as usual. (The quickest one to download is FreeBSD-10.2-RELEASE-amd64-bootonly.iso, but all I have tried lead to the same result. The uefi and non uefi ISOs also gave the same symptoms for 10.2.) After booting, all hard disk devices are empty, 0 MB, and can not be accessed. If using an install ISO, the installation will fail during partitioning, since there are no disks available that it will allow me to partition. There is no way to proceed. camcontrol devlist shows: <Msft Virtual CD/ROM 1.0> at scbus0 target 0 lun 0 (pass0,cd0) < > at scbus1 target 0 lun 0 (da0,pass1) < > at scbus1 target 0 lun 1 (da2,pass3) < > at scbus1 target 1 lun 0 (da1,pass2) < > at scbus1 target 1 lun 1 (da3,pass4) (This is with the Hyper-V default SCSI adapter removed from the machine configuration. Letting it remain just adds 16 more empty da* devices to this list. Even if I actually connect the disk to the SCSI adapter, all the da* devices will still be empty.) dmesg shows: da0 at blkvsc0 bus 0 scbus1 target 0 lun 0 da0: < > Fixed Direct Access SCSI device da0: 300.000MB/s transfers da0: 0MB (0 512 byte sectors 0H 0S/T 0C) ...and exactly the same for da1, da2, da3. (The DVD is detected as cd0.) Also when I download the pre-installed VHD image for Hyper-V, and try to boot it, it shows that it detects the same empty devices as above, and then fails to mount the root file system, leaving me at the mountroot prompt. The prompt also refuses to manually mount any of the da* devices. Probably because there is nothing to read from them, having length 0, I would assume. (This was actually where I originally discovered this problem.) The console shows: Trying to mount root from ufs:/dev/gpt/rootfs [rw]... mountroot: waiting for device /dev/gpt/rootfs ... Mounting from ufs:/dev/gpt/rootfs failed with error 19. ... mountroot> ? List of GEOM managed disk devices: da3 da2 da1 da0 cd0 fd0 mountroot> ufs:da0 Trying to mount root from ufs:da0 ... g_vfs_done():da0[READ(offset=65536, length=8192)]error = 6 Mounting from ufs:da0 failed with error 6. I also tried downloading the FreeBSD 10.3 RC3 ISO, to see if this has already been fixed there. The results were worse. The non uefi version didn't list any da* devices at all, any more. The uefi version (2nd boot image) gave the same results as 10.2 above. I don't know why UEFI suddenly would make a difference to this. I also tried downloading FreeBSD 10.1. (In this case, I used the pre-installed VHD image.) That version DID succeed to fully boot the system from disk. So this problem seems to have been introduced between 10.1 and 10.2. I did notice that 10.1 seems to have detected the same IDE disk both as device ada0 and device da0. (Maybe that is normal for 10.1? I don't know. 10.2 and 10.3 didn't mention any ada device.) 10.1 also complained "GEOM: ada0: corrupt or invalid GPT detected." But it mounted and booted the disk anyway, using the name /dev/gpt/rootfs. I noticed there is one recent similar bug report, 206630, with status FIXED. It also applies to Hyper-V, failing to find the hard disk. However, the symptoms described say the hard disk IS detected, but appears on a randomly selected da* device. In my case, the disk is not detected on any device. That bug report also only mentions Windows 10 & 2016, and does not mention trying it out on 2008R2. There is also an older unresolved bug report 153990 for Hyper-V 2008R2, failing to find the hard disk. But that was FreeBSD 8.1. The symptoms are not so detailed, and I suppose some things have changed since then, so I don't know if there might be any possible relation. There is a forum discussion https://forums.freebsd.org/threads/52797/ where "meciarz" and "hshh" seem to ask about the same problem as I am describing here, with 10.2 and Hyper-V 2008R2. So I don't seem to be alone. There are some replies referring to a change of device names in recent releases and other suggestions, but to me they don't seem to apply to this exact problem, and don't seem to have solved the problem. To me that discussion seems to end with the problem still remaining for 10.2 using Hyper-V 2008R2, although the final posts says that it works for Windows 2012.
Comment 1 horst.leitenmueller 2016-05-09 18:20:33 UTC
same Problem on 10.3 with hyper-v 2008R2 with zfs slightly different is loading of the hard disk is not done anymore zfs:zroot/ROOT/default failed with error 5 in boot only the cd0 is loaded mountroot> ? cd0 fd0 in older version 10.1 its working da0 ist normal loaded <Mfst Virtual Disk 1.0>
Comment 2 Sepherosa Ziehau 2016-05-10 02:38:51 UTC
Try the current snapshot. We fixed some attach ordering issue there.
Comment 3 horst.leitenmueller 2016-05-10 05:26:17 UTC
from which svn revision is/should this working ? i'm using svn (svn update -r 299215) from the stable10 branch..
Comment 4 Sepherosa Ziehau 2016-05-10 05:52:25 UTC
Comment 5 Dmitry 2016-08-18 05:16:16 UTC
Try FreeBSD-10.3-STABLE-amd64-20160808-r303856-uefi-disc1 it's not working with the same simptoms