Correcting Snapshot Chains

by Mike · 0 comments

in ESXi,Tips and Tricks,VMware

Working with a new backup product here and we’re having a few issues with snapshots getting out of order and getting disk consolidation alarms, but are unable to do so.

The fix I use is this shell command and then manually edit the VMDKs (not the -flats) and point to the correct parent disks:

grep “CID=” `ls *.vmdk | grep -v ‘delta\|flat’`

That outputs the following:

SERVERNAME-000001.vmdk:CID=da409ac4
SERVERNAME-000001.vmdk:parentCID=da409ac4
SERVERNAME.vmdk:CID=59111937
SERVERNAME.vmdk:parentCID=ffffffff
SERVERNAME_1-000001.vmdk:CID=014da149
SERVER1_1-000001.vmdk:parentCID=014da149
SERVER1_1.vmdk:CID=0dfb62a4
SERVER1_1.vmdk:parentCID=ffffffff
SERVER1_2-000001.vmdk:CID=182d97e6 <–in this case, the child, parentCID and actual parent have the same CID. So here you can just changed the snapshot’s CID to something random.
SERVER1_2-000001.vmdk:parentCID=182d97e6
SERVER1_2.vmdk:CID=182d97e6
SERVER1_2.vmdk:parentCID=ffffffff

As you can see, the “parentCID” for the snapshots is the same as the child CID itself. The snapshot is pointing to itself as the parent.

So, after editing, this is how it should look:

SERVERNAME-000001.vmdk:CID=da409ac4
SERVERNAME-000001.vmdk:parentCID=59111937
SERVERNAME.vmdk:CID=59111937
SERVERNAME.vmdk:parentCID=ffffffff
SERVERNAME_1-000001.vmdk:CID=014da149
SERVER1_1-000001.vmdk:parentCID=0dfb62a4
SERVER1_1.vmdk:CID=0dfb62a4
SERVER1_1.vmdk:parentCID=ffffffff
SERVER1_2-000001.vmdk:CID=thevlab1
SERVER1_2-000001.vmdk:parentCID=182d97e6
SERVER1_2.vmdk:CID=182d97e6
SERVER1_2.vmdk:parentCID=ffffffff

You can now consolidate your disks.

Leave a Comment

Previous post: