vmware esxi 5, cant create snapshots and consolidate fails, how to delete old or consolidate redo logs?

I have a VM that seems to be working ok, but when VMWare DR (or I) tries to create a snap shot, it fails, and when I view the summary page of the VM it has a warning at the top showing that the disks need to be consolidated.

So I go to snapshot manager for the VM and choose consolidate (in snapshot manager, there are no snapshots actually listed by the way). If fails with this error:

This virtual machine has 255 or more redo logs in a single branch of its snapshot tree. The maximum supported limit has been reached, creating new snapshots will not be allowed. To create new snapshots, please delete old snapshots or consolidate the redo logs.

If I browse the data store (which has plenty of free space, 2 TB and this vm is under 40gb), in the vm folder, I do in fact see a bunch of files, numbered all the way to 0255:

  • myvm-000255-ctk.vmdk
  • myvm-000255-delta.vmdk
  • myvm-000255.vmdk

How can I clean all this up? Is there an SSH command line command or can I delete some of the files safely? Thanks!


Here is KB about fixing this problem. I did not move staff around but just committed few snapshots in the middle to get to more manageable count and then used "Consolidate"...

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


What I did is the following:

Use with caution and do not copy commands blindly. Your actual file names, numbers, locations, etc. might vary. You should have backups of your data!

While the virtual machine is still running:

/vmfs/volumes/XXXXXXXXX/myvm # mkdir consolidate
/vmfs/volumes/XXXXXXXXX/myvm # vmkfstools -e myvm-000254.vmdk 
Disk chain is consistent.
/vmfs/volumes/XXXXXXXXX/myvm # vmkfstools -i myvm-000254.vmdk -d zeroedthick consolidate/myvm.vmdk

This consolidates all snapshots up to snapshot no. 254 in a single disk in consolidate/myvm.vmdk. We can do that since actual write activity is only on myvm-000255.vmdk (The last snapshot of the disk).

Keep in mind your actual numbers may vary.

Now shut down the VM.

Remove the VM from inventory.

/vmfs/volumes/XXXXXXXXX/myvm # mkdir backup
/vmfs/volumes/XXXXXXXXX/myvm # mv *.vmdk backup/
/vmfs/volumes/XXXXXXXXX/myvm # cp backup/myvm-000255*.vmdk consoldidate/

Edit consolidate/myvm-000255.vmdk:

Change parentCID to the CID entry of consolidate/myvm.vmdk (In my case this was already ok, since vmkfstools -i seems to keep the CID.)

Change parentFileNameHint:

parentFileNameHint="myvm.vmdk"

Now copy the files from consolidate/ back in place:

/vmfs/volumes/XXXXXXXXX/myvm # mv consolidate/*.vmdk .
/vmfs/volumes/XXXXXXXXX/myvm # rmdir consolidate
/vmfs/volumes/XXXXXXXXX/myvm # vmkfstools -e myvm-000255.vmdk
Disk chain is consistent.

Reregister your VM.

Power up your VM.

Now you can use the consolidate option in vSphere Web Client to consolidate the last delta while the VM is already running.

If everything is running fine you can delete the backup folder.

In general a good resource for manual VMWare disk editing is: http://sanbarrow.com/vmdk-handbook.html