对注册克隆的客户端时出现的问题进行查错

如果您使用 SUSE Multi-Linux Manager 来管理虚拟机,您可能发现创建 VM 的克隆版本会很有用。克隆版本是使用主磁盘(与现有磁盘完全相同的副本)的 VM。

虽然克隆 VM 可以节省大量时间,但磁盘上复制的标识信息有时会导致问题。

如果您有一个已注册的客户端,并创建了该客户端的克隆版本,在尝试注册该克隆版本时,您可能希望 SUSE Multi-Linux Manager 将原始客户端和克隆版本注册为两个不同的客户端。但是,如果原始客户端和克隆版本中的计算机 ID 相同,则 SUSE Multi-Linux Manager 会将这两个客户端注册为一个系统,并且现有客户端数据将由克隆版本的数据重写。

可以通过更改克隆版本的计算机 ID 来解决此问题,以便 SUSE Multi-Linux Manager 将它们识别为两个不同的客户端。

此过程的每个步骤都在克隆的客户端上执行。此过程不会对原始客户端进行操作,原始客户端仍保持注册到 SUSE Multi-Linux Manager。

过程:解决克隆的 Salt 客户端中的重复计算机 ID
  1. Initial System Configuration

    1. 在克隆的计算机上,更改主机名和 IP 地址。 确保 /etc/hosts 包含您所做的更改和正确的主机项。

  2. Resolving Duplicate Machine IDs

    1. For distributions that support systemd:

      1. 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
      2. If the cloned machine also has a folder in /var/log/journal/ it needs to be renamed accordingly to the new machine ID. If names do not match, journalctl could not retrieve any log and podman logs would not show anything.

        mv /var/log/journal/* /var/log/journal/$(cat /etc/machine-id)
    2. For distributions that do not support systemd:

      1. As root, generate a machine ID from dbus:

      rm /var/lib/dbus/machine-id
      rm /var/lib/zypp/AnonymousUniqueId
      dbus-uuidgen --ensure
    • If you are cloning a Red Hat Enterprise Linux 8.10 server that will later be liberated to SUSE Liberty Linux, you must perform extra steps to fix the kernel configuration files.

    Red Hat Enterprise Linux uses the machine ID to generate kernel entries in /boot/loader/entries. Not performing these steps will result in a mix of old and new kernel entries after the liberation, as SUSE Liberty Linux kernels will create new entries instead of replacing the old ones.

    • After changing the machine ID and before liberating, run:

      sudo rm -rf /boot/loader/entries/
      sudo for ver in $(rpm -q kernel --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n'); do echo "Reinstalling kernel $ver..."; sudo kernel-install add $ver /lib/modules/$ver; done
      sudo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
    • For more information and example on liberating Red Hat Enterprise Linux 8.10 server, see Liberate Red Hat Enterprise Linux 8.10 with secureboot.

  3. Reconfiguring Salt Clients

    1. 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).

      1. For Salt Minion clients:

        rm /etc/salt/minion_id
        rm -rf /etc/salt/pki
      2. 对于 Salt 捆绑包客户端:

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

      1. For Salt Minion clients:

        service salt-minion restart
      2. 对于 Salt 捆绑包客户端:

      service venv-salt-minion restart
    3. 重新注册客户端。每个客户端现在都有一个不同的 /etc/machine-id,并且应会正确显示在系统概览页面上。