Enabling or disabling Changed Block Tracking (CBT) on virtual machines while they are live!

So, its been a while since I posted an update. Been busy…yada yada. Lets get right to it.

You need to enable or disable Change Block Tracking (CBT) on a VM without bringing it down.

So, vSphere is out.

So, get yourself a copy of PowerCLI that matches your version and connect to you server with: “Connect-VIServer”

It will ask for your server host/ip and then prompt for credentials.

After that it will drop you in a CLI. Just input the following:

$vm=”VM_Name
$vmtest = Get-vm $vm| get-view
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
This first part is the same whether you are disabling or enabling. Just choose the following set of commands based on which you want. You need to change the first attribute to the name of the VM for each VM you want to enable/disable it on.
$vm=”VM_Name
$vmtest = Get-vm $vm| get-view
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
#disable ctk
$vmConfigSpec.changeTrackingEnabled = $false
$vmtest.reconfigVM($vmConfigSpec)
$snap=New-Snapshot $vm -Name “Disable CBT”
$snap | Remove-Snapshot -confirm:$false
# enable ctk
$vmConfigSpec.changeTrackingEnabled = $true
$vmtest.reconfigVM($vmConfigSpec)
$snap=New-Snapshot $vm -Name “Enable CBT”
$snap | Remove-Snapshot -confirm:$false
It will create snapshots at the end and then delete them.
That’s it!
Hope to start posting more frequently. See you soon!