1

We're a dev shop so we make heavy use of VMs and snapshots for testing. This works great most of the time, but occasionally I discover some setting in a VM that needs to be changed across all my snapshots.

For example, I recently created a Vista VM and only gave it 512MB of RAM. The VM already has about 18 snapshots, and I'd really, really like to avoid recreating all of them if possible.

Is there a quick way to propagate VMWare-level changes like this across all the VM's snapshots?

I'm using ESX 3.5 but advice from any other versions (especially Workstation) is welcome.

2 Answers 2

3

How long have those snapshots been in place? Typically you don't want a snapshot around longer than a few days otherwise you're liable to run into issues. Best thing I can recommend is either committing those snapshots (might take awhile if they're large/have been running for awhile. Virtual Center might time out but its still deleting in the ESX if its really large). Snapshots are just delta files of a particular VM so there's no way of applying system-wide changes across multiple ones.

Update:

Why snapshots can stop machines for long time: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1002836

VMware Admin guide (PDF): http://www.vmware.com/pdf/vi3_301_201_admin_guide.pdf

Horror story of "the long snapshot" which should be quite painful for you guys if you decide to commit: http://www.vmwarez.com/2006/11/beware-long-snapshot.html

9
  • Are there reasons aside from disk space to avoid keeping snapshots around for long periods of time? Many of our VMs are over a year old and still going strong with dozens of snapshots...
    – sh-beta
    May 28, 2009 at 15:14
  • The problems we've had with stale snapshots have more to do with domain-related problems. If they get old enough the SYSTEM password has cycled, those old snapshots can't get onto the domain. But if you're not in a domain that shouldn't matter.
    – sysadmin1138
    May 28, 2009 at 15:56
  • 1
    Snapshots are deltas from the original VM. When you create a snapshot that file (delta) grows with all changes made against original image. If you create multiple snapshots you keep taking deltas from the previous, etc. VMware doesn't recommend multiple snaps for long periods of time for stability reasons. Remember snaps are for short term stuff. If you're going to keep changes like that for that long just do vmdk or system backups.
    – SQLChicken
    May 28, 2009 at 16:10
  • I am impressed you have had such good luck keeping snapshots around of so much time. In workstation anyway, I have had numerous occasions where snapshots would get corrupt and not be able to start.
    – Brettski
    May 28, 2009 at 17:52
  • 1
    I updated my original answer to links you'll find useful. I can't find the direct documentation about snapshot length but they do warn about it in the Installing and Configuring VMware Infrastructure class.
    – SQLChicken
    May 28, 2009 at 19:12
1

I've used perl search / replace to modify the .vmsn file. If you look at the first part of this file, you'll see the .vmx file.

I was modifying the Virtual Portgroup for all my snapshots, because a network change made this necessary. Snapshots that were reverted used the new portgroup just fine.

The only issue was with .vmsn files that were very large (many GBs), as perl loaded the entire file into memory while changing. I'm sure you can do this more efficiently, but it worked for us on 100's of snapshots.

1
  • Good idea. Can you provide an example script?
    – sh-beta
    Mar 13, 2012 at 23:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .