Should virtual machine snapshots be used in production? [Hyper-V]

With all of the information that I have been talking about around snapshotting – one conversation that I have often is whether people should use virtual machine snapshots in production environments (note that this is virtual machine snapshotting I am talking about – not VSS snapshots which are great for backing up production virtual machines).

The short answer is “Virtual machine snapshots are supported in production environments, but not recommended.”  The longer answer is that there are a number of issues you should consider before deciding to use virtual machine snapshots in a production environment.  The are as follows:

  • Performance: as virtual machine snapshots use differencing disks, there is a performance overhead to be considered.  This overhead is not too noticeable if you are already using dynamically expanding virtual hard disks, and you only plan to have a small number of snapshots around.  If you are using fixed size virtual hard disks – then there will be a noticeable performance hit to using a virtual machine snapshot.
  • Disk space: once again, because virtual machine snapshots use differencing disks, there is an added disk space usage involved with having a virtual machine snapshot.  This is not too significant if you are using dynamically expanding virtual hard disks – but is more pronounced if using fixed size virtual hard disks (hint: do not use fixed size virtual hard disks and virtual machine snapshots together, it works but does not make a lot of sense as you lose most of the benefits of using fixed size virtual hard disks).
  • Downtime: if you create a virtual machine snapshot and then delete it, you will have to turn the virtual machine off at some point in the future to let the snapshot AVHD file merge in. 
  • Clustering: unfortunately, if you use snapshots on a virtual machine that is part of a cluster, the snapshots will have incorrect network configurations after they have been moved from one node to another.
  • Physical disks: if a virtual machine has a physical disk connected directly to it – you cannot use virtual machine snapshots.

So in summary: if you are using dynamically expanding virtual hard disks, have planned the location of your snapshot files, and can tolerate downtime at a later point in time to allow deleted snapshot files to merge – then go for it.  Otherwise you may want to carefully consider the usage of virtual machine snapshots in production.

As a side note – the reason that I most often here for people using virtual machine snapshots in production environments is that they want to have a safe point to return to before applying a patch / installing new software / making a configuration change.  While it is a bit more work you can use VSS snapshots just as well for this sort of scenario – and you avoid the issues that I have outlined above.

Cheers,
Ben