Freigeben über


Simultaneous Snapshot Trick

This came up in a discussion with one of the virtualization MVPs the other day.  How do you snapshot a complex demo environment that contains multiple virtual machines that are networking with each other?

The problem here is that the Hyper-V manager serializes operations like saving state and taking snapshots – which is to say that if you select a bunch of virtual machines and choose to snapshot them; we will snapshot the first one, then the second one, and so on.  This means that you could end up with virtual machine snapshots that are minutes apart in time – which could cause problems.

There is a simple, but not obvious, way to get around this.

The first thing you do is select all the virtual machines you want to snapshot and “pause” them.  This is a very quick operation and all virtual machines will be paused in a second or two.  Unfortunately, you cannot snapshot a paused virtual machine.  But you can put a paused virtual machine into a saved state – which is the second step (select the paused virtual machines and “save state” them).

Once the virtual machines are all in a saved state – you can now take a snapshot of the virtual machines.

When this is complete you can start the virtual machines running again – and now you have a set of virtual machine snapshots that were all taken in a very small window of time (from the perspective of the software running inside the virtual machines).

I figured this trick out when I was trying to do a demonstration of clustering inside virtual machines.  I had a domain controller, iSCSI server and two cluster nodes.  I wanted to use snapshots so I could repeatedly practice the demo – but I needed to snapshots to be at practically the same point in time – or the cluster would have all sorts of problems when I restored the snapshots.  This process worked perfectly for me.

Cheers,
Ben

Comments

  • Anonymous
    March 24, 2011
    Or you could do it without any risk shutting down all the VMs, snapshotting them and power on them again. This for sure will be an exact same time for all VMs. Cheers, Akuma.

  • Anonymous
    March 24, 2011
    Very slick, not sure I'll ever need to perform this task, but it's always better to know how to do something and not need it then....well, you know the rest. Thanks again for the great tip!

  • Anonymous
    April 03, 2011
    The comment has been removed

  • Anonymous
    April 01, 2014
    Hey Ben, Recently, we've been hosting a number of environments like this for training.  We frequently see when we restore these environments from a running snapshot, the Domain Controllers rebooting into safe mode. This is new to 2012 HV.   Has anything changed that you know of? Cheers and thanks, Mezz