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
Date: 30/06/2020 07:02:15
Event ID: 19100
Task Category: None
‘xxx-xxxxxxxxxxxx’ background disk merge failed to complete: General access denied error (0x80070005). (Virtual machine ID xxxxxxxxxxx-xxxx-xxxxx-xxxx-xxxxxxxxxxxxxx)
Correct the permissions
In PowerShell run
get-vm | fl name, id
Which will output the ID of the virtual server you need to merge
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
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.
FYI – If you do follow the steps without the VM off as who has time to wait for a VM Disk to merge with the power off, this can be run while online although it is slight more “dangerous” as to get the VM into a working state requires breaking it further to then fix it.
- Merge the disks while online
- Shutdown the VM (hope it doesn’t hang)
- You will now find the machine will not boot due to the AVHDX files being missing. Panic stations!
- Trust me on this one now! Take a note of the locations of both existing disks.
- Remove both AVHDX disks from the iSCSI controllers and click apply
- Re-add the newly merged VHDX files onto the iSCSI controllers on the same controller ID’s they were on previously.
- Boot the VM up and happy days!
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.
- Select Merge to merge the changes stored in a differencing disk into the parent or another disk. Click Next.
- Select To the parent virtual hard disk and click Finish.
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.