If you don’t know what Changed Block Tracking is, just read this excellent post from Eric Siebert.

You can check the status of Changed Block Tracking with the following PowerCLI one-liner:

Get-VM | Get-View | `
Sort Name | Select Name, `

The output of the one-liner will look like this:


If you’re running a VM with only one VMDK, you can use the following function to enable Changed Block Tracking:

Function EnableChangeTracking{
    $vmView = Get-VM $vm | Get-View

    if($vmView.Config.Version -eq "vmx-04"){
        Write-Host -ForegroundColor Red `
        "The Virtual Hardware version of this VM does not support Changed Block Tracking"

    $vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
    $vmConfigSpec.changeTrackingEnabled = $true

    sleep 3

    Get-VM $vm | New-Snapshot -Name "Temp" 

    sleep 5

    Get-VM $vm | Get-Snapshot | Where {$_.Name -eq "Temp"} | Remove-Snapshot -Confirm:$false

You can run the function via the following command:


I am going to updated the function later, so it will be able to enable Changed Block Tracking on a VM with multiple VMDKs.

Update: When the VM is powered off, you are able to set the Changed Block Tracking feature for all the VMDKs.

Update 2: There was a little chat about this subject on Twitter between @lamw @gabvirtualworld and me (@afokkema) where @gabvirtualworld posted the following tweet:


I can confirm this theory and update my script with this little trick. Now you’re able to enable Changed Block Tracking when your VM is powered on.


9 thoughts on “PowerCLI: Enable Changed Block Tracking

  1. Actually if you’re enabling CBT using API and the VM is running HW7 and is poweredOff, it should add entries for all VMDK(s) for your VM and create the ctkEnabled to true. If you set it to disable, then you’ll just get “false” entries in your .vmx file.

    Take a look at at this vSphere SDK for Perl that does exactly that which I believe you’re already doing, so you shouldn’t have to do anything special for a VM that has 1 VMDK or 10 VMDKs


  2. Just tried this with vSphere 4.0U1 / VDR 1.1:

    I just used your one-liner and it listed all VMs that are associated with a VDR backup schedule as being TRUE. All VMs not associated were listed as being FALSE. I created a new backup job with four new VMs. Once the first backup job finished, the four new VMs listed as TRUE.

    It looks like your function is not needed since it appears as if VDR enables CBT automagically now.

  3. Hi guys,

    I am using netbackup 7 Block Level Incremental Backup feature. When you run the backup, VMs cbt configuration is enabled by Netbackup automatically. I also heard from a Veeam engineer that they also enable this automatically. So I suggest check with your backup product vendor or documentation before you start using powercli to enable this feature.

    Burak Uysal
    Storage Consultant

  4. I am looking to update CBT on the VMs in my environment and I was just wondering what would need to be added to make this work on VMs with more than one VMDK?

  5. I used above command and it worked only for disable ($false), when I set enable ($true), Ctkenabled still have value false from vsphere client

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.