Bug 1055617

Summary: [RFE] rct cat-cert should also report the "VCPU Limit" attribute for an Order
Product: Red Hat Enterprise Linux 7 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Carter Kozak <ckozak>
Status: CLOSED WONTFIX QA Contact: John Sefler <jsefler>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: bkearney, ckozak, gxing
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-30 18:49:37 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 John Sefler 2014-01-20 15:52:46 UTC
Description of problem:
Now that VCPU Compliance bug 885785 has been implemented, The rct cat-cert tool should report the "VCPU Limit" corresponding to the "vcpu" subscription pool's product attribute.

This bug is similar in scope to bug 951142 and bug 861993 that were used for Core Limit and RAM Limit.


Version-Release number of selected component (if applicable):
[root@jsefler-7 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.9.2-1
subscription-manager: 1.10.10-1.git.22.bf03c6b.el7
python-rhsm: 1.10.10-1.git.1.90486fd.el7


How reproducible:


Steps to Reproduce:
configured against a candlepin server with the TESTDATA deployed...
[root@jsefler-7 ~]# subscription-manager register --username testuser1 --password password --org admin
The system has been registered with ID: 51578115-36e0-4939-b96e-115c2eeb8b60 
[root@jsefler-7 ~]# subscription-manager list --avail | egrep "Awesome OS Server Basic$" -A4
Subscription Name: Awesome OS Server Basic
Provides:          Awesome OS Server Bits
SKU:               awesomeos-server-basic
Contract:          1
Pool ID:           8a908740439d1e6f01439d1f39e0059a
[root@jsefler-7 ~]# subscription-manager attach --pool 8a908740439d1e6f01439d1f39e0059a
Successfully attached a subscription for: Awesome OS Server Basic
[root@jsefler-7 ~]# rct cat-cert --no-content /etc/pki/entitlement/8190472999679086625.pem 

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

Certificate:
	Path: /etc/pki/entitlement/8190472999679086625.pem
	Version: 1.0
	Serial: 8190472999679086625
	Start Date: 2014-01-16 00:00:00+00:00
	End Date: 2015-01-16 00:00:00+00:00
	Pool ID: Not Available

Subject:
	CN: 8a908740439d1e6f0143b0536a503588

Issuer:
	C: US
	CN: jsefler-f14-candlepin.usersys.redhat.com
	L: Raleigh

Product:
	ID: 37060
	Name: Awesome OS Server Bits
	Version: 6.1
	Arch: ALL
	Tags: 
	Brand Type: OS

Order:
	Name: Awesome OS Server Basic
	Number: order-8675309
	SKU: awesomeos-server-basic
	Contract: 1
	Account: 12331131231
	Service Level: None
	Service Type: Self-Support
	Quantity: 10
	Quantity Used: 1
	Socket Limit: 2
	RAM Limit: 
	Core Limit: 
	Virt Only: False
	Stacking ID: 
	Warning Period: 30
	Provides Management: 0

^BANG! Expected the Order information to include VCPU Limit: 4


Additional info:
I know that the VCPU Limit on this entitlement is 4 by using the new rhsm-debug tool as follows...

[root@jsefler-7 ~]# rhsm-debug system --no-archive
Wrote: /tmp/rhsm-debug-system-20140120-631679
[root@jsefler-7 ~]# grep "vcpu" /tmp/rhsm-debug-system-20140120-631679/entitlements.json -A4 -B3
                {
                    "created": "2014-01-16T22:15:05.953+0000",
                    "id": "8a908740439d1e6f01439d1f39e105a5",
                    "name": "vcpu",
                    "productId": "awesomeos-server-basic",
                    "updated": "2014-01-16T22:15:05.953+0000",
                    "value": "4"
                }

Comment 1 Carter Kozak 2014-01-30 18:49:37 UTC
We don't encode vcpu into entitlement certificates (or virt_limit/guest_limit) because the client should never need to use them.

It doesn't seem right to encode these values into the certificate just to print them with rct cat-cert.  They would just provide unnecessary bloat.

All attributes can be read from the entitlement json provided by the subscription management server.