将代理从 4.3 迁移到 5.1

1. 要求和注意事项

To migrate a SUSE Manager 4.3 Proxy to SUSE Multi-Linux Manager 5.1, you require a new machine with SL Micro 6.1 or SUSE Linux Enterprise Server 15 SP7 and mgrpxy installed.

无论所选主机操作系统是 SL Micro 6.1 还是 SUSE Linux Enterprise Server 15 SP7,从 SUSE Manager 4.3 就地迁移到 5.1 都需要重新安装主机操作系统。

在从 SUSE Manager 4.3 迁移到 5.1 之前,必须将所有现有的传统客户端(包括传统代理)迁移到 Salt。有关将传统 SUSE Multi-Linux Manager 4.3 客户端迁移到 Salt 客户端的详细信息,请参见 https://documentation.suse.com/suma/4.3/en/suse-manager/client-configuration/contact-methods-migrate-traditional.html

SUSE Multi-Linux Manager 5.0 及更高版本不再支持传统联系协议。

在将 SUSE Manager 4.3 代理迁移至 SUSE Multi-Linux Manager 5.1 之前,需要先迁移 SUSE Manager 4.3 服务器,详情请参见 将 SUSE Multi-Linux Manager 服务器迁移到容器化环境

2. 简介

在 SUSE Multi-Linux Manager 5.1 中,可以使用两种不同的方法来部署代理:

  • 基于 Podman 运行的容器化部署

  • 基于 k3s 运行的容器化部署

In SUSE Multi-Linux Manager 5.1, RPM based support was removed, and only the containerized version running with podman or k3s is supported. The management of the containerized proxy running with Podman is done using the mgrpxy tool.

43 proxy migration.mmaid

3. 备份现有 SUSE Multi-Linux Manager Proxy 数据

SUSE Multi-Linux Manager for Retail 5.1.2 为两种 SUSE Multi-Linux Manager Proxy 变体都提供了自动化备份迁移流程。该流程会收集所有必要数据并上载至 SUSE Multi-Linux Manager 服务器。对于 SUSE Multi-Linux Manager Retail Branch Server,此工具还会创建并迁移与 Saltboot 相关的实体,请参见 Migrating from SUSE Multi-Linux Manager Retail Branch Server 4.3

启动 SUSE Multi-Linux Manager Proxy 4.3 迁移流程的方式有多种:

  • 调用 API

    Replace $proxyid by a server id of the branch proxy, or multiple server ids separated by a comma.

    mgrctl api login
    mgrctl api post proxy/backupConfiguration '{\"sids\":[$proxyid]}'
  • 调用 Salt

    Replace $proxy in command below by branch proxy minion id or -L proxyminionid1,proxyminionid2,…​ when addressing multiple branch proxies.

    salt $proxy proxy.backup

建议您同时手动备份代理,尤其是当存在自定义修改时。

备份完成后,SUSE Multi-Linux Manager Proxy 仍可照常运行,但请在执行备份后尽快迁移服务器主机,以避免潜在的数据不一致问题。

4. 部署新的 SUSE Multi-Linux Manager Proxy

You can either upgrade the existing host to SUSE Linux Enterprise Server 15 SP7 using AutoYaST, or perform a fresh installation of SL Micro 6.1.

4.1. Upgrade to SUSE Linux Enterprise Server 15 SP7 using AutoYaST

Create and use AutoYAST profiles to migrate or reinstall the proxy host.

4.1.1. 准备基于 SUSE Linux Enterprise Server 15 SP7 的自动安装发行套件

  • 将 SUSE Linux Enterprise Server 15 SP7 安装 ISO 下载或放置到服务器主机中

  • Use mgradm distribution copy $path_to_the_iso to copy installation files to the container

  • 注册自动安装发行套件,请参见 可自动安装的发行套件

4.1.2. 准备自动安装配置文件

有关详细信息,请参见 自动安装配置文件

基于之前创建的发行套件创建自动安装配置文件。可使用以下地址提供的配置文件:https://github.com/SUSE/manager-build-profiles/blob/master/AutoYaST/SUSE-Multi-Linux-Manager/SUSE%20Multi-Linux%20Manager%20Proxy/MLM_Proxy-51-SLES-Install.xml - Once profile is created, switch to Variables tab and fill in required variables:

+

org='组织_id'
distrotree='上一步中的自动安装发行套件标签'
channel_prefix='clm_通道前缀'(如果使用 SCC 通道,则留空)
registration_key='升级后的激活密钥'
  • In tab Autoinstallation File you can see complete rendered profile for additional inspection

4.1.3. 置备代理的自动安装

使用上一步创建的配置文件,在旧 SUSE Multi-Linux Manager Proxy 4.3 上安排自动安装。

  • Use Web UI interface Provisioning tab at the System view of migrating branch server

  • Or use API call system/provisionSystem to schedule the migration. For example execute following snippet from the SUSE Multi-Linux Manager host:

    mgrctl api login
    mgrctl api post system/provisionSystem '{\"sid\":$proxyid,\"profileName\":\"$profileName\"}'

4.2. Reinstall with SL Micro 6.1

SL Micro 6.1 requires a fresh installation on the host.

Perform the backup of the existing 4.3 Proxy before proceeding with the host reinstallation. For more information see 备份现有 SUSE Multi-Linux Manager Proxy 数据.

4.3. 准备 SL Micro 6.1 主机

4.3.1. 下载安装媒体

过程:下载安装媒体
  1. 访问 https://www.suse.com/download/sle-micro/,找到 SL Micro 6.1 的安装媒体,并下载相应媒体文件。

  2. Prepare a DVD or USB flash drive with the downloaded .iso image for installation.

4.3.2. 安装 SL Micro 6.1

有关虚拟机或物理机的准备工作详细信息,请参见 SL Micro 部署指南

过程:安装 SL Micro 6.1
  1. 插入包含 SLE Micro 6.1 安装映像的 DVD 或 USB 闪存盘(USB 磁盘或密钥)。

  2. 引导或重引导您的系统。

  3. Use the arrow keys to select Installation.

  4. 调整键盘和语言。

  5. Click the checkbox to accept the license agreement.

  6. Click Next to continue.

  7. 跳过注册步骤。SL Micro 6.1 权利已包含在 SUSE Multi-Linux Manager 权利中,因此不需要单独的注册代码。

  8. 单击 下一步 继续。

  9. On the NTP Configuration page click Next.

  10. On the Authentication for the System page enter a password for the root user. Click Next.

  11. On the Installation Settings page click Install.

将 SL Micro 6.1 和 SUSE Multi-Linux Manager 5.1 安装为扩展的过程到此完成。

4.3.3. 更新系统

过程:更新系统
  1. root 身份登录。

  2. 运行 transactional-update

    transactional-update
  3. 重引导。

SL Micro 设计为默认自动更新,并会在应用更新后重引导。但是,这种行为对于 SUSE Multi-Linux Manager 环境而言是不利的。为了防止服务器自动更新,SUSE Multi-Linux Manager 会在引导过程中禁用 transactional-update 计时器。

如果您希望保留 SL Micro 的默认行为,请运行以下命令来启用计时器:

systemctl enable --now transactional-update.timer

4.3.4. Register and deploy the proxy

Procedure: Registering and deploying the proxy
  1. Once the host is prepared, register the new SL Micro 6.1 system to the SUSE Multi-Linux Manager Server as a client. It is recommended to use the same minion ID as the original 4.3 Proxy. For more information, see 客户端注册.

  2. On the SUSE Multi-Linux Manager Server, generate the proxy configuration for the new proxy server. For more information, see installation-and-upgrade:container-deployment/mlm/proxy-deployment-mlm.adoc#generate-proxy-config.

  3. Transfer the configuration to the SL Micro 6.1 host and install the proxy:

    mgrpxy install podman config.tar.gz
  4. Start the proxy:

    mgrpxy start
  5. Once the proxy is operational, the SUSE Multi-Linux Manager Server will automatically deploy the backed up configuration during the next Hardware Refresh step.

You need to accept the Salt key manualy to allow autoinstallation to continue.

5. 验证代理功能

After migration is finished and salt is started first time, backed up proxy configuration is automatically deployed during Hardware refresh step.

完成所有初始配置步骤后,验证代理的必要功能

6. TFTP 文件同步

容器化代理不使用 tftpsync 机制传输 tftproot 文件。相反,这些文件会按需自动下载并缓存。

To prevent false positive errors during cobbler sync run, migrated 4.3 proxies need to be removed from tftpsync mechanism.

如果您之前已将 4.3 代理配置为接收 TFTP 文件,则需要选择以下配置选项之一:

要在容器内访问外壳,请在容器主机上运行以下命令:

mgrctl term

In the SUSE Multi-Linux Manager 5.1 server container, run configure-tftpsync.sh with the list of remaining 4.3 proxies as arguments. If no 4.3 proxies remain, run configure-tftpsync.sh with no arguments.

In the SUSE Multi-Linux Manager 5.1 server container, manually remove the relevant proxy from the proxies setting in the /etc/cobbler/settings.yaml file. If there are no 4.3 proxies remaining, then manually remove the proxies list completely.