Bug 1000358

Summary: KVM/XEN:Can't get the host's consummer uuid in the guest info of SAM server
Product: [Retired] Subscription Asset Manager Reporter: Liushihui <shihliu>
Component: candlepinAssignee: Tom McKay <tomckay>
Status: CLOSED WONTFIX QA Contact: SAM QE List <sam-qe-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 1.3CC: hsun, liliu, mstead, sgao, shihliu, tomckay
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-11 03:30:52 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: 971511    
Attachments:
Description Flags
virtuuid
none
correct_associate_uuid
none
guest consumer info none

Description Liushihui 2013-08-23 09:32:30 UTC
Description of problem:
After host and guest have registered to SAM server ,In the SAM server, Can't see the host's consumer uuid in the guest info

Version-Release number of selected component (if applicable):
katello-headpin-1.4.3-9.el6sam_splice.noarch
candlepin-0.8.21-1.el6sam.noarch
subscription-manager-1.8.20-1.el5
python-rhsm-1.8.16-1.el5
virt-who-0.7-9.el5

How reproducible:
Always

Steps to Reproduce:
1.Configure the virt-who(virt-who running in the libvirt mode)
   # vi /etc/sysconfig/virt-who
    VIRTWHO_BACKGROUND=1
    VIRTWHO_DEBUG=5
2.Restart the virt-who service,
   # service virt-who restart
3.Registered host and guest to samserver with the same username and password
   # subscription-manager register --username=admin --password=admin
4.Get the guests' and host's consummer uuid and record them:
In the guest,get the guest's consumer uuid = 2dd3527f-cedb-418a-9bd8-902e9ee4763f:
   # subscription-manager identity
	Current identity is: 2dd3527f-cedb-418a-9bd8-902e9ee4763f
	name: dhcp-66-102-65.englab.nay.redhat.com
	org name: ACME_Corporation
	org id: 8ac28d2340a922640140a923840a0001
In the host, get the host's consumer uuid = aadbeb31-22d5-42ae-8f28-939da4c953ea:
   # subscription-manager identity
	Current identity is: aadbeb31-22d5-42ae-8f28-939da4c953ea
	name: hp-z220-04.qe.lab.eng.nay.redhat.com
	org name: ACME_Corporation
	org ID: ACME_Corporation
    # subscription-manager identity
5.Check the host consummer uuid on SAM server side.
    #curl -u admin:admin -k https://$samIP/sam/api/consumers/$guest_consumer_uuid > virtuuid "
    Check if the host's consumer uuid are in the guest info (virtuuid file), please see the virtuuid file in the attachment.

Actual results:
It hasn't contain the host consumer uuid in the guest info(file:virtuuid)


Expected results:
It should display the host consumer uuid in the guest info(file:virtuuid)

Additional info:
It can get the guest's consumer uuid in the host info(file: correct_associate_uuid which in the attachment)

Test Env:
SAM server: 10.66.12.135

Comment 1 Liushihui 2013-08-23 09:35:23 UTC
Created attachment 789519 [details]
virtuuid

Comment 2 Liushihui 2013-08-23 09:36:04 UTC
Created attachment 789520 [details]
correct_associate_uuid

Comment 3 Tom McKay 2013-08-28 13:46:59 UTC
Is this working for some guests but not others? Is this something that was working and is not now?

Comment 4 Michael Stead 2013-08-28 13:54:01 UTC
Depending on the answer to the questions in comment3, this might be an RFE for katello.

If required, the host consumer can be fetched with the following candlepin API call -- the host uuid can be extracted and appended to the katello repsonse.

GET /consumers/$guest_uuid/host

Comment 5 Liushihui 2013-09-04 02:36:58 UTC
(In reply to Tom McKay from comment #3)
> Is this working for some guests but not others? 
---> Only the guest which has registered to SAM server should work
Is this something that was working and is not now?
---> Yes, SAM-1.3-20130624.0 hasn't this problem. Then in the SAM-1.3.0-RHEL-6-20130808.0, it has occur a new bug995968 which is related to this problem, After bug995968 fixed, This problem still exist.

Comment 6 gaoshang 2013-09-06 09:08:53 UTC
This issue still exist in SAM-1.3.0-RHEL-6-snapshot5. After comparing with old SAM (SAM-1.3-20130624.0), I found that old SAM will add guest info to host consumer, and will add host info to guest consumer, but latest SAM add a blank guest info to guest consumer which caused this bug, please see the marked section in attachment, thanks.

Comment 7 gaoshang 2013-09-06 09:11:04 UTC
Created attachment 794624 [details]
guest consumer info

Comment 8 Tom McKay 2013-09-06 12:12:20 UTC
Note to developers: Looking at attachment in comment #7, something changed in how consumer json is being generated in katello. Previously the host information was included, then it was removed.

Comment 9 Eko 2015-06-04 03:10:02 UTC
This issue should be fixed

1. check host identity on host
  # subscription-manager identity   -> 69950bed-79c1-451d-b88b-05b424673141

2. check guest identity on guest
  # subscription-manager identity   -> 721eb6f7-5034-4148-8608-7836987e8c09

3. run curl with host identity, check guest identity whether exist
  # curl -u virt-who-test:redhat -k https://subscription.rhn.stage.redhat.com/subscription/consumers/[Host Identity]]/guests |python -mjson.tool

4. run curl with guest identity, check host identity whether exist
  # curl -u virt-who-test:redhat -k https://subscription.rhn.stage.redhat.com/subscription/consumers/[Guest Identity]/host |python -mjson.tool