Bug 837143

Summary: autosubscription with activation key fails for virtual type subscription with vcpu>=2 guest.
Product: [Retired] Subscription Asset Manager Reporter: Etsuji Nakai <enakai>
Component: katelloAssignee: Tom McKay <tomckay>
Status: CLOSED WONTFIX QA Contact: SAM QE List <sam-qe-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 1.3CC: bkearney, huiwang, sthirugn
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 837914 (view as bug list) Environment:
Last Closed: 2016-03-11 03:31:55 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: 837914, 971511    

Description Etsuji Nakai 2012-07-03 00:13:37 UTC
Description of problem:

Auto-subscription using activation key fails with the error,

  Multi-entitlement not supported for pool with id XXXXX

under the condition:

1. Activation Key contains only virtual type subscription.
2. RHEL guest VM to subscribe has multilple vCPUs.


Version-Release number of selected component (if applicable):

For SAM server:
# rpm -qa | grep -E "(katello|candlepin)"
katello-configure-0.3.7-1.el6_2.noarch
katello-cli-headpin-0.2.2-1.el6_2.noarch
candlepin-tomcat6-0.6.5-1.el6_2.noarch
katello-certs-tools-1.1.5-1.el6_2.noarch
katello-common-0.3.3-1.el6_2.noarch
katello-headpin-0.2.13-1.el6_2.noarch
katello-glue-candlepin-0.3.3-1.el6_2.noarch
katello-cli-common-0.3.5-2.el6_2.noarch
candlepin-0.6.5-1.el6_2.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-selinux-0.2.4-1.el6_2.noarch
katello-headpin-all-0.2.13-1.el6_2.noarch

For Guset VM:
# rpm -qa | grep subscription
subscription-manager-0.99.19.3-1.el6_3.x86_64



How reproducible:

1. Register and subscribe KVM host with physical type subscription.
2. Create activation key containing only virtual type subscription derived from the physical one.
3. Register KVM guest using the activation key.


Actual results:

If the guest VM has two vCPUs, subscription fails with the error:
  Multi-entitlement not supported for pool with id XXXXX.

If the guest VM has one vCPU, it succeeds as expected.


I investigated the exceution path of this failed process.

1. Katello successfully POSTed the request to Candlepin with the following URI:
(POST /candlepin/consumers/c65be5db-0fae-4919-8c96-a72a1d93b36f/entitlements?pool=4028fa8b3846bd3e013847f0d3f402b8&quantity=2)

2. Then, Candlepin *possiblly* returns the exception "rulefailed.pool.does.not.support.multi-entitlement" at the following point of code.

./src/main/resources/rules/default-rules.js
 564  if (pre.getQuantity() > 1 && product.getAttribute("multi-entitlement") != "yes") {
 565      pre.addError("rulefailed.pool.does.not.support.multi-entitlement");
 566  }


I guess either of them would be the root cause of the problem.

- The quantity attribute should not reflect the number of vCPUs?
- Candlepin should accept quantity>1 for non-muti-entitlement subscription?

Comment 1 Etsuji Nakai 2012-07-03 12:52:34 UTC
I changed the component to Katello as it wouldn't be a Candlepin's problem.

It looks Katello always assumes that the number of subscription (quantity) should equal to the number of sockets when auto-subscribing with an activation key. But all subscriptions don't necessarily follow that rule.

Activation key needs to contain information not only for subscriptions but also for their consumption rules, right?