Bug 783529

Summary: Could not find ESX host on SAM WebUI
Product: Red Hat Satellite Reporter: Tom McKay <tomckay>
Component: Content ManagementAssignee: Katello Bug Bin <katello-bugs>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: bkearney, cpelland, esammons, huiwang, inecas, khong, mstead, yuzheng
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 783461 Environment:
Last Closed: 2012-08-22 13:28:00 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: 783461    
Bug Blocks: 747354, 803375    

Description Tom McKay 2012-01-20 18:05:46 UTC
+++ This bug was initially created as a clone of Bug #783461 +++

Description of problem:
After virt-who successfully sending esx hostid:guestids mappings to SAM, we could find the esx host on SAM WebUI. However, we could see the esx guest was associated with the esx host.

See attached screenshot for more info.

Version-Release number of selected component (if applicable):
virt-who-0.5-5.el5
ESX4.1
katello-headpin-0.1.126-2.el6.noarch
katello-httpd-ssl-key-pair-1.0-1.noarch
katello-cli-headpin-0.1.13-2.el6.noarch
katello-configure-0.1.52-2.el6.noarch
katello-qpid-broker-key-pair-1.0-1.noarch
katello-cli-common-0.1.34-2.el6.noarch
katello-common-0.1.180-2.el6.noarch
katello-headpin-all-0.1.126-2.el6.noarch
katello-glue-candlepin-0.1.180-2.el6.noarch
katello-trusted-ssl-cert-1.0-1.noarch
katello-certs-tools-1.0.1-2.el6.noarch
candlepin-0.5.10-1.el6.noarch
candlepin-tomcat6-0.5.10-1.el6.noarch
katello-glue-candlepin-0.1.180-2.el6.noarch
thumbslug-0.0.21-1.el6.noarch


How reproducible:


Step to Reproduce:
Following steps are copied from https://bugzilla.redhat.com/show_bug.cgi?id=783355#c0

1. prepared one rhel5.8-snapshot4.0 host, and register to SAM:
#subscription-namager register --org=ACME_Corporation --environment=env1
--username=$username --password=$password

2.Deployed the env of ESX as following:
Set the vcenter's username/password 
Vcenter username : Administrator
Vcenter password :123qweP
Vcenter server IP : 10.66.5.106
Vsphere client Ip : 10.66.6.128
ESX IP: 10.66.6.66
ESX username=$username
ESX password=$password
Installed some Guests on ESX

3.Set the /etc/sysconfig/virt-who on rhel5.8-snapshot5.0 host (or on one of the
guests that is installed on ESX).

#vim /etc/sysconfig/virt-who
VIRTWHO_BACKGROUND=1
VIRTWHO_DEBUG=1
VIRTWHO_ESX=1
VIRTWHO_ESX_OWNER=ACME_Corporation
VIRTWHO_ESX_ENV=env1
VIRTWHO_ESX_SERVER=10.66.5.106
VIRTWHO_ESX_USERNAME=Administrator
VIRTWHO_ESX_PASSWORD=123qweP

4.Restart virt-who service
#service virt-who restart

5.Log in SAM WebUI and look for esx host under "Systems" tab

Actual results:
no esx host found

Expected results:
esx host found, and can add subscriptions for the esx host

Additional info:

--- Additional comment from khong on 2012-01-20 09:22:57 EST ---

Created attachment 556516 [details]
no esx host found on SAM WebUI

--- Additional comment from mstead on 2012-01-20 12:34:10 EST ---

I have concluded that the esx host reported by virt-who was created and associated with the reported guests in candlepin (according to the database).

After looking at the katelloschema database, I have noticed that a 'system' entry was not created for the host's consumer that was created in candlepin.

When virt-who reports the host/guest mapping to candlepin, candlepin will create the new Host consumer associate its guests, and then return some metadata about what happened (consumers created, guests associated and any failures).

From what I understand, katello should have looked at candlepins's response, seen that the host consumer was created, and (I'm assuming katello logic here) create a new system entry doing the environment association ect...

Someone more familiar with the katello side of this process would likely be better to look at this issue.

Comment 1 Mike McCune 2012-01-26 19:08:05 UTC
mass ON_QA move

Comment 3 Jeff Weiss 2012-04-27 13:20:34 UTC
Verified by inspection of git - System Engine commit 
6e16ef90476800ca00a40f1a9662e05cb413a10b pulls in the same fix that was made to SAM and Katello (verified by testing in the original bug).  Went into katello-0.1.181-1.