Managing Hyper-V Snapshots (Part 2)

by [Published on 3 Oct. 2013 / Last Updated on 31 Oct. 2013]

This article continues the discussion on Hyper-V snapshot management by explaining the snapshot creation process.

If you would like to read the other parts in this article series please go to:

Introduction

In the previous article in this series, I spent a considerable amount of time cautioning you about all the bad things that could potentially happen if you were to use snapshots in a reckless manner. Even so, the snapshot feature simply would not exist if it were not useful. Snapshots can be very handy when they are properly used. In this article, I will walk you through the process of using snapshots.

Before I Begin

Before I get started, I need to quickly point out that although much of the information that is presented in this article applies to all versions of Hyper-V, I am basing the article on Windows Server 2012 and Hyper-V 3.0.

Creating a Snapshot

Hyper-V makes it easy to create snapshots. To do so, open the Hyper-V Manager, right click on the virtual machine that you want to snapshot, and select the Snapshot command from the resulting shortcut menu, as shown in Figure A. When you do, the snapshot will be created.

Image
Figure A: Right click on the virtual machine and select the Snapshot command from the resulting shortcut menu.

As you can see, the process of creating a snapshot couldn’t be any easier. Windows doesn’t make you answer any prompts or work through any wizards. When you choose that Snapshot command from the shortcut menu, the snapshot is made right then and there, no questions asked.

As you look at the figure above, you will notice that the snapshot was created on a virtual machine that is not currently running. However, Hyper-V does allow you to snapshot a virtual machine regardless of whether it is running or not.

Once you have made your first snapshot of a virtual machine, you will see the snapshot appear in the Snapshots portion of the Hyper-V Manager, as shown in Figure B.

Image
Figure B: The Snapshots pane displays the snapshots that have been created.

As you look at the figure above, you will see two pieces of information shown in the Snapshots pane. The first is the word Core, followed by a date and time stamp. The second thing that you will see is the word Now. Although these items might seem a little bit cryptic at first, there is actually a very simple explanation for them.

As I explained in the previous article, when you create a snapshot you are not actually creating a copy of the virtual machine. What you are actually creating is a differencing disk. At the time that the snapshot is created, the original virtual hard disk becomes read only and all write operations are redirected to the differencing disk that was created as a part of the snapshotting process. Snapshots provide rollback capabilities because the original virtual hard disk remains in a pristine state once it has been flagged read-only.

With this explanation in mind, let’s take a look back at the screen capture shown above. The first item in the Snapshots pane is the word Core and a date and time stamp. Core is the name of the virtual machine, and the date and time stamp reflect the date and time when the snapshot was created.

You can actually think of this another way as well. While it is true that the date and time stamp correspond to when the snapshot was created, it is also true that the date and time stamp reflect the point in time when the original virtual hard disk became read-only.

The word Now reflects the current state of the virtual machine. It actually points to the differencing disk where write operations are currently being redirected. Therefore, in the screen capture above the word Core corresponds to the virtual machine as it existed before the snapshot was created, and the word Now corresponds to the virtual machine as it exists at this current point in time.

This naming convention works, but it isn’t perfect. Imagine for a moment that you were hired as a consultant by an organization that ran Hyper-V. Now, imagine that you open the Hyper-V Manager and saw the screen capture shown above. You could tell by looking at the console that a snapshot was created of a virtual machine named Core on March 1, 2013 at 8:43 PM. What you would not be able to tell however, is why the snapshot was created.

At first, not knowing the reason for why a snapshot was created might not seem like such a big deal. But keep in mind what I said in the first part of this article series. Hyper-V snapshots have the potential to degrade read performance on virtual machines. The more snapshots that you accumulate for a virtual machine, the worse read performance generally becomes. That being the case, you really don’t want to hang on to any unnecessary snapshots. Herein lies the problem. You can’t get rid of a snapshot if you don’t know why the snapshot was created in the first place.

The solution to this problem is quite simple. Hyper-V allows you to rename snapshots. Doing so allows you to enter a descriptive name which conveys the reason for why the snapshot was created.

If you want to rename a snapshot, then all you have to do is right click on the snapshot and then choose the Rename command from the resulting shortcut menu. Upon doing so, you can enter a new name for the snapshot.

Going back to the previous figure, I want to clarify that you can never rename the virtual machine’s current state. As such, right clicking on the word Now will not reveal a Rename option. You can only rename previous virtual machine states. In this case for example, you can rename the state that corresponds to the original virtual hard disk. You can see with this looks like in Figure C.

Image
Figure C: You can rename a virtual machine’s previous state by right clicking on it and choosing the Rename option from the resulting shortcut menu.

Renaming a virtual machine snapshot can be handy if you plan on hanging on to the snapshot for an extended period of time. However, renaming a snapshot should be considered to be an absolute must if you plan on creating multiple snapshots of the virtual machine.

Imagine for example that a virtual machine has ten different snapshots (which isn’t recommended for performance reasons). Now imagine that the decision is made to revert the virtual machine back to a state as it existed at an earlier point in time. How will you know which snapshot to use? Unless you have taken the time to assign a descriptive name to each snapshot then the only thing that you will have to go on is a date and time stamp. If you really want to get a feel for just how messy this can be, then take a look at Figure D and imagine trying to figure out which snapshot should be restored.

Image
Figure D: It can be confusing to try to figure out which snapshot to restore unless you use descriptive snapshot names.

Conclusion

As you can see, Hyper-V 3.0 makes it very easy to create virtual machine snapshots. In Part three of this article series, I will conclude the discussion on snapshot management by showing you how to delete and apply snapshots.

If you would like to read the other parts in this article series please go to:

 

Advertisement

Featured Links