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
Created redmine issue http://projects.theforeman.org/issues/15197 from this bug
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.
Upstream bug assigned to tomckay
Upstream bug component is Hosts
Moving to POST since upstream bug http://projects.theforeman.org/issues/15197 has been closed
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.
Created attachment 1174877 [details] before renaming the content-host
Created attachment 1174879 [details] after renaming and rerunning virt-who can see only on entry with name rhevh
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