Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be unavailable on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1340088 - Duplicate entries for hypervisors after renaming content host
Summary: Duplicate entries for hypervisors after renaming content host
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts
Version: 6.2.0
Hardware: All
OS: All
high
high
Target Milestone: Unspecified
Assignee: Tom McKay
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-26 12:35 UTC by Stefan Meyer
Modified: 2019-09-26 14:01 UTC (History)
5 users (show)

Fixed In Version: rubygem-katello-3.0.0.53-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 11:26:51 UTC
Target Upstream Version:


Attachments (Terms of Use)
before renaming the content-host (83.05 KB, image/png)
2016-07-01 10:59 UTC, Sachin Ghai
no flags Details
after renaming and rerunning virt-who can see only on entry with name rhevh (79.42 KB, image/png)
2016-07-01 11:01 UTC, Sachin Ghai
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 15197 0 High Closed Duplicate entries for hypervisors after renaming content host 2021-02-08 16:17:22 UTC
Red Hat Knowledge Base (Solution) 4135181 0 Customize or extend None Duplicate entries for hypervisors after renaming content host on Red Hat Satellite 6. 2019-05-14 08:20:15 UTC

Description Stefan Meyer 2016-05-26 12:35:08 UTC
Description of problem:
After renaming the hypervisor in /content_hosts and another run of virt-who
the hypervisor content host is again created with a random name but with
the same uuid.

Version-Release number of selected component (if applicable):
Satellite 6.2 SNAP 13.1
virt-who 0.14-9.el7

How reproducible:
With every virt-who run

Steps to Reproduce:
1. Register hypervisor via virt-who
2. Rename hypervisor in /content_hosts
3. Run virt-who again

Actual results:
A new entry is created in /content_hosts

Expected results:
Only update the already existing content host

Additional info:
- virt-who is always sending the correct hypervisor uuid
- looks like the unique identifier was changed from the content hosts uuid to the name
- this is a regression as it worked fine in 6.1

Comment 1 Tom McKay 2016-05-26 12:51:11 UTC
Created redmine issue http://projects.theforeman.org/issues/15197 from this bug

Comment 2 Tom McKay 2016-05-26 12:56:52 UTC
Note that the host name is not changed in candlepin, which I think is a good thing. In katello, when looking for existing hypervisors to match on the results returned from candlepin, the UUID needs to be searched for with the fallback being the name.

This situation will lead to corrupt database since there will be multiple hosts referencing a single candlepin consumer. If the consumer is deleted (ie. one of the hosts is deleted) then the other records will fail w/ errors when queried.

Comment 3 Bryan Kearney 2016-05-26 14:17:28 UTC
Upstream bug assigned to tomckay@redhat.com

Comment 4 Bryan Kearney 2016-05-26 14:17:31 UTC
Upstream bug component is Hosts

Comment 5 Bryan Kearney 2016-05-26 14:17:34 UTC
Upstream bug assigned to tomckay@redhat.com

Comment 8 Bryan Kearney 2016-06-02 22:16:50 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/15197 has been closed

Comment 9 Sachin Ghai 2016-07-01 10:57:11 UTC
Verified with sat62 GA snap18.1

I registered rhev hypervisor with satellite62 server and later changed the content-host name from "virt-who-rhevh2-1" to "rhevh2". Content host was successfully renamed after running virt-who without another duplicate entry.

Comment 10 Sachin Ghai 2016-07-01 10:59:57 UTC
Created attachment 1174877 [details]
before renaming the content-host

Comment 11 Sachin Ghai 2016-07-01 11:01:39 UTC
Created attachment 1174879 [details]
after renaming and rerunning virt-who can see only on entry with name rhevh

Comment 12 Bryan Kearney 2016-07-27 11:26:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1501


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