Bug 1035672

Summary: The compliance calculate in RHEL7 doesn't work
Product: Red Hat Enterprise Linux 7 Reporter: xingge <gxing>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED NOTABUG QA Contact: John Sefler <jsefler>
Severity: high Docs Contact:
Priority: high    
Version: 7.0CC: ckozak, dgoodwin, gxing, ldai, liliu, qianzhan
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-04 09:43:34 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 xingge 2013-11-28 09:43:32 UTC
Description of problem:
The compliance calculate in RHEL7 with account rhel7beta doesn't work.

Version-Release number of selected component (if applicable):
RHEL7.0-everything-20131127.1-x86_64
subscription-manager-gui-1.10.6-1.el7
subscription-manager-firstboot-1.10.6-1.el7
subscription-manager-1.10.6-1.el7
python-rhsm-1.10.6-1.el7

How reproducible:
always

Steps to Reproduce:
1.register the system and auto subscribe some subscriptions.

[root@dhcp12-196 ~]# subscription-manager register --username=rhel7beta --auto-attach
Password: 
The system has been registered with ID: ca1e89d7-2bda-4e3d-b69c-4bb0fd245162 
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux 7 Public Beta
Status:       Subscribed

2.Find if the subscription is socket based.
[root@dhcp12-196 ~]# rct cat-cert /etc/pki/entitlement/5632434856821685168.pem |more

+-------------------------------------------+
	Entitlement Certificate
+-------------------------------------------+

Certificate:
	Path: /etc/pki/entitlement/5632434856821685168.pem
	Version: 3.2
	Serial: 5632434856821685168
	Start Date: 2013-11-07 05:00:00+00:00
	End Date: 2014-11-07 04:59:59+00:00
	Pool ID: 8a99f9844228f57b0142334975185cde

Subject:
	CN: 8a99f98442981a7901429e0c86335c09

Issuer:
	C: US
	CN: Red Hat Candlepin Authority
	O: Red Hat, Inc.
	OU: Red Hat Network
	ST: North Carolina
	emailAddress: ca-support

Product:
	ID: 226
	Name: Red Hat Enterprise Linux 7 Public Beta
	Version: 
	Arch: x86_64
	Tags: 
	Brand Type: 

Order:
	Name: Red Hat Enterprise Linux Workstation Beta
	Number: 
	SKU: RH00074
	Contract: 10299497
	Account: 5363962
	Service Level: Self-Support
	Service Type: L1-L3
	Quantity: 1000
	Quantity Used: 1
	Socket Limit: 2   <-------Socket based and Limit is 2.
	RAM Limit: 
	Core Limit: 
	Virt Only: False
	Subscription: 
	Stacking ID: RH00074
	Warning Period: 0
	Provides Management: False


3.modify the system facts to make the system not fully compliance

[root@dhcp12-196 ~]# subscription-manager facts | grep socket
cpu.core(s)_per_socket: 1
cpu.cpu_socket(s): 2 <---
dmi.processor.socket_designation: CPU 1
lscpu.core(s)_per_socket: 1
lscpu.socket(s): 2
[root@dhcp12-196 ~]# echo '{"cpu.cpu_socket(s)": "16"}' > /etc/rhsm/facts/custom.facts
[root@dhcp12-196 ~]# subscription-manager facts --update
Successfully updated the system facts.
[root@dhcp12-196 ~]# subscription-manager facts | grep socket
cpu.core(s)_per_socket: 1
cpu.cpu_socket(s): 16  <----
dmi.processor.socket_designation: CPU 1
lscpu.core(s)_per_socket: 1
lscpu.socket(s): 2

4.list the system current status.

Actual results:
[root@dhcp12-196 ~]# subscription-manager status
+-------------------------------------------+
   System Status Details
+-------------------------------------------+
Overall Status: Current  <----Should be Only covered 2 of 16 sockets

[root@dhcp12-196 ~]# subscription-manager list --installed
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat Enterprise Linux 7 Public Beta
Product ID:     226
Version:        7.0 Beta
Arch:           x86_64
Status:         Subscribed <---Should be Partially Subscribed
Status Details: 
Starts:         11/07/2013
Ends:           11/07/2014

Expected results:


Additional info:

Comment 1 Carter Kozak 2013-12-02 15:34:04 UTC
Can you please re-register when you change facts, or let the daemon run?  That will make sure your facts are synced with the server.  I believe that it still thinks your system has 2 sockets.

Comment 2 John Sefler 2013-12-02 16:31:33 UTC
One more thing to be aware of....
These RHEL7 beta subscriptions are instance based with an instance_multiplier=2 which means that if your system is a guest (not a physical system), then only one quantity from the pool will be attached and the system will be compliant regardless of the cpu.cpu_socket(s).

If you grep your subscription-manager facts --list for is_guest and find it equals True, then I believe this bug should be closed/notabug.

Comment 3 Devan Goodwin 2013-12-02 20:24:03 UTC
I think jsefler may be onto it in comment #2. Not reproducible on physical hardware.

Comment 4 xingge 2013-12-04 09:43:34 UTC
I think John is right, I test this bug in a physical system, the complaince calculate works fine.