Description of problem: The katello.facts is generated automatically during the installation of the katello-ca-consumer-latest rpm. It populates the files using the below code. === FQDN=`hostname -f` if [ $? == "0" ] && [ -d /etc/rhsm/facts/ ]; then echo "{\"network.hostname-override\":\"$FQDN\"}" > /etc/rhsm/facts/katello.facts fi === So it should contain the hostname of the hypervisor as below. cat /etc/rhsm/facts/katello.facts {"network.hostname-override":"myhost.example.com"} Where myhost.example.com is the hypervisor hostname. Since the katello-ca-consumer-latest is an extra rpm, we will be using "rpm -Uvh" at the end of the upgrade procedure to move the package to the new layer. This is done using systemd-nspawn as below. === 2019-03-28 12:47:06,988 [DEBUG] (MainThread) Running ['systemd-nspawn', '--uuid', '68ee01a38489442c9ba23c1746b9e330', '-D', u'/tmp/mnt.T18wo//', 'rpm', '-Uvh', '/var/imgbased/persisted-rpms/katello-ca-consumer-latest.noarch.rpm'] === We are not passing the "--machine" with systemd-nspawn. So from the man page of systemd-nspawn, if -machine is not specified, the last component of the root directory path of the container is used to set the hostname. So this results in having an invalid entry in the katello.facts. === cat /etc/rhsm/facts/katello.facts {"network.hostname-override":"mnt.T18wo"} === Version-Release number of selected component (if applicable): Customer reproduced with RHV 4.2 and I have used 4.3 to reproduce the issue. How reproducible: 100% Steps to Reproduce: 1. Install katello-ca-consumer-latest from the satellite on RHV-H. 2. Check if /etc/rhsm/facts/katello.facts is having correct hostname. 3. Upgrade the host. 4. The /etc/rhsm/facts/katello.facts will be having an invalid hostname. Actual results: katello.facts gets invalid hostname while updating RHV hypervisor Expected results: Upgrading RHV-H should not make an invalid entry in /etc/rhsm/facts/katello.facts. Additional info:
How to reproduce this Bug. 1.Use a modified katello-ca-consumer-latest rpm to install by Yum. yum -y install katello-ca-consumer-host-8-243-104.host.centralci.eng.rdu2.redhat.com-1.0-1.noarch.rpm 2. It automatically generates a katello.facts file. Note: katello-ca-consumer-latest rpm can not automatically generate files before modification. My satellite version is 6.4.2. It can't generate katello.facts file. cat katello.facts {"network.hostname-override":"dhcp-10-180.nay.redhat.com"} 3. Upgrade from rhvh-4.2.5.0-20180724 to rhvh-4.2.8.3-0.20190219.0。 result: The katello.facts file has changed. cat /etc/rhsm/facts/katello.facts {"network.hostname-override":"mnt.q6aAw"}
The issue is fixed in rhvh-4.3.0.5-0.20190404.0+1. Test version: Build1: rhvh-4.3.0.5-0.20190328.0 Build2: rhvh-4.3.0.5-0.20190404.0+1 Test steps: 1.Use a modified katello-ca-consumer-latest rpm to install by Yum. yum -y install katello-ca-consumer-host-8-243-104.host.centralci.eng.rdu2.redhat.com-1.0-1.noarch.rpm The content modified in A is the following: #rpmrebuiled -enp katello-ca-consumer-host-8-243-104.host.centralci.eng.rdu2.redhat.com-1.0-1.noarch.rpm Add following below line 66: FQDN=`hostname -f` if [ $? == "0" ] && [ -d /etc/rhsm/facts/ ]; then echo "{\"network.hostname-override\":\"$FQDN\"}" > /etc/rhsm/facts/katello.facts fi 2. It automatically generates a katello.facts file. cat katello.facts {"network.hostname-override":"dhcp-10-180.nay.redhat.com"} 3. Upgrade from rhvh-4.3.0.5-0.20190328.0 to rhvh-4.3.0.5-0.20190404.0+1. Test result: this file will not change. cat /etc/rhsm/facts/katello.facts {"network.hostname-override":"dhcp-10-180.nay.redhat.com"} So this bug is fixed in rhvh-4.3.0.5-0.20190404.0+1, I will change the status to VERIFIED.
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-2019:1053
sync2jira