FreeNAS disconnects disks in Hyper-V

Status
Not open for further replies.

BabaJega

Dabbler
Joined
Sep 2, 2017
Messages
15
Hello all,

this is my first post here. I have already searched for a while but apparently only a few of you are using Hyper-V to virtualize FreeNAS.
I would be thankful for any information about this topic. If you have experience in virtualizing FreeNAS in Hyper-V, please help me.

First of all, something about my rig:

Specifications:
Ryzen 1700x
Asrock AB350 Pro4 (i know, not the best choice, but this was all I had)
Kingston DDR4 2x16GB ECC RAM (soon 64 GB RAM, when I have the money :) )
2x 32GB SSD (software mirrored with diskpart, for Hyper-V Server 2016 & FreeNAS 11 VHD)
6x 4TB Western Digital Red
2x Gigabit onboard LAN (Intel)

Setup:
As already mentioned, FreeNAS is virtualized on Hyper-V Server 2016. It runs as a GEN 1 virtual machine with the 6x 4TB harddrives directly passed through to the FreeNAS VM.
Unfortunately, FreeNAS 11 is based on FreeBSD 11 Stable and GEN2 VM´s are only supported for FreeBSD 11.1 based distributions.
It has 24 GB of ram and 4 virtual cores assigned. The main target of FreeNAS is to backup my files.

Problem:
When the harddisks are attached by a virtual IDE-controller, everything works fine. Except there can only be 4 devices attached to IDE-controllers, and I need at least 7 devices
(6x 4TB harddrives + VHD with Freenas installed).
So I tried to attach the 6x 4TB harddrives by a virtual SCSI-controller offered by Hyper-V. While booting, the harddrives are recognized (even the serial numbers are displayed).
Unfortunately, about 8 steps after that, the harddrives get detached for any reason. You can see the code right here (with only one 4TB hard disk attached to the virtual SCSI-controller):

storvsc1: <Hyper-V SCSI> on vmbus0
(probe0:storvsc1:0:0:0): storvsc scsi_status = 2
da1 at storvsc1 bus 0 scbus4 target 0 lun 0
da1: <WDC WD40EFRX-68WT0N0 82.0> Fixed Direct Access SCSI device
da1: Serial Number WD-WCC4E2PXU2E8
da1: 300.000MB/s transfers
da1: Command Queueing enabled
da1: 3815447MB ((7814037168 512 byte sectors)
da1 at storvsc1 bus 0 scbus4 target 0 lun 0
da1: <WDC WD40EFRX-68WT0N0 82.0> s/n WD-WCC4E2PXU2E8 detached
(da1:storvsc1:0:0:0): storvsc scsi_status = 2
g_access(918): provider da1 has error
g_access(918): provider da1 has error
g_access(918): provider da1 has error
g_access(918): provider da1 has error
(da1:storvsc1:0:0:0): Periph destroyed

What I tried:
I was thinking about maybe the power states of the hard disks are configured wrong in Hyper-V Server 2016, so I set the harddisk timeout to 0 by powercfg.
I also tried the same setup with different disks (Seagate barracuda 250 GB) connected to the virtual SCSI-controller. FreeNAS recognized these disks and i was able to create a new raid Z2 with them.
But this was on another workstation. So maybe, its about my Western Digital drives or about my workstation, I don't know...


If any of you can help me with this topic I would be more than happy! I know its kind of an exotic solution and many of you say, Hyper-V and FreeNAS don't work well together.
But my virtualization platform is and will be Hyper-V Server 2016.

Thanks for reading and trying to help me
BabaJega
 
Last edited by a moderator:
D

dlavigne

Guest
Were you able to resolve this? If not, please create a report at bugs.freenas.org and post the issue number here. Include a debug when making the report (System -> Save -> Debug) to assist the dev in diagnosing the issue.
 

BabaJega

Dabbler
Joined
Sep 2, 2017
Messages
15
Do you really think this is a bug? I thought it is some kind of "problem is sitting in front of screen" error... I was searching for a solution for many hours and was trying to fix it but until now there is no solution in sight. Maybe you are right, I will create a bug report and post the issue number here as you said. Thank you!
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
When the harddisks are attached by a virtual IDE-controller, everything works fine. Except there can only be 4 devices attached to IDE-controllers, and I need at least 7 devices
There are people that have successfully virtualized FreeNAS with ESXi, but they usually pass the entire SAS HBA through to the virtual machine. Is there a way you can put the target drives on a separate controller and pass the entire controller into the VM?
I think it would also be better to just pass the raw disks in for the boot drives. They can be mirrored in the FreeNAS install using ZFS, so there is no need to use the Microsoft mirroring.
 

BabaJega

Dabbler
Joined
Sep 2, 2017
Messages
15
Hello and thanks for the suggestion. Unfortunately, I have already tried ESXi and it didnt work good for me. As you said, you can passthrough the entire controller. This somehow does not work for me because ESXi tries to passthrough more then I want to ( I select the SATA controller to passthrough, after the reboot many other devices are passed through as well for no reason. Its strange...

You are right about the mirroring but I only have 2 SSD's and Hyper-V Server 2016 is installed on them as well. This is the only solution I have for now.

You see, I thought this will be an easy project and now everything is messed up. But I want to get Freenas running in Hyper-V! I wont give up easily.
 
Status
Not open for further replies.
Top