Bug 1138771

Summary: Registering hypervisors with the same ID to different orgs is blocked
Product: Red Hat Satellite Reporter: Carter Kozak <ckozak>
Component: Subscription ManagementAssignee: Jason Montleon <jmontleo>
Status: CLOSED CURRENTRELEASE QA Contact: Li Bin Liu <liliu>
Severity: medium Docs Contact:
Priority: unspecified    
Version: UnspecifiedCC: akrzos, alikins, bbuckingham, bkearney, cwelton, dgoodwin, liliu, mmccune, sgao, sthirugn, tomckay
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:
: 1159769 (view as bug list) Environment:
Last Closed: 2014-11-20 13:26:30 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, 1159769    
Attachments:
Description Flags
capture none

Description Carter Kozak 2014-09-05 15:26:46 UTC
Description of problem:

Registering hypervisors with the same ID to different orgs is blocked.
If two virt-who instances in different orgs report the same hypervisorId, the second one will currently fail.

Version-Release number of selected component (if applicable):
all versions currently (latest is 9.26.1) I have a more permanent fix that should be in candlepin master soon, but I don't think we can get it into sat6 for release.

How reproducible:
100%

Steps to Reproduce:
point two virt-who instances (in different orgs, registered to the same sat6) at the same cluster.
second one to run will always fail.

Actual results:
One virt-who fails to create the host-guest association.  It receives errors (result.failedUpdate in the json response), which should also appear in candlepin logs (info level)

Expected results:
Each organization should have a hypervisor consumer created to represent the given hypervisor ID

Additional info:
The fix shouldn't involve any code change.  If we append this line to the installed candlepin.conf, the problem should be resolved:

candlepin.block_duplicate_hypervisor_ids = false

Future candlepin versions should remove that config and always behave as though 'false' is used.

Comment 1 RHEL Program Management 2014-09-05 15:43:24 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Carter Kozak 2014-09-09 18:02:02 UTC
But wait, there's more!!

The candlepin server included in satellite 6 is missing default configuration values for c3p0.  Without any configuration, too many concurrent requests will cause candlepin to request more database connections than the database can handle, causing the request to fail.

# Default values for c3p0 to avoid requesting more connections than possible
# Without this, problems can occur in heavy load scenarios (attempts to get a db connection will cause exceptions)
jpa.config.hibernate.connection.provider_class=org.hibernate.connection.C3P0ConnectionProvider
jpa.config.hibernate.c3p0.min_size=5
jpa.config.hibernate.c3p0.max_size=20
jpa.config.hibernate.c3p0.timeout=300
jpa.config.hibernate.c3p0.idle_test_period=300
jpa.config.hibernate.c3p0.max_statements=0

Comment 9 gaoshang 2014-11-03 07:45:50 UTC
This bug has been verified on RHEL-7.1-20141024.1 against sat6 zstream but failed, please check following steps:

1, Configure virt-who host1 with ESX and register to Satellite, org selected: Default_Organization

2, Start virt-who service in host1, check hypervisor consumer created in Default_Organization --> Content Hosts page

3, Configure virt-who host2 with the same ESX and register to Satellite, org selected: sgao_org

4, Start virt-who service in host2, check hypervisor consumer created in sgao_org --> Content Hosts page
---- This step failed, the second hypervisor consumer did not show up here, instead in Default_Organization --> Content Hosts page, a duplicated hypervisor consumer has been added.

5, Check log files /var/log/rhsm/rhsm.log in both the 2 virt-who hosts, no error show up.

Comment 10 gaoshang 2014-11-03 07:47:39 UTC
Created attachment 953014 [details]
capture

Please check the captures

Comment 11 Adrian Likins 2014-11-05 20:01:16 UTC
Are the candlepin logs from the satellite available?

Comment 15 Tom McKay 2014-11-20 13:26:30 UTC
This limitation was removed prior to Sat-6.0 release.