Migrate Hyper-V VM to new volume with RoboCopy

Here is the approach that we take to migrate Hyper-V VM to new volume with RoboCopy for a standalone Hyper-V Server without SCVMM Manager to perform Live Storage Migration. However, this approach will neeed long downtime of all Virtual Machines (VMs)

  1. Prepared the new Volume (F) with same or greater size that original volume where all the VHD files stored

  2. Stop Hyper-V Services to release the locking for VHD files

Get-Service | where {$_.Displayname -like "Hyper*"}

Status   Name               DisplayName
------   ----               -----------
Running  nvspwmi            Hyper-V Networking Management Service
Running  vhdsvc             Hyper-V Image Management Service
Running  vmms               Hyper-V Virtual Machine Management

#Stop Hyper-V Services
Get-Service | where {$_.Displayname -like "Hyper*"} | Stop-Service
  1. Copy all the files from H: (Source Volume) to F: (Destination Volume)
robocopy H: F: /e /zb /copyall /tee /LOG:C:\Temp\RoboCopy.txt /r:0 /w:0

Explantion of the parameters used

/E      = Copy Subfolders, including empty subfolders
/ZB     = Copy files in Restrtable & Backup Mode
/copyall= Copy ALL file info )equivalent to /copy:DATSOU
/R:0    = 0 retries for read/write failures
/W:0    = 0 seconds between retries
/LOG    = Destination for Log Files    

S=Security=NTFS ACLs, 
O=Owner info, 
U=(aUditing info)

Do not attempt to copy & paste the VHD files using Windows Explorer as some of the NTFS permission is required to start the VM


R:0 & W:0 are required to skip some of the system files that cannot be copied over

  1. Change the Drive Letter of H to other and assign H: to new Volume

  2. Start HyperV Services

Get-Service | where {$_.Displayname -like "Hyper*"} | Start-Service
  1. All the VMs stored in new Volume wiht the same drive letter assigned can be power on successfully

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top