使用 VMware 虚拟化

您可以在 SUSE Multi-Linux Manager 中设置虚拟主机管理器 (VHM) 来使用 VMware vSphere 虚拟机,包括 ESXi 和 vCenter。

开始前,您需要在 SUSE Multi-Linux Manager 服务器上设置 VHM,然后清点可用的 VM 主机。之后,Taskomatic 便可以开始使用 VM API 收集数据。

1. VHM 设置

虚拟主机管理器 (VHM) 在 SUSE Multi-Linux Manager 服务器上运行。

要运行 VHM,需要打开端口 443 以使您的 SUSE Multi-Linux Manager 服务器可访问 VMware API。

VMware hosts use access roles and permissions to control access to hosts and guests. Ensure that any VMware objects or resources that you want to be inventoried by the VHM have at least read-only permissions. If you want to exclude any objects or resources, mark them with no-access.

当您向 SUSE Multi-Linux Manager 添加新主机时,需考虑是否需要让 SUSE Multi-Linux Manager 清点已指派给用户和对象的角色和权限。

有关用户、角色和权限的详细信息,请参见 VMWare vSphere 文档,网址为:https://techdocs.broadcom.com/us/en/vmware-cis/vsphere.html

过程:创建 VMware VHM
  1. 在 SUSE Multi-Linux Manager Web UI 中,导航到系统  虚拟主机管理器

  2. Click Create and select VMware-based.

  3. In the Add a VMware-based Virtual Host Manager section, use these parameters:

    • In the Label field, type a custom name for your VHM.

    • In the Hostname field, type the fully qualified domain name (FQDN) or host IP address.

    • In the Port field, type the ESXi API port to use (for example, 443).

    • In the Username field, type the username associated with the VM host.

    • In the Password field, type the password associated with the VM host user.

  4. 单击 创建 保存更改并创建 VHM。

  5. On the Virtual Host Managers page select the new VHM.

  6. On the Properties page, click Refresh Data to inventory the new VHM.

要查看已清点的对象和资源,请导航到系统  系统列表  虚拟系统

Connecting to the ESXi server from a browser using HTTPS can sometimes log an invalid certificate error. If this occurs, refreshing the data from the virtual hosts server fails. To correct the problem, extract the certificate from the ESXi server, and copy it to /etc/pki/trust/anchors. Re-trust the certificate by running the update-ca-certificates command on the command line, and restart the spacewalk services.

创建并配置好 VHM 后,Taskomatic 即会自动运行数据收集过程。如果您要手动进行数据收集,请导航到系统  虚拟主机管理器,选择适当的 VHM,然后单击 刷新数据

SUSE Multi-Linux Manager ships with a tool called virtual-host-gatherer that can connect to VHMs using their API, and request information about virtual hosts. virtual-host-gatherer maintains the concept of optional modules, where each module enables a specific VHM. This tool is automatically invoked nightly by Taskomatic. Log files for the virtual-host-gatherer tool are located at /var/log/rhn/gatherer.log.

2. 在 VMware 上对 SSL 错误进行查错

如果您在配置安装的 VMware 时遇到 SSL 错误,需要下载 VMware 提供的 CA 证书文件,并在 SUSE Multi-Linux Manager 上信任该证书。

过程:信任 VMware CA 证书
  1. 从您安装的 VMware 中下载 CA 证书。 您可以通过登录 vCenter Web UI 并单击 下载可信根 CA 证书 来实现此目的。

  2. If the downloaded CA certificates file is in .zip format, extract the archive. The certificate files have a number as an extension. For example, certificate.0.

  3. Copy the certificate files to your SUSE Multi-Linux Manager Server, and save them to the /etc/pki/trust/anchors/ directory.

  4. Change the filename suffix on the copied certificate to either .crt or .pem.

  5. 在 SUSE Multi-Linux Manager 服务器上的命令提示符处更新 CA 证书记录:

    update-ca-certificates