mchagnon951
Contributor
Contributor

When to clone vs. snapshots

Jump to solution

I'm looking for best practices on when to either clone or use a snapshot of a vm.

I'm sure like most of you I work in a enterprise environment with FC SAN, using Vcenter 2.5 U4 and ESX 3.5. My manager wants me to write up a process by which the applications team can use to update their apps, but wanting to test before deploying to production. Before writing up the process I want to know the caveats or pitfalls to either creating a clone or a snapshot before I proceed. The following is a rudimentary idea for keeping PRD VM intact while testing out patches to Apps:

PRD VM --> Clone PRD VM --> Apply patch to Clone VM --> Test Clone VM --> If passes Apply patch to PRD VM --> Delete Clone VM.

Of should I just use snapshots of the prd and then apply patches and revert back or consolidate if it's ok.

I know there are issues with snapshots taking up alot of space and also heard of some performance issues, not sure. And with cloning what if the PRD VM is left off for some time while working with the clone is there a problem after doing all the testing then shutting down the clone to bring up PRD again? Someone told me there's something called secure channel, something to the fact that if a system can't communicate with a domain controller for some time then you'd have to rejoin it to the domain? I don't know anything about this. Also should their be a standard set on how long you can let a VM with a snapshot run before either reverting back or consolidating it because snapshots take up more space? Maybe 1 or 2 days max?

See where I'm going here, I'm just trying to make sure I make the right choice on whether to use snapshots or a clone. Any help would be GREATLY appreciated!!!

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
jguzmanr
Enthusiast
Enthusiast

I usually do a snapshot when I know that the snapshot is only needed for a day or two. Sometimes, the developers need a few days to test their changes, so in that scenarion I do clones.

View solution in original post

0 Kudos
9 Replies
AntonVZhbankov
Immortal
Immortal

Clone VM is an exact copy of production VM, including IP address, DNS name and so on.

If you really need to test patches before applying - create some dummy VMs and test there. Before applying patches to production VMs create snapshots. And of course do a regular backup.

Snapshot is a "quick revert" feature, if something goes wrong. But you still need good old backups on other storage.


---

VMware vExpert '2009

http://blog.vadmin.ru

EMCCAe, MCITP: SA+VA, VCP 3/4/5, VMware vExpert http://blog.vadmin.ru
0 Kudos
weinstein5
Immortal
Immortal

I would use the snapshot because that is what is designed for - the ability to revert a vm back to a state prior to making a change that causes issues. Snapshots only become large when they are left running for long periods of time - a snapshot is not a copy of the VM rather it maintains a log of the changes to the VMs disk along with an image of the system state when the snapshot was taken

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
mchagnon951
Contributor
Contributor

The reason we use a clone is because we do need an exact copy to test with because when we apply the patch or updates we want to make sure it's going to behave the exact same way in PRD. I know a clone will be the exact IP, DNS, Hostname, but we will be turning off PRD once we make the clone and then bring up the clone and do our testing. After we're all done with testing shut down the clone and bring up PRD to apply the patch or updates, this way everything is still intact.

0 Kudos
Rumple
Virtuoso
Virtuoso

In this case you are doing a whole lot of extra work in order to test patching when a snapshot is doing exactly what you are doing with the clone, but with alot less work.

Think of snapshots like using the system restore in XP (except snapshots drop EVERY data change). Another way to think of it is like using Ghost to image the machine and then replacing the system with the image after testing (if necessary), or just leaving the changes.

What you are doing is basically taking an image of a machine, restoring it..testing, then deleitng the image and redoing the work in prod.

Personally if its a half day testing process I would snapshot the VM and then either commit the changes once signed off on, or using the revert button to drop ALL changes including data and going back to the pre-change state.

0 Kudos
AntonVZhbankov
Immortal
Immortal

Use snapshots instead. They work the same way, you have fully operational copy of VM (at the moment you took snapshot) and you can revert to snapshot in a matter of seconds if somehting goes wrong. If all is OK, just delete snapshot (commit changes).


---

VMware vExpert '2009

http://blog.vadmin.ru

EMCCAe, MCITP: SA+VA, VCP 3/4/5, VMware vExpert http://blog.vadmin.ru
0 Kudos
VMmatty
Virtuoso
Virtuoso

VMware makes a product called VMware vCenter Lab Manager that is designed specifically for this scenario. I'm not sure if you're looking to purchase an additional product to accomplish you're goal but this might be worth looking into.

http://www.vmware.com/products/labmanager/

Matt | http://www.thelowercasew.com | @mattliebowitz
jguzmanr
Enthusiast
Enthusiast

I usually do a snapshot when I know that the snapshot is only needed for a day or two. Sometimes, the developers need a few days to test their changes, so in that scenarion I do clones.

View solution in original post

0 Kudos
petedr
Virtuoso
Virtuoso

What I used to do when i ran a Vmware infrasructure we did a combination of the both.

For application development changes and patches we would first clone back the production VM. This provided the production base for testing. Then we would apply a snapshot on the cloned VM in order to do the tests. If there was a problem we would revert on the cloned VM and start the tests again,

As others were stating as well I also don't like keeping snapshots on production VMs for any period of time.

www.phdvirtual.com, makers of esXpress

www.thevirtualheadline.com www.liquidwarelabs.com
0 Kudos
Erik_Zandboer
Expert
Expert

Labmanager is basically designed for having a set of VMs, which are linked-cloned so that developers can work on the sets individually. Stage manager would come closer for your needs I guess.Stagemanager will guide your VMs rfrom development to testing to production (and back again). But I doubt you want to go and use stage manager unless you have a pretty big shop...

Visit my blog at http://erikzandboer.wordpress.com

Visit my blog at http://www.vmdamentals.com
0 Kudos