Skip to main content

Managing Snapshots in Hyper-V

Taking snapshots

Taking a snapshot is a very easy process. Just remember a few considerations first.

1. Make sure the disk that is holding the virtual machine (VM) folder has the disk space for a snapshot.

2. Make sure the VM is either running, or shutdown. You cannot take a snapshot while the VM is paused.

3. Snapshots are not supported in a production environment. Snapshots are good for lab or test environments.

4. Snapshots are not a replacement for regular backups.

You can take a snapshot in one of two ways; you can right click a VM in Hyper-V Manager and select Snapshot. Your other option is to click on the VM in Hyper-V Manager and click Snapshot from the VM specific menu in the lower left hand corner of the Hyper-V Manager.

clip_image001

It will take several seconds for the snapshot to appear in the Snapshots window.

 
 
Reverting snapshots

Snapshots make it very easy to go back to a point-in-time. You can easily reset a VM back to its current snapshot by doing a Revert. To Revert a VM, right click the VM in Hyper-V Manager. Click Revert.

clip_image002

This will make the VM fall back to the last Snapshot taken or the last snapshot applied, whichever is the case.

 
 
merging snapshots

Merging a snapshot is the result of deleting a snapshot from Hyper-V. To merge a snapshot into its parent, right click the snapshot to delete and select Delete Snapshot Subtree. Click Delete when prompted.

clip_image003

A word of caution on this procedure. Take a look at the example below:

clip_image004

If I were to merge the snapshot label VTEC1 with its parent Network Base 1, the results would be catastrophic for the snapshots 6416C – AD Recycle Bin and 6420 No DHCP. That is because differencing disks are used for snapshots. All three snapshots in questions are children of Network Base 1. By merging VTEC1 into Network Base 1, I make the other two snapshots unusable.

Perform this procedure with caution.

 
 
Deleting snapshots

From time to time it is good practice to remove snapshots that you no longer need. This will help to conserve on disk space and help to make the VM more portable.

In Hyper-V Manager, right click the snapshot you want to delete and click Delete Snapshot.

clip_image005

Then click Delete when prompted.

The Snapshot will be removed from the list and the disk.
 
 
Applying snapshots;

Applying a snapshot is very easy to do. You can apply a snapshot with the VM running or turned off. In Hyper-V Manager, you apply a snapshot in one of two ways. Right click the snapshot and Click Apply or click the Snapshot and click Apply from the VM menu on the lower left.

clip_image007

Hyper-V will asked you if you want to just apply the Snapshot or if you want to take one of the current machine state before applying the snapshot you selected.

clip_image008

The VM will now be configured to that snapshot.

Comments

Popular posts from this blog

Adding a Comment to a GPO with PowerShell

As I'm writing this article, I'm also writing a customization for a PowerShell course I'm teaching next week in Phoenix.  This customization deals with Group Policy and PowerShell.  For those of you who attend my classes may already know this, but I sit their and try to ask the questions to myself that others may ask as I present the material.  I finished up my customization a few hours ago and then I realized that I did not add in how to put a comment on a GPO.  This is a feature that many Group Policy Administrators may not be aware of. This past summer I attended a presentation at TechEd on Group Policy.  One organization in the crowd had over 5,000 Group Policies.  In an environment like that, the comment section can be priceless.  I always like to write in the comment section why I created the policy so I know its purpose next week after I've completed 50 other tasks and can't remember what I did 5 minutes ago. In the Group Policy module for PowerShell V3, th

Return duplicate values from a collection with PowerShell

If you have a collection of objects and you want to remove any duplicate items, it is fairly simple. # Create a collection with duplicate values $Set1 = 1 , 1 , 2 , 2 , 3 , 4 , 5 , 6 , 7 , 1 , 2   # Remove the duplicate values. $Set1 | Select-Object -Unique 1 2 3 4 5 6 7 What if you want only the duplicate values and nothing else? # Create a collection with duplicate values $Set1 = 1 , 1 , 2 , 2 , 3 , 4 , 5 , 6 , 7 , 1 , 2   #Create a second collection with duplicate values removed. $Set2 = $Set1 | Select-Object -Unique   # Return only the duplicate values. ( Compare-Object -ReferenceObject $Set2 -DifferenceObject $Set1 ) . InputObject | Select-Object – Unique 1 2 This works with objects as well as numbers.  The first command creates a collection with 2 duplicates of both 1 and 2.   The second command creates another collection with the duplicates filtered out.  The Compare-Object cmdlet will first find items that are diffe

How to list all the AD LDS instances on a server

AD LDS allows you to provide directory services to applications that are free of the confines of Active Directory.  To list all the AD LDS instances on a server, follow this procedure: Log into the server in question Open a command prompt. Type dsdbutil and press Enter Type List Instances and press Enter . You will receive a list of the instance name, both the LDAP and SSL port numbers, the location of the database, and its status.