Merge pull request #66728 from gnufied/fix-volume-modifition-aws

Automatic merge from submit-queue (batch tested with PRs 66489, 66728, 66739). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Speed up volume modifications on AWS

Volume becomes reusable after it reached optimizing state.

/sig storage
/sig aws


```release-note
Make EBS volume expansion faster
```

cc @d-nishi @kokhang
This commit is contained in:
Kubernetes Submit Queue 2018-07-30 17:10:04 -07:00 committed by GitHub
commit 1f8b3fded9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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