VHD over SMB 3 - possible with FreeNAS? "Incorrect Function" error

Status
Not open for further replies.

hasselholz

Cadet
Joined
Feb 16, 2014
Messages
4
Hi folks,

I've built my first FreeNAS server last week, which is successfully running the current version 9.2.1. The NAS is joined to my Active Directory and CIFS/SMB sharing works great for normal files.

As FreeNas 9.2.1 now supports SAMBA 4 and SMB 3, I was tempted to try out a SMB3 compatible file share as a VHD storage for my Hyper-V hosts. However I have experienced a strange behavior. This is what I tried to do:

- Created a ZFS dataset named VHD01 for storing the VHDs.
- Created a CIFS share for the above dataset
- Set permission so that my user account, and my hyper-v hosts have full control to the data (I tested connectivity by mapping the CIFS from windows 2012 r2 server which was successful)

Here comes the weird part:

- I tried to create a new virtual machine from HyperV Manager von Server 2012. I configured the VM storage to be in \\mynas\vhd01\vm001. At the end of the wizard I receive an error: "Failed to create the virtual hard disk. The system failed to create \\mynas\vhd01\vm001\vm001.vhdx: Incorrect function. (0x80070001)".

Trying to accomplish the same on a remote windows 2012 file server works pretty fine.

My assumption was that running VHDs on a SMB 3 compatible CIFS share would run the same way as on a native Microsoft Windows 2012 server.

Am I missing something or is this currently not supported?

btw. I'm aware that I could create a Zvol and ISCSI target for storing VHDs, however I wanted to give SMB 3 as a VHD storage a try.

Anyone else experiencing the same strange behavior?

Thanks in advance for any help
Udo
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I don't have the answer to your question. But, I think we had a discussion about this in the forums about 2 weeks ago and SMB3 is not currently enabled in Samba as part of FreeNAS. I could be mistaken though. Maybe someone with more knowledge than I can pipe up with the actual answer. You may want to use something like Wireshark to see if SMB3 is being used. If it isn't, you may want to try adding the parameter "client max protocol = SMB3" to the CIFS auxiliary parameters block and see if it changes.
 

hasselholz

Cadet
Joined
Feb 16, 2014
Messages
4
I made a quick test using a powershell console from a Windows 2012 Server.

Running the command: get-smbconnection I receive "3.00" as the SMB dialect for my connection to the FreeNas. This is a clear indication that SMB 3.0 is actively being used. Any other suggestions?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I made a quick test using a powershell console from a Windows 2012 Server.

Running the command: get-smbconnection I receive "3.00" as the SMB dialect for my connection to the FreeNas. This is a clear indication that SMB 3.0 is actively being used. Any other suggestions?

Nope. That's the only advice I can provide for you. I do like that command though! I wasn't aware of it when I did a very long grueling post on SMB2 about 20 months ago. So it is confirmed that SMB3 is enabled and used. That's good news!

As for your original problem, I can't help you. Honestly, very few people use Hyper-V here. It doesn't support FreeBSD as a client, so most of us run away from it as fast as we can. You might want to try a forum that is more Hyper-V centric.
 

crumbz

Explorer
Joined
Nov 7, 2013
Messages
63
It doesn't support FreeBSD as a client, so most of us run away from it as fast as we can. You might want to try a forum that is more Hyper-V centric.

That depends on what you mean by supported, but FreeBSD 10.0 supports running on Hyper-V according to https://wiki.freebsd.org/HyperV.

Starting FreeBSD 10.0, most Hyper-V integration services will be installed as part of creating a FreeBSD virtual machine on Hyper-V and no separate ports will be required.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Well, that's good.. except we're not running FreeBSD 10 code. And FreeBSD 10 has been out for about a month, and nobody here has ever discussed how good or bad FreeBSD 10 runs om Hyper-V. My guess is it has some bugs to work out still.

That still doesn't change the fact that nobody here runs FreeNAS on Hyper-V... and you are on the FreeNAS forums. ;)
 

hasselholz

Cadet
Joined
Feb 16, 2014
Messages
4
To clarify the situation: I'am not running FreeNAS ON Hyper-V, I'm just trying to use my FreeNAS Server as a (SMB 3.0) datasource for a Hyper-V Cluster.
 
Last edited by a moderator:

hasselholz

Cadet
Joined
Feb 16, 2014
Messages
4
Q quick update on this topic: I upgraded to 9.2.1.1 yesterday and the problem still persists. Still unable to create a VHD on a network share nor attaching one :-(

For comparison I installed NAS4Free in a VM to make a quick comparison. I was surprised: Creating a VHD on a UNC path works beautifully (!!!) with NAS4FREE - just out of the box. Unfortunately NAS4FREE is still at SMB protocol version 2, which is unsuitable for being used as Hyper-V Storage. Can anybody help? Or should I submit this one as a bug report?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Can you create other file types? I'm not buying that there's a bug with .vhd files only. Samba doesn't care what a file type is or how big the file is. I'm betting this is user error more than a bug. But who knows?
 

rickh925

Cadet
Joined
Jan 29, 2013
Messages
7
I am just moving from 9.2.1 RC 2 to 9.2.1.2 RC2 I'll let you know if I can get this running with Windows 2012 Hyper-V. I ran into the same problem on 9.2.1 RC2.

You haven't by chance made any more progress have you?

Rick
 

flake

Dabbler
Joined
Oct 5, 2011
Messages
15
i would also be interested in this topic.
as i use FreeNAS as iscsi target for hyper-v server and think that there must be a way to reduce the overhead.
 
Last edited by a moderator:

rickh925

Cadet
Joined
Jan 29, 2013
Messages
7
I've moved at least temporarily to Win2012R2 SMB 3 shares for my Hyper-V files. I'll keep trying in the lab though.
 

dcfnet

Cadet
Joined
Jun 9, 2013
Messages
4
  • Samba is updated to 4.1.9 in FreeNAS 9.2.1.6-RELEASE
I am interested if anyone has been successful creating a VHD on a network share using the latest release
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
By "network share" do you mean NFS, CIFS, or AFP?

Edit: I just copied a .vhd file to NFS and CIFS without problems on 9.2.1.6....
 

dcfnet

Cadet
Joined
Jun 9, 2013
Messages
4
We have been discussing the creation of a .vhd from HyperV to an SMB share on a FreeNAS box.
 

flake

Dabbler
Joined
Oct 5, 2011
Messages
15
The problem is definitely solved. creating virtual disks on a FreeNAS cifs share is working.
 
Last edited by a moderator:

Stephen P.

Cadet
Joined
May 7, 2017
Messages
5
Unfortunately I am 99% sure this is not yet solved, there is a workaround by setting max SMB version to 2.02 but any time even on FN 9.10.2-U3 with samba 4.5.5 there is a error with the "resiliency" of the disk. Any SMB share that is running 2.10+ requires a resilient file handle or Hyper-V will not boot and instead give an error to that respect.
I am still looking for any way to fix this as 2.02 dosn't seem to like as many connections as I'm giving it but Ill post back here if I have some news.
 

flake

Dabbler
Joined
Oct 5, 2011
Messages
15
i can't tell you right now which smb versions work (i tried them all), but be aware that i was only talking about the virtual disc, not the whole machine. As the hyper-v state file is not working on cifs.
 
Status
Not open for further replies.
Top