0% found this document useful (0 votes)
27 views6 pages

AVHDXMerging

Merging AVHDX

Uploaded by

aunhavc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views6 pages

AVHDXMerging

Merging AVHDX

Uploaded by

aunhavc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

How to merge AVHDX files in Hyper-V Manager manually

1. Shutdown/Power off the target Hyper-V VM and Disable Checkpoint in


Setting then Select VM that needs to be merged after that Click Inspect Disk
to Check its Parent 1st AVHDX New -> AVHDX Older -> VHDX [Last] in
order to find latest AVHDX then do it one by one

2. In case of 1 VM have many drive inside separate to each other, you have to
do it 1 drive at a time
3. Launch Hyper-V Manager, select the target VM and click Edit
Disk… button to open an Edit Virtual Hard Disk Wizard.

4. Click Next to skip the introduction page and go to the Locate Disk tab,
click Browse… to select the AVHDX file you want to delete. Click Next to
continue.

5. On Choose Action tab, select Merge and click Next.


6. On Configure Disk sub tab, select To the parent virtual hard disk option
and click Next.

7. Review the Summary and click Finish to start merging. Then system will
take sometime (15 Minutes) to complete merging process
8. Repeat step 2 – 7 to merge all AVHDX completely then go to #9
9. Back to Setting then enable checkpoint back to normal
10.Back to checkpoint then select Delete Checkpoint Subtree

In case of no delete subtree menu, you need to delete via PS.

Delete CheckPoint via PowerShell

Get-VM -Name <VMName> | Get-VMSnapShot -Name <CheckpointName> | Remove-VMSnapshot

Sample:

Get-VM TestVM | Remove-VMSnapshot -Name Experiment*

Explanations: Deletes all checkpoints of virtual machine TestVM whose names starts with
Experiment.

Get-VMSnapshot -VMName TestVM | Where-Object {$_.CreationTime -lt (Get-Date).AddDays(-90) } |


Remove-VMSnapshot

Explanations: Deletes all checkpoints of virtual machine TestVM older than 90 days.

Get-VMSnapshot -VMName TestVM | Remove-VMSnapshot

Explanations: Deletes all checkpoints of virtual machine

11.Restart VM to get back to operate again if checkpoint have not been delete,
VM will unable to start properly.

12. Worse case scenario if VM can’t be start normally, let’s create new VM with the same
parameter but refer to VHDX that already been merged only

Clip: https://www.youtube.com/watch?v=XEMIiBOrseA
How to delete AVHDX file Hyper-V via PowerShell – Not Recommended

Note: You need to install Hyper-V PowerShell module in advance to run cmdlets.

Power off the target Hyper-V VM, launch Windows PowerShell, and run the following command to
merge the AVHDX file:

Merge-VHD -Path 'complete avhdx file path\avhdx name.avhdx'

For example:

Merge-VHD -Path ' C:\Users\Public\Documents\Hyper-V\Virtual hard disks\windemo_7A8CAE52-


C2BC-48A0-844A-477FE3879B96.avhdx'

Delete CheckPoint via PowerShell

Get-VM -Name <VMName> | Get-VMSnapShot -Name <CheckpointName> | Remove-VMSnapshot

Sample:

Get-VM TestVM | Remove-VMSnapshot -Name Experiment*

Explanations: Deletes all checkpoints of virtual machine TestVM whose names starts with
Experiment.

Get-VMSnapshot -VMName TestVM | Where-Object {$_.CreationTime -lt (Get-Date).AddDays(-90) } |


Remove-VMSnapshot

Explanations: Deletes all checkpoints of virtual machine TestVM older than 90 days.

Get-VMSnapshot -VMName TestVM | Remove-VMSnapshot

Explanations: Deletes all checkpoints of virtual machine

You might also like