如何在CentOS 8上安装oVirt Open Virtualization Manager

如何在CentOS 8上安装oVirt Open Virtualization Manager

oVirt是一个免费的开源分布式虚拟化解决方案,可用于管理整个基础架构。它基于Red Hat Enterprise Virtualization,可让您从基于Web的界面管理虚拟机,计算,存储和网络资源。它使用KVM虚拟机管理程序,并建立在libvirt,Gluster,PatternFly和Ansible等其他社区项目之上。

本教程将向您展示如何在CentOS 8服务器上安装oVirt。

先决条件

  • 运行至少16 GB RAM的CentOS 8服务器。
  • 在服务器上配置了root密码。

入门

在开始之前,您需要在系统上设置FQDN主机名。您可以使用以下命令执行此操作。

hostnamectl set-hostname centos.example.com

接下来,您需要编辑/ etc / hosts文件以将系统IP绑定到主机名。

nano /etc/hosts

添加以下行。

your-server-ip centos.example.com

完成后保存并关闭文件。

安装所需的存储库

接下来,您需要向系统添加oVirt和其他必需的存储库。

首先,使用以下命令安装oVirt存储库:

dnf install https://resources.ovirt.org/pub/yum-repo/ovirt-release44.rpm

安装后,使用以下命令启用Java打包工具,pki-deps和PostgreSQL模块。

dnf module enable javapackages-tools -ydnf module enable pki-deps -ydnf module enable postgresql:12 -y

完成后,您可以继续下一步。

oVirt Engine安装和设置

首先,使用以下命令更新存储库:

dnf update -y

更新存储库后,请使用以下命令安装oVirt Engine。

dnf install ovirt-engine -y

安装完成后,您可以使用以下命令配置oVirt Engine。

engine-setup

设置过程中将询问您一些问题,如下所示。

          --== PRODUCT OPTIONS ==--
         
          Configure Cinderlib integration (Currently in tech preview) (Yes, No) [No]: Yes
          Configure Engine on this host (Yes, No) [Yes]: Yes
         
          Configuring ovirt-provider-ovn also sets the Default cluster.'s default network provider to ovirt-provider-ovn.
          Non-Default clusters may be configured with an OVN after installation.
          Configure ovirt-provider-ovn (Yes, No) [Yes]: Yes
          Configure WebSocket Proxy on this host (Yes, No) [Yes]: Yes
         
          * Please note * : Data Warehouse is required for the engine.
          If you choose to not configure it on this host, you have to configure
          it on a remote host, and then configure the engine on this host so
          that it can access the database of the remote Data Warehouse host.
          Configure Data Warehouse on this host (Yes, No) [Yes]: Yes
          Configure Grafana on this host (Yes, No) [Yes]: Yes
          Configure VM Console Proxy on this host (Yes, No) [Yes]: Yes
         
          --== PACKAGES ==--
         
[ INFO  ] Checking for product updates...
[ INFO  ] No product updates found
         
          --== NETWORK CONFIGURATION ==--
         
          Host fully qualified DNS name of this server [centos.example.com]: Yes
[WARNING] Host name Yes has no domain suffix
[ ERROR ] Host name is not valid: Yes did not resolve into an IP address
          Host fully qualified DNS name of this server [centos.example.com]: 
[WARNING] Failed to resolve centos.example.com using DNS, it can be resolved only locally
         
          Setup can automatically configure the firewall on this system.
          Note: automatic configuration of the firewall may overwrite current settings.
          Do you want Setup to configure the firewall? (Yes, No) [Yes]: Yes
          --== DATABASE CONFIGURATION ==--
         
          Where is the DWH database located? (Local, Remote) [Local]: Local
         
          Setup can configure the local postgresql server automatically for the DWH to run. This may conflict with existing applications.
          Would you like Setup to automatically configure postgresql and create DWH database, or prefer to perform that manually? (Automatic, Manual) [Automatic]: 
          Where is the ovirt cinderlib database located? (Local, Remote) [Local]: 
          Setup can configure the local postgresql server automatically for the CinderLib to run. This may conflict with existing applications.
          Would you like Setup to automatically configure postgresql and create CinderLib database, or prefer to perform that manually? (Automatic, Manual) [Automatic]: 
          Where is the Engine database located? (Local, Remote) [Local]: 
         
          Setup can configure the local postgresql server automatically for the engine to run. This may conflict with existing applications.
          Would you like Setup to automatically configure postgresql and create Engine database, or prefer to perform that manually? (Automatic, Manual) [Automatic]: 
         
          --== OVIRT ENGINE CONFIGURATION ==--
         
          Engine admin password: 

          --== SUMMARY ==--
         
[ INFO  ] Restarting httpd
          Please use the user '[email protected]' and password specified in order to login
          Web access is enabled at:
              http://centos.example.com:80/ovirt-engine
              https://centos.example.com:443/ovirt-engine
          Internal CA 65:FA:CD:BF:DD:2D:F4:99:D6:63:85:80:97:B9:66:B9:C7:29:5A:F3
          SSH fingerprint: SHA256:Y46liXyme5Fz/oJA9QaYY1dhK8BKeJiw1kcSjOYL204
[WARNING] Less than 16384MB of memory is available
          Web access for grafana is enabled at:
              https://centos.example.com/ovirt-engine-grafana/
          Please run the following command on the engine machine centos.example.com, for SSO to work:
          systemctl restart ovirt-engine
         
          --== END OF SUMMARY ==--
         
[ INFO  ] Stage: Clean up
          Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20200830105920-2u1ydn.log
[ INFO  ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20200830110513-setup.conf'
[ INFO  ] Stage: Pre-termination
[ INFO  ] Stage: Termination
[ INFO  ] Execution of setup completed successfully

安装成功后,上面的输出将显示oVirt管理控制台和Grafana仪表板的URL。

配置SELinux和防火墙

在CentOS 8中默认启用SELinux。因此,必须为oVirt配置SELinux。您可以使用以下命令进行设置。

setsebool -P httpd_can_network_connect 1

接下来,您需要为防火墙设置端口80和443。您可以使用以下命令执行此操作。

firewall-cmd --permanent --zone public --add-port 80/tcpfirewall-cmd --permanent --zone public --add-port 443/tcp
firewall-cmd --reload

完成后,您可以继续下一步。

访问oVirt管理控制台

然后打开Web浏览器并输入URL https://centos.example.com/ovirt-engine/sso/login.html。显示oVirt登录页面。

广告

输入admin作为用户名,然后输入在安装过程中设置的密码, 日志 按钮。将显示以下屏幕。

视觉

下一个, 行政 门户网站..下一个屏幕显示oVirt仪表板。

oVirt仪表板

结论

恭喜! oVirt Engine已成功安装在CentOS 8服务器上。现在,您可以从oVirt控制台添加远程虚拟化主机,然后从oVirt仪表板开始创建您的第一个虚拟机。如有任何疑问,请随时与我们联系。

Sidebar