Ansible module - ec2_elb Failing with Boto exeception ( throttling )

149 views
Skip to first unread message

Nate Dobbs

unread,
Sep 30, 2014, 11:49:30 AM9/30/14
to ansible...@googlegroups.com
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 <module>
    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
<ErrorResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/">
  <Error>
    <Type>Sender</Type>
    <Code>Throttling</Code>
    <Message>Rate exceeded</Message>
  </Error>
  <RequestId>1a08966d-48b8-11e4-8ddc-e3515a48666b</RequestId>
</ErrorResponse>

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

Michael DeHaan

unread,
Oct 1, 2014, 8:16:06 AM10/1/14
to ansible...@googlegroups.com
For starters, what ansible --version are you using?



--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/10b7e184-cd7f-44de-bfc3-a182853b27b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nate Dobbs

unread,
Oct 1, 2014, 1:29:55 PM10/1/14
to ansible...@googlegroups.com
Thank you for replying. I knew I left something out.

Ansible version: ansible 1.7.2
Boto version: 2.32.1

Michael DeHaan

unread,
Oct 2, 2014, 11:49:38 AM10/2/14
to ansible...@googlegroups.com
Ok, can you please file a ticket on the github.com/ansible/ansible-modules-core repo?

Thanks!



Nate Dobbs

unread,
Oct 7, 2014, 10:09:58 AM10/7/14
to ansible...@googlegroups.com
Simply updating thread to include issue for cross reference.

On Wed, Oct 1, 2014 at 1:29 PM, Nate Dobbs <misconfi...@gmail.com> wrote:

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/90SfNANCL00/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.

To post to this group, send email to ansible...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Cheers,

Nate Dobbs RHCE
Reply all
Reply to author
Forward
0 new messages