You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Syncing all sources in parallel leads to missing hosts #5571
Using two completely separate satellite sources with the same "Organization" but different "Locations" results in AWX only importing some, but not all, of the hosts into a cumulative inventory.
ENVIRONMENT
AWX version: 9.0.1.0
AWX install method: docker on linux
Ansible version: 2.8.5
Operating System: RHEL 7
Web Browser: Chrome 79.0.3945.88
Red Hat Satellite 6.6
STEPS TO REPRODUCE
Inventories - > Add -> Enter Name ->Save -> Sources -> Add first Satellite server with creds using "Red Hat Satellite 6" for source-> Save
Inventories -> Select previously created inventory -> Sources -> Add -> Add 2nd Satellite server into source -> Save
Select Created Inventory -> Sources -> Click Sync All
"Overwrite, Overwrite Variables, or Update on Launch did not change results.
EXPECTED RESULTS
Expected a total of 350 hosts in Inventory.
ACTUAL RESULTS
Total number of hosts ingested was 180. Cumulative RH Satellite sources results in only a partial number of hosts in the inventory. If two separate inventories are used each utilizing a separate Satellite server, the correct number of hosts are ingested in the inventory.
Just ran through the steps to reproduce and I'm also finding that an inventory w/ two satellite inventory sources doesn't have the number of hosts I'd expect (a simple sum of the number of hosts returned by each inv. source). Digging to see what's going on. Wondering if this issue is specific to foreman or if it's a more general issue w/ awx inventories / inv. sources.
Note: In my testing, I used the new foreman plugin which awx is about to adopt.
I believe I'm able to reproduce this. Followed steps given in description and found that an inv source with 59 hosts and another one with 971 yielded an inventory that reported a total of 1023 hosts (instead of 1030).
I got a list of hosts from each inv. source and, sure enough, found seven ids present in both list. When I look for the associated hostnames of the instances, I can only find them listed in one satellite instance. I think this rules out the possibility that the inventory found duplicate hosts shared by the two sat instances.
The fact that:
seven hosts are missing from the total
the list of host id's shows seven overlapping ids
but these id's point to hosts only present on a single sat6 host
.. leads me to think that there's a race condition in awx when hosts are being created.
changed the title [-]AWX not importing all hosts from Red Hat Satellite sources[/-][+]Syncing all sources in parallel leads to missing hosts[/+]on May 29, 2020
Activity
blomquisg commentedon Feb 28, 2020
@jladdjr check if this is fixed with your inventory plugin work
jladdjr commentedon Feb 28, 2020
Just ran through the steps to reproduce and I'm also finding that an inventory w/ two satellite inventory sources doesn't have the number of hosts I'd expect (a simple sum of the number of hosts returned by each inv. source). Digging to see what's going on. Wondering if this issue is specific to foreman or if it's a more general issue w/ awx inventories / inv. sources.
Note: In my testing, I used the new foreman plugin which awx is about to adopt.
ryanpetrello commentedon Apr 28, 2020
@elyezer @squidboylan @kdelee is this something any of you and yours have bandwidth to test now that we've merged the plugin?
If it doesn't "just work" in the new plugin, we're unlikely to fix it right now.
cc @blomquisg
jladdjr commentedon May 6, 2020
Got side-tracked, poking at this now.
jladdjr commentedon May 6, 2020
I believe I'm able to reproduce this. Followed steps given in description and found that an inv source with 59 hosts and another one with 971 yielded an inventory that reported a total of 1023 hosts (instead of 1030).
I got a list of hosts from each inv. source and, sure enough, found seven ids present in both list. When I look for the associated hostnames of the instances, I can only find them listed in one satellite instance. I think this rules out the possibility that the inventory found duplicate hosts shared by the two sat instances.
The fact that:
.. leads me to think that there's a race condition in awx when hosts are being created.
11 remaining items
jladdjr commentedon May 19, 2020
It looks like we've known this was possible for a while - here's a comment from forever ago:
I've been poking at inventory_import with @AlanCoding and noticed that we're:
which
seems like it would make it possible forguarantees this scenario:In fact, I think @AlanCoding is correct in putting it more strongly:
jladdjr commentedon May 19, 2020
When we added the advisory lock, we needed to make sure that we read in the current state of the inventory after we got the lock:
#3529
jladdjr commentedon May 19, 2020
Thought #7090 might fix the issue, but I'm still seeing missing hosts even when we force inv. updates to happen serially. Doing some more digging.
[-]AWX not importing all hosts from Red Hat Satellite sources[/-][+]Syncing all sources in parallel leads to missing hosts[/+]ryanpetrello commentedon Oct 13, 2020
@AlanCoding @jladdjr @elyezer @elyezer I've put this into
needs_test, and we're merging #7090, which fixes this issue and also fixes https://github.com/ansible/tower/issues/4576one-t commentedon Oct 28, 2020
Verified concurrently with #4576