Hyper-V export with Export-VM to network (NAS) fails

Jari Sevon 5 Reputation points
2024-03-04T17:34:33.8133333+00:00

Hi,

I am trying to export Hyper-V virtual machine from Windows Server to network disk (NAS). And if change only the path to another network disk (NAS) it works as expected. I am running powershell with interactive user account (Administrator) on server and I have checked all user rights on both NAS devices disks. They are accessible and with all rights. Error description is not very helpfull.

Export-VM -Name "Hakopirtti-HA" -Path "\\192.168.1.20\levy\HA-Backups\-HA-VM"
Export-VM : Export failed for virtual machine 'Hakopirtti-HA'.
At C:\Hyper-V_Backup\VMCopy.ps1:41 char:1
+ Export-VM -Name "Hakopirtti-HA" -Path "\\192.168.1.20\levy\HA-Backups ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Export-VM], VirtualizationException
    + FullyQualifiedErrorId : OperationFailed,Microsoft.HyperV.PowerShell.Commands.ExportVM

# This works as expected
# Export-VM -Name "Hakopirtti-HA" -Path "\\192.168.1.15\Volume_1\ExportedVM2"


Any ideas?Jari

Windows for business | Windows Client for IT Pros | Storage high availability | Virtualization and Hyper-V
{count} vote

2 answers

Sort by: Most helpful
  1. cosine 5 Reputation points
    2024-04-02T21:39:08.21+00:00

    As an alternative solution, I created a powershell script that does it in steps since exporting directly to the NAS is not working. I export it locally to my Hyper-V Host, then copy it to the NAS, then remove it from my hyper-v host. I've had good luck using robocopy command as well to copy/sync. Not ideal, but it worked for me.

    Export-VM -Name "my-vm" -Path "C:\temp\"
    Copy-Item -Path "C:\temp\my-vm" -Destination "\\NAS\my-vm\" -Recurse
    Remove-Item -Path "C:\temp\my-vm" -Recurse
    
    1 person found this answer helpful.

  2. Anonymous
    2024-03-06T07:38:58.2566667+00:00

    Hi Jari,

    Thanks for your post. Please understand that Hyper-V virtual machine configurations have a specific version number. You can only import a virtual machine if the Hyper-V host supports that configuration version. Typically, this means that you can import a virtual machine to a Hyper-V host running a newer version of Hyper-V, but you cannot import a virtual machine created on a newer version of Hyper-V to an older version of Hyper-V. See Supported virtual machine configuration versions for more information.

    Export and import virtual machines | Microsoft Learn

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.