VMware – PowerCLI enable Change Block Tracking

Check CBT status for all VMs:

Get-VM | select Name, @{N="CBT";E={(Get-View $_).Config.ChangeTrackingEnabled}}

To enable CBT

Write-Host "This script enables CBT for a VM"
$vm = read-host "Specify VM name"
Get-VM $vm | select Name, @{N="CBT";E={(Get-View $_).Config.ChangeTrackingEnabled}}
write-host "Proceed ?"
pause
$vmView = Get-vm $vm | get-view
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec.changeTrackingEnabled = $true
$vmView.reconfigVM($vmConfigSpec)

Get-VM $vm | select Name, @{N="CBT";E={(Get-View $_).Config.ChangeTrackingEnabled}}
Write-host "Done.

Leave a Reply

Your email address will not be published. Required fields are marked *

16 + 20 =

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