Exporting Hyper-V VM to a NAS with Server 2012?

I am trying to test the functionality of exporting a Hyper-V VM from a Server 2012 Hyper-V backed host to a NAS.  I am using Hyper-V manager to do this, which is running on another server.  

I have set all of the shared file permissions as well as NTFS permission to a granular permission set that should make senses, but just to be sure, I also temporarily set the everyone group to full permission.  I also tested with another NAS by a completely different vendor.

In all cases I am met with the following error.

"An error occured while attempting to export the virtual machine. Failed to create export directory.  Failed to create export directory with error 'General access denied error' (0x80070005)"

It does this ether browsing to the NAS share or UNC pathing it.

There are a ton of post on the internet, ranging from Microsoft has 0 support for this (Exporting to anywhere else other than local storage...booo), to people can get it to work doing exactly as I have done, to other esoteric stuff that doesn't make sense.

I was wondering if someone could point me in the right direction to get this working.  This is something that VMware vCenter Server seems to have no problem doing.  

Thanks a lot :-)
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steve WhitcherSystems AdministratorCommented:
I would suggest you try it again using an instance of Hyper-V Manager that is running on the host you are trying to export from.  Sometimes adding that additional level of remoting and authentication can be enough to cause issues.
CnicNVAuthor Commented:
That seems like a reasonable suggestion, but my hosts are running server 2012 hyper-v which does not have a GUI, so I am not sure if it can even run Hyper-V Manager.
Steve WhitcherSystems AdministratorCommented:
In that case, try using powershell on the host to export the VM, using the "export-vm" cmdlet.  For example:

Export-VM -Name [VMNAME] -path \\NAS\SHARE

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

CnicNVAuthor Commented:
I tried the following command directly from the host using powershell verbatim..."Export-VM -Name Test Server V3 -Path \\nas\test share"

And I am presented with the following error...

Export-VM : A positional parameter cannot be found that accepts argument 'V3' . At line:1 char:1
+ Export-VM -Name Test Server V3 -Path \\nas\test share
  + CategoryInfo          : InvalidArgument: (:) [Export-VM], ParameterBindi
  + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.HyperV.Pow
\Find the jade monkey before the next... substitute for x...etc

It seems like the command doesn't like the Virtual Machine Name.  The Virtual Machine's host name (and DNS) is actually TestServer, but in Hyper-V manager it's Virtual Machine name is Test Server V3 and this is also what it is called in it's file structure on the host its self.
Steve WhitcherSystems AdministratorCommented:
Try wrapping the VM name in quotes.  Or, if you only have one guest with a "test" name, try this:

Get-VM Test*

Assuming that returns the VM you are working with, and only that VM, then you could do:

Get-VM Test* | Export-VM -path "\\NAS\Share\"

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CnicNVAuthor Commented:
Ha ha!  Awesome!  The quotes got it to work.  I can see it has created the folder structure on the NAS and the switch port activity is doing 70% of 1 GB/s.  Good show.

Thanks a lot, now I can back these suckers up :-)
Luke BCommented:
I had this very issue with a QNAP NAS for days!  Firstly, run net use * /d to remove any unwanted cached credentials.

Then ensure that you enable advanced windows permissions on the NAS, and give your Hyper-V host and SYSTEM full permissions to the share.  You can then right click Hyper-V Manager and run as different user.  Run it as domain admin and then the export will work.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.