第 5 章 安装 Red Hat Virtualization Manager

RHV-M 设备是在部署过程中安装的;但是,如果需要,您可以在开始安装前在部署主机上安装它:

# yum install rhvm-appliance

不支持手动安装 Manager 虚拟机。

5.1. 使用命令行部署自托管引擎

您可以从命令行部署自托管引擎。安装设置软件包后,您将运行 hosted-engine --deploy 命令,而脚本则收集环境的详细信息,并使用它们来配置主机和管理器。

先决条件

  • FQDN 为您的管理器和主机做好准备。正向和反向查找记录必须在 DNS 中设置。

流程

  1. 安装部署工具:

    # yum install ovirt-hosted-engine-setup
  2. 红帽建议使用 screen 工具程序运行该脚本,以避免在网络或终端中断时丢失会话。安装并启动 screen

    # yum install screen
    # screen
  3. 启动部署脚本:

    # hosted-engine --deploy
    注意

    要随时退出脚本,使用 Ctrl+D组合键中止部署。如果发生会话超时或连接中断,请运行 screen -d -r 来恢复部署会话。

  4. 出现提示时,输入 Yes 以开始部署:

    Continuing will configure this host for serving as hypervisor and will create a local VM with a running engine.
    The locally running engine will be used to configure a new storage domain and create a VM there.
    At the end the disk of the local VM will be moved to the shared storage.
    Are you sure you want to continue? (Yes, No)[Yes]:
  5. 配置网络。检查显示的网关是否正确并按 Enter。在同一个子网中输入可 ping 地址,以便脚本可以检查主机的连通性。

    Please indicate a pingable gateway IP address [X.X.X.X]:
  6. 脚本会检测可能的 NIC,以用作环境的管理网桥。输入其中之一或按 Enter 以接受默认值。

    Please indicate a nic to set ovirtmgmt bridge on: (eth1, eth0) [eth1]:
  7. 如果要使用自定义设备进行虚拟机安装,请输入 OVA 存档的路径。否则,将此字段留空,以使用 RHV-M Appliance。

    If you want to deploy with a custom engine appliance image,
    please specify the path to the OVA archive you would like to use
    (leave it empty to skip, the setup will use rhvm-appliance rpm installing it if missing):
  8. 输入虚拟机的 CPU 和内存配置:

    Please specify the number of virtual CPUs for the VM (Defaults to appliance OVF value): [4]:
    Please specify the memory size of the VM in MB (Defaults to maximum available): [7267]:
  9. 为 Manager 虚拟机指定 FQDN,如 manager.example.com

    Please provide the FQDN you would like to use for the engine appliance.
    Note: This will be the FQDN of the engine VM you are now going to launch,
    it should not point to the base host or to any other existing machine.
    Engine VM FQDN:
  10. 指定 Manager 虚拟机的域。例如,如果 FQDN 是 manager.example.com,则输入 example.com

    Please provide the domain name you would like to use for the engine appliance.
    Engine VM domain: [example.com]
  11. 为 Manager 创建 root 密码,并重新输入它以确认:

    Enter root password that will be used for the engine appliance:
    Confirm appliance root password:
  12. (可选)输入 SSH 公钥可让您以 root 用户身份登录 Manager,而无需输入密码,并指定是否为 root 用户启用 SSH 访问:

    Enter ssh public key for the root user that will be used for the engine appliance (leave it empty to skip):
    Do you want to enable ssh access for the root user (yes, no, without-password) [yes]:
  13. 输入 Manager 虚拟机的 MAC 地址,或接受随机生成的地址。如果要通过 DHCP 为 Manager 虚拟机提供 IP 地址,请确保此 MAC 地址具有有效的 DHCP 保留。部署脚本将不会为您配置 DHCP 服务器。

    You may specify a unicast MAC address for the VM or accept a randomly generated default [00:16:3e:3d:34:47]:
  14. 输入虚拟机的网络详情:

    How should the engine VM network be configured (DHCP, Static)[DHCP]?

    如果指定了 Static,请输入 Manager 的 IP 地址:

    重要
    • 静态 IP 地址必须属于与主机相同的子网。例如,如果主机在 10.1.1.0/24 中,则管理器虚拟机的 IP 必须位于同一子网范围 (10.1.1.1-254/24) 中。
    • 对于 IPv6,Red Hat Virtualization 仅支持静态寻址。
    Please enter the IP address to be used for the engine VM [x.x.x.x]:
    Please provide a comma-separated list (max 3) of IP addresses of domain name servers for the engine VM
    Engine VM DNS (leave it empty to skip):
  15. 指定是否将 Manager 虚拟机和基础主机的条目添加到虚拟机的 /etc/hosts 文件中。您必须确保主机名可以被解析。

    Add lines for the appliance itself and for this host to /etc/hosts on the engine VM?
    Note: ensuring that this host could resolve the engine VM hostname is still up to you (Yes, No)[No]
  16. 提供 SMTP 服务器的名称和 TCP 端口号、用于发送电子邮件通知的电子邮件地址,以及用于接收这些通知的电子邮件地址列表。或者,按 Enter 接受默认值:

    Please provide the name of the SMTP server through which we will send notifications [localhost]:
    Please provide the TCP port number of the SMTP server [25]:
    Please provide the email address from which notifications will be sent [root@localhost]:
    Please provide a comma-separated list of email addresses which will get notifications [root@localhost]:
  17. admin@internal 用户创建一个密码,以访问管理门户并重新输入它以确认:

    Enter engine admin password:
    Confirm engine admin password:

    该脚本将创建虚拟机。如果需要安装 RHV-M 设备,这可能需要一些时间。创建虚拟机后,脚本将继续收集信息。

  18. 选择要使用的存储类型:

    Please specify the storage you would like to use (glusterfs, iscsi, fc, nfs)[nfs]:
    • 对于 NFS,输入版本、存储的完整地址和路径,以及任何挂载选项:

      Please specify the nfs version you would like to use (auto, v3, v4, v4_1)[auto]:
      Please specify the full shared storage connection path to use (example: host:/path): storage.example.com:/hosted_engine/nfs
      If needed, specify additional mount options for the connection to the hosted-engine storage domain []:
    • 对于 iSCSI,请输入门户详情并从自动检测的列表中选择目标和 LUN。您只能在部署期间选择一个 iSCSI 目标,但支持多路径连接同一门户组的所有门户。

      注意

      要指定多个 iSCSI 目标,您必须先启用多路径,然后才能部署自托管引擎。详情请查看 Red Hat Enterprise Linux DM 多路径。另外,还有一个多路径帮助程序工具,它生成脚本来安装和配置使用不同选项的多路径。

      Please specify the iSCSI portal IP address:
      Please specify the iSCSI portal port [3260]:
      Please specify the iSCSI discover user:
      Please specify the iSCSI discover password:
      Please specify the iSCSI portal login user:
      Please specify the iSCSI portal login password:
      
      The following targets have been found:
      	[1]	iqn.2017-10.com.redhat.example:he
      		TPGT: 1, portals:
      			192.168.1.xxx:3260
      			192.168.2.xxx:3260
      			192.168.3.xxx:3260
      
      Please select a target (1) [1]: 1
      
      The following luns have been found on the requested target:
        [1] 360003ff44dc75adcb5046390a16b4beb   199GiB  MSFT   Virtual HD
            status: free, paths: 1 active
      
      Please select the destination LUN (1) [1]:
    • 对于 Gluster 存储,输入存储的完整地址和路径,以及任何挂载选项:

      重要

      仅支持副本 3 Gluster 存储。确定您有以下配置:

      • 在所有三个 Gluster 服务器上的 /etc/glusterfs/glusterd.vol 文件中,将 rpc-auth-allow-insecure 设置为 on

        option rpc-auth-allow-insecure on
      • 配置卷,如下所示:

        gluster volume set _volume_ cluster.quorum-type auto
        gluster volume set _volume_ network.ping-timeout 10
        gluster volume set _volume_ auth.allow \*
        gluster volume set _volume_ group virt
        gluster volume set _volume_ storage.owner-uid 36
        gluster volume set _volume_ storage.owner-gid 36
        gluster volume set _volume_ server.allow-insecure on
      Please specify the full shared storage connection path to use (example: host:/path): storage.example.com:/hosted_engine/gluster_volume
      If needed, specify additional mount options for the connection to the hosted-engine storage domain []:
    • 对于光纤通道,从自动检测的列表中选择 LUN。必须配置并连接主机总线适配器,而且 LUN 不得包含任何现有数据。要重复使用现有的 LUN,请参阅 管理指南中的重新使用 LUN

      The following luns have been found on the requested target:
      [1] 3514f0c5447600351   30GiB   XtremIO XtremApp
      		status: used, paths: 2 active
      
      [2] 3514f0c5447600352   30GiB   XtremIO XtremApp
      		status: used, paths: 2 active
      
      Please select the destination LUN (1, 2) [1]:
  19. 输入 Manager 磁盘大小:

    Please specify the size of the VM disk in GB: [50]:

    当部署成功完成时,一个数据中心、集群、主机、存储域和管理器虚拟机已在运行。您可以登录到管理门户来添加任何其他资源。

  20. (可选)使用 ovirt-engine-extension-aaa-ldap-setup 交互式设置脚本添加目录服务器,以便您可以将其他用户添加到环境中。如需更多信息,请参阅管理指南 中的配置外部 LDAP 提供程序

Manager 虚拟机、运行它的主机以及自托管引擎存储域在管理门户中标有金色标牌。

启用 Red Hat Virtualization Manager 软件仓库不是自动安装的一部分。登录到 Manager 虚拟机,将其注册到 Content Delivery Network 中: