Documentation survey

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

如果您使用 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

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

  3. Resolving Duplicate Machine IDs

  4. 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

如果克隆的计算机的 /var/log/journal/ 下也包含一个文件夹,则需要根据新计算机 ID 将其重命名。如果名称不一致,journalctl 将无法检索任何日志,并且 podman logs 将不会显示任何内容。

+

mv /var/log/journal/* /var/log/journal/$(cat /etc/machine-id)
  1. 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
  2. Fixing Kernel Entries on Red Hat Enterprise Linux 8.10

  3. 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.

  4. 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.

  5. Reconfiguring Salt Clients

  6. 如果您的客户端仍然具有相同的 Salt 客户端 ID,请删除每个客户端上的 minion_id 文件(这样就会使用在客户端重启动时重新生成的 FQDN)。对于 Salt 受控端客户端:

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

    对于 Salt 捆绑包客户端:

    rm /etc/venv-salt-minion/minion_id
    rm -rf /etc/venv-salt-minion/pki
  7. 从初始配置页面中删除接受的密钥并从 SUSE Multi-Linux Manager 中删除系统配置文件,然后重启动客户端。对于 Salt 受控端客户端,请使用以下命令:

    service salt-minion restart

    对于 Salt 捆绑包客户端:

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