How to Create and Delete Hyper-V Checkpoints / Snapshots
Checkpoints (see this article for a definition) can be useful for short-term testing when you need a quick way to revert a Hyper-V virtual machine to its prior state, for example, before updating Windows or installing software.
To create and delete checkpoints (aka. snapshots in older versions of Windows Server and Hyper-V), you can issue the following commands from the command line.
To run the commands you’ll need to invoke PowerShell, which resides in the folder:
%systemdrive%\Windows\System32\WindowsPowerShell\v1.0
The scripts below are ready to copy and paste to your batch files (or into BackupChain if need be), for whatever purpose you need them:
Creating Hyper-V Checkpoints / Snapshots
The actual PowerShell command for creating a checkpoint is:
Checkpoint-VM -Name w7 -SnapshotName WorkingSystem
Where “w7” is the virtual machine name and “WorkingSystem” is the desired checkpoint name.
To package the whole thing into a one-liner that can be launched from the command prompt, or from inside a batch file, we invoke PowerShell as follows:
%systemdrive%\Windows\System32\WindowsPowerShell\v1.0\powershell -command "Checkpoint-VM -Name w7 -SnapshotName testsnapshotname"
In order to remotely create a checkpoint for VM “w7” on server “MyHyperVHostName”, we can run the command as follows:
%systemdrive%\Windows\System32\WindowsPowerShell\v1.0\powershell -command "Get-VM W7 –ComputerName MyHyperVHostName | Checkpoint-VM"
Deleting Hyper-V Checkpoints / Snapshots
The command to delete Hyper-V checkpoints is similar but offers more options:
%systemdrive%\Windows\System32\WindowsPowerShell\v1.0\powershell -command "Get-VM w7 | Remove-VMSnapshot –Name testsnapshotname"
Other variations are possible, too, such as deleting all checkpoints whose names begin with a certain phrase:
%systemdrive%\Windows\System32\WindowsPowerShell\v1.0\powershell -command "Get-VM w7 | Remove-VMSnapshot –Name OldSnapshotName*"
And even slicker is the following command, which deletes snapshots of a certain age, here 30 days:
%systemdrive%\Windows\System32\WindowsPowerShell\v1.0\powershell -command "Get-VMSnapshot -VMName w7| Where-Object {$_.CreationTime -lt (Get-Date).AddDays(-30) } | Remove-VMSnapshot"
Backing up VMs with Checkpoints in Hyper-V
As mentioned by Microsoft, when it comes to Hyper V backup, “Checkpoints Are Not Intended for Backup”: (https://technet.microsoft.com/en-us/library/Cc956044.aspx)
In order to have your important Hyper-V VMs backed up and protected, use BackupChain Backup Software. It handles and restores checkpoints automatically, and VMs may also be restored as clones, side-by-side with the original VM without interference.
You may also be interested in
Hyper-V NAS Backup on Synology, Qnap, Netgear, Drobo, Buffalo
Hyper-V Fixed Disk Backup Considerations
Hyper-V Backup Pass-through Disk Considerations
Dynamic Disk Hyper-V Backup Considerations
Backup Software Overview
Server Backup SoftwareDownload BackupChain
Cloud Backup
Backup VMware Workstation
Backup FTP
Backup VirtualBox
Backup File Server
Hyper-V Backup
Backup Hyper-VPopular
- Hyper-V Links, Guides, Tutorials & Comparisons
- Veeam Alternative
- How to Back up Cluster Shared Volumes
- DriveMaker: Map FTP, SFTP, S3 Site to a Drive Letter (Freeware)
Resources
- Free Hyper-V Server
- Remote Desktop Services Blog
- SCDPM Blog
- SCOM Blog
- V4 Articles
- Knowledge Base
- FAQ
- Sitemap
- Backup Education
- Archive 2024
- Archive 2022
- Archive 2021
- Archive 2020
- Archive 2018
- Archive 2017
- Archive 2016
- Archive 2015
- Archive 2014
- Archive 2013
- Hyper-V Scripts in PowerShell
- FastNeuron
- BackupChain (Greek)
- BackupChain (Deutsch)
- BackupChain (Spanish)
- BackupChain (French)
- BackupChain (Dutch)
- BackupChain (Italian)
Backup Software List
BackupChain
Veeam
Unitrends
Symantec Backup Exec
BackupAssist
Acronis
Zetta
Altaro
Windows Server Backup
Microsoft DPM
Ahsay
CommVault
IBM
Other Backup How-To Guides
- Hyper-V Backup for Cluster Shared Volumes
- Hyper-V Cluster 2012 R2 Setup Instructions, Simple and Quick
- What are Hyper-V Checkpoints, Snapshots, and VSS?
- How to Fix: VM cannot be backed up …file groups reported during OnIdentify
- How to Backup VMware Workstation, VMs, VMDK Files
- Avoid Saved State Backup and Check Hyper-V Integration Service Versions Automatically
- How to Fix VolSnap 28 Error “The shadow copy could not be created…
- Hyper-V Stop 0x0000000A BSOD Error Causes and Fixes KB2776366
- Hyper-V Host Disk Backup, Physical Host and Virtual Machine Backup
- How to Fix: MSMQ Writer (MSMQ) failed
- Hyper-V Integration Services Update: Why You Need to Keep Them Up-to-Date at all Times
- How to Convert VHD Files to VHDX Disks in Hyper-V
- File Server Backup Software for Windows
- Slow Cluster Shared Volume–Tips to Speed Up CSV and Backups
- Hyper-V, VMware, and VirtualBox Hypervisor Limitations
- Download Links for Windows 10 & Windows Server Technical Preview
- Backup too Slow: How to Speed Up Backups
- Microsoft Hyper-V Backup for VHD and VHDX VMs
- Best Free Network Attached Storage for Files, Hyper-V, and Backups
- How to Convert from Dynamic VHD/VHDX Disk Format to / from Fixed in Hyper-V