Skip to content

Conversation

nikhilbarge
Copy link
Contributor

@nikhilbarge nikhilbarge commented Oct 20, 2025

What this PR does / why we need it:
Fix issue fetch virtual machine with version v1alpha4

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:
Running pre-checkins
https://jenkins-vcf-csifvt.devops.broadcom.net/job/vks-instapp-e2e-pre-checkin/484/
https://jenkins-vcf-csifvt.devops.broadcom.net/job/wcp-instapp-e2e-pre-checkin/487/

Performed manual testing on setup, now pods which are stuck in pending state are in running state
Manual Testing logs:

root@420f7528e73e637b52ced8eeb3921e36 [ ~ ]# k get pod -n st-iis 
NAME                           READY   STATUS    RESTARTS   AGE
windows-iis-6f7796c545-k86c6   1/1     Running   0          7m10s
root@420f7528e73e637b52ced8eeb3921e36 [ ~ ]# k get pvc windows-iis-pvc  -n st-iis  
NAME              STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   VOLUMEATTRIBUTESCLASS   AGE
windows-iis-pvc   Bound    pvc-d4a21f0c-4515-41bd-9cb4-c3986e9bf8ae   1Gi        RWO            vsansp         <unset>                 5d3h
root@420f7528e73e637b52ced8eeb3921e36 [ ~ ]# k get  pv pvc-d4a21f0c-4515-41bd-9cb4-c3986e9bf8ae  
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                    STORAGECLASS   VOLUMEATTRIBUTESCLASS   REASON   AGE
pvc-d4a21f0c-4515-41bd-9cb4-c3986e9bf8ae   1Gi        RWO            Delete           Bound    st-iis/windows-iis-pvc   vsansp         <unset>                          5d3h
root@420f7528e73e637b52ced8eeb3921e36 [ ~ ]# k get  pv pvc-d4a21f0c-4515-41bd-9cb4-c3986e9bf8ae   -o yaml
apiVersion: v1
kind: PersistentVolume
metadata:
  annotations:
    pv.kubernetes.io/provisioned-by: csi.vsphere.vmware.com
    volume.kubernetes.io/provisioner-deletion-secret-name: ""
    volume.kubernetes.io/provisioner-deletion-secret-namespace: ""
  creationTimestamp: "2025-10-15T09:37:24Z"
  finalizers:
  - kubernetes.io/pv-protection
  - external-attacher/csi-vsphere-vmware-com
  name: pvc-d4a21f0c-4515-41bd-9cb4-c3986e9bf8ae
  resourceVersion: "4692"
  uid: 0ee1425a-b804-4186-8f82-abd6c231fc3b
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 1Gi
  claimRef:
    apiVersion: v1
    kind: PersistentVolumeClaim
    name: windows-iis-pvc
    namespace: st-iis
    resourceVersion: "4666"
    uid: d4a21f0c-4515-41bd-9cb4-c3986e9bf8ae
  csi:
    driver: csi.vsphere.vmware.com
    fsType: ext4
    volumeAttributes:
      storage.kubernetes.io/csiProvisionerIdentity: 1760520534083-785-csi.vsphere.vmware.com
      type: vSphere CNS Block Volume
    volumeHandle: f04e37f1-aacf-45d3-80fe-8dd9c4951c78-d4a21f0c-4515-41bd-9cb4-c3986e9bf8ae
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: topology.kubernetes.io/zone
          operator: In
          values:
          - domain-c10
  persistentVolumeReclaimPolicy: Delete
  storageClassName: vsansp
  volumeMode: Filesystem
status:
  lastPhaseTransitionTime: "2025-10-15T09:37:24Z"
  phase: Bound

root@420f7528e73e637b52ced8eeb3921e36 [ ~ ]# k get vm vks35-cc35-etcd-323-ppwu-35ns1-c1-np2-worker-pztrh-9b2xp-5wp5h -n vks35-cc35-etcd-323-ppwu-35ns1 -o yaml
apiVersion: vmoperator.vmware.com/v1alpha4
kind: VirtualMachine
metadata:
  annotations:
    ...
    vmoperator.vmware.com/created-at-schema-version: v1alpha4 
    ...
  creationTimestamp: "2025-10-18T09:02:20Z"
  finalizers:
  - vmoperator.vmware.com/virtualmachine
  generation: 4
  labels:
    ...
    topology.kubernetes.io/zone: domain-c10
  name: vks35-cc35-etcd-323-ppwu-35ns1-c1-np2-worker-pztrh-9b2xp-5wp5h
  namespace: vks35-cc35-etcd-323-ppwu-35ns1
...
spec:
  biosUUID: 158fabc4-54e7-46f6-8e22-a3f352440b65
  ...
  powerOffMode: Hard
  powerState: PoweredOn
  promoteDisksMode: Online
  ...
  volumes:
  ...
  - name: f04e37f1-aacf-45d3-80fe-8dd9c4951c78-d4a21f0c-4515-41bd-9cb4-c3986e9bf8ae
    persistentVolumeClaim:
      claimName: f04e37f1-aacf-45d3-80fe-8dd9c4951c78-d4a21f0c-4515-41bd-9cb4-c3986e9bf8ae
status:
  biosUUID: 158fabc4-54e7-46f6-8e22-a3f352440b65
  ...
  uniqueID: vm-5887
  volumes:
  ...
  - attached: true
    diskUUID: 6000C29b-31c8-033b-e761-04354f57d591
    limit: 1Gi
    name: f04e37f1-aacf-45d3-80fe-8dd9c4951c78-d4a21f0c-4515-41bd-9cb4-c3986e9bf8ae
    requested: 1Gi
    type: Managed
    used: "0"
  ...
  zone: domain-c10

logs:

{"level":"info","time":"2025-10-20T12:47:18.417989313Z","caller":"wcpguest/controller.go:697","msg":"ControllerPublishVolume: called with args volume_id:\"f04e37f1-aacf-45d3-80fe-8dd9c4951c78-d4a21f0c-4515-41bd-9cb4-c3986e9bf8ae\" node_id:\"vks35-cc35-etcd-323-ppwu-35ns1-c1-np2-worker-pztrh-9b2xp-5wp5h\" volume_capability:{mount:{fs_type:\"ext4\"} access_mode:{mode:SINGLE_NODE_WRITER}} volume_context:{key:\"storage.kubernetes.io/csiProvisionerIdentity\" value:\"1760520534083-785-csi.vsphere.vmware.com\"} volume_context:{key:\"type\" value:\"vSphere CNS Block Volume\"}","TraceId":"282379a9-29e9-44e3-822b-0aa0042116c7"}
{"level":"info","time":"2025-10-20T12:47:18.418697187Z","caller":"wcpguest/controller_helper.go:442","msg":"attacherTimeout is set to 4 minutes","TraceId":"282379a9-29e9-44e3-822b-0aa0042116c7"}
{"level":"info","time":"2025-10-20T12:47:18.418756839Z","caller":"utils/utils.go:376","msg":"get machine with vm-operator api version v1alpha5 name: vks35-cc35-etcd-323-ppwu-35ns1-c1-np2-worker-pztrh-9b2xp-5wp5h, namespace: vks35-cc35-etcd-323-ppwu-35ns1","TraceId":"282379a9-29e9-44e3-822b-0aa0042116c7"}
..
{"level":"info","time":"2025-10-20T12:47:18.42993815Z","caller":"utils/utils.go:439","msg":"successfully fetched the virtual machines with name vks35-cc35-etcd-323-ppwu-35ns1-c1-np2-worker-pztrh-9b2xp-5wp5h and namespace vks35-cc35-etcd-323-ppwu-35ns1","TraceId":"282379a9-29e9-44e3-822b-0aa0042116c7"}
{"level":"info","time":"2025-10-20T12:47:18.429998576Z","caller":"utils/utils.go:454","msg":"PatchVirtualMachine: patch virtualmachine name: vks35-cc35-etcd-323-ppwu-35ns1-c1-np2-worker-pztrh-9b2xp-5wp5h","TraceId":"282379a9-29e9-44e3-822b-0aa0042116c7"}
{"level":"info","time":"2025-10-20T12:47:18.432343554Z","caller":"utils/utils.go:461","msg":"PatchVirtualMachine: converting VirtualMachine to v1alpha4 VirtualMachine, name: vks35-cc35-etcd-323-ppwu-35ns1-c1-np2-worker-pztrh-9b2xp-5wp5h","TraceId":"282379a9-29e9-44e3-822b-0aa0042116c7"}
..
{"level":"info","time":"2025-10-20T12:47:18.497655375Z","caller":"utils/utils.go:538","msg":"PatchVirtualMachine: successfully patched the virtualmachine, name: vks35-cc35-etcd-323-ppwu-35ns1-c1-np2-worker-pztrh-9b2xp-5wp5h","TraceId":"282379a9-29e9-44e3-822b-0aa0042116c7"}
{"level":"info","time":"2025-10-20T12:47:18.497716824Z","caller":"wcpguest/controller.go:814","msg":"check if volume attached to virtualmachine name vks35-cc35-etcd-323-ppwu-35ns1-c1-np2-worker-pztrh-9b2xp-5wp5h, namespace vks35-cc35-etcd-323-ppwu-35ns1","TraceId":"282379a9-29e9-44e3-822b-0aa0042116c7"}
{"level":"info","time":"2025-10-20T12:47:18.506586005Z","caller":"wcpguest/controller.go:858","msg":"converting v1alpha1 VirtualMachine to v1alpha5 VirtualMachine, name vks35-cc35-etcd-323-ppwu-35ns1-c1-np1-worker-668q5-crw8q-nw82h","TraceId":"282379a9-29e9-44e3-822b-0aa0042116c7"}
..
{"level":"info","time":"2025-10-20T12:47:19.049027168Z","caller":"wcpguest/controller.go:903","msg":"observed disk UUID \"6000C29b-31c8-033b-e761-04354f57d591\" is set for the volume \"f04e37f1-aacf-45d3-80fe-8dd9c4951c78-d4a21f0c-4515-41bd-9cb4-c3986e9bf8ae\" on virtualmachine \"vks35-cc35-etcd-323-ppwu-35ns1-c1-np2-worker-pztrh-9b2xp-5wp5h\"","TraceId":"282379a9-29e9-44e3-822b-0aa0042116c7"}
{"level":"info","time":"2025-10-20T12:47:19.049072098Z","caller":"wcpguest/controller.go:930","msg":"ControllerPublishVolume: Volume attached successfully \"f04e37f1-aacf-45d3-80fe-8dd9c4951c78-d4a21f0c-4515-41bd-9cb4-c3986e9bf8ae\"","TraceId":"282379a9-29e9-44e3-822b-0aa0042116c7"}

logs:
v1alpha4_manual_testing.log
v1alpha4_csi_controller_syncer.log

Special notes for your reviewer:

Release note:

Fix issue fetch virtual machine with version v1alpha4

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 20, 2025
@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 Oct 20, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @nikhilbarge. Thanks for your PR.

I'm waiting for a github.com 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.

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 the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 20, 2025
@deepakkinni
Copy link
Collaborator

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

@deepakkinni
Copy link
Collaborator

FAILED --- Jenkins Build #484

@deepakkinni
Copy link
Collaborator

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

@deepakkinni
Copy link
Collaborator

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

@deepakkinni
Copy link
Collaborator

FAILED --- Jenkins Build #485

@xing-yang
Copy link
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 Oct 20, 2025
@xing-yang
Copy link
Contributor

How do we know whether v1alpha4 or v1alpha5 are deployed? Are both served?

@nikhilbarge
Copy link
Contributor Author

How do we know whether v1alpha4 or v1alpha5 are deployed? Are both served?

we have upgraded CSI latest vm-op dependency with v1alpha5 version of vm API. CSI have backward compatibility for all api versions of virtualmachines upto v1alpha5. we have logic to fetch VirtualMachines and convert to v1alpha5.

@deepakkinni
Copy link
Collaborator

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

@deepakkinni
Copy link
Collaborator

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

@deepakkinni
Copy link
Collaborator

/ok-to-test

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chethanv28, nikhilbarge

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 20, 2025
@deepakkinni
Copy link
Collaborator

FAILED --- Jenkins Build #493

@xing-yang
Copy link
Contributor

The code change looks fine, but pre-check pipeline didn't pass.

@deepakkinni
Copy link
Collaborator

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

@deepakkinni
Copy link
Collaborator

FAILED --- Jenkins Build #494

@deepakkinni
Copy link
Collaborator

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

@deepakkinni
Copy link
Collaborator

FAILED --- Jenkins Build #494

@deepakkinni
Copy link
Collaborator

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

@deepakkinni
Copy link
Collaborator

FAILED --- Jenkins Build #499

@kolluria
Copy link
Contributor

How do we know whether v1alpha4 or v1alpha5 are deployed? Are both served?

Xing, VM Op team confirmed that only one version will be served and stored at any given time.

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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants