Change Block Tracking (CBT) is a VMkernel feature that keeps track of the storage blocks of a virtual machine as they change over time. The VMkernel keeps track of block changes on virtual machines, which enhances the backup process for applications that have been developed to take advantage of VMware's vStorage APIs.
If CTB is not enabled in a worker node and enabled on First Class Disks (FCDs), you can have errors on attaching PVC: PVCs cannot be mounted - The operation is not allowed in the current state.
CBT is enabled on the PVCs/FCDs but is not enabled on the newly deployed worker virtual machines. Those VMs where having problems attaching PVCs: PVCs cannot be mounted - The operation is not allowed in the current state
This is an expected behavior when the CBT flags on the FCD and the VM are different.
To resolve this issue, we need to enable CBT on the worker VM.
/usr/lib/vmware-wcp/decryptK8Pwd.py
. Refer Troubleshooting vSphere with Tanzu (TKGS) Supervisor Control Plane VMskubectl config get-contexts
kubectl edit virtualmachine <VM-Name> -n <Your-vSphere-Namespace (e.g.: shared-services)>
advancedOptions:
changeBlockTracking: true
Check if CBT is enabled, run this command:
kubectl get vm <vmname> -n <namespace> -o jsonpath='{.status.changeBlockTracking}'