Solved

Vmware snapshots

Posted on 2011-02-16
21
2,609 Views
Last Modified: 2012-05-11
Vmware snapshots
if I understand ,In vmware environment , there are 2 types of snapshots. the snapshot done with the built-in function of Vmware.
There is Vranger which is a third party that can take a snapshot image of the Virtual machine.
I would like to know the difference between Vranger and the snapshot built-in function in vmware.
Apparently to restore an image taken by Vranger takes longer.

anyone knows about the snapshots functions I have mentioned above?

thanks
0
Comment
Question by:jskfan
21 Comments
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
A Snapshot is a Snapshot, there is no difference between the Snapshot that you create manually, and the snapshot that Quest vRanger triggers to backup the virtual machine. When vRanger backs up a virtual machine, it invokes a snapshot (creates), so VMware ESX server takes the read lock off the main vmdk file, when the lock is removed off the main vmdk file, vRanger can backup this main vmdk file, whilst it is being backed up, changes made in the virtual machine are written to a delta file (the snapshot), after the backup is completed, vRanger closes/deletes this delta/snapshot by merging it with the main vmdk file.

VMware Snapshots allow you to create snapshots for patching, making small changes, so you can roll them back. Snapshots  are not designed to run ion production for a long time, it is not recommended to run production servers for longer than 2 days ona  snapshot.

Quest vRanger is a backup product that produces a FULL backup of the virtual machine, using the VMware Snapshot functionaility.
0
 

Author Comment

by:jskfan
Comment Utility
let say I have a VM machine that I want to deploy updates or install an application on it.
I will take a snapshot of it using the built-in vmware snapshot function.
Then after the deployment the VMachine , for some reason, crashes and can't come back up. In this case snapshot previously taken by the vmware built-in function will  help or will not?
0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
Yes, this is exactly what VMware Snapshots and Snapshot Manager is for, You take a snapshot before applying changes to virtual machines, e.g. patches, changes etc.

if it doesn't work, you select Revert to Current Snapshot or Go in Snapshot Manager, these diiscards all the changes you've made, and restarts the machine, before the changes, or patches were applied.

If you want to keep the changes you select Delete, and all the changes are merged into the main vmdk disk.
0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
The reason that Quest vRanger restore takes longer to restore, is because it's copying and restoring the entire virtual machine.

Snapshot is quicker for small changes, but be warned do not let them run out of disk space, and only keep them running for 2 days (no more). You should work on having at least 15-20% additional space for snapshots.
0
 

Author Comment

by:jskfan
Comment Utility
So why do companies buy third pary such as Vranger instead of using the built-in snapshit function ?

I also want to know which one is faster in restore operation, Vranger or the Built-in snapshot revert ?

0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
SNAPSHOTS are not a backup.

Comapnies purchase Quest vRanger or Veeam Backup to backup the machine.

Snapshots are not designed for backups.

You should obtain a third party backup product for backing up virtual machines, this is the number one question we get asked on EE, Snapshotting is not a backup product.

Rollback is quicker, after patching, than a complete restore, but Snapshot are not a backup.
0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
If you use the Snapshot function for Backup, you will get into trouble sooner or later with your virtual machines. Snapshots are not designed to run in production for longer than 2 days, because the size of the delta disk expands.
0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
0
 

Author Comment

by:jskfan
Comment Utility
As long as you can save the snapshot as a file, then I think it can be used as a backup.
where is the problem ?
0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
You cannot save the snapshot file. Although it is a file, you cannot copy it, and it's of no use to you without all the other files and main vmdk.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:jskfan
Comment Utility
if a VM machine VMDK is 4GB.
The first time you take a snapshot , what will be the size of the snapshot? I guess 4 GB
then you deploy updates , install Apps.
the second time you take a snapshot, the VMDK will be 4.5 GB. what will be the size of the snapshot?
is it going to be 4.5GB or 0.5 GB?


0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
When you first take a snapshot the size of the snapshot is ZERO (0), the Snapshot file grows as the data is written to it.

No more data is written to the main vmdk file. All the changes are written to the snapshot file. So it depends on how many data writes are written by the virtual machine.

On an average monthly patch file session, it could be approx 2GB.

The snapshots grow much larger than, that it's not just what data you are adding to the machine, it's ALL the virtual machine writes are being stored, to merge later.
0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
I can only advise you, that NOT having a third party backup solution and using Snapshots is a bad idea.

Any VMware Expert will state the same.

Just search EE, and see how many questions we get with Snapshots, when they GO WRONG! and then you have to use VMware Converter because the machines runs out of disk space, machines do not start, a virtual machine can only have a maximum of 29 snapshots. They are problematic, and only should be used for short periods. If you delete a large snapshot, it can take hours, crash the machine, corrupt the machine etc
0
 

Author Comment

by:jskfan
Comment Utility
Actually I was not trying to avoid purchasing third pary, but just understanding the difference.
I believe I came up to understand that the Vranger backs up the whole vm machine vmdk file.

so what does the snapshot contains.
As I gave you an example. when a VM machine vmdk is 4 GB, then you take a snapshot and then you deploy your updates and Apps. what is going to be the size of the snapshot ?

and if the VM machine crashes completely, the snapsot would be of any help. if the answers is YES means the snapshot has all files of the vm machine (vmdk).

OR
the other side I have n't understood could be.

VMDK is the initial file when the vm is created and the snapshot is the increment?

0
 
LVL 117

Expert Comment

by:Andrew Hancock (VMware vExpert / EE MVE)
Comment Utility
I understand you are not trying to get out of purchasing a backup solution, but you need to understand, that it is a dangerous practice to rely on Snapshots for Backup.

I have no idea, what size the snapshot is going to be when you deploy apps.

I tried to give you an example, when you download Security Updates, every month from Microsoft the snapshot size is approx 2GB. (now the updates you download from Microsoft every month are not 2GB), but the snapshot records ALL the block changes needed in the VMDK.

Correct, the Snapshot is the incremental.

Sometimes when machine crashes with snapshots, you cannot merge the snapshot file back into the vmdk, so ALL your changes are lost, back to the point when you created the first snapshot, resulting in a VMware machine that may not start due to disk corruption, or all the changes are lost forever.
0
 

Author Comment

by:jskfan
Comment Utility
Now it makes me think when you first create a VM machine, a VMDK file gets created, but when you add /increase/decrease things like CPU, RAM, disk. would the VMDK changes in size ?
when you install/unistall a new application  or patches would the VMDK file change in size?

Then comes a snapshot. when you take a snapshot. what does that mean ? are you duplicating the image of the VMDK?
 what 's in the snapshot?


0
 
LVL 117

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE) earned 150 total points
Comment Utility
No the VMDK is a fixed size, if you use thick provision. If you create a 12GB VMDK, it always stays at 12GB, it does not change when you alter CPU, RAM, these settings are stored in the VMX file.

there is a vswap file, which is equal to memory of the virtual machine in the datastore folder as well. So if you change virtual machine memory this file changes. If you alter CPU and RAM, it also updates the nvram file which is also stored in the folder datastore.

But the VMDK does not change size. It contains only the data on partition on the virtual machine.

The snapshot contains the disk writes, that would normally be written to the vmdk, but these are written to the snapshot delta file in stead, it just changes that are written.
0
 
LVL 28

Assisted Solution

by:jhyiesla
jhyiesla earned 150 total points
Comment Utility
hanccocka has done a great job of explaining the snapshot.  As an addendum here are some notes that made from a VMWare seminar about snaps:

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 28

Assisted Solution

by:bgoering
bgoering earned 150 total points
Comment Utility
Just to throw my 2 cents in (so you hear it from more than one place) never use snapshots for backups. Backup products however, use snapshot functionality to "freeze" a virtual disk so that it is in a consistent state to be backed up. Typically all I/O is flushed to disk and suspended for an instant while a snapshot is taken. But the backup product will commit the changes from the snapshot once the backup is complete.

It is a good idea to audit your environment periodically (I do it once a week) to make sure some user hasn't made a snapshot they forgot about because, as hanccocka indicates, it is east to get yourself into trouble when snapshots grow large for a couple of reasons: (1) they do require a fair amount of free space on the datastore in order to commit them (free space that may not be available); and (2) it can take seemingly forever to commit a large amount of snapshot data.

Good Luck
0
 
LVL 7

Assisted Solution

by:cdjc
cdjc earned 50 total points
Comment Utility
Everything you ever wanted to know about snapshots ...

VMware Best Practices: Snapshots - http://kb.vmware.com/kb/1025279

VMware: Understanding virtual machine snapshots in VMware ESX - http://kb.vmware.com/kb/1015180

0
 

Author Closing Comment

by:jskfan
Comment Utility
Excellent explanation Guys
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

This article is an update and follow-up of my previous article:   Storage 101: common concepts in the IT enterprise storage This time, I expand on more frequently used storage concepts.
David Varnum recently wrote up his impressions of PRTG, based on a presentation by my colleague Christian at Tech Field Day at VMworld in Barcelona. Thanks David, for your detailed and honest evaluation!
Teach the user how to delpoy the vCenter Server Appliance and how to configure its network settings Deploy OVF: Open VM console and configure networking:
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:

763 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

10 Experts available now in Live!

Get 1:1 Help Now