Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm currently stuck with a problem of insufficient disk space on a colocated server and could do with some help. The situation is:

  • The server is 'mine' but it's located at a hosting facility so I don't have easy access to it.
  • The server has two physical 250GB disks in a RAID1 configuration (i.e. presenting one 250GB disk)
  • The disk is partitioned into C: (177GB) and E: (54GB)
  • C: has about 25GB free. It might be possible to free up a little over 50GB (total) if needed.
  • The server is Win Server 2008 (not R2)
  • I have several VMs on the server. The problem one is called SVR03.
  • SVR03 has a dynamically-expanding vhd file which is the only file on E:, and is currently taking all the space on that drive: 54GB.
  • SVR03 had a snapshot, which was stored in the normal location on C:\programdata\microsoft\windows\hyper-v\snapshots. We found that this snapshot was taking increasing amounts of space on C: and we didn't want the snapshot, so it was deleted via Hyper-V manager. However, as I understand it this snapshot needs to be merged into the vhd before it's really deleted, and this merge happens on shutdown of the VM.
  • Now after shutting down SVR03 Hyper-V tries to perform that merge of the snapshot with the vhd, but because there's insufficient space on E: it fails. It seems to get to about 50% before failing.
  • Originally it was only getting to about 25% before failing, then I found an extra 2GB unpartitioned space on the drive so expanded the E:, sadly that wasn't enough extra space and the vhd has expanded to take all the space but the snapshot hasn't successfully merged in.
  • After Hyper-V fails to merge it waits a little while and then tries again.
  • I'm unable to compact the vhd for SRV03 because it's in use from Hyper-V trying to merge it.
  • I am able to start SVR03 back up again, but the same issue occurs when I shut down.

How can I get out of this situation?

Is there a way to tell Hyper-V to not merge the snapshot for now, so I can move the files around? e.g. I could move the vhd file elsewhere so there is more space (either by clearing space on C: or by turning off RAID and creating a new F: with 250GB). If I were to move the vhd file will that be ok or is the snapshot somehow linked to the current location of the file?

Is there a way to un-delete the snapshot so I can shut down SVR03 and then move the vhd?

Many thanks!

share|improve this question
add comment

3 Answers 3

Turning RAID off seems like a Bad Idea™, but you're pretty well suck unless you can plug a USB drive into the server or something like that. You can shutdown the machine, cancel the merge, the grab the vhd and avhd files. Once you move them Hyper-V will no longer merge them automatically, you'll have to do it manually. Once it's merged move the vhd back to the original location and Hyper-V will automatically pickup that the avhd file is gone.

share|improve this answer
    
How do I cancel the merge? –  Rory Mar 3 '12 at 18:50
add comment

Rename all the AVHD associated with the virtual server to VHD

It comes from a method of manually merging snapshots which might work.

I haven't tried this method so I take no responsibility if it messes up. If you have an external backup, I suggest you take one :)

Reference to manually merging disks

http://www.virtualizationadmin.com/kbase/VirtualizationTips/ServerVirtualization/MicrosoftHyper-VR2Tips/General/ManuallyMergingHyper-VSnapshots.html

share|improve this answer
add comment
up vote 0 down vote accepted

This is how I solved it:

  • Attached an external USB drive. This partly solves the space problem but still left me with a machine that kept trying to merge the snapshot on shutdown of the VM
  • Stop the Hyper-V Management Services by right-clicking on the server name within Hyper-V Manager > Stop Services. Note this doesn't stop any of the VMs or stop you accessing them via Remote Desktop etc.
  • Remote Desktop to the server SVR03 and shut it down. Now the disk files are not in use.
  • Copy the VHD (from E:) and the AVHD snapshot file to the USB drive.
  • Rename the original VHD and AVHD files. This is so (a) Hyper-V won't try to merge them when I start it up, and also (b) when using the Edit Disk wizard later on you get the 'reconnect' option.
  • Following instructions here, rename the AVHD file to VHD, then use the Edit Disk wizard to edit what was the AVHD file and reconnect it to the parent VHD. Note you don't get the reconnect option if the original VHD file (on E: in my case) is still there. Now use the Edit Disk wizard again to edit what was the AVHD file and merge it with the VHD file. This takes ages if you're on a USB drive!
    • Now my VHD was bigger than my partition for it, so I got rid of that drive and resized C: to use that space, deleted the old VHD and AVHD files then moved the merged VHD file to C:
    • Create a new VM with the same settings as SVR03 had, and give it as an existing hard drive the merged VHD file.
    • Start it up and all good!
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.