第2章:部署自托管引擎
您可以从命令行或通过Cockpit用户界面部署自托管引擎。默认情况下,oVirt主机上可使用Cockpit,并且可将其安装在Enterprise Linux主机上。两种方法都使用Ansible来自动化大多数过程。
自托管引擎安装使用oVirt Engine设备创建Engine虚拟机。设备是在部署过程中安装的;但是,可以根据需要在开始部署之前将其安装在主机上:
# yum install ovirt-engine-appliance
如果计划将绑定接口用于高可用性或将VLAN用于分隔不同类型的流量(例如,用于存储或管理连接),则应在部署之前对其进行配置。
使用座舱部署自托管引擎
您可以使用简化的向导通过Cockpit部署自托管引擎,以收集环境的详细信息。这是推荐的方法。
默认情况下,在oVirt节点上启用了Cockpit。如果使用的是Enterprise Linux主机,请参阅《安装指南》中的在Enterprise Linux主机上安装Cockpit。
先决条件
- 全新安装的oVirt Node或Enterprise Linux 7,已启用所需的存储库。请参阅《安装指南》中的“安装oVirt节点”或“启用Enterprise Linux主机存储库”。
- 为您的引擎和主机准备的完全限定域名。正向和反向查找记录都必须在DNS中设置。
- oVirt Engine设备的主机上至少5 GB的目录。部署过程将检查/ var / tmp是否有足够的空间来提取设备文件。如果不是,则可以指定其他目录或挂载外部存储。VDSM用户和KVM组必须对该目录具有读取,写入和执行权限。
- 为专用于Engine虚拟机的数据存储域准备的存储。该存储域是在自托管引擎部署期间创建的,并且必须至少为74 GiB。建议使用高度可用的存储空间。有关为部署准备存储的更多信息,请参阅《管理指南》的“存储”一章。
警告: oVirt Project强烈建议您在与自托管引擎存储域相同的数据中心中拥有其他活动数据存储域。
如果将自托管引擎部署在只有一个活动数据存储域的数据中心中,并且该数据存储域已损坏,则将无法添加新的数据存储域或删除损坏的数据存储域。您将不得不重新部署自托管引擎。
重要:如果您使用的是iSCSI存储,请不要对自托管引擎存储域和任何其他存储域使用相同的iSCSI目标。
程序
- 通过https:// HostIPorFQDN:9090登录到Cockpit,然后单击Virtualization → Hosted Engine。
- 单击“ 托管引擎”选项下的“启动” 。
- 输入引擎虚拟机的详细信息:
一世。输入引擎VM FQDN。这是引擎虚拟机的FQDN,而不是基础主机。
ii。输入引擎虚拟机的MAC地址,或接受随机生成的MAC地址。
iii。从网络配置下拉列表中选择DHCP或静态。
如果选择DHCP,则必须为Engine虚拟机保留DHCP预留,以便其主机名解析为从DHCP接收的地址。在“ MAC地址”字段中指定其MAC地址。
如果选择静态,请输入以下详细信息:
- VM IP地址-IP地址必须与主机属于同一子网。例如,如果主机位于10.1.1.0/24中,则Engine虚拟机的IP必须在相同的子网范围内(10.1.1.1-254 / 24)。
- 网关地址
- DNS服务器
iv。从下拉列表中选择网桥接口。
v。输入并确认虚拟机的Root Password。
vi。指定是否允许Root SSH访问。
七。输入虚拟机的虚拟CPU数量。
八。输入内存大小(MiB)。可用内存显示在输入字段旁边。
- (可选)展开“高级”字段:
一世。输入Root SSH公钥以用于对Engine虚拟机的根访问。
ii。选择或清除“ 编辑主机文件”复选框,以指定是否将引擎虚拟机和基本主机的条目添加到虚拟机的/ etc / hosts文件中。您必须确保主机名是可解析的。
iii。更改管理网桥名称,或接受默认名称ovirtmgmt。
iv。输入管理网桥的网关地址。
v。输入要添加到引擎的第一个主机的主机FQDN。这是在其上运行部署的基本主机的FQDN。
- 单击下一步。
- 输入并确认管理员门户密码的admin@internal用户。
- 配置事件通知:
一世。输入SMTP服务器的服务器名称和服务器端口号。
ii。输入发件人电子邮件地址。
iii。输入收件人电子邮件地址。
- 单击下一步。
- 查看引擎及其虚拟机的配置。如果详细信息正确,请单击“ 准备虚拟机”。
- 虚拟机安装完成后,单击“ 下一步”。
- 从下拉列表中选择存储类型,然后输入自承载引擎存储域的详细信息:
- 对于NFS:
一世。在“ 存储连接”字段中输入完整的地址和存储路径。
ii。如果需要,输入任何安装选项。
iii。输入磁盘大小(GiB)。
iv。从下拉列表中选择NFS版本。
v。输入存储域名。
- 对于iSCSI:
一世。输入门户网站IP地址,门户网站端口,门户网站用户名和门户网站密码。
ii。单击“ 检索目标列表”,然后选择一个目标。部署期间只能选择一个iSCSI目标,但是支持多路径连接同一门户网站组的所有门户网站。
注意:要指定多个iSCSI目标,必须在部署自托管引擎之前启用多路径。还有一个Multipath Helper工具,该工具会生成脚本以使用不同的选项安装和配置多路径。
iii。输入磁盘大小(GiB)。
iv。输入发现用户名和发现密码。
- 对于光纤通道:
一世。输入LUN ID。必须配置并连接主机总线适配器,并且LUN不得包含任何现有数据。
ii。输入磁盘大小(GiB)。
- 对于Gluster存储:
一世。在“ 存储连接”字段中输入完整的地址和存储路径。
ii。如果需要,输入任何安装选项。
iii。输入磁盘大小(GiB)。
- 点击下一步。
- 查看存储配置。如果详细信息正确,则单击完成部署。
- 部署完成后,单击“ 关闭”。
一个数据中心,群集,主机,存储域和Engine虚拟机已经在运行。您可以登录到管理门户以添加任何其他资源。
- 在引擎虚拟机上启用所需的存储库。
- (可选)使用ovirt-engine-extension-aaa-ldap-setup交互式安装脚本添加目录服务器,以便可以将其他用户添加到环境中。
自托管引擎的状态显示在Cockpit的“ 虚拟化” →“ 托管引擎”选项卡中。引擎虚拟机,运行它的主机以及自托管引擎存储域在管理门户中标有金牌。
使用命令行部署自承载引擎
您可以从命令行使用部署自托管引擎,hosted-engine --deploy以收集环境的详细信息。
注意:如有必要,您仍然可以通过运行来使用oVirt早期版本中的非Ansible脚本hosted-engine --deploy --noansible。
先决条件
- 全新安装的oVirt Node或Enterprise Linux 7,已启用所需的存储库。请参阅《安装指南》中的“安装oVirt节点”或“启用Enterprise Linux主机存储库”。
- 为您的引擎和主机准备的完全限定域名。正向和反向查找记录都必须在DNS中设置。
- oVirt Engine设备的主机上至少5 GB的目录。部署过程将检查/ var / tmp是否有足够的空间来提取设备文件。如果不是,则可以指定其他目录或挂载外部存储。VDSM用户和KVM组必须对该目录具有读取,写入和执行权限。
- 为专用于Engine虚拟机的数据存储域准备的存储。该存储域是在自托管引擎部署期间创建的,并且必须至少为74 GiB。建议使用高度可用的存储空间。有关为部署准备存储的更多信息,请参阅《管理指南》的“存储”一章。
警告: oVirt Project强烈建议您在与自托管引擎存储域相同的数据中心中拥有其他活动数据存储域。
如果将自托管引擎部署在只有一个活动数据存储域的数据中心中,并且该数据存储域已损坏,则将无法添加新的数据存储域或删除损坏的数据存储域。您将不得不重新部署自托管引擎。
重要:如果您使用的是iSCSI存储,请不要对自托管引擎存储域和任何其他存储域使用相同的iSCSI目标。
程序
- 安装部署工具:
- # yum install ovirt-hosted-engine-setup
- oVirt Project建议使用屏幕窗口管理器来运行脚本,以避免在网络或终端中断的情况下丢失会话。安装并开始屏幕:
- # yum install screen
- # screen
- 启动部署脚本:
- # hosted-engine --deploy
注意:要随时Ctrl+D退出脚本,请使用键盘组合来中止部署。如果会话超时或连接中断,请运行screen -d -r以恢复部署会话。
- 选择是开始部署:
- Continuing will configure this host for serving as hypervisor and create a local VM with a running engine.
- The locally running engine will be used to configure a 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]:
- 配置网络。该脚本检测可能用作环境管理网桥的NIC。
- Please indicate a pingable gateway IP address [X.X.X.X]:
- Please indicate a nic to set ovirtmgmt bridge on: (eth1, eth0) [eth1]:
- 如果要使用自定义设备进行虚拟机安装,请输入OVA存档的路径。否则,请将此字段留空以使用oVirt Engine设备。
- 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 ovirt-engine-appliance rpm installing it if missing):
- 指定引擎虚拟机的FQDN:
- 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: manager.example.com
- Please provide the domain name you would like to use for the engine appliance.
- Engine VM domain: [example.com]
- 输入引擎的根密码:
- Enter root password that will be used for the engine appliance:
- Confirm appliance root password:
- 输入SSH公钥,该公钥将允许您以root用户身份登录到引擎,并指定是否为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]:
- 输入虚拟机的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]:
- 输入Engine虚拟机的MAC地址,或接受随机生成的MAC地址。如果要通过DHCP为Engine虚拟机提供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]:
- 输入虚拟机的网络详细信息:
- How should the engine VM network be configured (DHCP, Static)[DHCP]?
如果指定静态,请输入引擎的IP地址:
重要:静态IP地址必须与主机属于同一子网。例如,如果主机位于10.1.1.0/24中,则Engine虚拟机的IP必须在相同的子网范围内(10.1.1.1-254 / 24)。
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):
- 指定是否将Engine虚拟机和基本主机的条目添加到虚拟机的/ 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]
- 提供SMTP服务器的名称和TCP端口号,用于发送电子邮件通知的电子邮件地址,以及用逗号分隔的电子邮件地址列表,以接收这些通知:
- 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]:
- 输入admin @ internal用户的密码以访问管理门户:
- Enter engine admin password:
- Confirm engine admin password:
该脚本创建虚拟机。如果需要安装oVirt Engine设备,则可能需要一些时间。
- 选择要使用的存储类型:
- 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目标,必须在部署自托管引擎之前启用多路径。还有一个Multipath Helper工具,该工具会生成脚本以使用不同的选项安装和配置多路径。
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存储。确保您具有以下配置:
* In the /etc/glusterfs/glusterd.vol file on all three Gluster servers, set rpc-auth-allow-insecure to on.
option rpc-auth-allow-insecure on
* Configure the volume as follows:
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不得包含任何现有数据。
- 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]:
- 输入引擎磁盘大小:
- Please specify the size of the VM disk in GB: [50]:
部署成功完成后,一个数据中心,群集,主机,存储域和Engine虚拟机已经在运行。您可以登录到管理门户以添加任何其他资源。
- 在引擎虚拟机上启用所需的存储库。请参阅《安装指南》中的启用oVirt Engine存储库。
- (可选)使用ovirt-engine-extension-aaa-ldap-setup交互式设置脚本添加目录服务器,以便可以将其他用户添加到环境中。有关更多信息,请参阅《管理指南》中的“配置外部LDAP提供程序”。
引擎虚拟机,运行它的主机以及自托管引擎存储域在管理门户中标有金牌。