Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VMDK Snapshots growng out of control

Posted on 2010-11-19
11
Medium Priority
?
1,622 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 28

Accepted Solution

by:
bgoering earned 1200 total points
ID: 34173685
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 400 total points
ID: 34173687
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
ID: 34173758
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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 3

Expert Comment

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

Expert Comment

by:Virtalicious
ID: 34176799
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
 
LVL 8

Expert Comment

by:markzz
ID: 34179970
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
ID: 34184873
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 1200 total points
ID: 34185050
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
ID: 34185061
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 400 total points
ID: 34185452
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 1200 total points
ID: 34187716
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

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
Giving access to ESXi shell console is always an issue for IT departments to other Teams, or Projects. We need to find a way so that teams can use ESXTOP for their POCs, or tests without giving them the access to ESXi host shell console with a root …
Teach the user how to edit .vmx files to add advanced configuration options Open vSphere Web Client: Edit Settings for a VM: Choose VM Options -> Advanced: Add Configuration Parameters:
This Micro Tutorial walks you through using a remote console to access a server and install ESXi 5.1. This example is showing remote access and installation using a Dell server. The hypervisor is the very first component of your virtual infrastructu…

670 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