VMware: Unable to consolidate VM

We had an alert in VCenter on a particular VM stating that ‘Virtual machine disk consolidation is needed’. I shut down the VM out of hours, right clicked on the VM then clicked ‘Snapshot’ and ‘Consolidate’ as suggested by VMware here (https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2003638)

As soon as I did this I received the following alert:

Status: An error occurred while consolidating disks: Could not open/create change tracking file

Using KB2013520 (https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2013520) I discovered the problem was possibly corrupt CTK files. I resolved it taking the following steps:

1. Shutdown affected VM

2. I then discovered which host the VM resided on in Vcenter and then logged onto it via ssh. I also discovered the datastore the host was using as I would need to browse to this directory.

2. I created a ‘tmp’ folder in the VM’s directory on vmfs/volumes/$LUN/$VM

3. Moved all CTDK files into the tmp directory ( mv *-ctdk.vmdk /tmp ) 

4. Back in VCenter I attempted to consolidate the snapshots again – this time it worked.

5 . Finally I powered on the VM. All good!