Search This Blog

Tuesday, April 22, 2014

Remove Unwanted Checkpoint By Using Powershell

 

In today post, we are going to look on how to check and remove unwanted checkpoint created by user. In my scenario, we do encountered customer who love to create a checkpoint and some till multi-level nested checkpoint . Eventually problem wont start now but soon you may encounter problem such as:-

  • Unable to boot up virtual machine due to lack of free hard disk space. Each time we create a checkpoint, avhd file is created and this occupied hard disk space.
  • Virtual machine performance start to degraded. Once an avhd file is created, your VM will act like differencing disk which consist of parent disk and child disk. Every new data write into the VM will store in avhd file.
  • Corruption occur due to unavoidance circumstance. In order to boot up the VM, you may need to create a new virtual machine configuration and merge existing checkpoint. When this happened, most likely 50% , you will encountered data lost.

Do take note that Checkpoint must handle with care and not meant to replace your backup solution.

Best practice when using checkpoint

  • Don’t leave the checkpoint on your system for quite sometimes.
  • Remove unwanted checkpoint after finish testing and when no longer require.
  • Do be careful when revert snapshot as you may encountering data lost. Make sure, no new data is coming into the VM after create a checkpoint
  • Avoid using checkpoint as backup solution. Use DPM or third party backup software to protect your virtual machine and application data.

Now let look on how to check if checkpoint exist on your virtualization environment:-

For single VM

  • Use Hyper-V Manager snap-in to verify.

For multiple VM, it will be east if we use Powershell

  • Use Powershell Get-VMSnapshot cmdlet
Get-VMSnapshot –VMname *

SNAGHTML53bd1d5

In my scenario above, we identified which virtual machine consists of checkpoint and also when is the creation time.

Well, time to do some clean up!

Execute Remove-VMsnapshot cmdlet

  • Remove a particular checkpoint on a Virtual machine
Remove-VMSnapshot –VMName (Virtual machine name)
  • Remove entire checkpoint in your virtualization environment. This will search entire virtual machine and restore any checkpoint.
Remove-VMSnapshot –VMName *

Once remove the snapshot, the system will merge the checkpoint and remove the temporary avhd file without turn off your virtual machine.

Note:-

  • Above scenario is applicable for Windows Server 2012 Hyper-V and Windows Server 2012 R2 Hyper-V.