Solved

VMDK Snapshots growng out of control

Posted on 2010-11-19
11
1,596 Views
Last Modified: 2012-05-10
Experts,

I have an ESXi 4.0 server setup with one Windows Server 2008 VM.  The VM is a database server so there are constant changes that's going on in the VM.  

I took two snapshots in the system (while it was running): Snapshot0001.vmdk & Snapshot0002.vmdk.  The Snapshot0001.vmdk continued to grow.  I read this forum:

http://communities.vmware.com/message/617010

and I deleted Snapshot0001.vmdk.  VMWare merged the snapshot I deleted (snapshot0001.vmdk) into the base vmdk (which I really didn't want it to do), but ok.  I just don't want the files on the datastore to grow.

Now, the second snapshot is growing!!!  The Snapshot0002.vmdk is grew from 10GB to over 20GB and it's still going.  My question:

1. How can I get these snapshots to stop growing?  I just want the snapshot to take up a flat file size.  I want to use it as a Restoration point at a single moment in time, hence a static file.
2. Is there a way, when I delete a snapshot in the middle (e.g. me deleting snapshot0001.vmdk) to not make it merge to the base vmdk file?

Thanks.
0
Comment
Question by:esesjay4
11 Comments
 
LVL 28

Accepted Solution

by:
bgoering earned 300 total points
Comment Utility
1. No - snapshots will continue to grow. Snapshot technology will work as a restore point (that is what they are intended for) and to use it that way instead of deleting a snapshot you revert to the snapshot. I would never recommend keeping snapshots around for very long as disk usage can, as you have found, get out of hand.

2, As for deleting snapshots in the middle, if they are deleted they will be merged into the previous level. This makes sense because later snapshots are always based on all the previous levels. That being the case later snapshots would be invalid if the previous level was just gone. You can revert to any snapshot level and discard later changes.

Good Luck
0
 
LVL 28

Assisted Solution

by:jhyiesla
jhyiesla earned 100 total points
Comment Utility
Here is an explanation of snapshots as they relate to the VM world.  I think you are expecting them to be something that they are not.

A snap shot is a way to preserve a point in time when the VM was running OK before making changes. A snapshot is NOT a way to get a static copy of a VM before making changes.  When you take a snapshot of a VM what happens is that a delta file gets created and the original VMDK file gets converted to a Read-Only file.  There is an active link between the original VMDK file and the new delta file.  Anything that gets written to the VM actually gets written to the delta file.   The correct way to use a snapshot is when you want to make some change to a VM like adding a new app or a patch; something that might damage the guest OS. After you apply the patch or make the change and it’s stable, you should really go into snapshot manager and delete the snapshot which will commit the changes to the original VM, delete the snap, and make the VMDK file RW. The official stance is that you really shouldn’t have more than one snap at a time and that you should not leave them out there for long periods of time. Adding more snaps and leaving them there a long time degrades the performance of the VM.  If the patch or whatever goes badly or for some reason you need to get back to the original unmodified VM, that’s possible as well.  
0
 
LVL 8

Expert Comment

by:markzz
Comment Utility
If you want a point in time restoration method you could live clone or backup.. eg VCB. Snapshots are not intended as a long term restoration method.( as you have found)
0
 
LVL 3

Expert Comment

by:driskollt
Comment Utility
Anything that uses the word "snapshot" is not meant as a long-term copy.
0
 
LVL 3

Expert Comment

by:Virtalicious
Comment Utility
Yeah I would agree with markzz:

If you are trying to get a point in time backup that will not grow and takes up little (as little as possible) disk space clone the VM and use Thin Provisioning.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 8

Expert Comment

by:markzz
Comment Utility
Something ANY admin worth his or her salt would setup is snapshot monitoring.
It's absolutely critical to have some sort of automated routine to monitor and report on snapshots and more importantly orphaned snapshots.
I use 3 routines but if I had to simplify things I would suggest you all look at snaphunter. It simply a perl script which you schedule via cron, this perl script looks at a simple config file which you edit to suit your requirements.
There are many other routines out there but snaphunter is so simplistic you can have it running a few minutes.
0
 

Author Comment

by:esesjay4
Comment Utility
Sorry for the delayed response.  I understand the use of snapshots based on the discussion above.  Obviously, my understanding of snapshots is not accurate.  Thanks for the clarification.

Would cloning the VM at the a given point in time be the best way to back it up?  Basically, I want a backup in case something goes wrong (HDD, OS, etc.).  Also, can I clone a VM with just vSphere client or do I need the vCenter (i'm only using one ESXi server right now)?

One other thing.  I noticed when I deleted the previous snapshot is merged into the base, as confirmed above.  But is there any reason by that base file size grew?  It almost grew 50GB!!!

Thanks.
0
 
LVL 28

Assisted Solution

by:bgoering
bgoering earned 300 total points
Comment Utility
Cloning is a good way to back it up. You need vCenter Server to clone a vm. However, you can also use a tool such as Veeam FastSCP (it is free) to copy the files of a vm to a backup location. With the free ESXi the vm needs to be powered off in order to get a consistent copy.

Good Luck
0
 
LVL 28

Expert Comment

by:bgoering
Comment Utility
Another possible way to back up a running vm is to use VMware Converter (http://www.vmware.com/products/converter). to "convert" the ESXi vm into another copy.
0
 
LVL 8

Assisted Solution

by:markzz
markzz earned 100 total points
Comment Utility
The converter can't be scheduled via the GUI although you could write a script to do all this via the remote CLI but it all becomes so VERY complex.
There are many free tools (scripts) out there already but they are all a mission to use.
I would still suggest vRanger Pro of the like for your situation.
.........Backups and snapshots are really not very important until you need to restore.............

Use a well established and supported solution.
0
 
LVL 28

Assisted Solution

by:bgoering
bgoering earned 300 total points
Comment Utility
I need to retract my last statement - apparently the "free" vmware converter will not allow you to convert a running vm unless you go through the "powered on machine" wizard which is much to much trouble - it would still be my recommendation as the free tool to use provided you can power off your vm while it is being copied. Your best bet, however, would be to license the vSphere Essentials (about $500) then either use the built in facilities to clone your VMs, or use an established third party product like Veeam (or vRanger) to make your backups.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Last article we focus in how to VMware: How to create and use VMs TAGs – Part 1 so before follow this article and perform the next tasks, you should read the first article how to create the TAG before using them in Veeam Backup Jobs.
HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
Teach the user how to rename, unmount, delete and upgrade VMFS datastores. Open vSphere Web Client: Rename VMFS and NFS datastores: Upgrade VMFS-3 volume to VMFS-5: Unmount VMFS datastore: Delete a VMFS datastore:
Teach the user how to use configure the vCenter Server storage filters Open vSphere Web Client:  Navigate to vCenter Server Advanced Settings: Add the four vCenter Server storage filters: Review the advanced settings: Modify the values of the four v…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now