Alexander's Blog

Sharing knowledge with the global IT community since November 1, 2004

Removing Backup Checkpoint in Hyper-V That Has No Delete Option

/
/
img

Hyper-V doesn’t require much maintenance, but once in a while you may see a checkpoint (formerly called snapshot) attached to a virtual machine (VM) that cannot be deleted because the option to delete is unavailable. I have encountered this on Hyper-V running on a Windows Server 2012 R2 Datacenter. One day something went wrong with the server backup and I noticed a checkpoint that I did not create. It was created by a third-party application that I used to backup checkpoints. The checkpoint was called ServerName – Backup, where ServerName was the name of the VM. I wanted to export the VM and didn’t want to have any checkpoints in the backup. I already had a backup of the VM and everything was working fine so I didn’t really care about the backup that system created. When I right-clicked the checkpoint to delete it, I noticed that the option Delete Checkpoint was not available. Here’s what I saw.

 



Notice that the options to Delete Checkpoint and Delete Checkpoint Subtree are missing in the above screenshot. Here’s what the options are for a standard checkpoint.

If you run into this situation, first try the following techniques.

  1. Right-click the host server name in the Hyper-V Manager in the left-hand pane and select Refresh.
  2. Close and re-open the Hyper-V Manager.
  3. Highlight the checkpoint and use the Delete key on the keyboard.

If none of these tips help, then use the PowerShell to get rid of unwanted checkpoint(s). This applies to any checkpoint that you want to delete.

PowerShell Script to Delete a Checkpoint (Snapshot)

To delete a checkpoint in Hyper-V, use the following instructions. The script should work on Hyper-V installed on any operating system, e.g. Windows Server 2008, Windows Server 2012, Windows Server 2016, Windows 10, etc.

  1. Start PowerShell on the computer where the virtual machine is located. I prefer to use PowerShell ISE.
  2. Type the following command and press Enter. The VMSnapshot parameter refers to the VM checkpoint. As I mentioned earlier, the checkpoint used to be called snapshot in Hyper-V before Microsoft changed its name.
    Get-VMSnapshot -ComputerName <Name-of-Computer> -VMName <Name-of-VM> | Remove-VMSnapshot
    The vertical bar is the pipe symbol above the Enter key on a standard keyboard. If your computer is called SERVER1 and the name of the virtual machine is SQLServer, you will use the following command. Make sure you use the name of the VM, not the name of the checkpoint . The following command will work if you have only one checkpoint that needs to be deleted. The -ComputerName <Name-of-Computer> parameter is optional, but you must specify the VMName parameter. In other words, either one of the following commands should work.
    Get-VMSnapshot -ComputerName “SERVER1” -VMName “SQLServer” | Remove-VMSnapshot
    or 
    Get-VMSnapshot -VMName “SQLServer” | Remove-VMSnapshot 
  3. If you have more than one checkpoints then use the -Name <Checkpoint-Name>  parameter at the end. For example, if the VM is called CONTOSO and the checkpoint you want to delete is called CONTOSO – (9/6/2018 – 8:07:13 PM), then the command would like this:
    Get-VMSnapshot -VMName “CONTOSO” -Name “CONTOSO – (6/20/2018 – 10:48:49 AM)” | Remove-VMSnapshot
    Specifying the Name of the Snapshot
  4. As soon as the checkpoint is deleted, Hyper-V will start the merge process in the Hyper-V Manager. Depending on the size of the virtual hard disk, the merge process may take some time so be patient.
  5. If you need to export the virtual machine, you will be able to proceed once the merge is complete.

Article Updated: 9/13/18


Copyright © 2017 SeattlePro Enterprises, LLC. All rights reserved.

  • Facebook
  • Twitter
  • Linkedin

20 Comments

  1. I can simply highlight one of these types of checkpoints and hit the delete key. A merge occurs and the .avhd file is deleted. I have a large on a mail server I am worried about trying this on. If the merge is occurring would I be losing any data deleting these in this way?

  2. Robert, the checkpoints that you can delete are the standard checkpoints (a.k.a. snapshots) that you have created. And that’s why you are able to delete them. My article is about checkpoints that cannot be deleted.

    As far as your question is concerned, you should know that checkpoints are simply snapshots in point that can restore your server to the point when checkpoint was created. If you delete a checkpoint created on 11/19/17, you lose the ability to restore the server back to the time when it was created on 11/19/17. It doesn’t delete your current VM data, it only deletes the checkpoint. If you are not sure who created the snapshot and why, but you know the mail server is currently working fine. You can create a new checkpoint today and then delete the old checkpoint. Another more safer approach is to export the mail server VM first. This will export the entire virtual machine and all the current checkpoints. Then you can get rid of the large checkpoint that you’ve mentioned. Keep in mind, that checkpoint (or snapshots) are not designed to be used as backups. They are designed for specific situations. For example, you are about to install Service Pack 2 on your Exchange Server. You create a checkpoint and then install SP2. If something goes wrong, you can restore the checkpoint which will put it back to the state before SP2 was installed. Once everything is working fine, you should delete the checkpoint.

    As a best practice, remember to rename your checkpoint after it is created so you know the purpose of the checkpoint. For example, “After installing Exchange SP2 – (11/21/2017 – 8:51:44 AM).” Hope this helps!

  3. Thanks for this. I had the same issue where I couldn’t see the delete option but was able to highlight and just hit the delete key and it’s now merging.

    Mine was a recovery checkpoint not a regular checkpoint and that does work per Robert’s comment.

  4. Hey Zubair, Both Robert Stone and Cradz are correct, even when the delete option is not visible in the context menu you can delete using the “Delete” key on your keyboard. I was just about to run the command until I tried it.

  5. Hi Sean, thanks for your feedback. Frankly, I don’t recall if I tried the delete key at the time I wrote the article more than a year ago. I do recall that rebooting the server didn’t make a difference. Anyway, the moral of the story seems to be to try the delete key first. If for some reason that doesn’t work then try the PowerShell script. Thanks again for taking the time to provide feedback.

  6. Hi,
    You use a generic command naming to show us what to do but those generic names are confusing…
    “server1”
    “sqlserver”
    My host is called srv1 and it hosts only 1 vm called srv2
    The checkpoint name I see is “srv2 – (2018-08-29 – 10:01:07 PM)”
    so…what would my command look like?
    Get-VMSnapshot -ComputerName “srv1” -VMName “srv2 – (2018-08-29 – 10:01:07 PM)” | Remove-VMSnapshot

    tx!

  7. Hi Phil, sorry about the confusion. I will try to use non-generic names in the future. You need to specify the VM name, not the name of the checkpoint. Actually, you don’t even have to specify the host server, you can jut use the command Get-VM “srv2” | Remove-VMSnapshot to delete the snapshot.

    Just watch out for the curly quotes though. Sometimes if you copy and paste the quotes from a Web site the command may fail. In that case, copy the text from the Web site into Notepad and then copy from the Notepad and paste it in the PowerShell or Command Prompt to ensure you are pasting pure ASCII text.

    If you only have one snapshot then the command will delete that snapshot. However, if you have multiple snapshots then add -Name to delete the one you want, like this:
    Get-VMSnapshot -VMName “srv2” -Name “srv2 – (2018-08-29 – 10:01:07 PM)” | Remove-VMSnapshot

    Good luck!

  8. Hi ,
    I am using IBM Spectrum Protect backups to backup Hyper-V VMs. Sometimes the checkpoints automatically gets merged with the previous day checkpoint once the backup is completed, but most of the times its creating a new checkpoint for each time backup is taken. So when I delete all the snapshots using the PowerShell, next day again a FULL backup is performed instead of incremental backup. Please advice.

  9. Hi Vignesh, this seems to be an issue with the IBM Spectrum Protect so I would suggest contacting their Tech Support. The backup software controls decides whether to do an incremental or full backup based on certain criteria and mode. Also, whether you are doing a “full incremental backup” or an “incremental-by-date backup” can also make a difference. The default is full incremental. I am not an expert on IBM Spectrum Protect software so you might want to check this article https://www.ibm.com/support/knowledgecenter/en/SSEQVQ_8.1.6/client/r_cmd_incremental.html to see if this helps, and if it doesn’t, then contact them for help. Your issue is not related to the Hyper-V topic in my article. Good luck!

  10. Yeesh, this article was a well written big help, thanks!
    But, I’m still puzzling why the delete option disappears. I had held off doing anything about a run-away snapshot until it blew up my drive because I thought something was wrong with the image and yet, all I had to do this whole time was hit delete ??
    Thanks again!

  11. Didn’t know about the delete key. Thanks! have been powershelling them off in the past much easier.

  12. I have seen this many times when power interruptions occur during backups. Rare but it happens

    Thank you for publishing this solution.

  13. Glad to see it’s not just me experiencing odd things from time to time!! This worked for me as well.

  14. I cannot believe this, but simply closing and then reopening the Hyper-V Manager, suggestion #2 worked! I probably wouldn’t have tried it for days, rebooted and then figured the reboot fixed the issue.

    I am running Veeam on a Server 2016 Hyper-V.

    Thanks for posting this fix.

  15. Sweet. Press the DELETE key, Homer. Never woulda thunk of that! Thank you for posting!

Leave a Comment

Your email address will not be published. Required fields are marked *

This div height required for enabling the sticky sidebar