Legacy Proxy Migration to Container

The containerized proxy now is managed by a set of systemd services. For managing the containerized proxy, use the mgrpxy tool.

This section will help you migrate from the legacy systemd proxy using the mgrpxy tool.

An in-place migration from previous releases of SUSE Multi-Linux Manager to 5.1 will remain unsupported due to the HostOS change from openSUSE Leap to openSUSE Leap Micro.

The traditional contact protocol is no longer supported in SUSE Multi-Linux Manager 5.1 and later. Before migrating from previous SUSE Multi-Linux Manager releases to 5.1, any existing traditional clients including the traditional proxies must be migrated to Salt.

1. Migrate From Legacy to Containerized Proxy With Systemd

1.1. Generate Proxy Configuration

Procedure: Generate the Proxy Configuration
  1. 登录到 SUSE Multi-Linux Manager 服务器 Web UI。

  2. 在左侧导航栏中,选择系统  代理配置

  3. 输入您的代理 FQDN。使用与原始代理主机相同的 FQDN。

  4. 输入您的服务器 FQDN。

  5. Enter the Proxy port number. We recommend using the default port of 8022.

  6. 证书和私用密钥位于服务器容器主机上的 /var/lib/containers/storage/volumes/root/_data/ssl-build/ 中。

    • RHN-ORG-TRUSTED-SSL-CERT

    • RHN-ORG-PRIVATE-SSL-KEY

  7. 使用以下命令将证书和密钥复制到您的计算机:

    scp root@uyuni-server-example.com:/root/ssl-build/RHN-ORG-PRIVATE-SSL-KEY
    scp root@uyuni-server-example.com:/root/ssl-build/RHN-ORG-TRUSTED-SSL-CERT
  8. 选择 选择文件 并在本地计算机上通过浏览找到证书。

  9. 选择 选择文件 并在本地计算机上通过浏览找到私用密钥。

  10. 输入 CA 口令。

  11. 单击 生成

1.2. 将代理配置传输到新主机

Procedure: Transfering the Proxy Configuration
  1. 在服务器中,将生成的包含代理配置的 tar.gz 文件传输到新代理主机:

    scp config.tar.gz <uyuni 代理 FQDN>:/root/
  2. 在执行下一步之前,请先禁用旧版代理:

    spacewalk-proxy stop
  3. 使用以下命令部署新代理:

    systemctl start uyuni-proxy-pod
  4. 使用以下命令启用新代理:

    systemctl enable --now uyuni-proxy-pod
  5. 运行 podman ps 来校验所有容器是否存在并正在运行:

    proxy-salt-broker
    proxy-httpd
    proxy-tftpd
    proxy-squid
    proxy-ssh

2. 将 SUSE Multi-Linux Manager 代理迁移到 SUSE Multi-Linux Manager 5.1 容器化代理

Procedure: Migrate SUSE Multi-Linux Manager Containerized Proxy to SUSE Multi-Linux Manager 5.1 New Containerized Proxy
  1. 引导新计算机,然后开始安装 openSUSE Leap Micro 6.1。

  2. 完成安装。

  3. 更新系统:

    transactional-update --continue
  4. 安装 mgrpxy,并根据需要安装 mgrpxy-bash-completion

    transactional-update pkg install mgrpxy mgrpxy-bash-completion
  5. 重引导。

  6. Copy your tar.gz proxy configuration to the host.

3. Install Packages Using the Web UI

在受控端已引导并已注册到服务器后,还可以通过 Web UI 安装 mgrpxymgrpxy-bash-completion 软件包。

Procedure: Installing Packages Using the Web UI
  1. After installation, ensure that the SLE Micro 6.1 parent channel and Proxy child channels are added and synchronized from the Admin  Setup Wizard → Products page.

  2. In the Web UI, go to Systems  Activation Keys and create an activation key linked for the synchronized SLE Micro 6.1 channel.

  3. 使用系统  引导页面将系统作为受控端进行引导。

  4. 在初始配置新计算机并且其显示在系统列表中后,选择系统并导航到系统细节  安装软件包页面。

  5. 安装软件包 mgrpxymgrpxy-bash-completion

  6. 重引导系统。

4. Generate Proxy Config With spacecmd and Self-Signed Certificate

可以使用 spacecmd 生成代理配置。

Procedure: Generate Proxy Config With spacecmd and Self-Signed Certificate
  1. 通过 SSH 连接到您的容器主机。

  2. 执行以下命令(替换其中的服务器和代理 FQDN):

    mgrctl exec -ti 'spacecmd proxy_container_config_generate_cert -- dev-pxy.example.com dev-srv.example.com 2048 email@example.com -o /tmp/config.tar.gz'
  3. 将生成的配置复制到代理:

    mgrctl cp server:/tmp/config.tar.gz
  4. 使用以下命令部署代理:

    mgrpxy install podman config.tar.gz

5. Generate Proxy Config With spacecmd and Custom Certificate

You can generate Proxy configuration using spacecmd for a custom certificates rather than default self-signed certificates.

2 GB 表示默认的代理 squid 缓存大小。需要根据您的环境调整此大小。

Procedure: Generate Proxy Config With spacecmd and Custom Certificate
  1. 通过 SSH 连接到您的服务器容器主机。

  2. 执行以下命令(替换其中的服务器和代理 FQDN):

    for f in ca.crt proxy.crt proxy.key; do
      mgrctl cp $f server:/tmp/$f
    done
    mgrctl exec -ti 'spacecmd proxy_container_config -- -p 8022 pxy.example.com srv.example.com 2048 email@example.com /tmp/ca.crt /tmp/proxy.crt /tmp/proxy.key -o /tmp/config.tar.gz'
  3. 将生成的配置复制到代理:

    mgrctl cp server:/tmp/config.tar.gz
  4. 使用以下命令部署代理:

    mgrpxy install podman config.tar.gz