Red Hat Training

A Red Hat training course is available for Red Hat Virtualization

2.2. 在 Red Hat Virtualization 主机上部署自托管引擎

在 Red Hat Virtualization Host (RHVH)上,自托管引擎部署通过 Cockpit 用户界面执行。hosted-engine 脚本的 UI 版本有助于配置主机和管理器虚拟机。该脚本要求您包含一系列问题,并根据您的答案配置您的环境。

前提条件

  • 您必须已安装 Red Hat Virtualization Host 系统。Cockpit 用户界面 的系统 子选项卡中的性能配置集必须设置为 virtual-host
  • 您必须已为自托管引擎环境准备存储。至少需要两个存储域:
    • 专用于 Manager 虚拟机的共享存储域。此域是在自托管引擎部署期间创建的,且必须至少 60 GB。
    • 常规虚拟机数据的数据存储域。此域必须在完成部署后添加到自托管引擎环境中。
      警告
      红帽强烈建议您在与自托管引擎环境相同的数据中心中提供额外的活跃数据存储域。
      如果您在只有一个活动数据存储域的数据中心部署自托管引擎,如果数据存储域损坏,您将无法添加新的数据存储域或删除损坏的数据存储域。您必须重新部署自托管引擎。
      如果您使用 ISO 存储域,红帽建议 ISO 域不在托管引擎虚拟机中。
    有关为您的部署准备存储的更多信息,请参阅管理指南中的存储章节https://access.redhat.com/documentation/en/red-hat-virtualization/4.0/single/administration-guide/#chap-Storage
    重要
    如果您使用的是 iSCSI 存储,请不要将同样的 iSCSI 目标用于共享存储域和数据存储域。
  • 您必须有针对 Manager 和主机的完全限定域名。正向和反向查找记录必须在 DNS 中设置。
  • 要将 RHV-M 虚拟设备用于管理器安装,一个目录必须至少 5 GB。hosted-engine 脚本首先检查 /var/tmp 是否有足够空间来提取设备文件。如果没有,您可以指定不同的目录或挂载外部存储。VDSM 用户和组必须具有目录的读取、写入和执行权限。

过程 2.3. 配置基于 RHVH 的自托管引擎

  1. 获取 RHV-M 虚拟设备

    从客户门户网站下载 RHV-M 虚拟设备:
    1. 登录位于 的客户门户网站 https://access.redhat.com
    2. 点菜单栏中的 Downloads
    3. Red Hat Virtualization > Download Latest 访问产品下载页面。
    4. 为正确的 Red Hat Virtualization 版本选择设备,然后单击 Download Now
    保护将 OVA 文件复制到 Red Hat Virtualization 主机:
    scp rhvm-appliance.ova root@host.example.com:/usr/share
  2. 启动自托管引擎部署

    登录到位于 https://HostIPorFQDN:9090 的 Cockpit 用户界面,并导航到 Virtualization > Hosted Engine。单击 Start
    部署脚本中的文本字段会在有可用的情况下预先填充默认答案;根据需要更改或输入您的答案。
    注意
    在此过程中,部署问题以文本形式显示。在 UI 中,在提示时点 Next
    During customization use CTRL-D to abort.
    Continuing will configure this host for serving as hypervisor and create a VM where you have to install the engine afterwards.
    Are you sure you want to continue? (Yes, No)[Yes]:
  3. 配置存储

    选择要使用的存储类型。
    Please specify the storage you would like to use (glusterfs, iscsi, fc, nfs3, nfs4)[nfs3]:
    • 对于 NFS 存储类型,请使用 FQDN 或 IP 地址以及共享存储域的路径名称指定完整地址。
      Please specify the full shared storage connection path to use (example: host:/path): storage.example.com:/hosted_engine/nfs
    • 对于 iSCSI,指定 iSCSI 门户 IP 地址、端口、用户名和密码,然后从自动检测的列表中选择目标名称。在部署过程中只能选择一个 iSCSI 目标。
      Please specify the iSCSI portal IP address:
      Please specify the iSCSI portal port [3260]:
      Please specify the iSCSI portal user:
      Please specify the iSCSI portal password:
      Please specify the target name (auto-detected values) [default]:
    • 对于 Gluster 存储,使用 FQDN 或 IP 地址以及共享存储域的路径名称指定完整地址。
      重要
      仅支持副本 3 Gluster 存储。确保已进行以下配置:
      • 在所有三个 Gluster 服务器上的 /etc/glusterfs/glusterd.vol 文件中,将 rpc-auth-allow-insecure 设置为 上的
        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
    • 对于光纤通道,必须配置并连接主机总线适配器,hosted-engine 脚本将自动探测可用的 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]:
  4. 配置网络

    该脚本检查您的防火墙配置,并提供修改控制台(SPICE 或 VNC)访问。然后,它会检测可能的网络接口控制器(NIC),以用作环境的管理网桥。
    iptables was detected on your computer, do you wish setup to configure it? (Yes, No)[Yes]: Yes
    Please indicate a pingable gateway IP address [X.X.X.X]:
    Please indicate a nic to set ovirtmgmt bridge on: (eth1, eth0) [eth1]:
  5. 配置虚拟机

    为引导设备类型选择 磁盘,然后指定到 RHV-M 虚拟设备的路径。如果 /var/tmp 目录没有足够的空间,请指定不同的目录。VDSM 用户和组必须具有目录的读取、写入和执行权限。
    Please specify the device to boot the VM from (choose disk for the oVirt engine appliance) (cdrom, disk, pxe) [disk]: disk
    Please specify the console type you would like to use to connect to the VM (vnc, spice) [vnc]: vnc
    Using an oVirt engine appliance could greatly speed-up ovirt hosted-engine deploy.
    You could get oVirt engine appliance installing ovirt-engine-appliance rpm.
    Please specify path to OVF archive you would like to use [None]: /path/to/rhvm-appliance.ova
    如果您希望 cloud-init 处理 Manager 虚拟机的初始配置,请指定 Yes。指定 Generate for cloud-init 以处理诸如设置 root 密码、配置网络、配置主机名、注入 engine-setup 要使用的回答文件,以及在引导时运行 engine-setup 等任务。(可选)如果您有一个现有的 cloud-init 脚本可以处理 cloud-init 的更复杂的功能,请选择 Existing
    注意
    有关 cloud-init 的更多信息,请参阅 https://cloudinit.readthedocs.org/en/latest/
    Would you like to use cloud-init to customize the appliance on the first boot (Yes, No)[Yes]? Yes
    Would you like to generate on-fly a cloud-init ISO image (of no-cloud type) or do you have an existing one (Generate, Existing)[Generate]? Generate
    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: (leave it empty to skip): manager.example.com
    Automatically execute engine-setup on the engine appliance on first boot (Yes, No)[Yes]? Yes
    Automatically restart the engine VM as a monitored service after engine-setup (Yes, No)[Yes]? Yes
    Please provide the domain name you would like to use for the engine appliance.
    Engine VM domain: [localdomain] example.com
    Enter root password that will be used for the engine appliance (leave it empty to skip): p@ssw0rd
    Confirm appliance root password: p@ssw0rd
    The following CPU types are supported by this host:
        - model_SandyBridge: Intel SandyBridge Family
        - model_Westmere: Intel Westmere Family
        - model_Nehalem: Intel Nehalem Family
        - model_Penryn: Intel Penryn Family
        - model_Conroe: Intel Conroe Family
    Please specify the CPU type to be used by the VM [model_SandyBridge]:
    Please specify the number of virtual CPUs for the VM [Defaults to appliance OVF value: [2]:
    You may specify a unicast MAC address for the VM or accept a randomly generated default [00:16:3e:77:b2:a4]:
    Please specify the memory size of the VM in MB (Defaults to maximum available): [12722]:
    How should the engine VM network be configured (DHCP, Static)[DHCP]? Static
    Please enter the IP address to be used for the engine VM: 192.168.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):
    指定 Yes/etc/hosts 文件从主机复制到 Manager 虚拟机,以进行主机名解析。
    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] Yes
  6. 配置自托管引擎

    在管理门户中指定要标识的主机的名称,以及 admin@internal 用户的密码来访问管理门户。提供 SMTP 服务器的名称和 TCP 端口号、用于发送电子邮件通知的电子邮件地址,以及用于接收这些通知的电子邮件地址列表。
    Enter engine admin password: p@ssw0rd
    Confirm engine admin password: p@ssw0rd
    Enter the name which will be used to identify this host inside the Administrator Portal [hosted_engine_1]:
    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]:
  7. 配置预览

    在继续之前,hosted-engine 脚本会显示您输入的配置值,并提示您确认以继续使用这些值。
    Please confirm installation settings (Yes, No)[Yes]: Yes
    该脚本将创建 Manager 虚拟机,启动 ovirt-engine 和高可用性服务,并将主机和共享存储域连接到 Manager 虚拟机。
    hosted-engine 部署脚本成功完成时,Red Hat Virtualization Manager 已配置并在您的主机上运行。Manager 已配置了数据中心、集群、主机、管理器虚拟机和专用于 Manager 虚拟机的共享存储域。
    重要
    admin@internal 用户身份登录管理门户,以继续配置管理器并添加其他资源。您必须为数据中心创建另一个数据域,以托管常规虚拟机数据,以及管理器虚拟机可见。如需了解不同存储选项以及如何添加数据存储域,请参阅管理指南中的 存储。https://access.redhat.com/documentation/en/red-hat-virtualization/4.0/single/administration-guide/#chap-Storage
    将 Red Hat Virtualization Manager 链接到目录服务器,以便您可以向环境中添加额外的用户。Red Hat Virtualization 支持许多目录服务器类型;例如,红帽目录服务器(RHDS)、红帽身份管理(IdM)、Active Directory 和许多其他类型。使用 ovirt-engine-extension-aaa-ldap-setup 交互式设置脚本,在您的环境中添加目录服务器。如需更多信息,请参阅管理指南中的配置外部 LDAP 提供程序
    该脚本还会将您在配置期间提供的答案保存到文件,以帮助进行灾难恢复。如果没有使用 --generate-answer=<file> 参数指定 目的地,则会在 /etc/ovirt-hosted-engine/answers.conf 中生成回答文件。
    注意
    RHV-M 虚拟设备上不默认启用 SSH 密码身份验证。您可以通过 SPICE 或 VNC 控制台访问 Red Hat Virtualization Manager 虚拟机来启用 SSH 密码身份验证。验证 sshd 服务是否正在运行。编辑 /etc/ssh/sshd_config,并将以下两个选项改为 yes
    • PasswordAuthentication
    • PermitRootLogin
    重启 sshd 服务以使更改生效。
  8. 订阅所需权利

    为 Manager 虚拟机订阅所需的权利。 如需更多信息,请参阅安装指南中的订阅所需权利