In this brief tutorial we show the simple steps to reset the Changed Block Tracking (CBT) for vSphere virtual machines.
CBT is a fundamental parameter of the options of a VMware ESXi virtual machine, since it allows, when enabled, to perform incremental and differential backups of VMware virtual machines. In fact, virtual machines running on ESXi hosts can keep track of disk sectors that have changed. This function is called Changed Block Tracking (CBT), and allows, at each backup procedure, to download only those parts of the VM disk that have actually been modified since the last backup, thus increasing performance and optimizing the space required. Moreover, the backup procedures performed thanks to the CBT allow to have different recovery points of a VM, based on the number of backups that have been configured.
Note: before performing this procedure, you must make sure that the virtual machine is not running on a snapshot.
For more information, see the related VMware articles:
- Snapshot consolidation in vSphere
- Determine if there are any delta files left or snapshots that VMware vSphere cannot detect
To reset CBT on a vSphere virtual machine, make all the following steps:
- Open vSphere Web Client.
- Right-click on the virtual machine and click on Power Off.
- Right-click on the virtual machine, click on Manage Snapshots. Make sure there are no active snapshots. If there are snapshots, consolidate them.
- Right-click on the virtual machine and click Edit Settings.
- Click on the Options tab (VM Options), select the General section and then click on Configuration Parameters -» “Edit configuration”
- Disable CBT for the virtual machine by setting the ctkEnabled value to FALSE.
- Disable CBT for individual virtual disks connected to the virtual machine by setting the scsix: x.ctkEnabled value for each virtual disk connected to FALSE (where scsix: x is the SCSI controller and SCSI device ID of the virtual disk).
- Access the folder on the datastore that contains the virtual machine (right click on the datastore and then on “Browse Datastore”).
- Make sure there are no snapshot files (.delta.vmdk) present in the virtual machine folder.
- Delete the -CTK.VMDK files in the virtual machine folder.
- In vSphere Web Client, right click on the virtual machine and click on Power -» Power On.
- If you use a backup application that uses the Changed Block Tracking feature (see: Backup of ESXi, vCenter, ESXi Free and Replica with Iperius Backup), you must reactivate the CBT manually.
Note: the first backup that is performed after restoring the CBT is a full. All subsequent incremental / differential backups will refer to the IDs of the changes generated after the full backup.
Re-enable CBT for incremental backup of virtual machines:
This procedure may be necessary if, for example, errors occur during incremental or differential backups. After performing this operation, if we need to perform incremental or differential backups, we will have to re-enable the CBT by resetting it to true. Of course also for this operation it will be necessary to make sure that there are no active snapshots and perform the operation with the virtual machine turned off.
How to restart Iperius virtual machine backups into after a CBT error:
If an error occurs in the backup of virtual machines with Iperius, and this error concerns the query of the CBT, it will be necessary to perform a further operation (as well as reset the CBT in the virtual machine settings) on the destination folders of the incremental/differential backup. In fact, since it must refer to a previous backup with a specific CBT value, Iperius cannot “append” new backups to the existing ones, because the CBT has been reset, so it will continue to return an error. You will then need to delete or rename the existing backup folders and then perform a new backup from scratch.
For more information:
- Changed Block Tracking (CBT) on VMware ESXi virtual machines
- Enable or Disable Changed Block Tracking (CBT) on VMware ESXi virtual machines