共用方式為


Consolidating Hyper-V Differencing Disks into One

I deleted two snapshots from a Hyper-V virtual machine (VM) this morning.  This left the base .vhd file and two .avhd differencing disks.  I decided I wanted to merge them into a single file and learned that the diskpart tool will let you do this.

  1. Open an elevated command prompt (i.e. run as administrator).
  2. Run diskpart.
  3. Enter: select vdisk file="<full path to the latest differencing disk>"
    1. A differencing disk ends in either .avhd or .avhdx.
  4. Enter: merge vdisk depth=n
    1. n will be the number of parent files you want to merge.  Since I had two parents, one .vhd and one .avhd for this .avhd file, I used depth=2.

Happy merging!

Rob

Comments

  • Anonymous
    February 04, 2015
    Hi Rob, Thank you so much for this tip ! I have replaced my HyperV 2008 host with a HyperV 2012 ... and no way to run the client management tool and merge my VHDs. I have saved many hours of work. Thanks again