Resetting Changed Block Tracking for VMware vSphere virtual machines
book
Article ID: 339974
calendar_today
Updated On:
Products
VMware vSphere ESXi
Issue/Introduction
This article provides steps to reset Changed Block Tracking (CBT) for vSphere virtual machines.
Environment
VMware vSphere ESXi 8.x VMware vSphere ESXi 7.x
VMware vSphere ESXi 6.x
Resolution
To reset CBT on a vSphere virtual machine:
Open the vSphere Web Client.
Right-click the virtual machine and click Power Off.
Right-click the virtual machine, click the Snapshot and navigate to Snapshot Manager. Ensure there are no active snapshots. If there are snapshots present, consolidate them to commit the changes. For more information, seeConsolidating/Committing snapshots in ESXi.
Right-click the virtual machine and click Edit Settings.
Click the Options tab, select the Advanced section and then click Configuration Parameters.
Disable CBT for the virtual machine by setting the ctkEnabled value to false.
Disable CBT for the individual virtual disks attached to the virtual machine by setting the scsix:x.ctkEnabled value for each attached virtual disk to false. Where scsix:x is SCSI controller and SCSI device ID of your virtual disk.
Delete any -CTK.VMDK files within the virtual machine's working directory.
In the vSphere Client, right-click the virtual machine and click Power On.
If you are using a backup application which utilizes CBT, you must re-enable CBT manually. Some backup tools automatically enable CBT. For more information, seeEnabling or disabling Changed Block Tracking (CBT) on virtual machines. Note: The first backup after resetting CBT is full. All subsequent incremental backups can reference only the change IDs generated after the full backup.
To reset CBT on multiple vSphere virtual machines using a PowerCLI script:
Download the 2139574_CBT-Reset.zip file attached to this article.
Extract the CBT-Reset.PS1 file from the archive and save.
Install and initialize VMware PowerCLI on your local system.
Open VMware PowerCLI.
Change directory to where you saved the CBT-Reset.PS1 file by running the cd command: For example: PowerCLI C:\> cd C:\CBTreset
Allow execution of an unsigned script by running this command: PowerCLI C:\CBTreset> Set-ExecutionPolicy Bypass Warning: This allows any unsigned script to run. Ensure you disable it after use.
Connect to your vCenter Server using this command: PowerCLI C:\CBTreset> Connect-VIServer -Server vcenter -User username -Password password Where vcenter is the name of your vCenter Server, username is your vCenter Server username password is your vCenter Server user password.
Run this command to load the CBT-Reset.PS1 script: .\CBT-Reset.PS1 Note: If you receive an error similar to File .\CBT-Reset.PS1 cannot be loaded because the execution of scripts is disabled on this system, check step 6 is applied correctly.
The script provides a report of virtual machines that are applicable. The script lists both virtual machines where CBT can be reset and cannot be reset:
All virtual machines where CBT can be reset are listed.
All virtual machines where CBT cannot be reset (virtual machines that are powered off or have snapshots) are listed for notification purposes. Note: When the script runs, a temporary virtual machine snapshot is taken. This avoids the needs for a power cycle of the virtual machine.
The script prompts you to confirm execution and proceed with the CBT reset of applicable virtual machines.
If you choose to continue, CBT data is reset for the virtual machines that do not have snapshots and the power state is on.
Additional Information
For more information about using CBT with vSphere virtual machines, see: