Partager via


Hyper-V: Avoid using snapshots on a virtual machine that runs a server workload in a production environment

Applies To: Windows Server 2008 R2, Windows Server 2012

This topic is intended to address a specific issue identified by a Best Practices Analyzer scan. You should apply the information in this topic only to computers that have had the Hyper-V Best Practices Analyzer run against them and are experiencing the issue addressed by this topic. For more information about best practices and scans, see Best Practices Analyzer.

Operating System

Windows Server 2012 or Windows Server 2008 R2

Product/Feature

Hyper-V

Severity

Warning

Category

Operations

Issue

A virtual machine with one or more snapshots has been found.

Impact

Available space may run out on the physical disk that stores the snapshot files. If this occurs, no additional disk operations can be performed on the physical storage. Any virtual machine that relies on the physical storage could be affected.

If physical disk space runs out, any running virtual machine that has snapshots or virtual hard disks stored on that disk may be paused automatically. Hyper-V Manager shows the status of these virtual machines as “paused-critical”.

Resolution

If the virtual machine runs a server workload in a production environment, take the virtual machine offline and then use Hyper-V Manager to apply or delete the snapshots. To delete snapshots, you must shut down the virtual machine to complete the process.

Before you perform the following procedure, decide whether you want to apply or delete each snapshot:

  • When you apply a snapshot to a virtual machine, the current virtual machine is reverted back to the state and configuration that it was in when the snapshot was taken. After the snapshot is applied, the virtual machine is either in a saved state or stopped, depending on whether the virtual machine was running or stopped when the snapshot was taken.

  • When you delete a snapshot, the state and configuration stored in the snapshot are discarded. This has no effect on the current state of the virtual machine or any other snapshots. To complete the process and recover the space used by the snapshot, shut down or save the state of the virtual machine. Deleted snapshot files are not removed from their storage location while a virtual machine is running or paused.

Warning

Do not delete .avhd files directly from the storage location. Instead, use Hyper-V Manager to select the virtual machine, and then delete the snapshots from the snapshot tree.

By default, membership in the local Administrators group, or equivalent, is the minimum required to complete this procedure. However, an administrator can use Authorization Manager to modify the authorization policy so that a user or group of users can complete this procedure. For more information, see Using Authorization Manager for Hyper-V Security (https://go.microsoft.com/fwlink/?LinkId=142886).

To apply or delete the snapshots

  1. Open Hyper-V Manager. Click Start, point to Administrative Tools, and then click Hyper-V Manager.

  2. In the results pane, under Virtual Machines, select a virtual machine. All snapshots associated with that virtual machine are listed in the Snapshots pane.

  3. Right-click a snapshot and then click Apply or Delete Snapshot. Confirm the action in the dialog box that follows.

Additional references

For more information about snapshots, see Hyper-V Virtual Machine Snapshots: FAQ (https://go.microsoft.com/fwlink/?LinkID=168819).