当前位置: 首页 > 工具软件 > oVirt > 使用案例 >

ovirt 安装

谭翔
2023-12-01

第一步,通过oVirt node iso安装host

从本站【安装包下载】页面或其它渠道获取到oVirt4.4版本的node iso,本次部署使用的是ovirt-node-ng-installer-4.4.1-2020080418.el8.iso;

使用node iso通过cd引导准备好的物理机或虚拟机;

安装完成后,重启系统;

使用root登录系统后,在/etc/hosts中添加主机名和IP的映射,如下:

第二步,通过dnf(yum)安装engine

到/etc/yum.repos.d/目录下将除CentOS-Sources.repo、CentOS-Media.repo外的其它所有CentOS开头的源中的enabled值改成1,如下:

将ovirt-4.4.repo、ovirt-4.4-dependencies.repo中的所有的“includepkgs”配置注释掉,如:

将/etc/dnf/plugins/versionlock.conf中的enabled值改成0,如:

好,下面可以通过dnf(yum)安装ovirt-engine了,先安装ovirt的软件源和开启必需的模块,执行以下命令:

# dnf install https://resources.ovirt.org/pub/yum-repo/ovirt-release44.rpm
# dnf module -y enable javapackages-tools
# dnf module -y enable pki-deps
# dnf module -y enable postgresql:12

安装ovirt-engine,执行以下命令:

# dnf -y install ovirt-engine

这个过程时间比较长,有可能失败,因为需要下载包,有的rpm包比较大,容易超时,多试几次。

安装完成后,将语言环境改成英文,执行以下命令:

localectl set-locale LANG=en_US.utf8

将/etc/ovirt-imageio/conf.d/50-vdsm.conf移动到/root/目录下(engine-setup完成后再移回来),执行以下命令:

mv /etc/ovirt-imageio/conf.d/50-vdsm.conf /root/

[root@node100 yum.repos.d]# cd /etc/ovirt-imageio/conf.d/
[root@node100 conf.d]# ls
60-vdsm.conf
[root@node100 conf.d]# mv 60-vdsm.conf /root/

可以执行engine-setup了,除了admin密码需要输入外,其它全部默认值敲回车即可;(admin如果是弱密码的话会让你确认)

[root@oVirt441 conf.d]# engine-setup
 [ INFO ] Stage: Initializing
 [ INFO ] Stage: Environment setup
 Configuration files: /etc/ovirt-engine-setup.conf.d/10-packaging-jboss.conf, /etc/ovirt-engine-setup.conf.d/10-packaging.conf, /etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf
 Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20200917142013-k2hc7m.log
 Version: otopi-1.9.2 (otopi-1.9.2-1.el8)
 [ INFO ] Stage: Environment packages setup
 [ INFO ] Stage: Programs detection
 [ INFO ] Stage: Environment setup (late)
 [ INFO ] Stage: Environment customization--== PRODUCT OPTIONS ==--[ INFO ] ovirt-provider-ovn already installed, skipping.--== PACKAGES ==--[ INFO ] Checking for product updates...
 [ INFO ] No product updates found--== NETWORK CONFIGURATION ==--
[WARNING] Failed to resolve oVirt441.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]:
 [ INFO ] firewalld will be configured as firewall manager.
--== DATABASE CONFIGURATION ==--
The detected DWH database size is 24.85240077972412 MB.
 Setup can backup the existing database. The time and space required for the database backup depend on its size. This process takes time, and in some cases (for instance, when the size is few GBs) may take several hours to complete.
 If you choose to not back up the database, and Setup later fails for some reason, it will not be able to restore the database and all DWH data will be lost.
 Would you like to backup the existing database before upgrading it? (Yes, No) [Yes]:
 Perform full vacuum on the oVirt engine history
 database ovirt_engine_history@localhost?
 This operation may take a while depending on this setup health and the
 configuration of the db vacuum process.
 See https://www.postgresql.org/docs/10/sql-vacuum.html
 (Yes, No) [No]:
--== OVIRT ENGINE CONFIGURATION ==--
Perform full vacuum on the engine database engine@localhost?
 This operation may take a while depending on this setup health and the
 configuration of the db vacuum process.
 See https://www.postgresql.org/docs/10/sql-vacuum.html
 (Yes, No) [No]:
--== STORAGE CONFIGURATION ==--
--== PKI CONFIGURATION ==--
--== APACHE CONFIGURATION ==--
--== SYSTEM CONFIGURATION ==--
--== MISC CONFIGURATION ==--
--== END OF CONFIGURATION ==--
[ INFO ] Stage: Setup validation
 During execution engine service will be stopped (OK, Cancel) [OK]:
 [WARNING] Less than 16384MB of memory is available
 [ INFO ] Cleaning stale zombie tasks and commands
--== CONFIGURATION PREVIEW ==--
Default SAN wipe after delete : False
 Host FQDN : oVirt441.com
 Firewall manager : firewalld
 Update Firewall : True
 Set up Cinderlib integration : False
 Engine database host : localhost
 Engine database port : 5432
 Engine database secured connection : False
 Engine database host name validation : False
 Engine database name : engine
 Engine database user name : engine
 Engine installation : True
 PKI organization : com
 Set up ovirt-provider-ovn : True
 Grafana integration : True
 DWH database host : localhost
 DWH database port : 5432
 DWH database secured connection : False
 DWH database host name validation : False
 DWH database name : ovirt_engine_history
 DWH database user name : ovirt_engine_history
 Grafana database user name : ovirt_engine_history_grafana
 Configure WebSocket Proxy : True
 DWH installation : True
 Backup DWH database : True
 Configure VMConsole Proxy : True
Please confirm installation settings (OK, Cancel) [OK]:
 [ INFO ] Cleaning async tasks and compensations
 [ INFO ] Unlocking existing entities
 [ INFO ] Checking the Engine database consistency
 [ INFO ] Stage: Transaction setup
 [ INFO ] Stopping engine service
 [ INFO ] Stopping ovirt-fence-kdump-listener service
 [ INFO ] Stopping dwh service
 [ INFO ] Stopping vmconsole-proxy service
 [ INFO ] Stopping websocket-proxy service
 [ INFO ] Stopping service: grafana-server
 [ INFO ] Stage: Misc configuration (early)
 [ INFO ] Stage: Package installation
 [ INFO ] Stage: Misc configuration
 [ INFO ] Upgrading CA
 [ INFO ] Updating OVN SSL configuration
 [ INFO ] Backing up database localhost:ovirt_engine_history to '/var/lib/ovirt-engine-dwh/backups/dwh-20200917142052.iw87ld6v.dump'.
 [ INFO ] Creating/refreshing DWH database schema
 [ INFO ] Configuring WebSocket Proxy
 [ INFO ] Backing up database localhost:engine to '/var/lib/ovirt-engine/backups/engine-20200917142107.5q1thu8i.dump'.
 [ INFO ] Creating/refreshing Engine database schema
 [ INFO ] Creating/refreshing Engine 'internal' domain database schema
 Unregistering existing client registration info.
 [ INFO ] Install selinux module /usr/share/ovirt-engine/selinux/ansible-runner-service.cil
 [ INFO ] Generating post install configuration file '/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf'
 [ INFO ] Stage: Transaction commit
 [ INFO ] Stage: Closing up
 [ INFO ] Starting service: grafana-server
 [ INFO ] Starting engine service
 [ INFO ] Starting dwh service
 [ INFO ] Starting Grafana service
 [ INFO ] Restarting ovirt-vmconsole proxy service
--== SUMMARY ==--
[ INFO ] Restarting httpd
 Web access is enabled at:
 http://oVirt441.com:80/ovirt-engine
 https://oVirt441.com:443/ovirt-engine
 Internal CA 3E:E8:AD:97:81:1D:95:87:0B:09:8C:28:BF:1B:5D:3B:B8:3D:47:77
 SSH fingerprint: SHA256:GpLaX5Y1y7EhiY//IJ/86SQpcPGqdYfurWfqsNpJQMA
 [WARNING] Less than 16384MB of memory is available
 Web access for grafana is enabled at:
 https://oVirt441.com/ovirt-engine-grafana/
 Please run the following command on the engine machine oVirt441.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-20200917142013-k2hc7m.log
 [ INFO ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20200917142252-setup.conf'
 [ INFO ] Stage: Pre-termination
 [ INFO ] Stage: Termination
 [ INFO ] Execution of setup completed successfully


本机操作

[root@node100 conf.d]# [root@node100 yum.repos.d]# cd /etc/ovirt-imageio/conf.d/
-bash: [root@node100: command not found
[root@node100 conf.d]# [root@node100 conf.d]# ls
-bash: [root@node100: command not found
[root@node100 conf.d]# 60-vdsm.conf
-bash: 60-vdsm.conf: command not found
[root@node100 conf.d]# [root@node100 conf.d]# mv 60-vdsm.conf /root/
-bash: [root@node100: command not found
[root@node100 conf.d]# engine-setup
[ INFO  ] Stage: Initializing
[ INFO  ] Stage: Environment setup
          Configuration files: /etc/ovirt-engine-setup.conf.d/10-packaging-jboss.conf, /etc/ovirt-engine-setup.conf.d/10-packaging.conf
          Log file: /var/log/ovirt-engine/setup/ovirt-engine-setup-20220508104152-7x4q2j.log
          Version: otopi-1.9.6 (otopi-1.9.6-1.el8)
[ INFO  ] Stage: Environment packages setup
[ INFO  ] Stage: Programs detection
[ INFO  ] Stage: Environment setup (late)
[ INFO  ] Stage: Environment customization

          --== PRODUCT OPTIONS ==--

          Configure Cinderlib integration (Currently in tech preview) (Yes, No) [No]:
          Configure Engine on this host (Yes, No) [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]:
          Configure WebSocket Proxy on this host (Yes, No) [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]:
          Configure VM Console Proxy on this host (Yes, No) [Yes]:
          Configure Grafana on this host (Yes, No) [Yes]:

          --== PACKAGES ==--

[ INFO  ] Checking for product updates...
[ INFO  ] No product updates found

          --== NETWORK CONFIGURATION ==--

          Host fully qualified DNS name of this server [node100.com]:
[WARNING] Failed to resolve node100.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]:
[ INFO  ] firewalld will be configured as firewall manager.

          --== DATABASE CONFIGURATION ==--

          Where is the DWH database located? (Local, Remote) [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 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:
          Confirm engine admin password:
[WARNING] Password is weak: The password is shorter than 8 characters
          Use weak password? (Yes, No) [No]:
          Engine admin password:
          Confirm engine admin password:
[WARNING] Password is weak: The password is shorter than 8 characters
          Use weak password? (Yes, No) [No]: yes
          Application mode (Virt, Gluster, Both) [Both]:
          Use default credentials (admin@internal) for ovirt-provider-ovn (Yes, No) [Yes]:

          --== STORAGE CONFIGURATION ==--

          Default SAN wipe after delete (Yes, No) [No]:

          --== PKI CONFIGURATION ==--

          Organization name for certificate [com]:

          --== APACHE CONFIGURATION ==--

          Setup can configure the default page of the web server to present the application home page. This may conflict with existing applications.
          Do you wish to set the application as the default page of the web server? (Yes, No) [Yes]:

          Setup can configure apache to use SSL using a certificate issued from the internal CA.
          Do you wish Setup to configure that, or prefer to perform that manually? (Automatic, Manual) [Automatic]:

          --== SYSTEM CONFIGURATION ==--


          --== MISC CONFIGURATION ==--

          Please choose Data Warehouse sampling scale:
          (1) Basic
          (2) Full
          (1, 2)[1]:
          Use Engine admin password as initial Grafana admin password (Yes, No) [Yes]:

          --== END OF CONFIGURATION ==--

[ INFO  ] Stage: Setup validation
[WARNING] Less than 16384MB of memory is available

          --== CONFIGURATION PREVIEW ==--

          Application mode                        : both
          Default SAN wipe after delete           : False
          Host FQDN                               : node100.com
          Firewall manager                        : firewalld
          Update Firewall                         : True
          Set up Cinderlib integration            : False
          Configure local Engine database         : True
          Set application as default page         : True
          Configure Apache SSL                    : True
          Engine database host                    : localhost
          Engine database port                    : 5432
          Engine database secured connection      : False
          Engine database host name validation    : False
          Engine database name                    : engine
          Engine database user name               : engine
          Engine installation                     : True
          PKI organization                        : com
          Set up ovirt-provider-ovn               : True
          Grafana integration                     : True
          Grafana database user name              : ovirt_engine_history_grafana
          Configure WebSocket Proxy               : True
          DWH installation                        : True
          DWH database host                       : localhost
          DWH database port                       : 5432
          DWH database secured connection         : False
          DWH database host name validation       : False
          DWH database name                       : ovirt_engine_history
          Configure local DWH database            : True
          Configure VMConsole Proxy               : True

          Please confirm installation settings (OK, Cancel) [OK]:
[ INFO  ] Stage: Transaction setup
[ INFO  ] Stopping engine service
[ INFO  ] Stopping ovirt-fence-kdump-listener service
[ INFO  ] Stopping dwh service
[ INFO  ] Stopping vmconsole-proxy service
[ INFO  ] Stopping websocket-proxy service
[ INFO  ] Stage: Misc configuration (early)
[ INFO  ] Stage: Package installation
[ INFO  ] Stage: Misc configuration
[ INFO  ] Upgrading CA
[ INFO  ] Initializing PostgreSQL
[ INFO  ] Creating PostgreSQL 'engine' database
[ INFO  ] Configuring PostgreSQL
[ INFO  ] Creating PostgreSQL 'ovirt_engine_history' database
[ INFO  ] Configuring PostgreSQL
[ INFO  ] Creating CA: /etc/pki/ovirt-engine/ca.pem
[ INFO  ] Creating CA: /etc/pki/ovirt-engine/qemu-ca.pem
[ INFO  ] Updating OVN SSL configuration
[ INFO  ] Updating OVN timeout configuration
[ INFO  ] Creating/refreshing DWH database schema
[ INFO  ] Setting up ovirt-vmconsole proxy helper PKI artifacts
[ INFO  ] Setting up ovirt-vmconsole SSH PKI artifacts
[ INFO  ] Configuring WebSocket Proxy
[ INFO  ] Creating/refreshing Engine database schema
[ INFO  ] Creating a user for Grafana
[ INFO  ] Creating/refreshing Engine 'internal' domain database schema
[ INFO  ] Creating default mac pool range
[ INFO  ] Adding default OVN provider to database
[ INFO  ] Adding OVN provider secret to database
[ INFO  ] Setting a password for internal user admin
[ INFO  ] Install selinux module /usr/share/ovirt-engine/selinux/ansible-runner-service.cil
[ INFO  ] Generating post install configuration file '/etc/ovirt-engine-setup.conf.d/20-setup-ovirt-post.conf'
[ INFO  ] Stage: Transaction commit
[ INFO  ] Stage: Closing up
[ INFO  ] Starting engine service
[ INFO  ] Starting dwh service
[ INFO  ] Starting Grafana service
[ INFO  ] Restarting ovirt-vmconsole proxy service

          --== SUMMARY ==--

[ INFO  ] Restarting httpd
          Please use the user 'admin@internal' and password specified in order to login
          Web access is enabled at:
              http://node100.com:80/ovirt-engine
              https://node100.com:443/ovirt-engine
          Internal CA 5B:F6:17:09:D6:CF:83:52:4F:CD:65:41:D6:3D:91:76:70:85:77:0E
          SSH fingerprint: SHA256:nec4j5TaoqEG1Azp1+JrM1Ikph7+QYAnacOg9RXB3jo
[WARNING] Less than 16384MB of memory is available
          Web access for grafana is enabled at:
              https://node100.com/ovirt-engine-grafana/
          Please run the following command on the engine machine node100.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-20220508104152-7x4q2j.log
[ INFO  ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20220508104704-setup.conf'
[ INFO  ] Stage: Pre-termination
[ INFO  ] Stage: Termination
[ INFO  ] Execution of setup completed successfully

将50-vdsm.conf移动回原地方,执行以下命令:

mv /root/50-vdsm.conf /etc/ovirt-imageio/conf.d/

engine setup成功后,到本机(将要用来访问engine门户的机器)上,在/etc/hosts里增加oVirt441.com的域名映射,如下:

(windows下的路径为C:\Windows\System32\drivers\etc\hosts,linux下的路径为/etc/hosts)

然后就可以在浏览器中通过域名访问engine了:(此处也可以配置成通过IP访问,具体见https://www.cnovirt.com/archives/715)

[root@node100 conf.d]# cd /etc/ovirt-engine/
[root@node100 ovirt-engine]# ls
aaa                  osinfo.conf.d
ansible              ovirt-engine-dwh
branding             ovirt-fence-kdump-listener.conf.d
cinderlib            ovirt-provider-ovn-conf.example
engine-config        ovirt-vmconsole-proxy-helper.conf.d
engine.conf.d        ovirt-websocket-proxy.conf.d
extensions.d         timezones
firewalld            uninstall.d
logcollector.conf.d  usbfilter.txt
notifier
[root@node100 ovirt-engine]# cd engine
engine-config/ engine.conf.d/
[root@node100 ovirt-engine]# cd engine.conf.d/
[root@node100 engine.conf.d]# vi 99-custom-sso-setup.conf
[root@node100 engine.conf.d]# systemctl restart ovirt-engine
[root@node100 engine.conf.d]#
[root@node100 engine.conf.d]# cat 99-custom-sso-setup.conf
SSO_ALTERNATE_ENGINE_FQDNS="192.168.20.100"

https://ovirt441.com,注意是https。

在engine门户页面,点击“CA证书”下载下来,导入到浏览器中;(如果是在win10下使用chrome浏览器,双击证书文件,点击安装证书,根据向导导入即可,注意证书存储选择“受信任的根证书颁发机构”);

导入证书后,后续再访问engine门户就不会每次都弹出不安全的网站链接的提示了;

 类似资料: