Bug 1401106

Summary: [RFE] Subscription-Intent: Allow a user to express the intent of how a subscription should be used, using a rules based syntax.
Product: Red Hat Satellite Reporter: Rich Jerrido <rjerrido>
Component: CandlepinAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WONTFIX QA Contact: jcallaha
Severity: unspecified Docs Contact:
Priority: medium    
Version: 6.3.0CC: ajambhul, aperotti, arusso, bbenson, bcourt, bkearney, chorn, daniele, dgross, egolov, gtaylor, jberry86, jcallaha, jdickers, jentrena, khowell, klaas, ktordeur, mlinden, mmccune, momran, mtenheuv, nsamant, pdudley, rchanter, rdixon, rjerrido, smane, smeyer, sokeeffe, vanhoof, vmeghana, wpinheir, yoliynyk
Target Milestone: UnspecifiedKeywords: FutureFeature, PrioBumpField, PrioBumpGSS, PrioBumpPM, SubscriptionExperience
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-03 10:21:52 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:
Bug Depends On:    
Bug Blocks: 1296845, 1353215, 1399395, 1476375, 1650573    

Description Rich Jerrido 2016-12-02 20:55:11 UTC
Description of problem:


As aa user of Satellite 6, I would like the ability to attach subscriptions based upon known subscription-manager facts. 

At registration time, the client reports its facts (via subscription-manager facts). I would like the ability to create a list of rules which govern how subscriptions get attached, based upon those system facts. 

Maybe an ordered list that states something like

if network.ipv4_address == 192.168.*.*, attach qty 1 of '$SOME_SUB'
if dmi.system.manufacturer == 'HP', attach qty 2 of $SOME_OTHER SUB. 

This capability should support booleans (AND, OR & NOT)

The idea is that end users purchases subs based upon particular facts (I purchase $X subs for dev systems, or $Y subs for physical systems. This capability will allow them to reflect that within Satellite 6.

Comment 2 Rich Jerrido 2017-01-09 18:12:17 UTC
Thinking about this a bit more, this would be a functionality/feature that would be useful as an organizational setting in addition to (or in lieu of) it being an activation key feature. 

As hosts/consumers can be created via means other than registration via subscription-manager (such as via virt-who or hammer csv), it may make sense to have this logic somewhere that covers all registration methods.

Comment 9 Barnaby Court 2017-04-03 17:38:28 UTC
*** Bug 1436822 has been marked as a duplicate of this bug. ***

Comment 13 Rich Jerrido 2017-12-14 21:15:24 UTC
*** Bug 1339286 has been marked as a duplicate of this bug. ***

Comment 14 Rich Jerrido 2017-12-14 21:16:37 UTC
*** Bug 1443108 has been marked as a duplicate of this bug. ***

Comment 15 Rich Jerrido 2017-12-16 10:38:02 UTC
*** Bug 1459551 has been marked as a duplicate of this bug. ***

Comment 16 Rich Jerrido 2018-01-18 15:49:06 UTC
*** Bug 1423505 has been marked as a duplicate of this bug. ***

Comment 17 Rich Jerrido 2018-01-18 15:49:36 UTC
*** Bug 1500959 has been marked as a duplicate of this bug. ***

Comment 18 Rich Jerrido 2018-02-26 19:30:40 UTC
*** Bug 1478080 has been marked as a duplicate of this bug. ***

Comment 20 Rich Jerrido 2018-07-24 15:06:05 UTC
*** Bug 1308544 has been marked as a duplicate of this bug. ***

Comment 22 Daniele Palumbo 2018-10-01 14:37:42 UTC
"attach qty 2 of $SOME_OTHER SUB."
is suitable on some condition but not all.
Likely "attach qty needed", having the math done by Satellite, is a common configuration.

Comment 23 Daniele Palumbo 2018-10-01 14:52:05 UTC
Some more considerations, please forgive the facts name, this is to explain just the expectation

if type = "hypervisor" and vmware.cluster="vdc_cluster" ( # start of a condition
if ( vmware.cluster_guests_members / vmware.cluster_host_members > 5), attach ( ( "RHEL Premium VDC subscription" or "RHEL Standard VDC subscription" ) and ("Smart Management Premium VDC Subscription" or "Smart Management Standard VDC Subscription" ) ) # mixed variables need to be evaluated. Math operations has to be possible.
else --attach Nil # remove the attached subscription if not matched on the 2nd condition
)

process # keyword to run the above queries not performed still and wait for the results

if type = "guest" and hypervisor.sub = Nil --attach ( ( "RHEL Premium Physical Node subscription" or "RHEL Standard Physical Node subscription" ) and ("Smart Management Premium Physical Node Subscription" or "Smart Management Standard Physical Node Subscription" ) ) # in case of Hypervisor is without a valid subscription, after process keyword

if type = "guest" and hypervisor.sub != Nil --attach ( hypervisor.all_available_subs ) #this will attach all of the available subscriptions that can be inherited from the Host

if type = "physical" --attach ( ( "RHEL Premium Physical Node subscription" or "RHEL Standard Physical Node subscription" ) and ("Smart Management Premium Physical Node Subscription" or "Smart Management Standard Physical Node Subscription" ) ) # simple rules for physical node

###

process is needed otherwise we need 2 round of the attachment of subscription to run.
Example: one Host currently has one subscription, and therefore is potentially need to have the first run to remove the attached subscription and then proceed with the other activities.

Comment 24 Rich Jerrido 2018-11-09 16:48:54 UTC
*** Bug 1644962 has been marked as a duplicate of this bug. ***

Comment 26 Rich Jerrido 2019-01-24 18:20:27 UTC
*** Bug 1659480 has been marked as a duplicate of this bug. ***

Comment 31 Sean O'Keeffe 2020-02-03 10:21:52 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, please do not reopen. Instead, feel free to contact Red Hat Technical Support.

Note, Simple Content Access and Subscription Watch may help. See https://access.redhat.com/documentation/en-us/subscription_central for more details.