When attempting to consolidate snapshots on a virtual machine, the following error is observed in the vSphere Client:
"An error occurred while consolidating disks: File too large."
VMware vSphere 7.x
VMware vSphere 8.x
This issue occurs due to insufficient free space on the datastore hosting the virtual machine's disk files.
To successfully consolidate snapshots, the available free space must be at least 1.5 times the total size of all snapshot files (.vmdk) for the virtual machine. If this requirement is not met, consolidation will fail with errors such as “File too large.”
From the ESXi host on which the VM resides, it can be seen that the consolidation fails due to lack of space: From the /var/run/log/hostd.log:hostd.log: DiskLib_IsCombinePossible: Could not get free space on disk using /vmfs/volumes/...hostd.log: Consolidate Disks message: An error occurred while consolidating disks: File too large.hostd.log: Event 33746 : Virtual machine ##### disks consolidation failed on ##### in cluster ##### in ha-datacenter.
Similarly, from the VM's vmware.log it can be seen that the snapshot consolidation completes without consolidating due to insufficient space:YYYY-MM-DDThh:mm:ss In(05) vcpu-0 #######-#####-auto-####-h5:###########-a1-7c-cf91 ConsolidateEnd: Snapshot consolidate complete: There is not enough space on the file system for the selected operation (5).
To resolve this issue, perform the following steps:
Calculate the Required Free Space:
Use the guidance in the following Broadcom KB to determine the amount of disk space required for snapshot consolidation:
How to calculate snapshot consolidation space requirements
Free Up Datastore Space:
Remove or relocate unused files.
Migrate other VMs to different datastores.
Extend the datastore, if possible.
Retry Snapshot Consolidation:
Once sufficient space is available, right-click the virtual machine and select Snapshot > Consolidate.
Monitor for Completion:
Monitor the task in vSphere Client to ensure successful completion.
If enough space is not available in the current datastore and the datastore free space cannot be increased:
VM's vmdk can be migrated to consolidate.
Power OFF the VM.
(During powered ON snapshot consolidation, a temporary snapshot is created to hold the active changes. This can increase in size if the snapshot consolidation task takes long. So if the VM is powered OFF, this file will not grow in size to fill up the datastore.)
Migrate the disk with snapshot to another datastore to consolidate.
Clone the VM to another datastore:
Power OFF the VM.
Clone the VM to another datastore.
In order to avoid situations like this, it is crucial to monitor for snapshots in the environment and delete them as soon as possible. Best practices for using VMware snapshots in the vSphere environment.