Skip to content
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

ec2_vol passes null iops to boto when changing type w/ existing iops value #605

Closed
1 task done
lowlydba opened this issue Jan 8, 2022 · 0 comments · Fixed by #606
Closed
1 task done

ec2_vol passes null iops to boto when changing type w/ existing iops value #605

lowlydba opened this issue Jan 8, 2022 · 0 comments · Fixed by #606

Comments

@lowlydba
Copy link
Contributor

lowlydba commented Jan 8, 2022

Summary

When attempting to modify an existing io1 volume to io2 and supplying the existing iops value, the iops in req_obj is never set and boto rejects it due to the missing required parameter.

if target_iops:
original_iops = volume['iops']
if target_iops != original_iops:
iops_changed = True
req_obj['Iops'] = target_iops

The following fixes it:

        if target_iops:
            original_iops = volume['iops']
            if target_iops != original_iops:
                iops_changed = True
                req_obj['Iops'] = target_iops
            else:
                req_obj['Iops'] = original_iops

I'd like to open a PR with this change to both main and stable-1.5.

Issue Type

Bug Report

Component Name

ec2_vol

Ansible Version

ansible [core 2.11.6] 

Collection Versions

Collection            Version
--------------------- -------
amazon.aws            1.5.1  
ansible.windows       1.8.0  
community.aws         1.5.0  
community.docker      1.10.2 
community.hashi_vault 2.1.0  
community.windows     1.8.0  

AWS SDK versions

Name: boto
Version: 2.49.0
Summary: Amazon Web Services Library
Home-page: https://github.com/boto/boto/
Author: Mitch Garnaat
Author-email: [email protected]
License: MIT
Location: /Users/john.mccall/.pyenv/versions/3.6.5/lib/python3.6/site-packages
Requires: 
Required-by: 
Name: boto3
Version: 1.18.31
Summary: The AWS SDK for Python
Home-page: https://github.com/boto/boto3
Author: Amazon Web Services
Author-email: 
License: Apache License 2.0
Location: /Users/john.mccall/.pyenv/versions/3.6.5/lib/python3.6/site-packages
Requires: botocore, jmespath, s3transfer
Required-by: 
Name: botocore
Version: 1.21.31
Summary: Low-level, data-driven core of boto 3.
Home-page: https://github.com/boto/botocore
Author: Amazon Web Services
Author-email: 
License: Apache License 2.0
Location: /Users/john.mccall/.pyenv/versions/3.6.5/lib/python3.6/site-packages
Requires: urllib3, jmespath, python-dateutil
Required-by: s3transfer, boto3

Configuration

No response

OS / Environment

MacOSX

Steps to Reproduce

amazon.aws.ec2_vol:
        region: "region-name"
        name: "disk-name"
        device_name: "device-name"
        volume_type: io2
        volume_size: 50
        iops: 16000
        modify_volume: true

Expected Results

I expect the existing io1 volume to change to io2, but it errors out with the below.

Actual Results

The error was: botocore.exceptions.ClientError: An error occurred (InvalidParameterCombination) when calling the ModifyVolume operation: The parameter iops must be specified for io2 volumes.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@lowlydba lowlydba changed the title ec2_vol passes null iops when changing io1 to io2 ec2_vol passes null iops to boto when changing type w/ existing iops value Jan 8, 2022
ansible-zuul bot pushed a commit that referenced this issue Jan 12, 2022
ec2_vol: set iops even if unchanged for boto req

SUMMARY

Set the iops value in req_obj even if the target iops is the same as the existing. This is a required parameter for boto's modify_volume. Fixes #605
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME
ec2_vol

Reviewed-by: None <None>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: None <None>
patchback bot pushed a commit that referenced this issue Jan 12, 2022
ec2_vol: set iops even if unchanged for boto req

SUMMARY

Set the iops value in req_obj even if the target iops is the same as the existing. This is a required parameter for boto's modify_volume. Fixes #605
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ec2_vol

Reviewed-by: None <None>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: None <None>
(cherry picked from commit 038c047)
patchback bot pushed a commit that referenced this issue Jan 14, 2022
ec2_vol: set iops even if unchanged for boto req

SUMMARY

Set the iops value in req_obj even if the target iops is the same as the existing. This is a required parameter for boto's modify_volume. Fixes #605
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ec2_vol

Reviewed-by: None <None>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: None <None>
(cherry picked from commit 038c047)
ansible-zuul bot pushed a commit that referenced this issue Jan 14, 2022
[PR #606/038c0474 backport][stable-2] ec2_vol: set iops even if unchanged for boto req

This is a backport of PR #606 as merged into main (038c047).
SUMMARY

Set the iops value in req_obj even if the target iops is the same as the existing. This is a required parameter for boto's modify_volume. Fixes #605
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME
ec2_vol

Reviewed-by: Jill R <None>
Reviewed-by: None <None>
softwarefactory-project-zuul bot pushed a commit that referenced this issue Apr 12, 2022
…hanged for boto req (#614)

[PR #606/038c0474 backport][stable-1.5] ec2_vol: set iops even if unchanged for boto req

Depends-On: #753
This is a backport of PR #606 as merged into main (038c047).
SUMMARY

Set the iops value in req_obj even if the target iops is the same as the existing. This is a required parameter for boto's modify_volume. Fixes #605
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME
ec2_vol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant