From d0c2d3fe892d5fc63412d0911e3646c826bbe06a Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Fri, 27 Jul 2018 16:19:16 -0400 Subject: [PATCH] Speed up volume modifications on AWS Volume becomes reusable after it reached optimizing state --- pkg/cloudprovider/providers/aws/aws.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/cloudprovider/providers/aws/aws.go b/pkg/cloudprovider/providers/aws/aws.go index 1fad5ae53d6..1319294022d 100644 --- a/pkg/cloudprovider/providers/aws/aws.go +++ b/pkg/cloudprovider/providers/aws/aws.go @@ -1796,7 +1796,9 @@ func (d *awsDisk) modifyVolume(requestGiB int64) (int64, error) { return false, err } - if aws.StringValue(volumeModification.ModificationState) == ec2.VolumeModificationStateCompleted { + // According to https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring_mods.html + // Size changes usually take a few seconds to complete and take effect after a volume is in the Optimizing state. + if aws.StringValue(volumeModification.ModificationState) == ec2.VolumeModificationStateOptimizing { return true, nil } return false, nil