8

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!

Burhan Ali
  • 153
  • 1
  • 3
  • 13
Scott Szretter
  • 1,860
  • 11
  • 42
  • 66
  • 2
    Can you clone it? – Chopper3 Jul 14 '12 at 22:38
  • So I tried and it ran for a long time (hours). Near the end, it finally came up with an error "error caused by file [datastore1] myvm/myvm-000255.vmdk. So it failed cloning. – Scott Szretter Jul 15 '12 at 01:51
  • Now when I try to consolidate snapshots, instead of failing right away with the 255 or more error, it runs for a while, then an error message shows failed because it could not allocate memory. Yet there is about 60% free (out of 16 gigs). – Scott Szretter Jul 15 '12 at 04:36
  • 2
    I think it's time to place a support call to be honest. – Chopper3 Jul 15 '12 at 07:23
  • 1
    [This](http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1004545) may help, it explains how to consolidate a snapshot. – JMeterX Jul 16 '12 at 13:09

3 Answers3

3

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

Gene
  • 31
  • 2
2

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

Hanno S.
  • 166
  • 3
  • Thanks for this - helped me out - you might want to emphasize to consolidate to the next last snapshot - it was not immediately clear to me :) – cairnz Oct 23 '17 at 18:20
0

Although this isn't really a "fix" as such, and may not be of use to a production server, when I've been faced with issues like this in the past I find the easiest solution is just to use Vmware converter to v2v the machine, this provides an identical machine with a single vmdk per disk and is done with an agent within the VM, rather than at the hypervisor level, so it isn't aware of snapshots.

Alex Berry
  • 2,307
  • 13
  • 23