How to Delete VPS Snapshots

How to Delete VPS Snapshots

Method 1: Directly delete a snapshot on Hyper-V Manager or PowerShell

1.  Directly delete a snapshot on Hyper-V Manager

Select a snapshot and delete it via the Delete Snapshot or Delete Snapshot Subtree option on Hyper-V Manager.
 
 
If the deletion fails, try to create a new snapshot , right-click on the topmost one and choose Delete Snapshot Subtree.
 
 

2.  View and delete snapshots via PowerShell.

View snapshots of the VM:
Get-VMSnapshot -VMName “Tracy.server.com”
 
 
Delete all the snapshots of the VM:
Get-VMSnapshot -VMName “Tracy.server.com” | Remove-VMSnapshot 
 
Delete a specific snapshot of the VM:
Get-VMSnapshot -VMName “Tracy.server.com” -Name “Tracy.server.com - (8/23/2020 - 10:47:31 PM)” | Remove-VMSnapshot
 
 

Method 2: Create a new snapshot, export it and import it as a new VM

  1. Create a brand new snapshot.
  2. Shutdown the original VM.
  3. Export the newly created snapshot.
  4. Import the snapshot as a new VM.
  5. Remove the original VM and replace it with the newly imported VM.
  6. Check if the new VM can be used as before: network, RDP connection, management via CP, etc.
Tips: If you cannot manage (reboot, shutdown, turn off and start) the VM on Control Panel, please detach and import the new VM.
 
 

Method 3: Manually merge AVHDs and VHD, and restore a new VM via merged VHD

1. Sort out chain of the snapshot structure/AVHD.

 Before start merging, it’s necessary to determine and sort out snapshot chain.  
  • Click Inspect Disk on Hyper-V Manager.
  • Select one of the AVHD files.
 
  • Click Inspect Parent to get its parent, and then Inspect Parent again, until the end.
 
  • Write down parent of each AVHD/snapshot.
 

2. Merge AVHD to VHD.

  • Click Edit Disk on Hyper-V Manager.
 
  • Select the child AVHD that will be merged and then choose Merge.
 
  • Click Next and select To the parent virtual hard disk and click Finish.
 
  • Repeat the above steps until all AVHDs are merged to VHD.
 

3. Shutdown the original VM.

 

4. Restore a new VM from the merged VHD.

Solution 1: Copy the merged VHD, and manually create a new VM with the VHD.
Solution 2: Create a new snapshot, export it and import it as a new VM.
 

5. Remove the original VM and replace it with the newly created one. Check whether it can be used as before: network, RDP connection, management via CP, etc.

Tips: If you cannot manage (reboot, shutdown, turn off and start) the VM on Control Panel, please detach and import the new VM.

Add Feedback