Bug 966430 - Firstboot:Error dialogue pops up even when you try to attach quantity 10 which is a multiplier of 2
Summary: Firstboot:Error dialogue pops up even when you try to attach quantity 10 whic...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 0.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Devan Goodwin
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel510
TreeView+ depends on / blocked
 
Reported: 2013-05-23 09:29 UTC by Shwetha Kallesh
Modified: 2015-05-14 16:04 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-10-01 13:47:50 UTC
Embargoed:


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

Description Shwetha Kallesh 2013-05-23 09:29:58 UTC
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 09:31:43 UTC
Created attachment 752059 [details]
Error dialogue

Comment 2 Shwetha Kallesh 2013-05-23 09:38:27 UTC
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 09:56:47 UTC
Created attachment 752077 [details]
Error dialogue on gui

Same is the case with GUI

Comment 5 RHEL Program Management 2013-05-23 14:25:24 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 6 Devan Goodwin 2013-06-10 14:21:20 UTC
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 12:36:21 UTC
Fixed in candlepin.git: 8a64aa776c13372192b6f90ead7f9ed01148eb09

Comment 8 Bryan Kearney 2013-08-01 15:54:58 UTC
Moving these to ON_QA. The tooling must have missed moving these.

Comment 9 John Sefler 2013-08-13 21:34:38 UTC
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 21:36:01 UTC
Created attachment 786306 [details]
VERIFIED GUI

Comment 11 John Sefler 2013-08-13 21:36:43 UTC
Created attachment 786307 [details]
VERIFIED FIRSTBOOT


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