Symptoms:
Changed Block Tracking (CBT) feature of VMware which facilitates taking incremental backups on virtual machines running on VMware ESX/ESXi.
CBT identifies and tracks block changes since the last backup, and stores these changes as logs for tracking the backups.
Unable to access file since it is locked. An error occurred while consolidating disks. One of the disks in this virtual machine is already in use by a virtual machine or by a snapshot. (In this case, the files will be there and there will be no locks present in the VM folders.)
VMware vSphere ESXi 6.0
VMware vSphere ESXi 6.5
VMware vSphere ESXi 6.7
VMware vSphere ESXi 7.0.x
VMware vSphere ESXi 8.0.x
To enable or disable CBT on a virtual machine, perform the appropriate steps given for enabling or disabling:
$vm="VM_Name"$vmtest = Get-vm $vm| get-view$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec#disable ctk$vmConfigSpec.changeTrackingEnabled = $false$vmtest.reconfigVM($vmConfigSpec)$snap=New-Snapshot $vm -Name "Disable CBT"$snap | Remove-Snapshot -confirm:$false# enable ctk$vmConfigSpec.changeTrackingEnabled = $true$vmtest.reconfigVM($vmConfigSpec)$snap=New-Snapshot $vm -Name "Enable CBT"$snap | Remove-Snapshot -confirm:$false