Skip to content

Conversation

xing-yang
Copy link
Contributor

@xing-yang xing-yang commented Sep 26, 2025

What this PR does / why we need it:

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:
WCP pre-check pipeline: https://jenkins-vcf-csifvt.devops.broadcom.net/job/wcp-instapp-e2e-pre-checkin/438/console (running)
VKS pre-check pipeline: https://jenkins-vcf-csifvt.devops.broadcom.net/view/instapp/job/vks-instapp-e2e-pre-checkin/460/console (passed)

Manual testing:

root@4215c92086cdb5f3389877bed39cd7f0 [ ~ ]# kubectl create -f pop-pvc.yaml
persistentvolumeclaim/pop-pvc created

root@4215c92086cdb5f3389877bed39cd7f0 [ ~ ]# kubectl get pvc pop-pvc -n test-ns
NAME      STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS                VOLUMEATTRIBUTESCLASS   AGE
pop-pvc   Pending                                      wcpglobal-storage-profile   <unset>                 14s
root@4215c92086cdb5f3389877bed39cd7f0 [ ~ ]# kubectl describe pvc pop-pvc -n test-ns
Name:          pop-pvc
Namespace:     test-ns
StorageClass:  wcpglobal-storage-profile
Status:        Pending
Volume:
Labels:        <none>
Annotations:   volume.beta.kubernetes.io/storage-provisioner: csi.vsphere.vmware.com
               volume.kubernetes.io/storage-provisioner: csi.vsphere.vmware.com
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
VolumeMode:    Filesystem
DataSource:
  APIGroup:  vmoperator.vmware.com
  Kind:      VirtualMachine
  Name:      my-vm-1
Used By:     <none>
Events:
  Type    Reason                Age                From                                                                                          Message
  ----    ------                ----               ----                                                                                          -------
  Normal  Provisioning          21s                csi.vsphere.vmware.com_4215c92086cdb5f3389877bed39cd7f0_bf344c5c-95c9-40a2-9793-bcc45671ef25  External provisioner is provisioning volume for claim "test-ns/pop-pvc"
  Normal  Provisioning          21s                external-provisioner                                                                          Assuming an external populator will provision the volume
  Normal  ExternalProvisioning  10s (x3 over 21s)  persistentvolume-controller                                                                   Waiting for a volume to be created either by the external provisioner 'csi.vsphere.vmware.com' or manually by the system administrator. If volume creation is delayed, please verify that the provisioner is running and correctly registered.

root@4215c92086cdb5f3389877bed39cd7f0 [ ~ ]# kubectl create -f register.yaml
cnsregistervolume.cns.vmware.com/static-volume created

root@4215c92086cdb5f3389877bed39cd7f0 [ ~ ]# kubectl get cnsregistervolume -n test-ns
NAME            AGE
static-volume   13s

root@4215c92086cdb5f3389877bed39cd7f0 [ ~ ]# kubectl get cnsregistervolume -n test-ns -o yaml
apiVersion: v1
items:
- apiVersion: cns.vmware.com/v1alpha1
  kind: CnsRegisterVolume
  metadata:
    creationTimestamp: "2025-10-07T19:08:56Z"
    generation: 2
    name: static-volume
    namespace: test-ns
    ownerReferences:
    - apiVersion: v1
      blockOwnerDeletion: true
      controller: true
      kind: PersistentVolumeClaim
      name: pop-pvc
      uid: 9ef2d5d2-5ede-43d5-8948-aa12fa63e8cb
    resourceVersion: "1569213"
    uid: c7683810-251e-4239-acdf-b7e975d5e2df
  spec:
    accessMode: ReadWriteOnce
    pvcName: pop-pvc
    volumeID: 35ee9a2f-f950-448a-bba8-eb9ad6660c8d
  status:
    registered: true
kind: List
metadata:
  resourceVersion: ""

root@4215c92086cdb5f3389877bed39cd7f0 [ ~ ]# kubectl get pvc pop-pvc -n test-ns
NAME      STATUS   VOLUME                                           CAPACITY   ACCESS MODES   STORAGECLASS                VOLUMEATTRIBUTESCLASS   AGE
pop-pvc   Bound    static-pv-35ee9a2f-f950-448a-bba8-eb9ad6660c8d   1Gi        RWO            wcpglobal-storage-profile   <unset>                 70s

root@4215c92086cdb5f3389877bed39cd7f0 [ ~ ]# kubectl describe pvc pop-pvc -n test-ns
Name:          pop-pvc
Namespace:     test-ns
StorageClass:  wcpglobal-storage-profile
Status:        Bound
Volume:        static-pv-35ee9a2f-f950-448a-bba8-eb9ad6660c8d
Labels:        <none>
Annotations:   csi.vsphere.volume-accessible-topology: [{"topology.kubernetes.io/zone":"domain-c36"}] <== topology annotation is added.
               pv.kubernetes.io/bind-completed: yes
               pv.kubernetes.io/bound-by-controller: yes
               volume.beta.kubernetes.io/storage-provisioner: csi.vsphere.vmware.com
               volume.kubernetes.io/storage-provisioner: csi.vsphere.vmware.com
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      1Gi
Access Modes:  RWO
VolumeMode:    Filesystem
DataSource:
  APIGroup:  vmoperator.vmware.com
  Kind:      VirtualMachine
  Name:      my-vm-1
Used By:     <none>
Events:
  Type    Reason                Age                From                                                                                          Message
  ----    ------                ----               ----                                                                                          -------
  Normal  ExternalProvisioning  20s (x5 over 53s)  persistentvolume-controller                                                                   Waiting for a volume to be created either by the external provisioner 'csi.vsphere.vmware.com' or manually by the system administrator. If volume creation is delayed, please verify that the provisioner is running and correctly registered.
  Normal  Provisioning          20s (x2 over 53s)  csi.vsphere.vmware.com_4215c92086cdb5f3389877bed39cd7f0_bf344c5c-95c9-40a2-9793-bcc45671ef25  External provisioner is provisioning volume for claim "test-ns/pop-pvc"
  Normal  Provisioning          20s (x2 over 53s)  external-provisioner                                                                          Assuming an external populator will provision the volume

Special notes for your reviewer:

Release note:

Add topology annotation to pre-existing PVC for CnsRegisterVolume if needed.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 26, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xing-yang

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

The pull request process is described here

Needs approval from an approver in each of these files:

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

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 26, 2025
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 26, 2025
@xing-yang xing-yang force-pushed the add_ann_topo branch 2 times, most recently from 99bd421 to 39816e4 Compare September 29, 2025 23:29
@k8s-ci-robot
Copy link
Contributor

@xing-yang: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-vsphere-csi-driver-verify-golangci-lint 5e0d211 link true /test pull-vsphere-csi-driver-verify-golangci-lint

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@deepakkinni
Copy link
Collaborator

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

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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants