Bug 1972759

Summary: Stop scheduled inventory status updates if auto upload is not configured
Product: Red Hat Satellite Reporter: James Jeffers <jjeffers>
Component: RH Cloud - InventoryAssignee: Shimon Shtein <sshtein>
Status: CLOSED ERRATA QA Contact: Jameer Pathan <jpathan>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.9.0CC: ahumbe, aruzicka, egolov, osousa, sshtein
Target Milestone: 6.9.4Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-foreman_rh_cloud-3.0.23 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1965239 Environment:
Last Closed: 2021-07-29 12:58:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description James Jeffers 2021-06-16 15:01:41 UTC
+++ This bug was initially created as a clone of Bug #1965239 +++

Currently inventory status will be executed no matter what.

Comment 2 Jameer Pathan 2021-06-18 08:26:53 UTC
Hello Shim,

I have disabled "Automatic inventory upload" setting on Configure > Inventory upload page, 
but I can still see "Inventory scheduled sync" task on Monitor > Recurring logics page as Active.
Is this expected?

Comment 3 Shimon Shtein 2021-06-20 07:41:47 UTC
Yes, it's expected. To check this feature, you should disable the scheduled sync and cause a re-plan of the task. If you have debug logging on, it will show you the message as you can see it here: https://github.com/theforeman/foreman_rh_cloud/blob/638a0915e6ae4f1d1501fc6fbc7eb173ed2f6892/lib/inventory_sync/async/inventory_scheduled_sync.rb#L8

The concept is that the scheduled task is always there, but it does not plan InventoryFullSync tasks unless the setting is true.

Comment 10 Jameer Pathan 2021-07-08 12:50:56 UTC
Verified

Verified with:
- Satellite 6.9.4 snap 1
- tfm-rubygem-foreman_rh_cloud-3.0.23-1.el7sat.noarch

Test steps:
- Register satellite host with insights.
- Sync inventory status
- Wait for "Inventory scheduled sync" task to execute. (Changed wait time to 1 minute for testing)
- After task is executed check whether the satellite shows successful inventory upload for the host.
- Disable "Automatic inventory upload" setting.
- unregister host from insights OR Delete host from cloud.
- Wait for "Inventory scheduled sync" task to execute.

Observation:
- When "Automatic inventory upload" setting is disabled then "Inventory scheduled sync" task 
doesn't sync the inventory status.

Comment 15 errata-xmlrpc 2021-07-29 12:58:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Satellite 6.9.4 Async Bug Fix Update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:2948

Comment 16 errata-xmlrpc 2021-07-29 13:02:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Satellite 6.9.4 Async Bug Fix Update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:2948