Resetting Changed Block Tracking for VMware vSphere virtual machines
search cancel

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.7
VMware vSphere ESXi 6.0
VMware vSphere ESXi 5.5
VMware vSphere ESXi 5.1

Resolution

Warning: Before applying this procedure, ensure the virtual machine is not running on snapshots. For more information, see:

 

To reset CBT on a vSphere virtual machine:
  1. Open the vSphere Web Client.
  2. Right-click the virtual machine and click Power Off.
  3. 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, see Consolidating/Committing snapshots in ESXi (1002310)
  4. Right-click the virtual machine and click Edit Settings.
  5. Click the Options tab, select the Advanced section and then click Configuration Parameters.
  6. Disable CBT for the virtual machine by setting the ctkEnabled value to false.
  7. 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.
     
  8. Open the virtual machine's working directory using the Datastore Browser or ESXi shell. For more information on identifying the working directory, see Locating virtual machine log files on an ESXi/ESX host (1007805).
  9. Ensure there are no snapshot files (.delta.vmdk) present in the virtual machine's working directory. For more information, see Determining if there are leftover delta files or snapshots that VMware vSphere or Infrastructure Client cannot detect (1005049)
  10. Delete any -CTK.VMDK files within the virtual machine's working directory.
  11. In the vSphere Client, right-click the virtual machine and click Power On.
  12. 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, see Enabling or disabling Changed Block Tracking (CBT) on virtual machines (1031873)

    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:
  1. Download the 2139574_CBT-Reset.zip file attached to this article.
  2. Extract the CBT-Reset.PS1 file from the archive and save.
  3. Install and initialize VMware PowerCLI on your local system.
  4. Open VMware PowerCLI.
  5. Change directory to where you saved the CBT-Reset.PS1 file by running the cd command:

    For example:

    PowerCLI C:\> cd C:\CBTreset
     
  6. 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.
     
  7. 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.
     
  8. 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.
     
  9. 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.
       
  10. The script prompts you to confirm execution and proceed with the CBT reset of applicable virtual machines.
  11. If you choose to continue, CBT data is reset for the virtual machines that do not have snapshots and the power state is on.
     
THE CONTENT OF THIS ARTICLE IS PROVIDED "AS-IS," AND TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, VMWARE DISCLAIMS ALL OTHER REPRESENTATIONS AND WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS CONTENT, INCLUDING THEIR FITNESS FOR A PARTICULAR PURPOSE, THEIR MERCHANTABILITY, OR THEIR NONINFRINGEMENT. VMWARE SHALL NOT BE LIABLE FOR ANY DAMAGES ARISING OUT OF OR IN CONNECTION WITH THE USE OF THIS CONTENT, INCLUDING DIRECT, INDIRECT, CONSEQUENTIAL DAMAGES, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF VMWARE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.



Additional Information

Attachments

2139574_CBT-Reset.zip get_app