kubernetes / kubernetes/cloud-provider-openstack
[cinder-csi-plugin] Support for arbitrary volume metadata in storageclass parameters
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 720
- Forks
- 687
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 51
Description
/kind feature
Currently, the cinder-csi-plugin supports a restricted set of StorageClass parameters. There is no mechanism to inject arbitrary Cinder Volume Metadata during the CreateVolume workflow.
In our environment, we use a sidecar agent that watches for volume attachments and enforces iotune values on the libvirt layer based on volume metadata. Using OpenStack Volume Types for this is non-viable because:
- Type Explosion: Managing hundreds of types for different IOPS/Billing permutations is unscalable.
- Performance Impact: In many OpenStack backends, a retype (to change QoS/Metadata) triggers a physical migration of data. Performing a data migration on a volume that is already performance-starved just to update a metadata hint is counter-productive.
Describe the solution you'd like
I propose adding a metadata parameter to the StorageClass. These key-value pairs should be parsed and passed into the Metadata field of the volumes.CreateOpts struct when the driver calls the Cinder API via Gophercloud.
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: gold-tenant-a
provisioner: cinder.csi.openstack.org
parameters:
type: high-performance
# Proposed metadata injection
cinder.xxx/static-metadata/x-iops-limit: "5000"
cinder.xxx/static-metadata/x-billing-code": "34FDVX"
Describe alternatives you've considered
- Unique Volume Types: Too rigid; causes unnecessary physical data movement during QoS adjustments.
The underlying gophercloud/openstack/blockstorage/v3/volumes package already supports Metadata map[string]string in CreateOpts.
I'm willing to contribute to this PR, if everyone agrees it in principle to this feature.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace the cinder-csi-plugin CreateVolume workflow and inspect how StorageClass parameters become gophercloud volumes.CreateOpts. Confirm the metadata parameter convention and ensure arbitrary key-value pairs reach CreateOpts.Metadata during volume creation; done means the requested metadata is present on newly created Cinder volumes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cloud
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100