Bug 962487

Summary: [RFE] Add more features in to auto healing/subscibe process
Product: [Community] Candlepin Reporter: Rehana <redakkan>
Component: candlepinAssignee: candlepin-bugs
Status: CLOSED CURRENTRELEASE QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.9CC: bkearney, fsharath, jgalipea, jmolet, jsefler, skallesh, spandey
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-29 19:05:16 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    

Description Rehana 2013-05-13 16:00:53 UTC
Description of problem:
As per our recent discussion on "auto-heal" precedence v/s over consumption, partial compliance. This bug is to track the enhancement request for the same,more details on the issue/observation give below

Version-Release number of selected component (if applicable):
[root@hp-bl460cgen8-01 product]# rpm -qa | grep subscr*
subscription-manager-gui-1.8.7-1.el5
subscription-manager-1.8.7-1.el5
subscription-manager-firstboot-1.8.7-1.el5
subscription-manager-migration-1.8.7-1.el5
subscription-manager-migration-data-1.11.2.7-1.el5
subscription-manager-debuginfo-1.8.7-1.el5

How reproducible:
100%

Steps to Reproduce:
1.Register the client and copy core products(example)

2.Update the facts to have 10 Cores on the system
[root@hp-bl460cgen8-01 product]# echo '{"cpu.core(s)_per_socket":"5"}' > /etc/rhsm/facts/cores.facts
[root@hp-bl460cgen8-01 product]# subscription-manager facts --update
Successfully updated the system facts.
[root@hp-bl460cgen8-01 product]# subscription-manager facts --list | grep cpu
cpu.core(s)_per_socket: 5
cpu.cpu(s): 2
cpu.cpu_socket(s): 2

3.Attach subscription to partially cover the installed product

[root@hp-bl460cgen8-01 product]# subscription-manager attach --pool 8ac6a30b3e9c9a9c013e9c9b799c04a9
Successfully attached a subscription for: Stackable Cores Package (8 cores)
[root@hp-bl460cgen8-01 product]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Core Limiting Product
Product ID:     806
Version:        1.0
Arch:           x86_64
Status:         Partially Subscribed
Status Details: Only covers 8 of 10 cores.
Starts:        
Ends:           

[root@hp-bl460cgen8-01 product]# subscription-manager list --status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Insufficient
 
Stackable Cores Package (8 cores):
- Only covers 8 of 10 cores.
Actual results:

4.Enable  the autoheal, set heal frequency as 2 min ,restart rhsmcertd service, and wait for 2  mins

[root@hp-bl460cgen8-01 product]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Core Limiting Product
Product ID:     806
Version:        1.0
Arch:           x86_64
Status:         Subscribed
Status Details:
Starts:         05/12/2013
Ends:           05/12/2014
 
Product turned to be "subscribed"

5.[root@hp-bl460cgen8-01 product]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Cores Package (26 cores)  ------------> newly added 
                                                subscription by healing
Provides:          Core Limiting Product
SKU:               cores-26
Contract:          168
Account:           12331131231
Serial Number:     3529653356956039547
Pool ID:           8ac6a30b3e9c9a9c013e9c9b7a0e04ce
Active:            True
Quantity Used:     1
Service Level:    
Service Type:      
Status Details:    
Starts:            05/12/2013
Ends:              05/12/2014
 
Subscription Name: Stackable Cores Package (8 cores)  --> Old 
                                                          subscripion(partiall)
Provides:          Core Limiting Product
SKU:               cores-8-stackable
Contract:          175
Account:           12331131231
Serial Number:     2645450693209800889
Pool ID:           8ac6a30b3e9c9a9c013e9c9b799c04a9
Active:            True
Quantity Used:     1
Service Level:    
Service Type:      
Status Details:    Only covers 8 of 10 cores.
Starts:            05/12/2013
Ends:              05/12/2014
 
 
System continued to show as partial
 
[root@hp-bl460cgen8-01 product]# subscription-manager list --status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Insufficient
 
Stackable Cores Package (8 cores):
- Only covers 8 of 10 cores.

since the healing precedence  always preferred non-stackable first, the previously attached partial multi-entitled subscription was left behind, this 
left the system in the "Insufficient" status even after the heal process

Expected results:
suggestions from QE 
 "tweak auto-healing to consider already attach subscriptions for healing"
 "minimise the overconsumption during autoheal"

Additional info:

Comment 1 Rehana 2013-05-13 16:02:32 UTC
Attaching the post-office link of the email discussions, just incase anyone wants to check it 

http://post-office.corp.redhat.com/archives/chainsaw/2013-May/msg00196.html

Comment 3 Carter Kozak 2014-01-17 21:08:24 UTC
This was fixed by the autobind rewrite.

Comment 4 John Sefler 2014-02-28 22:13:06 UTC
Verifying Version...
[root@jsefler-7 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 0.9.4-1
subscription-manager: 1.10.14-3.el7
python-rhsm: 1.10.12-1.el7

[root@jsefler-7 ~]# subscription-manager register --serverurl=jsefler-f14-candlepin.usersys.redhat.com:8443/candlepin
Username: testuser1
Password: 
Organization: admin
The system has been registered with ID: 46d78064-46f0-420d-b1c9-0b0dd333cb87 

[root@jsefler-7 ~]# echo '{"cpu.core(s)_per_socket":"5"}' > /etc/rhsm/facts/cores.facts
[root@jsefler-7 ~]# subscription-manager facts --update
Successfully updated the system facts.
[root@jsefler-7 ~]# subscription-manager facts --list | egrep ^cpu
cpu.core(s)_per_socket: 5
cpu.cpu(s): 2
cpu.cpu_socket(s): 2
cpu.thread(s)_per_core: 1
cpu.topology_source: kernel /sys cpu sibling lists
[root@jsefler-7 ~]# subscription-manager facts --list | grep is_guest
virt.is_guest: false

[root@jsefler-7 ~]# subscription-manager attach --pool=8a9087e3447986dc01447987c1ca11c2 --quantity=1
Successfully attached a subscription for: Stackable Cores Package (8 cores)

[root@jsefler-7 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Stackable Cores Package (8 cores)
Provides:          Core Limiting Product
SKU:               cores-8-stackable
Contract:          1
Account:           12331131231
Serial:            5683624921941540987
Pool ID:           8a9087e3447986dc01447987c1ca11c2
Active:            True
Quantity Used:     1
Service Level:     
Service Type:      
Status Details:    Only supports 8 of 10 cores.
Subscription Type: Stackable
Starts:            02/27/2014
Ends:              02/27/2015
System Type:       Physical


[root@jsefler-7 ~]# subscription-manager auto-attach --enable 
Auto-attach preference: enabled
[root@jsefler-7 ~]# /usr/libexec/rhsmcertd-worker --autoheal
Updating entitlement certificates & repositories
1 updates required
done

[root@jsefler-7 ~]# subscription-manager list --consumed
+-------------------------------------------+
   Consumed Subscriptions
+-------------------------------------------+
Subscription Name: Stackable Cores Package (8 cores)
Provides:          Core Limiting Product
SKU:               cores-8-stackable
Contract:          1
Account:           12331131231
Serial:            5683624921941540987
Pool ID:           8a9087e3447986dc01447987c1ca11c2
Active:            True
Quantity Used:     1
Service Level:     
Service Type:      
Status Details:    
Subscription Type: Stackable
Starts:            02/27/2014
Ends:              02/27/2015
System Type:       Physical

Subscription Name: Stackable Cores Package (8 cores)
Provides:          Core Limiting Product
SKU:               cores-8-stackable
Contract:          1
Account:           12331131231
Serial:            4825489558117759844
Pool ID:           8a9087e3447986dc01447987c1ca11c2
Active:            True
Quantity Used:     1
Service Level:     
Service Type:      
Status Details:    
Subscription Type: Stackable
Starts:            02/27/2014
Ends:              02/27/2015
System Type:       Physical

[root@jsefler-7 ~]# subscription-manager status 
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current


VERIFIED: Autoheal efficiently completed the stack to achieve compliance.

Comment 5 Bryan Kearney 2014-09-29 19:05:16 UTC
These bugs were fixed during 7.0 but not moved to CLOSED. They have been delivered