Bug 683459

Summary: Virt only skus creating two pools
Product: [Community] Candlepin Reporter: Bryan Kearney <bkearney>
Component: candlepinAssignee: Bryan Kearney <bkearney>
Status: CLOSED NOTABUG QA Contact: John Sefler <jsefler>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 0.5CC: jmolet
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: 2011-11-22 13:38:40 UTC Type: ---
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: 682238    

Description Bryan Kearney 2011-03-09 13:25:19 UTC
Per amanda: 

Not sure who owns this, but the virt only product that I set up for testing still looks bad after the push -- different than before the push but still wrong :)

The account is qe_test_2 / redhat ; I've booked aty 5 MCT1851 into it which is RHEL Virt Only for 4 guests. The user appears to have been granted 2 pools 1 for qty 5 and 1 for qty 20. The qty 20 is the only one that should be there, it looks like we're getting a physical pool still maybe?

Amanda Carter

----
Senior Business Analyst
Red Hat, Inc.

919-754-4478

Comment 1 Bryan Kearney 2011-03-22 13:23:21 UTC
This has been fixed by other tasks.

Comment 2 John Sefler 2011-04-11 17:42:58 UTC
Amanda,
Is qe_test_2 / redhat still available to test a virt_only product in on webqa?  I'm getting:

2011-04-11 13:38:37,597 [ERROR] validateResponse() @connection.py:191 - remote server status code: 500
2011-04-11 13:38:37,599 [ERROR] handle_exception() @managercli.py:46 - Error during registration: 
2011-04-11 13:38:37,600 [ERROR] handle_exception() @managercli.py:47 - 
Traceback (most recent call last):
  File "/usr/share/rhsm/managercli.py", line 422, in _do_command
    facts=self.facts.get_facts())
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 323, in registerConsumer
    return self.conn.request_post('/consumers/', params)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 203, in request_post
    return self._request("POST", method, params)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 178, in _request
    self.validateResponse(result)
  File "/usr/lib/python2.6/site-packages/rhsm/connection.py", line 192, in validateResponse
    raise RemoteServerException(response['status'])
RemoteServerException

Comment 3 John Sefler 2011-04-13 22:28:07 UTC
Testing candlepin version...
[root@jsefler-betastage-workstation ~]# curl -u stage_test_virtonly:redhat -k http://rubyvip.web.stage.ext.phx2.redhat.com:80/clonepin/candlepin/status | python -mjson.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0    56    0    56    0     0    239      0 --:--:-- --:--:-- --:--:--   358
{
    "release": "1%{?dist}", 
    "result": true, 
    "version": "0.2.15"
}


Using the account that Amanada setup in stage (stage_test_virtonly) with a virt_only subscription to VMware....

[root@jsefler-betastage-workstation ~]# subscription-manager register --username=stage_test_virtonly
Password: 
172443fe-17c6-4e37-8c28-a4e843dba4e7 jsefler-betastage-workstation

[root@jsefler-betastage-workstation ~]# curl -u stage_test_virtonly:redhat -k http://rubyvip.web.stage.ext.phx2.redhat.com:80/clonepin/candlepin/consumers/172443fe-17c6-4e37-8c28-a4e843dba4e7 | python -mjson.tool | grep owners
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7762    0  7762    0     0  19924      0 --:--:-- --:--:-- --:--:-- 25038
        "href": "/owners/6306644", 
[root@jsefler-betastage-workstation ~]# 

[root@jsefler-betastage-workstation ~]# curl -u stage_test_virtonly:redhat -k http://rubyvip.web.stage.ext.phx2.redhat.com:80/clonepin/candlepin/owners/6306644/subscriptions | python -mjson.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     2    0     2    0     0      5      0 --:--:-- --:--:-- --:--:--     8
[]

^^^ DARN: I seem to be blocked from listing the subscription objects on stage, I'll do my best with the pools instead...

[root@jsefler-betastage-workstation ~]# subscription-manager facts --list | grep guest
virt.is_guest: True

^^^ proof that I am on a guest

[root@jsefler-betastage-workstation ~]# subscription-manager list --avail --all | grep MCT0986 -B2 -A4
ProductName:       	Red Hat Enterprise Linux Advanced Platform for VMware,
                        Standard (unlimited sockets)
ProductId:         	MCT0986                  
PoolId:            	8a99f9812f270524012f5073850f26f7
Quantity:          	100                      
Expires:           	2012-04-12               

--
ProductName:       	Red Hat Enterprise Linux Advanced Platform for VMware,
                        Standard (unlimited sockets)
ProductId:         	MCT0986                  
PoolId:            	8a99f9812f270524012f5073851c26fc
Quantity:          	1000                     
Expires:           	2012-04-12     


For each of the MCT0986 pools, let's look at the attributes...

m:80/clonepin/candlepin/pools/8a99f9812f270524012f5073850f26f7 | python -mjson.tool 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
101  1524    0  1524    0     0   3416      0 --:--:-- --:--:-- --:--:--  4118
{
    "accountNumber": "1444091", 
    "activeSubscription": true, 
    "attributes": [], 
    "consumed": 0, 
    "contractNumber": "2280412", 
    "created": "2011-04-13T20:00:38.000+0000", 
    "endDate": "2012-04-13T03:59:59.000+0000", 
    "href": "/pools/8a99f9812f270524012f5073850f26f7", 
    "id": "8a99f9812f270524012f5073850f26f7", 
    "owner": {
        "href": "/owners/6306644", 
        "id": "8a99f9812f270524012f5073811a26ef"
    }, 
    "productId": "MCT0986", 
    "productName": "Red Hat Enterprise Linux Advanced Platform for VMware, Standard (unlimited sockets)", 
    "providedProducts": [
        {
            "created": "2011-04-13T20:00:38.000+0000", 
            "id": "8a99f9812f270524012f5073850f26fb", 
            "productId": "85", 
            "productName": "Red Hat Enterprise Linux Load Balancer (for RHEL 6 Server)", 
            "updated": "2011-04-13T20:00:38.000+0000"
        }, 
        {
            "created": "2011-04-13T20:00:38.000+0000", 
            "id": "8a99f9812f270524012f5073850f26fa", 
            "productId": "69", 
            "productName": "Red Hat Enterprise Linux 6 Server", 
            "updated": "2011-04-13T20:00:38.000+0000"
        }, 
        {
            "created": "2011-04-13T20:00:38.000+0000", 
            "id": "8a99f9812f270524012f5073850f26f8", 
            "productId": "90", 
            "productName": "Red Hat Enterprise Linux Resilient Storage (for RHEL 6 Server)", 
            "updated": "2011-04-13T20:00:38.000+0000"
        }, 
        {
            "created": "2011-04-13T20:00:38.000+0000", 
            "id": "8a99f9812f270524012f5073850f26f9", 
            "productId": "83", 
            "productName": "Red Hat Enterprise Linux High Availability (for RHEL 6 Server)", 
            "updated": "2011-04-13T20:00:38.000+0000"
        }
    ], 
    "quantity": 100, 
    "restrictedToUsername": null, 
    "sourceEntitlement": null, 
    "startDate": "2011-04-13T04:00:00.000+0000", 
    "subscriptionId": "2077783", 
    "updated": "2011-04-13T20:00:38.000+0000"
}




[root@jsefler-betastage-workstation ~]# curl -u stage_test_virtonly:redhat -k http://rubyvip.web.stage.ext.phx2.redhat.com:80/clonepin/candlepin/pools/8a99f9812f270524012f5073851c26fc | python -mjson.tool 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2011    0  2011    0     0   5453      0 --:--:-- --:--:-- --:--:--  6886
{
    "accountNumber": "1444091", 
    "activeSubscription": true, 
    "attributes": [
        {
            "created": "2011-04-13T20:00:38.000+0000", 
            "id": "8a99f9812f270524012f5073851c26fd", 
            "name": "requires_consumer_type", 
            "updated": "2011-04-13T20:00:38.000+0000", 
            "value": "system"
        }, 
        {
            "created": "2011-04-13T20:00:38.000+0000", 
            "id": "8a99f9812f270524012f5073851c26fe", 
            "name": "virt_limit", 
            "updated": "2011-04-13T20:00:38.000+0000", 
            "value": "0"
        }, 
        {
            "created": "2011-04-13T20:00:38.000+0000", 
            "id": "8a99f9812f270524012f5073851c26ff", 
            "name": "virt_only", 
            "updated": "2011-04-13T20:00:38.000+0000", 
            "value": "true"
        }
    ], 
    "consumed": 0, 
    "contractNumber": "2280412", 
    "created": "2011-04-13T20:00:38.000+0000", 
    "endDate": "2012-04-13T03:59:59.000+0000", 
    "href": "/pools/8a99f9812f270524012f5073851c26fc", 
    "id": "8a99f9812f270524012f5073851c26fc", 
    "owner": {
        "href": "/owners/6306644", 
        "id": "8a99f9812f270524012f5073811a26ef"
    }, 
    "productId": "MCT0986", 
    "productName": "Red Hat Enterprise Linux Advanced Platform for VMware, Standard (unlimited sockets)", 
    "providedProducts": [
        {
            "created": "2011-04-13T20:00:38.000+0000", 
            "id": "8a99f9812f270524012f5073851c2702", 
            "productId": "69", 
            "productName": "Red Hat Enterprise Linux 6 Server", 
            "updated": "2011-04-13T20:00:38.000+0000"
        }, 
        {
            "created": "2011-04-13T20:00:38.000+0000", 
            "id": "8a99f9812f270524012f5073851d2703", 
            "productId": "85", 
            "productName": "Red Hat Enterprise Linux Load Balancer (for RHEL 6 Server)", 
            "updated": "2011-04-13T20:00:38.000+0000"
        }, 
        {
            "created": "2011-04-13T20:00:38.000+0000", 
            "id": "8a99f9812f270524012f5073851c2701", 
            "productId": "90", 
            "productName": "Red Hat Enterprise Linux Resilient Storage (for RHEL 6 Server)", 
            "updated": "2011-04-13T20:00:38.000+0000"
        }, 
        {
            "created": "2011-04-13T20:00:38.000+0000", 
            "id": "8a99f9812f270524012f5073851c2700", 
            "productId": "83", 
            "productName": "Red Hat Enterprise Linux High Availability (for RHEL 6 Server)", 
            "updated": "2011-04-13T20:00:38.000+0000"
        }
    ], 
    "quantity": 1000, 
    "restrictedToUsername": null, 
    "sourceEntitlement": null, 
    "startDate": "2011-04-13T04:00:00.000+0000", 
    "subscriptionId": "2077783", 
    "updated": "2011-04-13T20:00:38.000+0000"
}

Pool 8a99f9812f270524012f5073851c26fc appears to be a virt_only pool, so let's test that it is NOT available from a HOST machine...  (It should not be, nor subscribable)

Trick this vm into thinking it is a HOST...
[root@jsefler-betastage-workstation ~]# cp `which virt-what` /tmp/virt-what
[root@jsefler-betastage-workstation ~]# echo '#!/bin/bash - ' > `which virt-what`; echo 'exit 0' >> `which virt-what`;
[root@jsefler-betastage-workstation ~]# virt-what
[root@jsefler-betastage-workstation ~]# subscription-manager facts --list | grep guest
virt.is_guest: False

^^^ proof that sm thinks we are running on a HOST (non-guest)

[root@jsefler-betastage-workstation ~]# subscription-manager list --avail  | grep MCT0986 -B2 -A4
ProductName:       	Red Hat Enterprise Linux Advanced Platform for VMware,
                        Standard (unlimited sockets)
ProductId:         	MCT0986                  
PoolId:            	8a99f9812f270524012f5073850f26f7
Quantity:          	100                      
Expires:           	2012-04-12               

--
ProductName:       	Red Hat Enterprise Linux Advanced Platform for VMware,
                        Standard (unlimited sockets)
ProductId:         	MCT0986                  
PoolId:            	8a99f9812f270524012f5073851c26fc
Quantity:          	1000                     
Expires:           	2012-04-12 
       
[root@jsefler-betastage-workstation ~]# subscription-manager subscribe --pool=8a99f9812f270524012f5073851c26fc
[root@jsefler-betastage-workstation ~]# 

Something is not correct here ^^^.  I did NOT expect to see pool 8a99f9812f270524012f5073851c26fc as available and I did NOT expect to be able to subscribe to it.  Moreover, where is pool 8a99f9812f270524012f5073850f26f7 coming from? It does not have any attributes.  I wish I could see the subscription object returened from the candlepin server.  Was there a typo in my restfulapi call?

Amanada, what are the details by which you created the subscriptions for MCT0986?