Link to home
Start Free TrialLog in
Avatar of CnicNV
CnicNV

asked on

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 :-)
Avatar of Steve Whitcher
Steve Whitcher

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.
Avatar of CnicNV

ASKER

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.
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

https://technet.microsoft.com/en-us/library/hh848491.aspx
Avatar of CnicNV

ASKER

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
 ngException
  + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.HyperV.Pow
 erShell.Commands.ExportVMCommand...
\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.
ASKER CERTIFIED SOLUTION
Avatar of Steve Whitcher
Steve Whitcher

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CnicNV

ASKER

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 :-)
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.