Background disk merge failed to complete: General access denied error (0x80070005)

Issue

When removing a snapshot for a virtual machine the AVHDX files do not merge to the parent disk and the Event ID 19100 is logged in the Microsoft-Windows-Hyper-V-VMMS event log.

Log Name: Microsoft-Windows-Hyper-V-VMMS-Admin
Source: Microsoft-Windows-Hyper-V-VMMS
Date: 30/06/2020 07:02:15
Event ID: 19100
Task Category: None
Level: Error
Keywords:
User: SYSTEM
Computer: xxx-xxxxxxxxxxx.xxxxxxx.xxxxxxxxxx
Description:
‘xxx-xxxxxxxxxxxx’ background disk merge failed to complete: General access denied error (0x80070005). (Virtual machine ID xxxxxxxxxxx-xxxx-xxxxx-xxxx-xxxxxxxxxxxxxx)

Solution

Correct the permissions

In PowerShell run

runget-vm | fl name, id

Which will output the ID of the virtual server you need to merge

Output example:
Name : BackupVM
Id :
d3599536-222a-4d6e-bb10-a6019c3f2b9b

For each VM ID you need to merge, assign the VMMS process full control by running the following command

icacls <Folder with VHDS> /grant “NT VIRTUAL MACHINE\<VM ID>”:(OI)F

Example

icacls “D:\Hyper-V\Main Server\VHDX Files” /grant “NT VIRTUAL MACHINE\a0af7903-94b4-4a2c-b3b3-16050d5f80f2”:(OI)F

Merge the changes

This is due to a snapshot merge having failed due to the host machine not having correct permissions set on the VHD(x) files.

Note that your VM must be turned off to avoid any issues during the merging operation.

To merge Hyper-V snapshots, do the following:

  • Open Hyper-V Manager.
  • Select the required VM.
  • Click Edit Disk. The Edit Virtual Hard Disk Wizard will open. Click Next.
  • Click Browse to select the latest AVHDX file. Click Next.
2020 06 30 15 47 31 Window
  • Select Merge to merge the changes stored in a differencing disk into the parent or another disk. Click Next.
2020 06 30 15 47 37 Window
  • Select To the parent virtual hard disk and click Finish.
2020 06 30 15 47 46 Window

To fully complete the process of merging Hyper-V snapshots, repeat the steps for each AVHDX file, until all of the changes have merged into the original parent disk.

If you found this article helpful, would you consider buying me a Coffee?