How to register a cloned virtual machine on the satellite server?
Environment
- Red Hat Satellite 6
- Red Hat Enterprise Linux 7.x
Issue
-
Registering a cloned machine, which was created from an already registered
Red Hat Enterprise Linux 7virtual machine toRed Hat Satelliteserver, lists as the original system that was cloned in web interface. -
When we try to register a cloned virtual machine in
Red Hat Satelliteserver, the cloned machine will get registered but does not appear on theRed Hat Satelliteserver web interface. -
When we try to register a cloned virtual machine in
Red Hat Satelliteserver, the below error is observed:The system is already registered. Use --force to override.
Resolution
Solution 1
-
Ensure that
/etc/rhsm/rhsm.conffile has default content in it -
While cloning images for virtual machines, ensure that the following files are not present and have the cloning process regenerate them on the first boot:
/var/lib/dbus/machine-id /etc/machine-id /etc/rhsm/facts/katello.facts /etc/insights-client/machine-id
Solution 2
NOTE: Applies for an existing VM that has been cloned without removing the files as described in Solution 1
-
Generate the new
UUIDand store in the variable:# _UUID=$(uuidgen) -
Update the
UUIDinkatello.factfile:# sh -c "echo '{\"network.hostname-override\": \"$(hostname --fqdn)\", \"dmi.system.uuid\": \"$_UUID\", \"virt.uuid\": \"$_UUID\"}' > /etc/rhsm/facts/katello.facts" -
Run the below command to update the
UUID:# subscription-manager register
For more KB articles/solutions related to Red Hat Satellite 6.x Client Subscription Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Client Subscription Issues
Root Cause
- As a part of the registration process when
katello-ca-consumer-latest.noarch.rpmis installed it creates file./etc/rhsm/facts/katello.factsto ensure that subscription-manager reports system via FQDN.Since this file already exists on a cloned machine, so new facts file is not created. - When a virtual machine
already registeredwith the Satellite server is cloned, then file/etc/rhsm/facts/katello.factson cloned machines, has thekatello factsinformation of the original virtual machine. - So it is necessary to ensure that
katello.factsfile is not present and have the cloning process regenerate them on the first boot. Otherwise, the system might report ashort hostnameand that causes issues with the puppet.
Diagnostic Steps
-
If it's present, based on
Root Causeexplanation, compare facts file/etc/rhsm/facts/katello.factson original as well as cloned virtual machine where the same entries are present. -
Verify the
virt.uuidon both the systems using the following command.# subscription-manager facts |egrep 'hostname|uuid' network.hostname: client.example.com virt.uuid: 422e8494-9477-532b-984e-c0675a88969c # subscription-manager facts |egrep 'hostname|uuid' network.hostname: cloned-client.example.com virt.uuid: 422e8494-9477-532b-984e-c0675a88969c
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.