Bug 2022743

Summary: When SCA is enabled, Rest API of Satellite 6 can not attach subscriptions to the host whereas subscription-manager can.
Product: Red Hat Satellite Reporter: Sayan Das <saydas>
Component: Subscription ManagementAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Cole Higgins <chiggins>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.9.7CC: ahumbe, janarula, jlenz, momran, peter.vreman, rjerrido
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-01-10 13:18:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Reproducer commands and outputs none

Description Sayan Das 2021-11-12 13:43:19 UTC
Description of problem:

There are some functionality differences observed in the Rest API of Satellite 6 and subscription-manager in terms of Simple Content Access mode.

---------------------------------------------------------------
Actions (For Subscriptions)	|      SCA    	|    NON-SCA  |
---------------------------------------------------------------
sub-man attach			|	Y	|	Y     |
sub-man auto-attach		|	N	|	Y     |
sub-man remove			|	Y	|	Y     |

Sat API attach to Host		|	N	|	Y     |
Sat API auto-attach to Host	|	N	|	Y     |
Sat API remove from host	|	Y	|	Y     |

Sat API attach to AK		|	N	|	Y     |
Sat API remove from AK		|	Y	|	Y     |
---------------------------------------------------------------


Version-Release number of selected component (if applicable):

Satellite 6.9 and above

How reproducible:

Always


Steps to Reproduce:

Please check the reproducer.txt file attached on the Bugzilla. 


Actual results:

Using subscription-manager we can attach subscription to the host even while SCA is enabled but Satellite API fails to do so.

Satellite API also fails to attach subscriptions to any activation key.

But in both cases, Satellite API will be able to remove subscription i.e. from both HOst and Activation key.


Expected results:

A consistent behavior should be present for all subscription_management tools when it comes to SCA.

Either disable the subscription attachment feature completely for subscription-manager when SCA is enabled or re-enable the capability of satellite REST api to be able to attach the subscriptions on the hosts as well as activation keys.


Additional info:

We created a simple content access feature, to give some relaxation to the end-users i.e. even if they don't attach subscriptions to the hosts, they can use yum without worrying about overconsumption of the subscriptions or anything else but we never said, they are not allowed to attach any subscriptions to hosts. 

So we either need to make our point of view clear to the end-users if we expect to have no subscriptions attached to the systems at all or if we leave that choice to the end-users, then have the subscription_management tools behave in a consistent way.

There's no problem in having auto-attach disabled but manual attachment should work.

Comment 1 Sayan Das 2021-11-12 13:44:30 UTC
Created attachment 1841445 [details]
Reproducer commands and outputs

Comment 2 Peter Vreman 2021-11-15 19:17:58 UTC
The inconsistency already starts immediately after enabling SCA. At that time all existing Hosts and ActivationKeys still have the old Subscription Pools attached.
At that time with SCA enabled you can not create an new ActivationKey with Subscription Pools attached, but an existing ActiviationKey can still have the Subscription Pools attazched.

This is major Bug because it breaks Backwards Combability, the API behavior is changed and is now breaking Sat6 Provision Scripts.