How to register a cloned virtual machine on the satellite server?

Solution Verified - Updated

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 7 virtual machine to Red Hat Satellite server, lists as the original system that was cloned in web interface.

  • When we try to register a cloned virtual machine in Red Hat Satellite server, the cloned machine will get registered but does not appear on the Red Hat Satellite server web interface.

  • When we try to register a cloned virtual machine in Red Hat Satellite server, the below error is observed:

    The system is already registered. Use --force to override.
    

Resolution

Solution 1

  • Ensure that /etc/rhsm/rhsm.conf file 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 UUID and store in the variable:

    # _UUID=$(uuidgen)
    
  • Update the UUID in katello.fact file:

    # 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.rpm is installed it creates file. /etc/rhsm/facts/katello.facts to 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 registered with the Satellite server is cloned, then file /etc/rhsm/facts/katello.facts on cloned machines, has the katello facts information of the original virtual machine.
  • So it is necessary to ensure that katello.facts file is not present and have the cloning process regenerate them on the first boot. Otherwise, the system might report a short hostname and that causes issues with the puppet.

Diagnostic Steps

  • If it's present, based on Root Cause explanation, compare facts file /etc/rhsm/facts/katello.facts on original as well as cloned virtual machine where the same entries are present.

  • Verify the virt.uuid on 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
    
SBR
Product(s)
Category

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.