# Ansible module - ec2\_elb Failing with Boto exeception ( throttling )

**URL:** <https://forum.ansible.com/t/ansible-module-ec2-elb-failing-with-boto-exeception-throttling/16382>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [September 30, 2014, 3:49pm UTC](https://forum.ansible.com/t/ansible-module-ec2-elb-failing-with-boto-exeception-throttling/16382 "2014-09-30T15:49:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nate\_Dobbs](https://avatars.discourse-cdn.com/v4/letter/n/7cd45c/32.png) [@Nate\_Dobbs](https://forum.ansible.com/u/Nate_Dobbs)\
**Post date:** [September 30, 2014, 3:49pm UTC](https://forum.ansible.com/t/ansible-module-ec2-elb-failing-with-boto-exeception-throttling/16382/1 "2014-09-30T15:49:30Z")

</div>

Hello fellow ansible users.

I have a process that turns on ec2 instances, then subsequently adds said instances to their respective load balancers. I get very intermittent results, sometimes the playbook will complete successfully, even consecutively at times. No matter what I do, ( change logic, implement ‘pauses’ etc, setting and retrieving facts ) I can not get around this AWS throttling message.

ansible code:

- name: starting instance(s)  
when: instance\_id is defined and lights\_on|default (“false”) == “true”  
local\_action: ec2  
args:  
region: ‘us-west-2’  
instance\_ids: “{{ instance\_id }}”  
state: ‘running’  
wait: ‘yes’  
wait\_timeout: ‘300’  
register: ec2

- name: Pausing, trying to avoid AWS throttling  
pause: minutes=10

- name: registering instance to its respective groups ELB

# instances that do not require ELBs do not need to run this part of the playbook

when: elb\_shortname is defined and lights\_on|default (“false”) == “true”  
local\_action: ec2\_elb  
args:  
region: ‘us-west-2’  
state: ‘present’  
wait: ‘yes’  
wait\_timeout: ‘300’

Output:

TASK: [roles/lights\_on | registering instance to its respective groups ELB] \*\*\*  
failed: [tstmaorawss01 → 127.0.0.1] =\> {“failed”: true, “parsed”: false}  
invalid output was: Traceback (most recent call last):  
File “/Users/ndobbs/.ansible/tmp/ansible-tmp-1412091621.06-77576803493759/ec2\_elb”, line 1874, in   
main()  
File “/Users/ndobbs/.ansible/tmp/ansible-tmp-1412091621.06-77576803493759/ec2\_elb”, line 326, in main  
elb\_man.register(wait, enable\_availability\_zone, timeout)  
File “/Users/ndobbs/.ansible/tmp/ansible-tmp-1412091621.06-77576803493759/ec2\_elb”, line 159, in register  
self.\_await\_elb\_instance\_state(lb, ‘InService’, initial\_state, timeout)  
File “/Users/ndobbs/.ansible/tmp/ansible-tmp-1412091621.06-77576803493759/ec2\_elb”, line 196, in \_await\_elb\_instance\_state  
instance\_state = self.\_get\_instance\_health(lb)  
File “/Users/ndobbs/.ansible/tmp/ansible-tmp-1412091621.06-77576803493759/ec2\_elb”, line 244, in \_get\_instance\_health  
status = lb.get\_instance\_health([self.instance\_id])[0]  
File “/Library/Python/2.7/site-packages/boto/ec2/elb/loadbalancer.py”, line 324, in get\_instance\_health  
return self.connection.describe\_instance\_health(self.name, instances)  
File “/Library/Python/2.7/site-packages/boto/ec2/elb/ **init**.py”, line 547, in describe\_instance\_health  
[(‘member’, InstanceState)])  
File “/Library/Python/2.7/site-packages/boto/connection.py”, line 1166, in get\_list  
raise self.ResponseError(response.status, response.reason, body)  
boto.exception.BotoServerError: BotoServerError: 400 Bad Request  
  
  
Sender  
`Throttling`  
Rate exceeded  
  
1a08966d-48b8-11e4-8ddc-e3515a48666b

Any insights as to what I can change to make this successful would be greatly appreciated. Thank you for your time.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [October 1, 2014, 12:16pm UTC](https://forum.ansible.com/t/ansible-module-ec2-elb-failing-with-boto-exeception-throttling/16382/2 "2014-10-01T12:16:02Z")

</div>

For starters, what ansible --version are you using?

---

<div class="post-metadata">

**Author:** ![Nate\_Dobbs](https://avatars.discourse-cdn.com/v4/letter/n/7cd45c/32.png) [@Nate\_Dobbs](https://forum.ansible.com/u/Nate_Dobbs)\
**Post date:** [October 1, 2014, 5:29pm UTC](https://forum.ansible.com/t/ansible-module-ec2-elb-failing-with-boto-exeception-throttling/16382/3 "2014-10-01T17:29:55Z")

</div>

Thank you for replying. I knew I left something out.

Ansible version: ansible 1.7.2  
Boto version: 2.32.1

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [October 2, 2014, 3:49pm UTC](https://forum.ansible.com/t/ansible-module-ec2-elb-failing-with-boto-exeception-throttling/16382/4 "2014-10-02T15:49:33Z")

</div>

Ok, can you please file a ticket on the [github.com/ansible/ansible-modules-core](http://github.com/ansible/ansible-modules-core) repo?

Thanks!

---

<div class="post-metadata">

**Author:** ![Nate\_Dobbs](https://avatars.discourse-cdn.com/v4/letter/n/7cd45c/32.png) [@Nate\_Dobbs](https://forum.ansible.com/u/Nate_Dobbs)\
**Post date:** [October 7, 2014, 2:09pm UTC](https://forum.ansible.com/t/ansible-module-ec2-elb-failing-with-boto-exeception-throttling/16382/5 "2014-10-07T14:09:48Z")

</div>

issue has been submitted: [https://github.com/ansible/ansible-modules-core/issues/143](https://github.com/ansible/ansible-modules-core/issues/143)

Simply updating thread to include issue for cross reference.
