Bug 1261193

Summary: Datacenter subscriptions in stage candlepin-0.9.51.5-1 should create Temporary pools for their derived products
Product: [Community] Candlepin Reporter: John Sefler <jsefler>
Component: candlepinAssignee: candlepin-bugs
Status: CLOSED NOTABUG QA Contact: Katello QA List <katello-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.2   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-09-09 13:42:14 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:

Description John Sefler 2015-09-08 20:38:49 UTC
Description of problem:
The idea behind temporary subscriptions was supposed to benefit Datacenter subscriptions.  The Datacenter subscription was supposed to provide a derived subpool for a different product and a temporary derived subpool was supposed to be created and available to virtual systems that have not yet been mapped to their host.  The problem in stage candlepin right now is that the temporary pool is being created for the parent datacenter subscription rather than the derived product.


Version-Release number of selected component (if applicable):
[root@ibm-x3650m4-01-vm-06 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 0.9.51.5-1
subscription management rules: 5.15
subscription-manager: 1.15.9-7.el7
python-rhsm: 1.15.4-4.el7


How reproducible:


Steps to Reproduce:
[root@ibm-x3650m4-01-vm-06 ~]# subscription-manager register --serverurl=subscription.rhn.stage.redhat.com --baseurl=https://cdn.redhat.com --username=stage_auto_testuser1
Registering to: subscription.rhn.stage.redhat.com:443/subscription
Password: 
The system has been registered with ID: e41945ef-c3c7-4627-a6fe-e50fdf455fd0 


[root@ibm-x3650m4-01-vm-06 ~]# echo '{"virt.is_guest":"False"}' > /etc/rhsm/facts/override.facts
[root@ibm-x3650m4-01-vm-06 ~]# subscription-manager facts --update
Successfully updated the system facts.
[root@ibm-x3650m4-01-vm-06 ~]# subscription-manager list --avail --matches RH00001
+-------------------------------------------+
    Available Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux for Virtual Datacenters,
                     Premium
Provides:            
SKU:                 RH00001
Contract:            10692229
Pool ID:             8a99f9874df893c8014e1cadac36775e
Provides Management: No
Available:           99
Suggested:           1
Service Level:       Premium
Service Type:        L1-L3
Subscription Type:   Stackable
Ends:                06/20/2016
System Type:         Physical

[root@ibm-x3650m4-01-vm-06 ~]# subscription-manager attach --pool=8a99f9874df893c8014e1cadac36775e
Successfully attached a subscription for: Red Hat Enterprise Linux for Virtual Datacenters, Premium

[root@ibm-x3650m4-01-vm-06 ~]# echo '{"virt.is_guest":"True"}' > /etc/rhsm/facts/override.facts
[root@ibm-x3650m4-01-vm-06 ~]# subscription-manager facts --update
Successfully updated the system facts.
[root@ibm-x3650m4-01-vm-06 ~]# subscription-manager list --avail --matches RH00001
+-------------------------------------------+
    Available Subscriptions
+-------------------------------------------+
Subscription Name:   Red Hat Enterprise Linux for Virtual Datacenters,
                     Premium
Provides:            
SKU:                 RH00001
Contract:            10692229
Pool ID:             8a99f9834efa4582014f21d5fb2e01ca
Provides Management: No
Available:           100
Suggested:           1
Service Level:       Premium
Service Type:        L1-L3
Subscription Type:   Standard (Temporary)
Ends:                06/20/2016
System Type:         Virtual

Subscription Name:   Red Hat Enterprise Linux for Virtual Datacenters,
                     Premium
Provides:            
SKU:                 RH00001
Contract:            10692229
Pool ID:             8a99f9874df893c8014e1cadac36775e
Provides Management: No
Available:           98
Suggested:           0
Service Level:       Premium
Service Type:        L1-L3
Subscription Type:   Stackable
Ends:                06/20/2016
System Type:         Physical


BANG! Did not expect a Temporary pool for RH00001 to be available for consumption.


[root@ibm-x3650m4-01-vm-06 ~]# subscription-manager list --avail --matches RH00049
No available subscription pools were found matching the expression "RH00049".


BANG! Expected a temporary derived sub pool for RH00049 to be available to my virtual system since the the parent Datacenter was consumed and the guest has not yet been mapped as a guestId on the physical host consumer.




Additional info:


Below is the RAW Datacenter subscription pool for SKU "RH00001" that is host_limited and has a unlimited virt_limit that provides a derivedProductId "RH00049"
[root@ibm-x3650m4-01-vm-06 ~]# curl --stderr /dev/null --insecure --user stage_auto_testuser1:redhat --request GET http://candlepin.dist.stage.ext.phx2.redhat.com/candlepin/pools/8a99f9874df893c8014e1cadac36775e | python -m json/tool
{
    "accountNumber": "5569219",
    "activeSubscription": true,
    "attributes": [],
    "branding": [],
    "calculatedAttributes": {
        "compliance_type": "Stackable"
    },
    "consumed": 1,
    "contractNumber": "10692229",
    "created": "2015-08-12T12:15:15.000+0000",
    "derivedProductAttributes": [
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8c01f0",
            "name": "enabled_consumer_types",
            "productId": "RH00049",
            "updated": "2015-08-12T12:15:15.000+0000",
            "value": "SAM"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8c01f1",
            "name": "variant",
            "productId": "RH00049",
            "updated": "2015-08-12T12:15:15.000+0000",
            "value": "Physical Server"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8c01f2",
            "name": "ph_product_name",
            "productId": "RH00049",
            "updated": "2015-08-12T12:15:15.000+0000",
            "value": "RHEL Server"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8c01f3",
            "name": "ph_category",
            "productId": "RH00049",
            "updated": "2015-08-12T12:15:15.000+0000",
            "value": "Subscriptions"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8c01f4",
            "name": "subtype",
            "productId": "RH00049",
            "updated": "2015-08-12T12:15:15.000+0000",
            "value": "Premium"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8d01f5",
            "name": "support_type",
            "productId": "RH00049",
            "updated": "2015-08-12T12:15:15.000+0000",
            "value": "L1-L3"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8d01f6",
            "name": "description",
            "productId": "RH00049",
            "updated": "2015-08-12T12:15:15.000+0000",
            "value": "Red Hat Enterprise Linux"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8d01f7",
            "name": "arch",
            "productId": "RH00049",
            "updated": "2015-08-12T12:15:15.000+0000",
            "value": "x86_64,ppc64le,ppc64,ia64,ppc,s390,x86,s390x"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8d01f8",
            "name": "ph_product_line",
            "productId": "RH00049",
            "updated": "2015-08-12T12:15:15.000+0000",
            "value": "RHEL"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8d01f9",
            "name": "host_limited",
            "productId": "RH00049",
            "updated": "2015-08-12T12:15:15.000+0000",
            "value": "true"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8d01fa",
            "name": "name",
            "productId": "RH00049",
            "updated": "2015-08-12T12:15:15.000+0000",
            "value": "Red Hat Enterprise Linux for Virtual Datacenters, Premium (DERIVED SKU)"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8d01fb",
            "name": "type",
            "productId": "RH00049",
            "updated": "2015-08-12T12:15:15.000+0000",
            "value": "MKT"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8d01fd",
            "name": "product_family",
            "productId": "RH00049",
            "updated": "2015-08-12T12:15:15.000+0000",
            "value": "Red Hat Enterprise Linux"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8d01fc",
            "name": "support_level",
            "productId": "RH00049",
            "updated": "2015-08-12T12:15:15.000+0000",
            "value": "Premium"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8d01fe",
            "name": "option_code",
            "productId": "RH00049",
            "updated": "2015-08-12T12:15:15.000+0000",
            "value": "102"
        }
    ],
    "derivedProductId": "RH00049",
    "derivedProductName": "Red Hat Enterprise Linux for Virtual Datacenters, Premium (DERIVED SKU)",
    "derivedProvidedProducts": [
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8d01ff",
            "productId": "91",
            "productName": "Red Hat Enterprise Linux Resilient Storage (for RHEL Server) - Extended Update Support",
            "updated": "2015-08-12T12:15:15.000+0000"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8d0200",
            "productId": "244",
            "productName": "Oracle Java (for RHEL Workstation)",
            "updated": "2015-08-12T12:15:15.000+0000"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8d0201",
            "productId": "201",
            "productName": "Red Hat Software Collections (for RHEL Server)",
            "updated": "2015-08-12T12:15:15.000+0000"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8d0202",
            "productId": "84",
            "productName": "Red Hat Enterprise Linux High Availability (for RHEL Server) - Extended Update Support",
            "updated": "2015-08-12T12:15:15.000+0000"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8d0203",
            "productId": "182",
            "productName": "Red Hat EUCJP Support (for RHEL Server) - Extended Update Support",
            "updated": "2015-08-12T12:15:15.000+0000"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8d0204",
            "productId": "70",
            "productName": "Red Hat Enterprise Linux Server - Extended Update Support",
            "updated": "2015-08-12T12:15:15.000+0000"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8d0205",
            "productId": "180",
            "productName": "Red Hat Beta",
            "updated": "2015-08-12T12:15:15.000+0000"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8e0206",
            "productId": "133",
            "productName": "Red Hat Enterprise Linux High Performance Networking (for RHEL Server) - Extended Update Support",
            "updated": "2015-08-12T12:15:15.000+0000"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8e0207",
            "productId": "93",
            "productName": "Red Hat Enterprise Linux Scalable File System (for RHEL Server) - Extended Update Support",
            "updated": "2015-08-12T12:15:15.000+0000"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8e0208",
            "productId": "240",
            "productName": "Oracle Java (for RHEL Server)",
            "updated": "2015-08-12T12:15:15.000+0000"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8e0209",
            "productId": "86",
            "productName": "Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support",
            "updated": "2015-08-12T12:15:15.000+0000"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8e020a",
            "productId": "69",
            "productName": "Red Hat Enterprise Linux Server",
            "updated": "2015-08-12T12:15:15.000+0000"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8e020b",
            "productId": "205",
            "productName": "Red Hat Software Collections Beta (for RHEL Server)",
            "updated": "2015-08-12T12:15:15.000+0000"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8e020c",
            "productId": "127",
            "productName": "Red Hat S-JIS Support (for RHEL Server) - Extended Update Support",
            "updated": "2015-08-12T12:15:15.000+0000"
        },
        {
            "created": "2015-08-12T12:15:15.000+0000",
            "id": "8a99f9834efa4582014f21d5fb8e020d",
            "productId": "176",
            "productName": "Red Hat Developer Toolset (for RHEL Server)",
            "updated": "2015-08-12T12:15:15.000+0000"
        }
    ],
    "endDate": "2016-06-21T03:59:59.000+0000",
    "exported": 0,
    "href": "/pools/8a99f9874df893c8014e1cadac36775e",
    "id": "8a99f9874df893c8014e1cadac36775e",
    "orderNumber": null,
    "owner": {
        "displayName": "7628215",
        "href": "/owners/7628215",
        "id": "8a99f9874df893c8014e1cad15a57651",
        "key": "7628215"
    },
    "productAttributes": [
        {
            "created": "2015-06-22T19:10:20.000+0000",
            "id": "8a99f9874df893c8014e1cadac38777d",
            "name": "host_limited",
            "productId": "RH00001",
            "updated": "2015-06-22T19:10:20.000+0000",
            "value": "true"
        },
        {
            "created": "2015-06-22T19:10:20.000+0000",
            "id": "8a99f9874df893c8014e1cadac38777e",
            "name": "type",
            "productId": "RH00001",
            "updated": "2015-06-22T19:10:20.000+0000",
            "value": "MKT"
        },
        {
            "created": "2015-06-22T19:10:20.000+0000",
            "id": "8a99f9874df893c8014e1cadac38777f",
            "name": "stacking_id",
            "productId": "RH00001",
            "updated": "2015-06-22T19:10:20.000+0000",
            "value": "RH00001"
        },
        {
            "created": "2015-06-22T19:10:20.000+0000",
            "id": "8a99f9874df893c8014e1cadac387780",
            "name": "ph_product_line",
            "productId": "RH00001",
            "updated": "2015-06-22T19:10:20.000+0000",
            "value": "RHEL"
        },
        {
            "created": "2015-06-22T19:10:20.000+0000",
            "id": "8a99f9874df893c8014e1cadac387781",
            "name": "sockets",
            "productId": "RH00001",
            "updated": "2015-06-22T19:10:20.000+0000",
            "value": "2"
        },
        {
            "created": "2015-06-22T19:10:20.000+0000",
            "id": "8a99f9874df893c8014e1cadac387782",
            "name": "product_family",
            "productId": "RH00001",
            "updated": "2015-06-22T19:10:20.000+0000",
            "value": "Red Hat Enterprise Linux"
        },
        {
            "created": "2015-06-22T19:10:20.000+0000",
            "id": "8a99f9874df893c8014e1cadac387783",
            "name": "description",
            "productId": "RH00001",
            "updated": "2015-06-22T19:10:20.000+0000",
            "value": "Red Hat Enterprise Linux"
        },
        {
            "created": "2015-06-22T19:10:20.000+0000",
            "id": "8a99f9874df893c8014e1cadac387784",
            "name": "enabled_consumer_types",
            "productId": "RH00001",
            "updated": "2015-06-22T19:10:20.000+0000",
            "value": "SAM"
        },
        {
            "created": "2015-06-22T19:10:20.000+0000",
            "id": "8a99f9874df893c8014e1cadac387785",
            "name": "support_level",
            "productId": "RH00001",
            "updated": "2015-06-22T19:10:20.000+0000",
            "value": "Premium"
        },
        {
            "created": "2015-06-22T19:10:20.000+0000",
            "id": "8a99f9874df893c8014e1cadac387786",
            "name": "subtype",
            "productId": "RH00001",
            "updated": "2015-06-22T19:10:20.000+0000",
            "value": "Premium"
        },
        {
            "created": "2015-06-22T19:10:20.000+0000",
            "id": "8a99f9874df893c8014e1cadac387787",
            "name": "ph_category",
            "productId": "RH00001",
            "updated": "2015-06-22T19:10:20.000+0000",
            "value": "Subscriptions"
        },
        {
            "created": "2015-06-22T19:10:20.000+0000",
            "id": "8a99f9874df893c8014e1cadac387788",
            "name": "derived_sku",
            "productId": "RH00001",
            "updated": "2015-06-22T19:10:20.000+0000",
            "value": "RH00049"
        },
        {
            "created": "2015-06-22T19:10:20.000+0000",
            "id": "8a99f9874df893c8014e1cadac38778a",
            "name": "variant",
            "productId": "RH00001",
            "updated": "2015-06-22T19:10:20.000+0000",
            "value": "Physical Server"
        },
        {
            "created": "2015-06-22T19:10:20.000+0000",
            "id": "8a99f9874df893c8014e1cadac387789",
            "name": "option_code",
            "productId": "RH00001",
            "updated": "2015-06-22T19:10:20.000+0000",
            "value": "102"
        },
        {
            "created": "2015-06-22T19:10:20.000+0000",
            "id": "8a99f9874df893c8014e1cadac38778b",
            "name": "multi-entitlement",
            "productId": "RH00001",
            "updated": "2015-06-22T19:10:20.000+0000",
            "value": "yes"
        },
        {
            "created": "2015-06-22T19:10:20.000+0000",
            "id": "8a99f9874df893c8014e1cadac38778c",
            "name": "name",
            "productId": "RH00001",
            "updated": "2015-06-22T19:10:20.000+0000",
            "value": "Red Hat Enterprise Linux for Virtual Datacenters, Premium"
        },
        {
            "created": "2015-06-22T19:10:20.000+0000",
            "id": "8a99f9874df893c8014e1cadac38778d",
            "name": "ph_product_name",
            "productId": "RH00001",
            "updated": "2015-06-22T19:10:20.000+0000",
            "value": "RHEL Server"
        },
        {
            "created": "2015-06-22T19:10:20.000+0000",
            "id": "8a99f9874df893c8014e1cadac38778f",
            "name": "virt_limit",
            "productId": "RH00001",
            "updated": "2015-06-22T19:10:20.000+0000",
            "value": "unlimited"
        },
        {
            "created": "2015-06-22T19:10:20.000+0000",
            "id": "8a99f9874df893c8014e1cadac38778e",
            "name": "support_type",
            "productId": "RH00001",
            "updated": "2015-06-22T19:10:20.000+0000",
            "value": "L1-L3"
        }
    ],
    "productId": "RH00001",
    "productName": "Red Hat Enterprise Linux for Virtual Datacenters, Premium",
    "providedProducts": [],
    "quantity": 100,
    "restrictedToUsername": null,
    "sourceConsumer": null,
    "sourceEntitlement": null,
    "sourceStackId": null,
    "stackId": "RH00001",
    "stacked": true,
    "startDate": "2015-06-21T04:00:00.000+0000",
    "subscriptionId": "3592049",
    "subscriptionSubKey": "master",
    "type": "NORMAL",
    "updated": "2015-08-12T12:15:15.000+0000"
}

Comment 2 John Sefler 2015-09-09 13:42:14 UTC
Good News.... refreshing the subscription pools for account stage_auto_testuser1 solved this unexpected subscription behavior.

Moving to CLOSED NOTABUG