AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
14.11k
stars
3.43k
forks
source link
Job slicing does not respect host limit, leading to unnecessary job failures #15589
[X] I understand that AWX is open source software provided for free and that I might not receive a timely response.
[X] I am NOT reporting a (potential) security vulnerability. (These should be emailed to security@ansible.com instead.)
Bug Summary
I have a job template that runs against approximately 50 hosts. To speed up execution, I've set Job Slicing to 5, which effectively runs 5 parallel jobs against 10 hosts each.
However, when I run this job template with a limit set to target only 2 hosts, the job still creates 5 slices. As a result:
1 slice succeeds (processing the 2 limited hosts).
4 slices fail because they have no hosts to run against.
This behavior causes the overall job to report failures, and since I have alerting configured, I receive unnecessary failure notifications.
My deployment of AAP is in VMs.
AWX version
AAP 2.4
Select the relevant components
[ ] UI
[ ] UI (tech preview)
[ ] API
[ ] Docs
[ ] Collection
[ ] CLI
[ ] Other
Installation method
N/A
Modifications
no
Ansible version
No response
Operating system
RHEL 8
Web browser
No response
Steps to reproduce
Create a job template with Job Slicing set to 5.
Set a limit to target a small number of hosts (e.g., 2 hosts).
Launch the job template.
Observe that multiple slices fail due to having no hosts assigned.
Expected results
When a limit is set that results in fewer hosts than the number of slices, AWX should adjust the number of slices accordingly. In this case, it should:
Create only 1 slice to handle the 2 hosts.
Avoid creating additional slices that have no hosts to process.
Actual results
AWX creates the maximum number of slices specified (5 in this case), regardless of the number of hosts after applying the limit.
Slices without any hosts assigned fail, impacting the overall job status.
Please confirm the following
security@ansible.com
instead.)Bug Summary
I have a job template that runs against approximately 50 hosts. To speed up execution, I've set Job Slicing to 5, which effectively runs 5 parallel jobs against 10 hosts each.
However, when I run this job template with a limit set to target only 2 hosts, the job still creates 5 slices. As a result:
This behavior causes the overall job to report failures, and since I have alerting configured, I receive unnecessary failure notifications.
My deployment of AAP is in VMs.
AWX version
AAP 2.4
Select the relevant components
Installation method
N/A
Modifications
no
Ansible version
No response
Operating system
RHEL 8
Web browser
No response
Steps to reproduce
Expected results
When a limit is set that results in fewer hosts than the number of slices, AWX should adjust the number of slices accordingly. In this case, it should:
Actual results
Additional information
Perhaps this is fixed in AAP 2.5?