Skip to content

enable PVC CBT during new provisioning#3981

Merged
k8s-ci-robot merged 1 commit into
kubernetes-sigs:masterfrom
zhanhank:enable_cbt_on_new_pvc
Apr 28, 2026
Merged

enable PVC CBT during new provisioning#3981
k8s-ci-robot merged 1 commit into
kubernetes-sigs:masterfrom
zhanhank:enable_cbt_on_new_pvc

Conversation

@zhanhank
Copy link
Copy Markdown
Contributor

@zhanhank zhanhank commented Apr 21, 2026

What this PR does / why we need it:
This PR is part of CSI CBT enablement in WCP. It implements CBT enablement for new PVC provisioned.
It bumps govmomi commit to use new CNS CBT APIs.
It adds CBTConfig CR to query namespace CBT status.
It adds FSS CSIBackupAPI for CSI CBT feature gate.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Testing done:
https://jenkins-vcf-csifvt.devops.broadcom.net/job/vks-instapp-e2e-pre-checkin/1021/ passed
Most cases passed in Jenkins Build #1333
Only two failures are not caused by this change.

[FAIL] Volume Expansion Test [It] [ef-vanilla-block][pq-n1-vanilla-block][pq-n2-vanilla-block][cf-wcp][csi-block-vanilla][csi-supervisor][csi-block-vanilla-parallelized][csi-vcp-mig] Verify online volume expansion on dynamic volume [p0, block, vanilla, wcp, core, vc70]
[FAIL] Volume Expansion Test [It] [ef-wcp] [csi-supervisor] Offline and Online volume resize on statically created volume [p0, block, wcp, vc70]

Manual testing:

1, enable cbt for the test namespace test-vadp-supervisor-ns

get cbtconfig default -o yaml
apiVersion: cnsdp.vmware.com/v1alpha1
kind: CBTConfig
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"cnsdp.vmware.com/v1alpha1","kind":"CBTConfig","metadata":{"annotations":{},"name":"default","namespace":"test-vadp-supervisor-ns"},"spec":{"enabled":true}}
  creationTimestamp: "2026-04-21T01:52:39Z"
  generation: 3
  name: default
  namespace: test-vadp-supervisor-ns
  resourceVersion: "5795620"
  uid: c6e9e619-5a6e-4c51-85d6-1a824db233e0
spec:
  enabled: true
status:
  enabled: true

2, provisioning new PVC and confirm underlying CNS volume and FCD CBT is on

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
....
  creationTimestamp: "2026-04-21T02:58:17Z"
  finalizers:
  - kubernetes.io/pvc-protection
  name: pvc-05
  namespace: test-vadp-supervisor-ns
  resourceVersion: "5673302"
  uid: ca75f28a-47e8-486f-8ae2-97e4a4f1d9f4
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  storageClassName: wcpglobal-storage-profile
  volumeMode: Filesystem
  volumeName: pvc-ca75f28a-47e8-486f-8ae2-97e4a4f1d9f4
....

Enablement logging

2026-04-21T03:00:27.500Z        DEBUG   common/util.go:558      CBT is enabled for namespace test-vadp-supervisor-ns    {"TraceId": "03b60e4b-7cc7-4d01-8388-ed54012b0e3d"}
2026-04-21T03:00:27.500Z        INFO    volume/manager.go:3668  Set control flags [enableChangedBlockTracking]  {"TraceId": "03b60e4b-7cc7-4d01-8388-ed54012b0e3d"}
2026-04-21T03:00:27.500Z        DEBUG   config/config.go:540    GetCnsconfig called with cfgPath: /etc/vmware/wcp/vsphere-cloud-provider.conf   {"TraceId": "03b60e4b-7cc7-4d01-8388-ed54012b
0e3d"}
2026-04-21T03:00:27.501Z        DEBUG   config/config.go:381    Initializing vc server lvn-dvm-10-161-222-78.dvm.lvn.broadcom.net       {"TraceId": "03b60e4b-7cc7-4d01-8388-ed54012b0e3d"}
2026-04-21T03:00:27.501Z        DEBUG   config/config.go:426    vc server lvn-dvm-10-161-222-78.dvm.lvn.broadcom.net config: {User:**********************************************************
********************************************** Password:******************** VCenterPort:443 InsecureFlag:false CAFile: Thumbprint: Datacenters:datacenter-40 TargetvSANFileShareClusters: Mi
grationDataStoreURL: FileVolumeActivated:false} {"TraceId": "03b60e4b-7cc7-4d01-8388-ed54012b0e3d"}
2026-04-21T03:00:27.501Z        DEBUG   config/config.go:435    No Net Permissions given in Config. Using default permissions.  {"TraceId": "03b60e4b-7cc7-4d01-8388-ed54012b0e3d"}
2026-04-21T03:00:27.501Z        DEBUG   config/config.go:508    Setting default queryLimit to 10000     {"TraceId": "03b60e4b-7cc7-4d01-8388-ed54012b0e3d"}
2026-04-21T03:00:27.501Z        DEBUG   config/config.go:513    Setting default list volume threshold to 50     {"TraceId": "03b60e4b-7cc7-4d01-8388-ed54012b0e3d"}
2026-04-21T03:00:27.510Z        DEBUG   vsphere/virtualcenter.go:305    Successfully connected to vCenter       {"TraceId": "03b60e4b-7cc7-4d01-8388-ed54012b0e3d", "attempt": 1}
2026-04-21T03:00:27.637Z        INFO    volume/manager.go:3682  Successfully set control flags [enableChangedBlockTracking] for volumeID: "ca75f28a-47e8-486f-8ae2-97e4a4f1d9f4"        {"Tra
ceId": "03b60e4b-7cc7-4d01-8388-ed54012b0e3d"}
2026-04-21T03:00:27.637Z        DEBUG   common/vsphereutil.go:1416      Successfully set CBT flags for volume: ca75f28a-47e8-486f-8ae2-97e4a4f1d9f4     {"TraceId": "03b60e4b-7cc7-4d01-8388-ed54012b0e3d"}
2026-04-21T03:00:27.637Z        DEBUG   wcp/controller.go:1797  createVolumeInternal: returns fault ""  {"TraceId": "03b60e4b-7cc7-4d01-8388-ed54012b0e3d"}
2026-04-21T03:00:27.637Z        INFO    wcp/controller.go:1809  Volume created successfully. Volume Handle: "ca75f28a-47e8-486f-8ae2-97e4a4f1d9f4", PV Name: "pvc-ca75f28a-47e8-486f-8ae2-97e4a4f1d9f4"      {"TraceId": "03b60e4b-7cc7-4d01-8388-ed54012b0e3d"}

Special notes for your reviewer:

Release note:

enable PVC CBT during new provisioning

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Welcome @zhanhank!

It looks like this is your first PR to kubernetes-sigs/vsphere-csi-driver 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/vsphere-csi-driver has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 21, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @zhanhank. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 21, 2026
@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1260

@deepakkinni
Copy link
Copy Markdown
Collaborator

FAILED --- Jenkins Build #1260

@zhanhank zhanhank force-pushed the enable_cbt_on_new_pvc branch from 146f926 to b50771d Compare April 21, 2026 07:01
@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1261

@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-TKG Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1021

@deepakkinni
Copy link
Copy Markdown
Collaborator

SUCCESS --- Jenkins Build #1261

@deepakkinni
Copy link
Copy Markdown
Collaborator

SUCCESS --- Jenkins Build #1021

Comment thread pkg/common/cns-lib/volume/manager.go Outdated
Comment thread pkg/csi/service/common/constants.go Outdated
@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-TKG Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1027

@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-TKG Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1028

@zhanhank zhanhank requested a review from akankshapanse April 22, 2026 01:55
@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-TKG Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1030

@deepakkinni
Copy link
Copy Markdown
Collaborator

FAILED --- Jenkins Build #1030

Comment thread pkg/csi/service/common/util.go Outdated
@zhanhank zhanhank force-pushed the enable_cbt_on_new_pvc branch from 850f2df to a8bda0a Compare April 22, 2026 11:53
@zhanhank zhanhank requested a review from akankshapanse April 22, 2026 11:54
Comment thread pkg/apis/cbtconfig/v1alpha1/cbtconfig_types.go Outdated
Comment thread pkg/csi/service/wcp/controller.go Outdated
Comment thread pkg/csi/service/wcp/controller.go Outdated
@zhanhank zhanhank force-pushed the enable_cbt_on_new_pvc branch from a8bda0a to 5a04493 Compare April 24, 2026 06:01
@zhanhank zhanhank requested a review from xing-yang April 24, 2026 06:03
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 24, 2026
@zhanhank zhanhank force-pushed the enable_cbt_on_new_pvc branch from 5a04493 to 2b9201f Compare April 24, 2026 11:38
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 24, 2026
@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1312

@deepakkinni
Copy link
Copy Markdown
Collaborator

FAILED --- Jenkins Build #1312

Signed-off-by: Hank Zhan <hank.zhan@broadcom.com>
Made-with: Cursor
@zhanhank zhanhank force-pushed the enable_cbt_on_new_pvc branch from 6ba395b to 6bb16f8 Compare April 27, 2026 06:25
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 27, 2026
@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1319

@zhanhank zhanhank requested a review from akankshapanse April 27, 2026 07:04
@zhanhank
Copy link
Copy Markdown
Contributor Author

rest of the code looks good to me.

add unit tests

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 27, 2026
@akankshapanse
Copy link
Copy Markdown
Contributor

Please make sure precheckin runs pass with the changes

@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1320

@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1321

@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1322

@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1326

@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1332

@deepakkinni
Copy link
Copy Markdown
Collaborator

FAILED --- Jenkins Build #1332

@deepakkinni
Copy link
Copy Markdown
Collaborator

Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete
Jenkins Build #1333

@deepakkinni
Copy link
Copy Markdown
Collaborator

FAILED --- Jenkins Build #1333

@xing-yang
Copy link
Copy Markdown
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 28, 2026
@xing-yang
Copy link
Copy Markdown
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 28, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akankshapanse, xing-yang, zhanhank

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [akankshapanse,xing-yang]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@xing-yang
Copy link
Copy Markdown
Contributor

Can you add the VKS pre-check pipeline results back?

@k8s-ci-robot k8s-ci-robot merged commit 7f43e25 into kubernetes-sigs:master Apr 28, 2026
12 checks passed
@zhanhank zhanhank deleted the enable_cbt_on_new_pvc branch May 7, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants