Search code examples
automationvmwarevirtualizationvirtualboxwindows-update

How to keep a tree of VM snapshots up to date with Windows Update?


For testing our product's installer, I maintain a tree of virtual machine snapshots with different previous versions installed. It is a tedious task to do Windows Update, re-snapshot, delete parent snapshot on each VM.

Is there an automated solution for keeping a group of VMs up-to-date? I use VirtualBox but have access to VMware Workstation and would switch if maintenance would improve.


Solution

  • We keep a baseline of VMs in a library of sorts. They're are about 20-odd (with mixtures of different versions of Java, DB2, WAS and so on) that the development and test teams can copy out for their own use.

    The librarian (developer, doing this part-time) is responsible for keeping them up to date. What they'll do is copy one of the VMs every week or so, boot it and install all updates, then copy the updated VM back over the original. This means it's available for checking out except when the copy operation is being done. Additionally, the number of VMs that need to be updated is minimized by virtue of the fact that they're shared.

    That's how we do our snapshots, by copying the directories partially because it's easier to manage but mostly because we're too tight to buy the workstation version :-) We use the player instead.

    It's mostly automated since all the VMs grab their updates from our SUS server and we know when they have updates ready to go. The librarian is notified by a script which VMs need to be updated and just has to run another script which copies the VM and starts the copy.

    Once the librarian is satisfied the copy is up to date, they shut it down and yet another script copies that VM back into the library and updates its status.