While the system can technically create up to 254 snapshots for one virtual disk, VMware only supports up to 32 snapshots in a linear sequence (a single branch). To understand what we mean by a 'single branch', consider this example of a snapshot tree:
Base VM Virtual Disk
│
├── Snapshot 1
│ │
│ ├── Snapshot 2
│ │ │
│ │ ├── Snapshot 3
│ │ │ │
│ │ │ ├── Snapshot 4
│ │ │ │ │
│ │ │ │ └── Snapshot 5 <-- This is one branch with 5 snapshots
│ │ │ │
│ │ │ └── Alternative Snapshot Path 1
│ │ │
│ │ └── Alternative Snapshot Path 2
│ │
│ └── Alternative Snapshot Path 3In this example, the path from Base VM through Snapshot 1, 2, 3, 4, and 5 represents a single branch. The vCenter and ESXi operating systems are designed to handle up to 32 snapshots in such a linear sequence for optimal performance and stability. While you may see other branches form (shown as Alternative Paths in the diagram), the 32-snapshot limit applies to any single path from the Base VM to the end of a branch.
The vCenter and ESXi operating systems therefore aren't designed to handle more than 32 snapshots in one branch.
Confirm that a complete and verified backup of the virtual machine is available prior to performing any maintenance actions.
Power off the affected virtual machine to eliminate active guest I/O and lock contention on the snapshot chain.
Clone the virtual machine using the vSphere Client to collapse the snapshot chain into a single base virtual disk:
a. In the vSphere Client inventory, right-click the virtual machine and select Clone > Clone to Virtual Machine.
b. Follow the prompt wizard to assign a name and specify the target compute resource.
c. Select the destination datastore and the appropriate VM Storage Policy.
d. Complete the wizard to initiate the clone task. The cloning process reads through the snapshot chain and consolidates all delta disks into a single base disk on the target virtual machine.
Once the clone operation completes successfully, power on the cloned virtual machine and verify guest operating system and data integrity. If the the Clone operation fails proceed to manual process.
Edit settings... > Advanced ParametersAttribute field for ctkEnabledFALSEvim-cmd vmsvc/getallvms |grep <vm_name>Example output:
vim-cmd vmsvc/getallvms |grep testvm1
17 testvm1 [datastore1] testvm1/testvm1.vmx windows8Server64Guest vmx-13esxcli storage filesystem list |grep <datastore name>Example output:
esxcli storage filesystem list |grep datastore1
/vmfs/volumes/abc######-######### datastore1 abc######-######### true NFS 347967913943040 258073703899136cd /vmfs/volumes/abc######-#########/testvm1ls -lExample output:
-rw------- 1 root root 369 Jan 31 14:12 testvm1-000240.vmdk
-rw------- 1 root root 64424509440 Jan 31 14:12 testvm1-000240-delta.vmdk
-rw------- 1 root root 635 Jan 31 14:12 testvm1.vmdkvmkfstools -i "<path to VM><highest snapshot number>" "<path to VM><vm name>_consolidated.vmdk" -d thinExample: Notice that we only use the vmdk descriptor file names in the command, not the -flat, -delta, or -sesparse file names:
vmkfstools -i "/vmfs/volumes/abc######-#########/testvm1/testvm1-000240.vmdk" "/vmfs/volumes/abc######-#########/testvm1/testvm1_consolidated.vmdk" -d thincp <vmx file name> <vmx file name>.bakExample:
cp testvm1.vmx testvm1.vmx.bakExample:
vi testvm1.vmx
# Find disk reference to the file you used in the consolidation command (press / then type):
/testvm1-000240.vmdk
# Where you find the file change line from:
scsi0:0.fileName = "testvm1-000240.vmdk"
# To:
scsi0:0.fileName = "testvm1_consolidated.vmdk"
# Save and exit (press ESC, then type):
:wqvim-cmd vmsvc/reload <Vmid>. See KB Reloading a vmx file without removing the virtual machine from inventory for more details.Snapshots > Take SnapshotOKSnapshots > Manage SnapshotsDeleteSnapshots > ConsolidateIf Initial Consolidation Fails with below error then rerun the command with -v100 to get more details on why the process is failing.
Failed to open '/vmfs/volumes/Datastore/VM_Name/VM_Name-000254.vmdk': The parent of this virtual disk could not be opened (23). [root@esx004:/vmfs/volumes/Datastore/VM_Name]If you see error "Too many open files" in the output stack then you will need to do an incremental consolidation.
vmkfstools -i "/vmfs/volumes/abc######-#########/testvm1/testvm1-000030.vmdk" "/vmfs/volumes/abc######-#########/testvm1/testvm1_consolidated30.vmdk" -d thinvi testvm1-000031.vmdkOriginal content example:
# Disk DescriptorFile
version=1
encoding="UTF-8"
CID=4b1240c1
parentCID=4b1240c1
createType="seSparse"
parentFileNameHint="testvm1-000030.vmdk"Modified content:
# Disk DescriptorFile
version=1
encoding="UTF-8"
CID=4b1240c1
parentCID=ffffffff
createType="seSparse"
parentFileNameHint="testvm1_consolidated30.vmdk"vmkfstools -i "/vmfs/volumes/abc######-#########/testvm1/testvm1-000060.vmdk" "/vmfs/volumes/abc######-#########/testvm1/testvm1_consolidated60.vmdk" -d thinvi testvm1-000061.vmdk...