July 26, 2017
Faster VM Backup with VMware Changed Block Tracking (CBT)
VMware Changed Block Tracking (CBT) Essentials
VMware is one of few companies that really care about backups in the enterprise virtual environment. Ever since VMware ESX/ESXi 4.0 was introduced, ESX/ESXi hosts have been able to track changed disk sectors. This powerful monitoring mechanism is called Changed Block Tracking (CBT) and aims to improve the efficiency of the backup process and simplify the use of 3rd party VM backup software.
Let’s find out, what is the essence of VMware Changed Block Tracking. This VMware feature compares the last and current changeset IDs and finds the disk sectors which were altered between these changeset IDs. VMware CBT also identifies all Virtual Machine File System (VMFS) blocks across the virtual disk, which are in use. The tracking is performed by the hypervisor itself and takes place outside the VM.
VMware CBT is a part of vSphere Storage APIs – Data Protection framework. So, CBT works on ESX Storage Stack level and allows 3rd party backup solutions, like NAKIVO Backup & Replication, to back up only the blocks of data changed since the last backup, or the blocks in use, but not the entire VM. Therefore, the amount of data to be backed up is dramatically reduced, and, the overall backup speed is increased.
To make CBT work, the following conditions should be fulfilled:
- ESX/ESXi must be v4.0 or later;
- Virtual hardware must be not lower than version 7;
- CBT must be enabled for the VM;
- The following disk types may be used: SAN, iSCSI, NFS, or local disks with VMFS (except for raw disks (Raw Device Mapping (RDM) in Physical Compatibility Mode));
- For a clean start, the VM must have zero snapshots.
By default, CBT is disabled, as it consumes some small amount of host CPU time. But for a 3rd party backup solution like NAKIVO Backup & Replication CBT must be enabled to let the product perform fast and reliable Incremental Backup.
To check whether CBT is enabled for the VM, do the following:
- Open the vSphere Web client;
- Find the needed VM and make sure it is powered off;
- Go to the VM folder on datastore;
- Find a VM configuration file (.VMX).
The configuration file contains the “ctkEnabled” entry. The entry’s value has to be “TRUE”. If it is not, then change the value to “TRUE” to enable CBT for the VM.
With the enabled CBT, each virtual disk is accompanied by a xxx-ctk.vmdk file, where “xxx” is a virtual disk name.
This file is related to the respective vmdk disk and contains a list of blocks changed in this virtual disk between the certain time identified in the last changeset ID and the actual state.
In some cases, such as inappropriate host shutdown or power failure, CBT can lose track of changes while VM is powered on. This may cause CBT to reset, which means that all previously collected CBT data will be flushed and the new data will start being collected from the moment of reset.
Using VMware CBT in NAKIVO Backup & Replication
To speed up incremental backup performed with NAKIVO Backup & Replication, CBT is enabled by default in any new backup job.
There are several cases when NAKIVO Backup & Replication, as any other VM backup solution, cannot use VMware CBT:
- VMware CBT is not supported by a VM: Possible cause – ESXi host is lower than v4.1, or Virtual Hardware version is lower than v7;
- VMware CBT data was not provided: Possible cause – ESXi host power outage and CBT lost track of VM incremental changes.
In the additional Change tracking settings, you can find the On error actions.
Let’s take a closer look at these On error actions:
- Switch to proprietary method: NAKIVO Backup & Replication proprietary change tracking method will be used, which is slower than VMware CBT and consumes more host’s resources;
- Reset CBT: CBT will be reset for the virtual machine in case of CBT failure;
- Fail VM processing: VM processing will be stopped.
Also, you can specify when to apply the selected On error action:
- Immediately: On error action will be applied immediately (except for the Reset CBT action);
- On the next retry: On error action will be applied on the next retry;
- On the last retry: On error action will be applied on the last retry.
You can also check the Double-check changed blocks provided by CBT checkbox. In this case, data provided by VMware Changed Block Tracking will be additionally checked against NAKIVO Backup & Replication proprietary CBT. This approach is more reliable, but may be slower than the ordinary VMware CBT.
VMware Changed Block Tracking is a very powerful feature that makes the backup process faster and reliable in every respect. Actually, CBT helps 3rd party solutions, such as NAKIVO Backup & Replication, to perform the incremental backup faster and without additional load on hosts.