Bug 966430 - Firstboot:Error dialogue pops up even when you try to attach quantity 10 which is a multiplier of 2
Firstboot:Error dialogue pops up even when you try to attach quantity 10 whic...
Status: CLOSED CURRENTRELEASE
Product: Candlepin
Classification: Community
Component: candlepin (Show other bugs)
0.9
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Devan Goodwin
Katello QA List
:
Depends On:
Blocks: rhsm-rhel510
  Show dependency treegraph
 
Reported: 2013-05-23 05:29 EDT by Shwetha Kallesh
Modified: 2015-05-14 12:04 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-10-01 09:47:50 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
quantity 10 being attached (111.06 KB, image/png)
2013-05-23 05:29 EDT, Shwetha Kallesh
no flags Details
Error dialogue (113.31 KB, image/png)
2013-05-23 05:31 EDT, Shwetha Kallesh
no flags Details
Error dialogue on gui (70.26 KB, image/png)
2013-05-23 05:56 EDT, Shwetha Kallesh
no flags Details
VERIFIED GUI (70.25 KB, image/png)
2013-08-13 17:36 EDT, John Sefler
no flags Details
VERIFIED FIRSTBOOT (116.48 KB, image/png)
2013-08-13 17:36 EDT, John Sefler
no flags Details

  None (edit)
Description Shwetha Kallesh 2013-05-23 05:29:58 EDT
Created attachment 752058 [details]
quantity 10 being attached

Description of problem:
Firstboot:Error dialogue pops up even when you try to attach quantity 10 which is a multiplier of 2

Version-Release number of selected component (if applicable):
[root@shwethahostname ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.8.7-1
subscription-manager: 1.8.8-1.git.10.f718984.el6
python-rhsm: 1.8.11-1.git.1.7236cc2.el6

How reproducible:


Steps to Reproduce:
1.firstboot -r
2.only 32060.pem cert in your /etc/pki/product folder
3.register with auto-attach
4.subscribe to quantity which is a multiplier of 2

Actual results:
Error dialogue pops up saying "quantity not a multiplier of 2"

Expected results:
Should successfully attach and register

Additional info:
Comment 1 Shwetha Kallesh 2013-05-23 05:31:43 EDT
Created attachment 752059 [details]
Error dialogue
Comment 2 Shwetha Kallesh 2013-05-23 05:38:27 EDT
Registration is successful,but subscriptions are not attached

[root@shwethahostname ~]# subscription-manager identity
Current identity is: 8abcee09-c65e-4b78-b9b5-7386fca5b37e
name: shwethahostname
org name: Admin Owner
org ID: admin

[root@shwethahostname ~]# subscription-manager list --consumed
No consumed subscription pools to list
Comment 4 Shwetha Kallesh 2013-05-23 05:56:47 EDT
Created attachment 752077 [details]
Error dialogue on gui

Same is the case with GUI
Comment 5 RHEL Product and Program Management 2013-05-23 10:25:24 EDT
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 6 Devan Goodwin 2013-06-10 10:21:20 EDT
Some missing steps to reproduce, you need to have the system requiring more entitlements than are available from any one pool, *and* you need to have an uneven number of entitlements left in that pool.

So additional steps:

- register as a guest and consume 1 from the instance pool. In this case leaving 19 available.
- go to physical system with a fake "22" sockets and register

$ cat /etc/rhsm/facts/custom.facts 
{"blah": "2", "cpu.cpu_socket(s)": "22", "virt.is_guest": "False"}

- Use autosubscribe in GUI, choose the pool with only 19 available, get error.

The logic is attempting to figure out the correct value, then checking if it is more than what is available, and reducing it to what is available if necessary. This check just needs to be instance multiplier aware.

Fix will be server side.
Comment 7 Devan Goodwin 2013-06-11 08:36:21 EDT
Fixed in candlepin.git: 8a64aa776c13372192b6f90ead7f9ed01148eb09
Comment 8 Bryan Kearney 2013-08-01 11:54:58 EDT
Moving these to ON_QA. The tooling must have missed moving these.
Comment 9 John Sefler 2013-08-13 17:34:38 EDT
Verifying Version....

[root@jsefler-5 ~]# subscription-manager register --username=testuser1 --org=admin --serverurl=jsefler-f14-candlepin.usersys.redhat.com:8443/candlepin
Password: 
The system has been registered with ID: f433403d-1c9e-424a-812f-7fb10991dce0 
[root@jsefler-5 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.8.18-1
subscription-manager: 1.8.19-1.el5
python-rhsm: 1.8.16-1.el5


[root@jsefler-5 ~]# echo '{"virt.is_guest":"True"}' > /etc/rhsm/facts/custom.facts
[root@jsefler-5 ~]# subscription-manager facts --update
Successfully updated the system facts.
[root@jsefler-5 ~]# subscription-manager attach --auto
Installed Product Current Status:
Product Name: Awesome OS Instance Server Bits
Status:       Subscribed

[root@jsefler-5 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Awesome OS Instance Based (Standard Support)
Provides:          Awesome OS Instance Server Bits
SKU:               awesomeos-instancebased
Contract:          43
Account:           12331131231
Serial:            3840435853508632793
Pool ID:           8a90f84a4035a6cb014035a82e0e051d
Active:            True
Quantity Used:     1
Service Level:     Standard
Service Type:      L1-L3
Status Details:    
Starts:            07/30/2013
Ends:              07/30/2014

[root@jsefler-5 ~]# subscription-manager list --avail | grep "awesomeos-instancebased" -A6 | grep Quantity
Quantity:          19
Quantity:          10

Now I have an odd quantity of instance based entitlements available.
Let's fake a physical system with 22 sockets and test the gui...

[root@jsefler-5 ~]# echo '{"virt.is_guest":"False", "cpu.cpu_socket(s)":"22"}' > /etc/rhsm/facts/custom.facts
[root@jsefler-5 ~]# subscription-manager clean
All local data removed
[root@jsefler-5 ~]# subscription-manager register --username=testuser1 --org=admin --serverurl=jsefler-f14-candlepin.usersys.redhat.com:8443/candlepin
Password: 
The system has been registered with ID: 260be32e-2a7d-4c18-b217-0c8efa023346 
[root@jsefler-5 ~]# subscription-manager list --avail | grep "awesomeos-instancebased" -A6 | grep Quantity
Quantity:          19
Quantity:          10
[root@jsefler-5 ~]# subscription-manager-gui&

VERIFIED: In the gui, Auto-attach was clicked and the quantity granted from the first pool is 18 instead of 19.  See attached screen shot "VERIFIED GUI". and then clicked Attach.

[root@jsefler-5 ~]# subscription-manager unsubscribe --all
2 subscriptions removed at the server.
2 local certificates have been deleted.
[root@jsefler-5 ~]# subscription-manager unregister
System has been unregistered.


Now I am back to an odd quantity of instance based entitlements available.
Let's test firstboot...
I am launching firstboot and registering within firstboot.

[root@jsefler-5 ~]# rm /etc/sysconfig/firstboot 
rm: remove regular file `/etc/sysconfig/firstboot'? y
[root@jsefler-5 ~]# firstboot 

VERIFIED: In firstboot, after registering with the same cedentials used earlier, the quantity granted from the first pool is 18 instead of 19.  See attached screen shot "VERIFIED FIRSTBOOT". and then clicked Forward.

[root@jsefler-5 ~]# subscription-manager list --avail | grep "awesomeos-instancebased" -A6 | grep Quantity
Quantity:          1
Quantity:          6

^^ Notice that both pools have remaining entitlements including the first pool with the single remaining 19th entitlement.

Moving to VERIFIED.
Comment 10 John Sefler 2013-08-13 17:36:01 EDT
Created attachment 786306 [details]
VERIFIED GUI
Comment 11 John Sefler 2013-08-13 17:36:43 EDT
Created attachment 786307 [details]
VERIFIED FIRSTBOOT

Note You need to log in before you can comment on or make changes to this bug.