# Async issues in ansible

**URL:** <https://forum.ansible.com/t/async-issues-in-ansible/37263>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [October 25, 2022, 10:26am UTC](https://forum.ansible.com/t/async-issues-in-ansible/37263 "2022-10-25T10:26:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shivani\_Arora](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@Shivani\_Arora](https://forum.ansible.com/u/Shivani_Arora)\
**Post date:** [October 25, 2022, 10:26am UTC](https://forum.ansible.com/t/async-issues-in-ansible/37263/1 "2022-10-25T10:26:40Z")

</div>

Hi All,

I’m trying to take snapshots of aws ebs volumes using ansible. But my playbook fails when the volume size is big ( \>1024 GB) with the below error. Unable to figure out if it is an async issue or if something else causing it. Looking forward to any suggestions or alternatives to achieve the same.

**Ansible playbook:**

tasks:

- block:

- name: Snapshot the EBS volume.  
amazon.aws.ec2\_snapshot:  
profile: “{{ aws\_profile\_name }}”  
region: “{{ aws\_region }}”  
volume\_id: “{{ item }}”  
snapshot\_tags:  
Name: “snapshot\_test”  
date: “{{ ansible\_date\_time.date }}”  
with\_items:

- “vol-0dc6e684fcd5f82d3”

- “vol-0c5f08c0dcb53a1e2”

- “vol-06cbff0337132054b”  
async: 1800  
poll: 0  
register: snapshot\_jobs

- name: Print out all the snapshot jobs  
debug:  
msg: “{{ item }}”  
with\_items: “{{ snapshot\_jobs.results }}”

- name: Check the status of snapshot jobs  
async\_status: jid={{ item.ansible\_job\_id }}  
register: job\_result  
until: job\_result.finished  
retries: 45  
delay: 120  
with\_items: “{{ snapshot\_jobs.results }}”

**The error I’m getting is on the last task (Check the status of snapshot jobs) -**

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: botocore.exceptions.WaiterError: Waiter snapshot\_completed failed: Max attempts exceeded  
failed: [localhost] (item={‘failed’: 0, ‘started’: 1, ‘finished’: 0, ‘ansible\_job\_id’: ‘562261181848.42040’, ‘results\_file’: ‘/users/shivania/.ansible\_async/562261181848.42040’, ‘changed’: True, ‘item’: ‘vol-0dc6e684fcd5f82d3’, ‘ansible\_loop\_var’: ‘item’}) =\> {“ansible\_job\_id”: “562261181848.42040”, “ansible\_loop\_var”: “item”, “attempts”: 7, “boto3\_version”: “1.20.24”, “botocore\_version”: “1.23.24”, “changed”: false, “finished”: 1, “item”: {“ansible\_job\_id”: “562261181848.42040”, “ansible\_loop\_var”: “item”, “changed”: true, “failed”: 0, “finished”: 0, “item”: “vol-0dc6e684fcd5f82d3”, “results\_file”: “/users/shivania/.ansible\_async/562261181848.42040”, “started”: 1}, “msg”: “Timed out while creating snapshot: Waiter snapshot\_completed failed: Max attempts exceeded”, “results\_file”: “/users/shivania/.ansible\_async/562261181848.42040”, “started”: 1, “stderr”: “”, “stderr\_lines”: , “stdout”: “”, “stdout\_lines”: }

-bash-4.2$ ansible --version  
ansible [core 2.12.1]

Any help will be appreciated!

Thanks.

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [October 25, 2022, 10:50am UTC](https://forum.ansible.com/t/async-issues-in-ansible/37263/2 "2022-10-25T10:50:18Z")

</div>

Have you tried increasing the wait\_timeout of the module?

[https://docs.ansible.com/ansible/latest/collections/amazon/aws/ec2\_snapshot\_module.html#parameter-wait\_timeout](https://docs.ansible.com/ansible/latest/collections/amazon/aws/ec2_snapshot_module.html#parameter-wait_timeout)
