vSphere 4.0 - is it practical to use snapshots as a reliable backup?

MrEgo

Senior member
Jan 17, 2003
874
0
76
First of all, let me apologize if this is the wrong forum for this. I wasn't really sure where else to put this post, but I think I got it right..

Anyway, I've just dug into the whole VM world, and I'm liking what I'm seeing so far. vSphere 4.0 couldn't have been easier to install, and the Server 2008 guest OSes were just as easy to get going.

However, I've been reading about snapshots.. and I guess I'm a little confused as to how they could be used as a possible VM restoration. Some websites say that you cannot use snapshots as a reliable backup of your VM, while others are saying it can be a lifesaver. Lifesaver for what in particular?

I've tried Google'ing the issue, but I really cannot find a clear cut answer. I'll list out my questions to make it easier to respond to:

1. Where are snapshots stored?
2. Can you simply "restore" a snapshot to a datastore and boot up your original VM?
3. (Kind of applies to question 2), But what are snapshots typically utilized for?

I hope I'm asking my questions correctly :eek:

Thank you in advance.
 

jparnell

Member
Oct 12, 2004
36
0
0
Hi,

1) Snapshots are stored on the same datastore as the vmdk (virtual disks) for the virtual machine. When there's a snapshot of a VM, any writes are diverted to the snapshot (delta disk). If you want to revert to snapshot then the delta is simply deleted and you are back at the point when the snapshot was taken. If you want to delete the snapshot then all the changes must be written back into the base disk.

2)Kinda answered it already, yes, its easy to revert / restore back to when you took the snapshot

3)Snapshots are typically used to test an upgrade, patching etc - generally small changes. People love to take snapshots when the virtual machine is new and pristine so they can use the snapshot to restore to if they want to start again. This can end in disaster though because all the writes need to be recorded in the delta disk so can potentially grow as big as the original base disk. Its better to use templates in this scenario. Snapshots are great - if used sparingly.

Let me know if you have more questions
 

jparnell

Member
Oct 12, 2004
36
0
0
Should have also said lifesaver because say i want to test an oracle upgrade. On a physical machine i would have had to backup to tape (potentially taking hours), apply the upgrade and then test. If there's a problem then i would have to restore from tape which could again take hours. With a snapshot its a lot quicker and much more reliable.
 

MrEgo

Senior member
Jan 17, 2003
874
0
76
Ok, I guess it's not what I originally thought it was..

I was under the impression that a snapshot was simply a single file that is created by vSphere that was an image file of your VM... or is that what it is..?

Basically I'm wondering what the difference is between a snapshot and a disk image of your virtual server?
 

jparnell

Member
Oct 12, 2004
36
0
0
you can use vmware consolidated backups to dump the virtual machine out to a single image on a windows box, and then backup that if you want.
or you could create a clone of the virtual machine.
 

tomt4535

Golden Member
Jan 4, 2004
1,758
0
76
VMware consolidated backup will do what you want. Although you need Virtual Center and all the licensing that goes with it, if you dont have that already
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Whether snapshots are reliable are not depend on your workload. Since you're looking at Server 2k8 think about a database like MS SQL or Exchange. At any point in time there's a lot of uncommited data in memory otherwise the system would perform terrible, so if you take a snapshot of the drive you're missing all of the stuff that's still in memory. So if you try to use that image for recovery it's a coin flip as to whether it actually works or not. This is why things like Backup Exec have plugins for Exchange and SQL, they actually talk to that particular app and either make sure all of it's data is flushed or do a backup in a separate format.

But if you've just got something like a web server that's got very little write I/O going on then a snapshot will probably work fine 99% of the time.
 

Brovane

Diamond Member
Dec 18, 2001
6,392
2,582
136
You have to be careful with snapshots.

A snapshot is keeping a Delta file of all the changes after the snapshot was taken. If you allow a snapshot to go on to long you can actually create such a large Delta file that you might not be able to remove the Snapshot.

Also a snapshot interfers with Vmotion capability.

The best way if you want a down and dirty way to take a backup of a machine is to do a hot clone of the machine.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
A snapshot is keeping a Delta file of all the changes after the snapshot was taken. If you allow a snapshot to go on to long you can actually create such a large Delta file that you might not be able to remove the Snapshot.

Yea, we actually had a case recently where an engineer saw a really old snapshot on a client's setup, deleted it and the whole VM went with it. Apparently there wasn't enough space to consolidate the changes back into the original VMDK but ESX decided to try anyway and corrupted it.
 

Chiefcrowe

Diamond Member
Sep 15, 2008
5,056
199
116
Totally agree here.. i had a problem running out of space while creating snapshots of several machines and it totally screwed up some important stuff!!!
so now i'm just going to backup elsewhere instead.



Originally posted by: Brovane
You have to be careful with snapshots.

A snapshot is keeping a Delta file of all the changes after the snapshot was taken. If you allow a snapshot to go on to long you can actually create such a large Delta file that you might not be able to remove the Snapshot.

Also a snapshot interfers with Vmotion capability.

The best way if you want a down and dirty way to take a backup of a machine is to do a hot clone of the machine.

 

MrEgo

Senior member
Jan 17, 2003
874
0
76
Originally posted by: Nothinman

Yea, we actually had a case recently where an engineer saw a really old snapshot on a client's setup, deleted it and the whole VM went with it. Apparently there wasn't enough space to consolidate the changes back into the original VMDK but ESX decided to try anyway and corrupted it.


What happens when you delete a snapshot file? Does this affect the current state of the virtual machine? There was a snapshot taken over a month ago, and the file is getting to be about 36GB in size. I want to keep the VM the way that it is..

 

RebateMonger

Elite Member
Dec 24, 2005
11,586
0
0
If you have virtualized Domain Controllers, be aware that snapshots are definitely NOT recommended as a backup for DCs.

http://technet.microsoft.com/e...y/dd363545(WS.10).aspx

"Do not use the Snapshot feature as a backup to restore a virtual machine that was configured as a domain controller. Problems will occur with replication when you revert the virtual machine to an earlier state. For more information, see Appendix A: Virtualized Domain Controllers and Replication Issues. Although using a snapshot to restore a read-only domain controller (RODC) will not cause replication issues, this method of restoration is still not recommended."
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
What happens when you delete a snapshot file? Does this affect the current state of the virtual machine? There was a snapshot taken over a month ago, and the file is getting to be about 36GB in size. I want to keep the VM the way that it is..

If it works properly you'll be fine. What happens is that when you create a snapshot ESX changes the vmdk for the guest to a new file that holds the differences and leaves the original vmdk alone. When you delete the snapshot those changes are commited to the original vmdk and it's made the real disk file again. Be cautious about deleting snapshots if you're low on disk space, doing that corrupted a vmdk for us for a customer a few months ago.
 

MrEgo

Senior member
Jan 17, 2003
874
0
76
I know you already said it, but I just want to make ABSOLUTELY sure that I'm doing this correctly:

If I delete the snapshot file, all of the changes that were made AFTER the snapshot was taken will be permanently committed?