将 SUSE Multi-Linux Manager 代理部署为虚拟机 - VMware

本节提供用于将 SUSE Multi-Linux Manager 5.1 代理部署为映像的虚拟机设置。将使用 VMware 作为此安装的沙箱。

1. 可用映像

The preferred method for deploying SUSE Multi-Linux Manager Proxy is to use one of the following available images. All tools are included in these images simplifying deployment.

SUSE Multi-Linux Manager 5.1 代理的映像可在 SUSE Multi-Linux Manager 5.1 VM 映像中找到。

Table 1. 可用代理映像
体系结构 映像格式

aarch64

qcow2、vmdk

x86_64

qcow2、vmdk、raw、Self Installer

2. 虚拟机设置 - VMware

This section describes VMware configurations, focusing on the creation of an extra virtual disk essential for the SUSE Multi-Linux Manager Proxy storage partition within VMware environments.

This section specifies the minimum requirements. These are suitable for a quick test installation, such as a proxy with one client.

If you want to use a production environment and need background information about disk space, see 硬件要求.

过程:创建 VMware 虚拟机
  1. 下载 SUSE Multi-Linux Manager 代理 .vmdk 文件,然后将该文件副本传输到您的 VMware 存储区。

  2. 使用 VMware Web 界面复制上载的 .vmdk 文件。这会将提供的 .vmdk 文件转换成适合 vSphere 超级管理程序的格式。

  3. 创建一个新的虚拟机,并根据 Guest 操作系统系列 Linux 和 Guest 操作系统版本 SUSE Linux Enterprise 15(64 位)为其命名。

  4. Add an additional Hard Disk 2 of 100 GB (or more).

  5. Configure RAM and number of CPUs with minimum values. *)

  6. 根据需要设置网络适配器。

  7. 启动 VM,然后按照首次引导对话框中的提示操作(键盘布局、许可协议、时区、root 的口令)。

  8. 安装完成后,以 root 身份登录。

  9. 继续阅读下一节。

3. Register SL Micro and SUSE Multi-Linux Manager 5.1 Proxy

Procedure: Registering SL Micro and SUSE Multi-Linux Manager 5.1 Proxy
  1. 引导虚拟机。

  2. root 身份登录。

  3. 在 SCC 中注册 SL Micro。

    transactional-update register -r <注册代码> -e <您的电子邮件地址>
  4. 重引导。

  5. 在 SUSE Customer Center 中注册 SUSE Multi-Linux Manager 5.1 代理。

    transactional-update register -p SUSE-Manager-Proxy/5.1/x86_64 -r <REGCODE>
  6. 重引导。

  7. 更新系统:

    transactional-update
  8. 如果已应用更新,请重引导。

  9. 此步骤是可选的。但是,如果您的基础架构需要自定义的永久性存储,请使用 mgr-storage-proxy 工具。

    • 有关详细信息,请参见 mgr-storage-proxy --help。此工具可以简化容器卷的创建过程。

    • 如下所示使用命令:

      mgr-storage-proxy <存储磁盘设备>

      例如:

      mgr-storage-proxy /dev/nvme1n1

      此命令会将 /var/lib/containers/storage/volumes 中的永久性存储卷移动到指定的存储设备。

      有关详细信息,请参见

4. 为代理创建激活密钥

过程:创建激活密钥
  1. Navigate to Systems  Activation Keys , and click Create key.

  2. 为代理主机创建激活密钥并使用 SLE Micro 6.1 作为父通道。此密钥应包括所有建议的通道以及用作扩展子通道的代理。

  3. 继续将代理主机作为 default 客户端进行引导。

5. 将代理主机作为客户端进行引导

过程:引导代理主机
  1. 选择系统  引导

  2. 填写代理主机的相关字段。

  3. 从下拉列表中选择上一步骤中创建的激活密钥。

  4. 单击 引导

  5. 等待引导过程成功完成。检查 Salt 菜单,确认 Salt 密钥已列出并已接受。

  6. 重引导代理主机。

  7. 系统列表中选择主机,并在所有事件完成后再次触发重引导以完成初始配置。

过程:更新代理主机
  1. 系统列表中选择主机,并应用所有补丁以将其更新。

  2. 重引导代理主机。

6. Generate Proxy Configuration

SUSE Multi-Linux Manager 代理的配置存档由 SUSE Multi-Linux Manager 服务器生成。每个附加代理都需要自身的配置存档。

对于 Podman 部署,在生成此代理配置之前,必须将 SUSE Multi-Linux Manager 代理的容器主机作为客户端注册到 SUSE Multi-Linux Manager 服务器。

如果使用代理 FQDN 生成非注册客户端的代理容器配置(如 Kubernetes 用例中那样),系统列表中将出现一个新的系统项。此新项将显示在之前输入的“代理 FQDN”值下方并属于外部系统类型。

6.1. 使用 Web UI 生成代理配置

Procedure: Generating a Proxy Container Configuration Using Web UI
  1. 在 Web UI 中,导航到系统  代理配置,然后填写所需数据:

  2. 代理 FQDN字段中,键入代理的完全限定域名。

  3. 父 FQDN字段中,键入 SUSE Multi-Linux Manager 服务器或另一个 SUSE Multi-Linux Manager 代理的完全限定域名。

  4. 代理 SSH 端口字段中,键入 SSH 服务在 SUSE Multi-Linux Manager 代理上监听的 SSH 端口。建议保留默认值 8022。

  5. In the Max Squid cache size [MB] field type maximal allowed size for Squid cache. Recommended is to use at most 80% of available storage for the containers.

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

  6. SSH 证书选择列表中,选择应为 SUSE Multi-Linux Manager 代理生成新服务器证书还是使用现有证书。您可以考虑作为 SUSE Multi-Linux Manager 内置(自我签名)证书生成的证书。

    然后根据所做的选择提供用于生成新证书的签名 CA 证书的路径,或者要用作代理证书的现有证书及其密钥的路径。

    服务器生成的 CA 证书存储在 /var/lib/containers/storage/volumes/root/_data/ssl-build 目录中。

    有关现有或自定义证书的详细信息以及企业和中间证书的概念,请参见 导入 SSL 证书

  7. 单击 生成 以在 SUSE Multi-Linux Manager 服务器中注册新代理 FQDN,并生成包含容器主机细节的配置存档 (config.tar.gz)。

  8. 片刻之后,系统会显示文件可供下载。请将此文件保存在本地。

6.2. Generate Proxy Configuration With spacecmd and Self-Signed Certificate

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

过程:使用 spacecmd 和自我签名证书生成代理配置
  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

6.3. Generate Proxy Configuration With spacecmd and Custom Certificate

可以使用 spacecmd 为自定义证书(而不是默认的自我签名证书)生成代理配置。

过程:使用 spacecmd 和自定义证书生成代理配置
  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

7. 传输代理配置

Web UI 将生成配置存档。需要在代理容器主机上提供此存档。

过程:复制代理配置
  1. 从服务器容器将上一步生成的配置存档 (config.tar.gz) 复制到服务器主机(如果还未执行此操作):

    mgrctl cp server:/root/config.tar.gz
  2. 将服务器主机中的文件复制到代理主机(如果还未执行此操作):

    scp config.tar.gz <代理 FQDN>:/root
  3. 在代理主机上使用以下命令安装代理:

    mgrpxy install podman config.tar.gz

8. 启动 SUSE Multi-Linux Manager 5.1 代理

现在可以使用 mgrpxy 命令启动容器:

过程:启动代理并检查状态
  1. 调用以下命令启动代理:

    mgrpxy start
  2. 调用以下命令检查容器状态:

    mgrpxy status

    应该会显示以下五个 SUSE Multi-Linux Manager 代理容器,并且它们应该是 proxy-pod 容器 Pod 的一部分:

    • proxy-salt-broker

    • proxy-httpd

    • proxy-tftpd

    • proxy-squid

    • proxy-ssh

8.1. 为服务使用自定义容器映像

默认情况下,SUSE Multi-Linux Manager 代理套件设置为针对其每个服务使用相同的映像版本和注册表路径。但是,可以使用以 -tag-image 结尾的 install 参数覆盖特定服务的默认值。

例如,可以按如下方式使用此命令:

mgrpxy install podman --httpd-tag 0.1.0 --httpd-image registry.opensuse.org/uyuni/proxy-httpd /path/to/config.tar.gz

该命令会在重启动 httpd 服务之前调整其配置文件。其中 registry.opensuse.org/uyuni/proxy-httpds 是要使用的映像,0.1.0 是版本标记。

要重置为默认值,请再次运行 install 命令但不要指定这些参数:

mgrpxy install podman /path/to/config.tar.gz

此命令首先将所有服务的配置重置为全局默认值,然后重新装载配置。