Bug 845600

Summary: Suggested quantities are incorrect for stacking subscriptions
Product: Red Hat Enterprise Linux 7 Reporter: J.C. Molet <jmolet>
Component: subscription-managerAssignee: Carter Kozak <ckozak>
Status: CLOSED CURRENTRELEASE QA Contact: Entitlement Bugs <entitlement-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: bkearney, ckozak, fsharath, jgalipea
Target Milestone: beta   
Target Release: 7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 11:55:54 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: 863175    
Attachments:
Description Flags
quantity bug
none
quantity os subscriptions when partially subscribed none

Description J.C. Molet 2012-08-03 14:38:40 UTC
Description of problem:
In subscription-manager-gui when you are manually subscribing to subscriptions, the gui gives a suggested default quantity in order to become compliant.

For example if you have 8 sockets, and you have a stackable subscription that provides for 2 sockets each, the suggested default quantity would be 4.  If you are then already subscribed to two, the suggested default quantity would be 2.

This works for single subscriptions, but when you have multiple stacking subscriptions the default quantity calculation does not consider other subscriptions (within the same stacking_id group) when you are partially subscribed.

Version-Release number of selected component (if applicable):
subscription-manager-1.0.12-1.git.9.871cb04.el5
subscription-manager-gui-1.0.12-1.git.9.871cb04.el5
python-rhsm-1.0.4-1.git.7.47e5112.el5

How reproducible:
always

Steps to Reproduce:
(Have a rhel5.9 system with the rhel sever product - 69.pem installed)
1.echo '{"cpu.cpu_socket(s)":"8"}' > /etc/rhsm/facts/sockets.facts
2.[root@jmolet-vm0 product]# grep . /etc/rhsm/rhsm.conf | grep -v \# | head -4
[server]
hostname=subscription.rhn.stage.redhat.com
prefix=/subscription
port=443
3. subscription-manager register --username=stacking-stage --password=redhat
4. in the gui, partially subscribe to one of the stackable subscriptions titled: 

Red Hat Enterprise Linux Server, Standard (1-2 sockets) (Up to 4 guests)

5. 'Update' your search list in "all available subscriptions", with all filters off

Actual results:
If you subscribed with a quanity of 2 subscriptions in step 4, only the subscription with the same SKU will have an updated suggested quantity.  The other subscription (different SKU) that is stackable with your current subscription will not have an updated suggested quantity.  It will still suggest you subscribe to 4 subscriptions.  You would then be oversubscribing.  See screenshot in next comment.

Expected results:
The suggested quantities for all subscriptions with the same stacking-id would be updated upon every subscribe.

Additional info:

Comment 1 J.C. Molet 2012-08-03 14:39:16 UTC
Created attachment 602143 [details]
quantity bug

screenshot for comment 0

Comment 2 RHEL Program Management 2012-08-03 14:48:33 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 4 RHEL Program Management 2012-12-14 08:47:22 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 5 Carter Kozak 2013-09-09 19:04:57 UTC
commit 12b5879bbf1b873ba349364cd2b10821bd07059c
Author: ckozak <ckozak>
Date:   Mon Sep 9 12:52:58 2013 -0400

    845600, 996672: fix suggested quantities

Comment 7 Sharath Dwaral 2013-11-08 16:47:49 UTC
Created attachment 821708 [details]
quantity os subscriptions when partially subscribed

Version:
# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.8.31-1
subscription-manager: 1.10.6-1.el7
python-rhsm: 1.10.6-1.el7

Verification:
# subscription-manager facts --list | grep "cpu_socket(s)"
cpu.cpu_socket(s): 20

# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Multi-Attribute Stackable (2 sockets)
Provides:          Multi-Attribute Limited Product
SKU:               sock2-multiattr
Contract:          2
Account:           12331131231
Serial:            2817593470809605432
Pool ID:           8a8d01e04238017101423801f34b0664
Active:            True
Quantity Used:     1
Service Level:     Premium
Service Type:      Level 3
Status Details:    Only covers 2 of 20 sockets.    <------  Partial subscription
Starts:            11/07/2013
Ends:              11/07/2014
System Type:       Physical

It can be seen from the attachment that, subscriptions with the same SKU decrease in number accordingly when partially subscribed.

Other subscriptions which are stackable with it but have different SKUs are not affected.

VERIFIED

Comment 8 Ludek Smid 2014-06-13 11:55:54 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.