对注册克隆的客户端时出现的问题进行查错
如果您使用 SUSE Manager 来管理虚拟机,您可能发现创建 VM 的克隆版本会很有用。克隆版本是使用主磁盘(与现有磁盘完全相同的副本)的 VM。
虽然克隆 VM 可以节省大量时间,但磁盘上复制的标识信息有时会导致问题。
如果您有一个已注册的客户端,并创建了该客户端的克隆版本,在尝试注册该克隆版本时,您可能希望 SUSE Manager 将原始客户端和克隆版本注册为两个不同的客户端。但是,如果原始客户端和克隆版本中的计算机 ID 相同,则 SUSE Manager 会将这两个客户端注册为一个系统,并且现有客户端数据将由克隆版本的数据重写。
可以通过更改克隆版本的计算机 ID 来解决此问题,以便 SUSE Manager 将它们识别为两个不同的客户端。
|
此过程的每个步骤都在克隆的客户端上执行。此过程不会对原始客户端进行操作,原始客户端仍保持注册到 SUSE Manager。 |
在克隆的计算机上,更改主机名和 IP 地址。 确保
/etc/hosts包含您所做的更改和正确的主机项。解决重复计算机标识问题
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-setupIf 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,journalctlcould not retrieve any log andpodman logswould not show anything.mv /var/log/journal/* /var/log/journal/$(cat /etc/machine-id)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
如果您计划克隆一台 Red Hat Enterprise Linux 8.10 服务器,之后再将其迁移至 SUSE Liberty Linux 系统,则必须执行额外步骤修复内核配置文件。
Red Hat Enterprise Linux 系统会利用计算机标识在
/boot/loader/entries下生成内核条目。如果跳过这些步骤,系统迁移后将同时存在新旧内核条目,因为 SUSE Liberty Linux 系统的内核会生成新条目,而非替换原有条目。
在更改计算机标识后、执行系统迁移前,请依次运行以下命令:
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.cfgFor more information and example on liberating Red Hat Enterprise Linux 8.10 server, see Liberate Red Hat Enterprise Linux 8.10 with secureboot.
重新配置 Salt 客户端
If your clients still have the same Salt client ID, delete the
minion_idfile 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对于 Salt 捆绑包客户端:
rm /etc/venv-salt-minion/minion_id rm -rf /etc/venv-salt-minion/pkiDelete accepted keys from the onboarding page and the system profile from SUSE Manager, and restart the client with.
For Salt Minion clients:
service salt-minion restart对于 Salt 捆绑包客户端:
service venv-salt-minion restart重新注册客户端。每个客户端现在都有一个不同的
/etc/machine-id,并且应会正确显示在系统概览页面上。