kubernetes-sigs / aws-ebs-csi-driver

CSI driver for Amazon EBS https://aws.amazon.com/ebs/
Apache License 2.0
998 stars 800 forks source link

Modify size and volume options in one API call #2113

Closed csuzhangxc closed 3 months ago

csuzhangxc commented 3 months ago

Is your feature request related to a problem? Please describe.

EBS has a cooldown period after modifying a volume.

If we change the spec.volumeAttributesClassName and spec.resources for a PVC in one Kubernetes call.

The CSI driver will ModifyVolume and ExpandVolume in two separated AWS API calls, then one of them will be blocked as the cooldown period of EBS.

I'm not tested yet. Does Coalescer have the function to merge theses requests?

https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/d560c06cf4925d3a6006f4ff065124a2c9041e78/pkg/driver/controller.go#L595-L598

https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/d560c06cf4925d3a6006f4ff065124a2c9041e78/pkg/driver/controller.go#L562-L564

Describe the solution you'd like in detail

The API call to AWS includes both size and IOPS/throughput... options

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

ConnorJC3 commented 3 months ago

Hi @csuzhangxc - yes, that is the purpose of our coalescer. As long as you modify the volume's size and VAC at the same time, it should, under normal circumstances, be coalesced into a single EC2 ModifyVolume call.

Please reach out if you need any assistance or encounter any bugs with the coalescer.

torredil commented 3 months ago

+1 to Connor's comment.

I've validated that coalescing is working as described above:

Action=ModifyVolume&Iops=10000&Size=200&Version=2016-11-15&VolumeId=vol-00a9fb5a488e96fb2&VolumeType=io2
SDK 2024/08/14 18:19:48 DEBUG Response
HTTP/1.1 200 OK
...
380
<?xml version="1.0" encoding="UTF-8"?>
<ModifyVolumeResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
    <requestId>xxxxxx-6827-4787-b594-cd5395101ad7</requestId>
    <volumeModification>
        <modificationState>modifying</modificationState>
        <originalIops>3000</originalIops>
        <originalMultiAttachEnabled>false</originalMultiAttachEnabled>
        <originalSize>100</originalSize>. <---------------
        <originalThroughput>125</originalThroughput>
        <originalVolumeType>gp3</originalVolumeType> <---------------
        <targetSize>200</targetSize>  <---------------
        <targetVolumeType>io2</targetVolumeType> <-----------
    </volumeModification>
</ModifyVolumeResponse>

Closing as the query is resolved, but please feel free to open a new issue if you need further help.

/kind support /close

k8s-ci-robot commented 3 months ago

@torredil: Closing this issue.

In response to [this](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/issues/2113#issuecomment-2289556387): >+1 to Connor's comment. > >I've validated that coalescing is working as described above: > >``` >Action=ModifyVolume&Iops=10000&Size=200&Version=2016-11-15&VolumeId=vol-00a9fb5a488e96fb2&VolumeType=io2 >SDK 2024/08/14 18:19:48 DEBUG Response >HTTP/1.1 200 OK >... >380 > > > xxxxxx-6827-4787-b594-cd5395101ad7 > > modifying > 3000 > false > 100. <--------------- > 125 > gp3 <--------------- > 200 <--------------- > io2 <----------- > > >``` > >Closing as the query is resolved, but please feel free to open a new issue if you need further help. > >/kind support >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.