After applying credential hardening for the Cloud Provider Interface (CPI) in Telco Cloud Automation (TCA) managed TKG clusters, you may encounter the following issues:
Pending state.FailedAttachVolume errors.ServerFaultCode: Permission to perform this operation was denied during ReconfigVM_Task.failed to attach disk: "####" err ServerFaultCode: Permission to perform this operation was denied.TKG 2.5.x, 2.5.1, 2.5.2, 2.5.3, 2.5.4
TCA 3.x, 3.1, 3.1.1, 3.2, 3.4
TCP 5.0, 5.0.1, 5.1
This issue occurs because the hardened TKG-CPI-Role may be missing required privileges or assigned at an incorrect scope. Specifically:
VirtualMachine.Config.AddExistingDisk at the VM Folder level, not the Resource Pool level.VirtualMachine.Interact.DeviceConnection for the hot-add operations performed by the CSI driver.Create the TKG-CPI-Role role in vCenter Server with the following privileges:
Cns
Searchable
Datastore
Browse datastore
Sessions
Message
Validate session
Storage views
View
Virtual Machine
Provisioning
Allow read-only disk access
Create a local cpi user with vsphere.local as the domain name, and set an appropriate password.
Assign Permissions to Objects
Go to the Hosts and Clusters view.
Right-click the Datacenter where TKG cluster will be deployed.
Select Permissions and click Add.
Enter the [email protected] user.
Select the TKG-CPI-Role role.
Check the Propagate to children checkbox.
SSH into the management cluster Control Plane node using the capv user.
Download the attached update_cpi_vcenter_credential script
Apply executable permissions
chmod +x ./update_cpi_vcenter_credential
Prepare an input CSV file containing the workload cluster names and the new vCenter credentials (username and password);
Note: Ensure all passwords are provided in base64-encoded format:
echo -n '<vcenter_user_password>' | base64
Generate a CSV file that includes the workload cluster name, username, and base64 encoded password:
echo '<workload_cluster_name>,<vcenter_user_name>,<base64_encoded_vcenter_user_password>' > clusters.csv
Run the update_cpi_vcenter_credential script with the parameters of csv files:
./update_cpi_vcenter_credential {csv_file_path}
Example:
./update_cpi_vcenter_credential /tmp/clusters.csv
If volumes remain stuck, check for stale VolumeAttachment objects in the workload cluster:
kubectl get volumeattachment
kubectl delete volumeattachment <attachment-name> --force --grace-period=0update_cpi_vcenter_credential script to be reapplied. | Cluster Operation | Standard cluster |
| Add Control plane | Reapply script required |
| Delete Control plane | Reapply script required |
| Modify Control plane | Reapply script required |
| Add worker node | Not needed |
| Delete worker node | Not needed |
| Modify worker node | Not needed |
| Deploy NF | Not needed |
| Upgrade cluster | Reapply script required |
| Certificate renew immediately from UI | Reapply script required |
| Certificate renew auto rotation | Not needed |
Note: Updating the credentials for a classy (ClusterClass-based) clusters is a one-time operation and will not require the script to be re-applied.
update_cpi_vcenter_credential script with the new password for the user.