Link to home
Start Free TrialLog in
Avatar of jag-pens
jag-pensFlag for Canada

asked on

HyperV VM with snapshot running low on disk space

2008r2 HyperV host with single VM, has one vhd and single snapshot

Flailing attempts to reduce consumed disk space have made the situation worse - now down to around 550MB free space for the host drive file system.

Researching the issue I believe that an export is the only option if snapshots are present but of course I need to retain the GUI and name of the server.  So successfully exported to a larger host disk with ample space but then the import of course fails.

So now it would appear that the only way to stay on the same host is to delete this VM - but then when the VM is deleted the avhd will be merged with the vhd file and it will run out of space (and I need to then be on-site to make more space happen).

I want rid of the snapshot but not the changes on it.

Any suggestions are welcome?

Oh yeah, I did do a Windows backup to shared folder if that matters.

Thanks
Avatar of zalazar
zalazar

You could try to do an image backup of the server.
There are several software products available which also provides an option to boot from an ISO (e.g. based on Windows PE).
You could then shutdown the server, boot the ISO and create a network drive mapping and backup the disks via the Image backup software to a network share.
I have used "Image for Windows" https://www.terabyteunlimited.com/image-for-windows.htm  for this in the past. The software should be installed on another computer.
After the image backup has been made, you can boot the ISO on a new VM.
Create the drive mapping again and then restore the image backup.
Avatar of jag-pens

ASKER

the best option would be done today with no site visit (because I can't get physical access today).

I see where you are going but why not just blow it all away and then create a new VM then restore from windows backup?

Failing that is there a product that can 'mount' the VM?  (including the snapshot data of course) then I could back that up and restore (it does sound complicated though )...
The snapshot will be growing in size as it is a 'differential file' which will record the difference between the snapshot point and the current state of the system. If you delete the snapshot record from the HyperV Console and then shut down the virtual machine, it will then merge the data and you will no longer have the snapshot file, but the server will contain the changes since the snapshot was made.
Ok, so if I provide enough room for the merge to happen, then delete the 'Now' it will merge the changes and all will be well?
VM-now.JPG
You will need to shut the machine down before the Merge will start, and leave it shutdown for the duration.
Richard,

Ok, doing that at noon today so will post back - Thank You!
Before you start with the merge, please make sure that your disks (VHDs) are fixed size disks.
If your disks are Dynamic then you would need extra disk space.
Maybe you could you let us know the sizes of the vhd and avhd files.

If your disks are Dynamic then instead of merging the snapshot a possiblity might be to shutdown the virtual server.
Create a new snapshot.
And then export this snapshot to another location with enough diskspace.
You can then create a new virtual server via import and selecting the exported data.
Ok, will check. Didn't get the planned amount of additional space today - forgot my external USB CD/DVD ...
Ok the original VHD is a dynamic disk - Size is 65GB and max is 70GB
The Snapshot AVHD is 14.5GB

If it matters, inside the VM which is 2012R2 it says 53.4GB free of 69.6GB
I squeezed a neighboring partition downwards today  to make some room so now the VM partition size is 109GB with 11.6GB free
Thanks for all the info.
So when the 14,5 AVHD data will be written to the dynamic disk.
Then the maximum dynamic disk grow could be 5 GB (70 - 65).
So 11,6 GB of free space should be ok.
After the snapshot has been merged, the AVHD will be deleted.
Please note that the AVHD files will be deleted only if the virtual server is in shutdown, turned off, or saved state.

P.S. you can delete the snapshot by right clicking on the Snapshot which is on the line above Now.
What happens if does happen to run out of space?
I expect that the virtual server will end up in undefined state.
If you want to limit the risks you could use one of the following options:
1) Shutdown the server and create a backup of the vhd and avhd files to another drive before deleting the snapshot (merging).

2) Copy the vhd and avhd files to another drive.
And create a new virtual server from there selecting the copied VHD file.
You could then manually merge the AVHD into the VHD by following this technet procedure.
https://social.technet.microsoft.com/wiki/contents/articles/6257.manually-merge-avhd-to-vhd-in-hyper-v.aspx

3) Create another snapshot and export it.
Use the export to import it as a new virtual server.
Ok, having issues with Acronis DDAS 11 - will try a few more things to try to get it to boot off USB (or I may need a BIOS update etc.)  If it comes to DISM to backup and restore the C drive into a smaller partition I will probably not do that ...and will do what you suggest - man this is painful!
Thanks for the update.
Good luck.
Apologies for not updating.  Crazy Friday - finally got the drivers for this machine on the WinPE Acronis stick - so hope to resize Monday or Tuesday.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.