Opvizor

CBT Management with Power CLI

List all virtual machines where CBT enabled 

Get-VM| Where-Object{$_.ExtensionData.Config.ChangeTrackingEnabled -eq $true}

Check specific virtual machines where CBT enabled 

Get-VM  “TEST-VM-01” | Where-Object{$_.ExtensionData.Config.ChangeTrackingEnabled -eq $true}

List all virtuals machine where CBT disabled

Get-VM| Where-Object{$_.ExtensionData.Config.ChangeTrackingEnabled -eq $false}

Check specific virtual machines where CBT disabled

Get-VM  “TEST-VM-01” | Where-Object{$_.ExtensionData.Config.ChangeTrackingEnabled -eq $false}

Note : In GUI mode we cannot modify the CBT configuration while virtual machine is powered on , so we can use below script to enable or disable CBT in VM powered on state.

Script to enable CBT

$vmtest = Get-VM TEST-VM-01 | get-view
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec.changeTrackingEnabled = $true
$vmtest.reconfigVM($vmConfigSpec)

Script to disable CBT

$vmtest = Get-VM TEST-VM-01 | get-view
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec.changeTrackingEnabled = $disabale
$vmtest.reconfigVM($vmConfigSpec)

You may use the above commands by pasting on vSphere CLI after connecting to vCenter   or  save it as .PS1  extension and run from the directory

Reference

Rajesh Radhakrishnan

Share
Published by
Rajesh Radhakrishnan

Recent Posts

NAKIVO Backup & Replication v10.8 Released With New Features

Nakivo has released its new Backup and Replication solution Nakivo v10.8, which includes support for…

2 years ago

Oracle Cloud VMware Solution and Features

Oracle Cloud VMware Solution (OCVS) provides a customer-managed, native VMware-based cloud environment hosted in Oracle…

2 years ago

Vinchin Backup and Recovery Review

Vinchin is a professional provider of data protection solutions for enterprises. It provides a series…

2 years ago

VMware Cloud Disaster Recovery (VCDR) Solution Deployment And Configuration Part 2

In my previous blog post, I have explained about VMware Cloud Disaster Recovery (VCDR) Onboarding and…

2 years ago

How to Deploy vRNI Cloud With VMC on AWS

vRealize Network Insight helps you build an optimized, highly available, and secure network infrastructure across…

2 years ago

This SysAdmin Day, WIN with Hornetsecurity!

Can you believe it's here again? SysAdmin Day is back, and with it comes endless gratitude…

2 years ago