Home VMware vSphere Snapshot Consolidation

vSphere Snapshot Consolidation

by admin

I’ve written a post recently around creating snapshots using the ESXi CLI. Further to that, I thought I’d cover a bit on Snapshot Consolidation With vSphere 5, a new feature was added to allow you to consolidate snapshots. This was done to address an issue where, when doing a snapshot removal, the delta files would not be merged with the base disk but would be removed from visibility in the vSphere client. This could lead to problems where a VM that didn’t look as though it had any active snapshots, was still actually writing to the delta files.

Now, when a VM has had issues consolidating its snapshots you will see a message on the Summary tab for the virtual machine:

snapshot_consolidation

When you see this, you can run a Consolidation on the virtual machine to commit the delta files to the base disk:

snapshot_consolidate

If you want to test the process, create a snapshot on your virtual machine, then run the following in PowerCLI:

snapshot_consolidation_test

This will remove the snapshot, without committing the delta files. You should immediately get the ‘needs consolidation’ message in the vSphere client. If you look at the contents of the *.vmsd file in the virtual machine’s working directory, you should see the following if consolidation is required:

/vmfs/volumes/4f27b82e-3fc1540e-bf6b-000c295da2d9/XP3 # cat XP3.vmsd
.encoding = "UTF-8"
snapshot.lastUID = "7"
snapshot.needConsolidate = "TRUE"

Using PowerCLI to Find Virtual Machines that need Snapshot Consolidation

You can use PowerCLI to list all VMs that need consolidation by running:

Get-VM | Where-Object {$_.Extensiondata.Runtime.ConsolidationNeeded}

If any are found, you can start a consolidation task by running:

(Get-VM -Name "VirtualMachineNameGoesHere").ExtensionData.ConsolidateVMDisks_Task()

Useful Links and Resources

https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1002310

https://blogs.vmware.com/vsphere/2011/08/consolidate-snapshots.html

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More