Troubleshooting Registering Cloned Clients

If you are using SUSE Manager to manage virtual machines, you might find it useful to create clones of your VMs. A clone is a VM that uses a primary disk that is an exact copy of an existing disk.

While cloning VMs can save you a lot of time, the duplicated identifying information on the disk can sometimes cause problems.

If you have a client that is already registered, you create a clone of that client, and then try and register the clone, you probably want SUSE Manager to register them as two separate clients. However, if the machine ID in both the original client and the clone is the same, SUSE Manager registers both clients as one system, and the existing client data is overwritten with that of the clone.

This can be resolved by changing the machine ID of the clone, so that SUSE Manager recognizes them as two different clients.

Each step of this procedure is performed on the cloned client. This procedure does not manipulate the original client, which remains registered to SUSE Manager.

Procedure: Resolving Duplicate Machine IDs in Cloned Salt Clients
  1. On the cloned machine, change the hostname and IP addresses. Make sure /etc/hosts contains the changes you made and the correct host entries.

  2. For distributions that support systemd: If your machines have the same machine ID, as root, delete the files on each duplicated client and re-create it:

    rm /etc/machine-id
    rm /var/lib/dbus/machine-id
    rm /var/lib/zypp/AnonymousUniqueId
    dbus-uuidgen --ensure
    systemd-machine-id-setup
  3. For distributions that do not support systemd: As root, generate a machine ID from dbus:

    rm /var/lib/dbus/machine-id
    rm /var/lib/zypp/AnonymousUniqueId
    dbus-uuidgen --ensure
  4. If your clients still have the same Salt client ID, delete the minion_id file on each client (FQDN is used when it is regenerated on client restart). For Salt Minion clients:

    rm /etc/salt/minion_id
    rm -rf /etc/salt/pki

    For Salt Bundle clients:

    rm /etc/venv-salt-minion/minion_id
    rm -rf /etc/venv-salt-minion/pki
  5. Delete accepted keys from the onboarding page and the system profile from SUSE Manager, and restart the client with:

    service salt-minion restart
  6. Re-register the clients. Each client now has a different /etc/machine-id and should be correctly displayed on the System Overview page.

Procedure: Resolving Duplicate Machine IDs in Cloned Traditional Clients
  1. On the cloned machine, change the hostname and IP addresses. Make sure /etc/hosts contains the changes you made and the correct host entries.

  2. Stop the rhnsd daemon, on Red Hat Enterprise Linux Server 6 and SUSE Linux Enterprise 11 with:

    /etc/init.d/rhnsd stop

    or, on newer systemd-based systems, with:

    service rhnsd stop
  3. Stop osad with:

    /etc/init.d/osad stop

    or:

    service osad stop

    or:

    rcosad stop
  4. Remove the osad authentication configuration file and the system ID:

    rm -f /etc/sysconfig/rhn/{osad-auth.conf,systemid}
  5. Delete the files containing the machine IDs:

    • SLES 12:

      rm /etc/machine-id
      rm /var/lib/dbus/machine-id
      dbus-uuidgen --ensure
      systemd-machine-id-setup
    • SLES 11:

      suse_register -E
  6. Remove the credential files:

    • SLES clients:

      rm -f /etc/zypp/credentials.d/{SCCcredentials,NCCcredentials}
    • Red Hat Enterprise Linux clients:

      rm  -f /etc/NCCcredentials
  7. Re-run the bootstrap script. You should now see the cloned system in SUSE Manager without overriding the system it was cloned from.