Bug 1000358 - KVM/XEN:Can't get the host's consummer uuid in the guest info of SAM server
KVM/XEN:Can't get the host's consummer uuid in the guest info of SAM server
Product: Subscription Asset Manager
Classification: Red Hat
Component: candlepin (Show other bugs)
x86_64 Linux
unspecified Severity high
: rc
: ---
Assigned To: Tom McKay
Depends On:
Blocks: sam20-tracker
  Show dependency treegraph
Reported: 2013-08-23 05:32 EDT by Liushihui
Modified: 2016-03-10 22:30 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-03-10 22:30:52 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
virtuuid (6.40 KB, text/plain)
2013-08-23 05:35 EDT, Liushihui
no flags Details
correct_associate_uuid (12.64 KB, text/plain)
2013-08-23 05:36 EDT, Liushihui
no flags Details
guest consumer info (16.39 KB, text/plain)
2013-09-06 05:11 EDT, gaoshang
no flags Details

  None (edit)
Description Liushihui 2013-08-23 05:32:30 EDT
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):

How reproducible:

Steps to Reproduce:
1.Configure the virt-who(virt-who running in the libvirt mode)
   # vi /etc/sysconfig/virt-who
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:
Comment 1 Liushihui 2013-08-23 05:35:23 EDT
Created attachment 789519 [details]
Comment 2 Liushihui 2013-08-23 05:36:04 EDT
Created attachment 789520 [details]
Comment 3 Tom McKay 2013-08-28 09:46:59 EDT
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 09:54:01 EDT
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-03 22:36:58 EDT
(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 05:08:53 EDT
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 05:11:04 EDT
Created attachment 794624 [details]
guest consumer info
Comment 8 Tom McKay 2013-09-06 08:12:20 EDT
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-03 23:10:02 EDT
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

Note You need to log in before you can comment on or make changes to this bug.