Guest Services in Hyper-V and Copy-VMFile

Русская версия/Russian version

Windows Server 2012 R2 provides a lot of updates and improvements to Hyper-V. The most visible change is the new guest service “Hyper-V Guest Service Interface” or just “Guest Services”, which disabled ,by default in the properties of every VM on 2012 R2 Hyper-V.
copyvmfile_4
This service has a really modest functional, but extremely useful. Guest Services allows you to copy the necessary files between the host (server Hyper-V, on which are placed the target VMs = parent partition) and virtual machines (= child partition) without any load on the network components. The copying process is provided by link between Hyper-V host and VM through vmbus (Virtual Machine Bus).hv_arch
Also, the vmicguestinterface service (from the virtual machine side) responsible for functionality integration service components  on the guest OS level.   Altogether,  we  have got native feature for point-to-point (for example, host 1 VM in the DMZ) or multi-point (host VMs) copying necessary files between Hyper-V partitions

Before using this new feature you have to check:

1) Hyper-V Integration services must be up-to-date. Version has to be at least 6.3.9600.16384.

Get-VM | Select Name, IntegrationServicesVersion

2) Guest Services enabled for target VMs

#Gets current VM configuration
Get-VM|Get-VMIntegrationService|ft VmName,Name,Enabled -AutoSize
#Enabling Guest Service
Get-VM | Enable-VMIntegrationService -Name "Guest Service Interface"

copyvmfile_5
3) vmicguestinterface service must be running inside the guest OS

Get-Service vmicguestinterface

sss

Service management is provided by only one cmdlet  Copy-VMFile ((Microsoft.HyperV.PowerShell.GuestServiceInterfaceComponent) , which has a list of required parameters:

-SourcePath = what we want to copy (UNC is supported!)
-DestinationPath = where we want to save files
-FileSource = file source type
-VMName   = VM names

Example:

#Copies 2012R2.ISO file from file source HOST to VM with name Server 2012R2_1 and saves files to pre-created folder C:\ISO on guest OS
Copy-VMFile "Server2012R2_1" -SourcePath C:\ISO\2012R2.iso -DestinationPath C:\ISO\2012R2.iso -FileSource Host

If you don’t have pre-created destination path – you will get error. To automate process of creation necessary files you have to use -CreateFullPath  parameter that checks and creates folders, if they are not exist.

Copy-VMFile "Server2012R2_1" -SourcePath C:\ISO\2012R2.iso -DestinationPath C:\ISO\2012R2.iso -FileSource Host -CreateFullPath

Process of copying:

copyvmfile_1

Final result:copyvmfile_3

UNC:

copy_vm_file_unc


Server 2012 R2 update rollup: May 2014

Microsoft has released new rollup for Server 2012 R2. This update resolves plenty issues and bugs:

  • 2958293 Cluster service stops unexpectedly on Windows 8.1 or Windows Server 2012 R2
  • 2958264 The virtual machine freezes in “Turning Off” state during live migration in Windows 8.1 or Windows Server 2012 R2
  • 2957625 Cluster shared volumes (CSV) are stuck when you stop a cluster service in Windows Server 2012 R2
  • 2908783 Data corruption occurs on iSCSI LUNs in Windows
  • 2957018 VMMS.exe process crashes after restart on a Windows 8.1 or Windows Server 2012 R2-based Hyper-V cluster
  • 2955628 Nodes are broken in cluster RHS upon file backchannel invalidation in Windows Server 2012 R2
  • ………….

The main prerequisite: installed 2919355 Windows RT 8.1, Windows 8.1, and Windows Server 2012 R2 Update April, 2014.

More information: KB2955164

Highly recommended to apply.

IMPORTANT: this update changes QFE level from 6.3.163xx to 6.3.17xxx . It may affect the Microsoft DSM version and your cluster validation results. If you receive “QFE Number is not the same on every nodes.” , you have to check updates or see my article