matedwards
asked on
Hyper-V delete Snapshot
I have deleted a snapshot of my hyper-V virtual machine to free up disk space on the Host.
I rebooted the VM.
The .AVHD file is still there and taking up space.
Can I manually delete the .AVHD file.?
Or does the VM need to be fully shutdown/turned off (from within Hyper-V Manager) for the .AVHD to be automatically deleted?
Many thanks in advance..
I rebooted the VM.
The .AVHD file is still there and taking up space.
Can I manually delete the .AVHD file.?
Or does the VM need to be fully shutdown/turned off (from within Hyper-V Manager) for the .AVHD to be automatically deleted?
Many thanks in advance..
ASKER
The first thing you need to do is determine if that AVHD is currently in use. You can do this by going to settings for the VM and looking at the hard drive info.
If it is using that AVHD then you might want to consider just merging it with its parent. You can do that using the Edit Disk... command and just follow the prompts.
If it is using that AVHD then you might want to consider just merging it with its parent. You can do that using the Edit Disk... command and just follow the prompts.
ASKER
Thanks Ross..
From looking in Hyper-V manager the .AVHDX file is certainly in use! It's listed in the path.
Will 'merging' create a single Hard Drive file smaller than both..?
Can I do it on a live or should the VM be in a shutdown/turned off/saved state.?
Great screen shots.. thanks again..
From looking in Hyper-V manager the .AVHDX file is certainly in use! It's listed in the path.
Will 'merging' create a single Hard Drive file smaller than both..?
Can I do it on a live or should the VM be in a shutdown/turned off/saved state.?
Great screen shots.. thanks again..
ASKER
Russ not Ross.. apologies..
ASKER
When inspecting the disk from within Hyper-V Manager it is listed as
Type: Differencing Virtual Hard Disk
Type: Differencing Virtual Hard Disk
The merged disk is almost always smaller than the two images combined. It takes a few minutes and after it's done you're just left with the parent. You can actually do this with any differencing disk. Just merge it with its parent. If its parent is also a differencing disk it still works. You can eventually merge everything back to the original disk.
Yes, you should have the VM shut down when doing this. You don't want the VM to be writing changes to the disk while you're trying to merge it. In fact, I don't think Hyper-V even allows you to merge a disk that is currently in use.
Yes, you should have the VM shut down when doing this. You don't want the VM to be writing changes to the disk while you're trying to merge it. In fact, I don't think Hyper-V even allows you to merge a disk that is currently in use.
ASKER
Thanks again Russ.. I was going to do the merge at the weekend although I came across this which may cause problems.
'A merge operation might require extra space, as well. If I were to merge that differencing disk with the OS back into the empty 4 megabyte root disk, then it would need to expand the root disk to accommodate all of those changed bits. It can’t destroy the differencing disk until the merge is complete, so I’m going to need enough space to hold that differencing disk twice. Once the merge is completed, the space used by the differencing disk will be reclaimed.'
Is it true that during the merge I will need free disk space the same size as the differencing disk?
This i do not have...
'A merge operation might require extra space, as well. If I were to merge that differencing disk with the OS back into the empty 4 megabyte root disk, then it would need to expand the root disk to accommodate all of those changed bits. It can’t destroy the differencing disk until the merge is complete, so I’m going to need enough space to hold that differencing disk twice. Once the merge is completed, the space used by the differencing disk will be reclaimed.'
Is it true that during the merge I will need free disk space the same size as the differencing disk?
This i do not have...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks Russ.. will attempt out of hours..
ASKER
Worked like a charm...
Many thanks, Russ..
Many thanks, Russ..
But be cautious. It may not even be a snapshot file. Differencing disks also use the avhd file, and deleting a differencing disk from a VM that used it could be disastrous.