Home > VMware Tips > VMware backup, disaster recovery (DR) and storage > VMware Server how-to: Clean up snapshot files to free disk space
VMware Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

VMWARE BACKUP, DISASTER RECOVERY (DR) AND STORAGE

VMware Server how-to: Clean up snapshot files to free disk space


Andrew Kutz, site expert
02.12.2007
Rating: -2.67- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Getting rid of disk-space hungry snapshots on VMware Server isn't a push-button task and requires a bit of creativity. This tip will offer some creative ideas for removing a snapshot chain in VMware Server in order to reclaim lost disk space.

Both VMware Workstation 5 and ESX 3 have snapshot managers that allow the creation of many snapshots. A series of snapshots is known as a snapshot chain, and each member of this chain is required, or else the chain is broken and the virtual machine (VM) will no longer function.

The snapshot managers in Workstation and ESX can remove older snapshots by collapsing the delta information back into the previous snapshot until at last there are no more snapshots. However, many people forget to delete these snapshots before moving a VM from Workstation or ESX to VMware Server, and VMware Server has no solution for deleting beyond the most recent snapshot. Many snapshots can consume large amounts of disk space; and because of the way snapshot chains work, it is not possible to simply delete the snapshot files.

Inside snapshots

To understand why it is not possible to simply remove snapshot files that belong to a snapshot chain requires a basic understanding of how snapshots work. When a snapshot is created in VMware Workstation, ESX, or VMware Server (Server) a new virtual hard disk file (VMDK) is created. All subsequent write operations are written to this new file; these are delta operations off of either the VM's original VMDK file or the previous snapshot.

The VM continues to function normally because, even though write operations are being flushed to a delta file, the underlying virtualization software is aware of the previous VMDK files. So, the snapshots that make up the snapshot chain


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   




and will read information from them as if all the data was grouped in a single container.

However, if any member of this snapshot chain were to be deleted then the virtual machine may be rendered unusable. Both Workstation's and ESX's snapshot managers can remove older snapshots by recombining these delta writes back into the previous snapshot or finally into the VM's original VMDK file. VMware Server does not possess the ability to create more than one snapshot at any given time and therefore it cannot remove more than the most recent snapshot.

Workstation 5 workarounds

The easiest way to recombine these snapshots into a single virtual hard disk file is to download a 30-day trial version of VMware Workstation 5. Using Workstation it is possible to clone a virtual hard disk or collapse a snapshot chain back to one virtual hard disk file. There may be cases though where Workstation is not an option, and since members of a snapshot chain cannot simply be erased, a little creativity is required.

These steps were validated by removing the snapshots from a VM running Windows XP SP2, but they will work for any guest operating system (OS) as long as the "dd" program has been ported to that OS.

If there any questions feel free to e-mail this author at editor@searchservervirtualization.com

About the author Andrew Kutz is deeply embedded in the dark, dangerous world of virtualization. He is a Microsoft Certified Solutions Developer (MCSD), a SANS/GIAC Certified Windows Security Administrator (GCWN), and a VMware Certified Professional (VCP) in VI3. Andrew also recently submitted a security practical entitled "Sudo for Windows (sudowin)" to the SANS organization where it was accepted, thereby granting Andrew SANS GOLD status.

Rate this Tip
To rate tips, you must be a member of SearchVMware.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



VMware Migration Tips - White Papers
HomeNewsTopicsITKnowledge ExchangeTipsBlogsMultimediaWhite PapersEvents
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2007 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts