-
Notifications
You must be signed in to change notification settings - Fork 322
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
Fix ec2 volume creation issue for io1 with iops #177
Fix ec2 volume creation issue for io1 with iops #177
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the time to submit this PR,
In theory the best way to deal with this would be to set suboptions down in the "argument_spec". However, ec2 is an 'old' boto based module that needs rewriting anyway and setting suboptions has a number of complex side effects. As such I think we go with this simple fix.
Please could you add a changelog fragment https://docs.ansible.com/ansible/latest/community/development_process.html#changelogs-how-to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @tremble Changelog has been added
changelogs/fragments/177-fix-ec2-volume-creation-issue-with-iops.yaml
Outdated
Show resolved
Hide resolved
…ps.yaml Co-authored-by: Mark Chappell <mchappel@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, will merge once the tests complete successfully.
SUMMARY
Related to volume creation io1 with iops.
When the volume parameters set with
set_fact
using volume size variable it will causecreate_block_device TypeError: unorderable types: int() > str()
unhandled exception.If we set volume_size just in set_fact, the volume_size parameter will always be a string.
In ec2.py file we have statement
if int(volume['iops']) > MAX_IOPS_TO_SIZE_RATIO * size:
and that means thatiops
parameter will always be int. So this statements triggersTypeError
exception, because we're trying to compare by>
int and string.ISSUE TYPE
COMPONENT NAME
ec2.py
ADDITIONAL INFORMATION
Reproduction:
defaults
main.yml
Task
main.yml
Before change:
After the change, it just works as expected