Skip to content

Add new CnsNodeVmBatchAttachment CRD and its reconcilation #3320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

skogta
Copy link
Contributor

@skogta skogta commented Jun 2, 2025

What this PR does / why we need it:
This PR adds the CnsNodeVmBatchAttachment CRD to allow batch attach for multiple volumes attaching to the same VM.

Testing done:
Created the following CnsNodeVmBatchAttachment CR

apiVersion: cns.vmware.com/v1alpha1
kind: CnsNodeVmBatchAttachment
metadata:
  name: test-8
  namespace: test
spec:
  nodeuuid: fe14f0ed-e99c-44d6-afa7-94a64fd6a108
  volumes:
    disk-1:
      pvcName: pvc-1
      diskMode: independentPersistent
      sharingMode: sharingMultiwriter
    disk-2:
      pvcName: pvc-2
      diskMode: "independentPersistent"
      controllerKey: 12345678

Observed that status got updated:

Name:         test-8
Namespace:    test
Labels:       <none>
Annotations:  <none>
API Version:  cns.vmware.com/v1alpha1
Kind:         CnsNodeVmBatchAttachment
Metadata:
  Creation Timestamp:  2025-06-18T06:46:01Z
  Finalizers:
    cns.vmware.com
  Generation:        3
  Resource Version:  2667479
  UID:               db95d6f6-20cd-45b0-92ec-146c12a79538
Spec:
  Nodeuuid:  fe14f0ed-e99c-44d6-afa7-94a64fd6a108
  Volumes:
    disk-1:
      Disk Mode:     independentPersistent
      Pvc Name:      pvc-1
      Sharing Mode:  sharingMultiwriter
    disk-2:
      Controller Key:  12345678
      Disk Mode:       independentPersistent
      Pvc Name:        pvc-2
Status:
  Volume Status:
    pvc-1:
      Attach State:   ATTACH_COMPLETED
      Cns Volume Id:  0328372e-d7c3-4687-8d94-eb42c88f1365
      Diskuuid:       6000C29e-d2c8-8782-4464-f7c7e1f2593d
    pvc-2:
      Attach State:   ATTACH_COMPLETED
      Cns Volume Id:  0328372e-d7c3-4687-8d94-eb42c88f1365
      Diskuuid:       6000C29e-d2c8-8782-4464-f7c7e1f2593d
Events:               <none>

Removed pvc-2 from the CR and observed that the status also got updated accordingly.

Name:         test-8
Namespace:    test
Labels:       <none>
Annotations:  <none>
API Version:  cns.vmware.com/v1alpha1
Kind:         CnsNodeVmBatchAttachment
Metadata:
  Creation Timestamp:  2025-06-18T06:46:01Z
  Finalizers:
    cns.vmware.com
  Generation:        6
  Resource Version:  2668175
  UID:               db95d6f6-20cd-45b0-92ec-146c12a79538
Spec:
  Nodeuuid:  fe14f0ed-e99c-44d6-afa7-94a64fd6a108
  Volumes:
    disk-1:
      Disk Mode:     independentPersistent
      Pvc Name:      pvc-1
      Sharing Mode:  sharingMultiwriter
Status:
  Volume Status:
    pvc-1:
      Attach State:   ATTACH_COMPLETED
      Cns Volume Id:  0328372e-d7c3-4687-8d94-eb42c88f1365
      Diskuuid:       6000C29e-d2c8-8782-4464-f7c7e1f2593d
Events:               <none>

Verified from logs that attach and detach APIs are being called.

Yet to write unit tests.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: skogta
Once this PR has been reviewed and has the lgtm label, please assign akankshapanse for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 requested a review from chethanv28 June 2, 2025 07:06
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 2, 2025
@k8s-ci-robot k8s-ci-robot requested a review from xing-yang June 2, 2025 07:06
@skogta skogta marked this pull request as draft June 2, 2025 07:06
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 2, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @skogta. 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.

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/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 2, 2025
@skogta skogta force-pushed the topic/skogta/nodeVmAttachmentBatchCrd branch 3 times, most recently from 4130679 to bc4c2c8 Compare June 3, 2025 07:33
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 3, 2025
@divyenpatel
Copy link
Member

PR title should say "Add new CnsNodeVmBatchAttachment CRD"

@skogta skogta force-pushed the topic/skogta/nodeVmAttachmentBatchCrd branch 6 times, most recently from 58300fd to 8b67065 Compare June 16, 2025 13:31
@skogta skogta marked this pull request as ready for review June 16, 2025 13:31
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 16, 2025
@skogta skogta force-pushed the topic/skogta/nodeVmAttachmentBatchCrd branch 3 times, most recently from 3cca10c to e0c43b2 Compare June 17, 2025 05:19
@skogta skogta force-pushed the topic/skogta/nodeVmAttachmentBatchCrd branch 2 times, most recently from f158219 to 8e0726c Compare June 17, 2025 07:31
@skogta skogta force-pushed the topic/skogta/nodeVmAttachmentBatchCrd branch from 8e0726c to 5c89fe4 Compare June 18, 2025 06:51
@skogta skogta changed the title Add new CnsNodeVmAttachment CRD Add new CnsNodeVmBatchAttachment CRD and its reconcilation Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants