oVirt 4.3.10 Install & Configuration(HostedEngine方式)

1 Prepare

2 部署oVirt-engine管理机

  • 配置本地host,(后面含有IP访问方式的配置)

    因为ovirt4.x版本后默认通过域名访问了,所以要修改访问系统的**hosts**文件,将ovirt1.com域名映射写入

    vim /etc/hosts
    

    添加本地域名配置

    #oVirt-engine
    10.10.10.39 mam.ovirt.xxxxxx.com
    #oVirt-node
    192.168.56.254 node.ovirt.xxxxxx.com
    
  • 暂时关闭防火墙

    systemctl stop firewalld
    
  • 创建安装包存放目录

    mkdir -pv /home/oVirt
    
  • 安装oVirt-engine RPM包

    在线安装

    yum -y install http://resources.ovirt.org/pub/yum-repo/ovirt-release42.rpm
    

    离线安装

    rpm -ivh ovirt-release42.rpm
    
  • 安装引擎

    yum install ovirt-engine
    
  • 运行engine-setup初始化向导,配置ovirt-engine(使用默认参数),中间需要配置管理台admin账号的登录密码,有复杂度要求

    engine-setup
    

    或者使用默认参数

    engine-setup --accept-defaults
    

    设置步骤

    [ 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-20221116175850-idkgpo.log
              Version: otopi-1.8.4 (otopi-1.8.4-1.el7)
    [ INFO  ] Stage: Environment packages setup
    [ INFO  ] Stage: Programs detection
    [ INFO  ] Stage: Environment setup (late)
    [ INFO  ] Stage: Environment customization
    
              --== PRODUCT OPTIONS ==--
    
              Set up Cinderlib integration
              (Currently in tech preview)
              (Yes, No) [No]:
              Configure Engine on this host (Yes, No) [Yes]:
              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 Image I/O Proxy on this host (Yes, No) [Yes]:
              Configure VM Console Proxy 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 [oVirt_Engine_I1.xxxxxx]: mam.ovirt.xxxxxx.com
    [WARNING] Failed to resolve mam.ovirt.xxxxxx.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.
              NOTICE: iptables is deprecated and will be removed in future releases
              Do you want Setup to configure the firewall? (Yes, No) [Yes]: no
    
              --== 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:
              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 [ovirt.xxxxxx.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]:
    
              --== 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
              Update Firewall                         : False
              Host FQDN                               : mam.ovirt.xxxxxx.com
              Set up Cinderlib integration            : False
              Configure local Engine database         : True
              Set application as default page         : True
              Configure Apache SSL                    : True
              Engine database secured connection      : False
              Engine database user name               : engine
              Engine database name                    : engine
              Engine database host                    : localhost
              Engine database port                    : 5432
              Engine database host name validation    : False
              Engine installation                     : True
              PKI organization                        : ovirt.xxxxxx.com
              Set up ovirt-provider-ovn               : True
              Configure WebSocket Proxy               : True
              DWH installation                        : True
              DWH database host                       : localhost
              DWH database port                       : 5432
              Configure local DWH database            : True
              Configure Image I/O Proxy               : 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 Image I/O Proxy 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
    [ INFO  ] Creating/refreshing DWH database schema
    [ INFO  ] Configuring Image I/O Proxy
    [ 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/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  ] 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  ] Restarting ovirt-vmconsole proxy service
    
              --== SUMMARY ==--
    
    [ INFO  ] Restarting httpd
              In order to configure firewalld, copy the files from
                  /etc/ovirt-engine/firewalld to /etc/firewalld/services
                  and execute the following commands:
                  firewall-cmd --permanent --add-service ovirt-postgres
                  firewall-cmd --permanent --add-service ovirt-https
                  firewall-cmd --permanent --add-service ovn-central-firewall-service
                  firewall-cmd --permanent --add-service ovirt-fence-kdump-listener
                  firewall-cmd --permanent --add-service ovirt-imageio-proxy
                  firewall-cmd --permanent --add-service ovirt-websocket-proxy
                  firewall-cmd --permanent --add-service ovirt-http
                  firewall-cmd --permanent --add-service ovirt-vmconsole-proxy
                  firewall-cmd --permanent --add-service ovirt-provider-ovn
                  firewall-cmd --reload
              The following network ports should be opened:
                  tcp:2222
                  tcp:35357
                  tcp:443
                  tcp:5432
                  tcp:54323
                  tcp:6100
                  tcp:6641
                  tcp:6642
                  tcp:80
                  tcp:9696
                  udp:7410
              An example of the required configuration for iptables can be found at:
                  /etc/ovirt-engine/iptables.example
              Please use the user 'admin@internal' and password specified in order to login
              Web access is enabled at:
                  http://mam.ovirt.xxxxxx.com:80/ovirt-engine
                  https://mam.ovirt.xxxxxx.com:443/ovirt-engine
              Internal CA 92:7C:02:B7:16:1C:5E:50:AE:EA:C8:04:C4:4C:58:54:1C:78:52:25
              SSH fingerprint: SHA256:nTR36hv9q6IIRQwqyxec0XQOgMbmC+vmx2eUVaBanmg
    [WARNING] Less than 16384MB of memory is available
    
              --== END OF SUMMARY ==--
    
    [ INFO  ] Stage: Clean up
              Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20221116175850-idkgpo.log
    [ INFO  ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20221116180500-setup.conf'
    [ INFO  ] Stage: Pre-termination
    [ INFO  ] Stage: Termination
    [ INFO  ] Execution of setup completed successfully
    
  • 启动防火墙

    systemctl start firewalld
    
  • 开放端口

    cp /etc/ovirt-engine/firewalld/* /etc/firewalld/services
    

    执行开放端口命令,并重载防火墙配置

    firewall-cmd --permanent --add-service ovirt-postgres
    firewall-cmd --permanent --add-service ovirt-https
    firewall-cmd --permanent --add-service ovn-central-firewall-service
    firewall-cmd --permanent --add-service ovirt-fence-kdump-listener
    firewall-cmd --permanent --add-service ovirt-imageio-proxy
    firewall-cmd --permanent --add-service ovirt-websocket-proxy
    firewall-cmd --permanent --add-service ovirt-http
    firewall-cmd --permanent --add-service ovirt-vmconsole-proxy
    firewall-cmd --permanent --add-service ovirt-provider-ovn
    firewall-cmd --reload
    
  • 成功后就可以通过域名方式访问engine的WEB管理台门户了,

    http:

    http://mam.ovirt.xxxxxx.com/ovirt-engine

    Https:

    https://mam.ovirt.xxxxxx.com/ovirt-engine

  • 将FQDN登录方式改为IP地址登录方式

    默认是采用FQDN的域名方式登录,为了方便起见

    采用IP地址登录,需要修改配置文件

    vim /etc/ovirt-engine/engine.conf.d/11-setup-sso.conf
    

    SSO_ALTERNATE_ENGINE_FQDNS=""中填入oVirt-engine管理机的IP地址10.10.10.39

    ENGINE_SSO_CLIENT_ID="ovirt-engine-core"
    ENGINE_SSO_CLIENT_SECRET="GrpxW3T29laoE3l98dwH8jlEJZLugQWN"
    ENGINE_SSO_AUTH_URL="https://${ENGINE_FQDN}:443/ovirt-engine/sso"
    ENGINE_SSO_SERVICE_URL="https://${ENGINE_FQDN}:443/ovirt-engine/sso"
    ENGINE_SSO_SERVICE_SSL_VERIFY_HOST=false
    ENGINE_SSO_SERVICE_SSL_VERIFY_CHAIN=true
    SSO_ALTERNATE_ENGINE_FQDNS=""
    SSO_ENGINE_URL="https://${ENGINE_FQDN}:443/ovirt-engine/"
    

    修改为

    ENGINE_SSO_CLIENT_ID="ovirt-engine-core"
    ENGINE_SSO_CLIENT_SECRET="GrpxW3T29laoE3l98dwH8jlEJZLugQWN"
    ENGINE_SSO_AUTH_URL="https://${ENGINE_FQDN}:443/ovirt-engine/sso"
    ENGINE_SSO_SERVICE_URL="https://${ENGINE_FQDN}:443/ovirt-engine/sso"
    ENGINE_SSO_SERVICE_SSL_VERIFY_HOST=false
    ENGINE_SSO_SERVICE_SSL_VERIFY_CHAIN=true
    SSO_ALTERNATE_ENGINE_FQDNS="10.10.10.39"
    SSO_ENGINE_URL="https://${ENGINE_FQDN}:443/ovirt-engine/"
    
  • 重新启动服务,使IP地址登录生效

    systemctl restart ovirt-engine
    
  • 查看服务运行状态

    systemctl status ovirt-engine
    

    显示Active: active (running)即为正常运行

    ● ovirt-engine.service - oVirt Engine
       Loaded: loaded (/usr/lib/systemd/system/ovirt-engine.service; enabled; vendor preset: disabled)
       Active: active (running) since 三 2022-11-16 19:09:43 CST; 3min 30s ago
     Main PID: 15373 (ovirt-engine.py)
       CGroup: /system.slice/ovirt-engine.service
               ├─15373 /usr/bin/python /usr/share/ovirt-engine/services/ovirt-engine/ovirt-engine.py --redirect-output --systemd=notify start
               └─15425 ovirt-engine -server -XX:+TieredCompilation -Xms1024M -Xmx1024M -Xss1M -Djava.awt.headless=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterva...
    
    11月 16 19:09:41 oVirt_Engine_I1.xxxxxx systemd[1]: Starting oVirt Engine...
    11月 16 19:09:42 oVirt_Engine_I1.xxxxxx ovirt-engine.py[15373]: 2022-11-16 19:09:42,338+0800 ovirt-engine: INFO _detectJBossVersion:195 Detecting JBoss version. Running: /usr/...nterval=36
    11月 16 19:09:43 oVirt_Engine_I1.xxxxxx ovirt-engine.py[15373]: 2022-11-16 19:09:43,220+0800 ovirt-engine: INFO _detectJBossVersion:215 Return code: 0,  | stdout: '[u'WildFly ...derr: '[]'
    11月 16 19:09:43 oVirt_Engine_I1.xxxxxx systemd[1]: Started oVirt Engine.
    Hint: Some lines were ellipsized, use -l to show in full.
    
  • 成功后就可以通过IP方式访问engine的WEB管理台门户了

    http:

    http://10.10.10.39/ovirt-engine

    Https:

    https://10.10.10.39/ovirt-engine

3 部署oVirt-node计算节点

  • 使用ventoy将U盘制作为系统启动盘

    https://www.ventoy.net/cn/

  • 安装ovirt-node-ng-installer-4.3.10-2020060117.el7.iso作为U盘系统盘

  • 系统安装完成后,配置IP地址

    vi /etc/sysconfig/network-scripts/ifcfg-eth0
    

    修改为

    TYPE=Ethernet
    PROXY_METHOD=none
    BROWSER_ONLY=no
    BOOTPROTO=static
    DEFROUTE=yes
    IPADDR=192.168.56.254
    NETMASK=255.255.255.0
    GATEWAY=192.168.56.1
    IPV4_FAILURE_FATAL=no
    IPV6INIT=yes
    IPV6_AUTOCONF=yes
    IPV6_DEFROUTE=yes
    IPV6_FAILURE_FATAL=no
    IPV6_ADDR_GEN_MODE=stable-privacy
    NAME=eth0
    UUID=e2a8229c-32c4-4da8-9410-20a8f3355a95
    DEVICE=eth0
    ONBOOT=yes
    ZONE=public
    

    重启网卡

    systemctl restart network
    

    测试网关连接

    ping 192.168.56.1
    

    网络配置完成

  • 设置时区

    timedatectl set-timezone "Asia/Shanghai"
    

    验证时区

    timedatectl
    
  • oVirt-node计算节点管理地址

    https://192.168.56.254:9090/

  • 安装阿里云yum源,通过ISO安装的oVirt-node计算节点 缺少命令(wget命令也没有)

    • 离线上传Centos-7.repo/etc/yum.repos.d/CentOS-Base.repo

      http://mirrors.aliyun.com/repo/Centos-7.repo

    • 执行操作,等待片刻

      yum clean all
      yum makecache
      yum update
      
    • 安装常用命令

      yum -y install vim net-tools wget
      
  • 建立虚拟机存放目录ISO存放目录虚拟机备份目录,并赋予权限,作为后续存储域的配置所需

    mkdir -pv /vm_data/data
    mkdir -pv /vm_data/iso
    mkdir -pv /vm_data/backup
    

    赋予权限

    chown -R vdsm:kvm /vm_data/data
    chown -R vdsm:kvm /vm_data/iso
    chown -R vdsm:kvm /vm_data/backup
    

4 进入oVirt-engine管理机 配置基础环境

engine-1

engine-2

  • 修改数据中心配置文本地

    • 进入Engine管理台的计算->数据中心页面,选中Default数据中心,点击编辑按钮

engine-3

  • 存储类型选择**本地**

engine-4

  • 添加oVirt-node计算节点

    • 进入Engine管理台的计算->主机页面,点击新建按钮

      输入mam.ovirt.xxxxxx.com192.168.56.254 输入账户密码点击确定即可

engine-5

  • 等待主机状态变为UP

engine-6

  • 新建本地数据域和ISO域

    • 进入Engine管理台存储->域页面,点击新建域,如下:

    • 在弹出的新建域对话框中,填写名称

      域功能选择“数据”,存储类型选择“主机本地”,路径填写“/data/images/rhev

      (注意这个路径是默认存在的,如果使用其它路径,需要新创建并修改权限)

    • 新建数据域,路径/vm_data/data

engine-7

  • 新建ISO域,路径/vm_data/iso

engine-8

  • 效果

engine-9

  • 上传镜像

    • 进入镜像域目录,(Tips:674037d9-c4a1-4eca-97d2-06e138e38f92为随机值,每次安装各不相同)
    cd /data/iso & ls
    cd 674037d9-c4a1-4eca-97d2-06e138e38f92 & ls
    cd images & ls
    cd 11111111-1111-1111-1111-111111111111
    
    • 上传ISO镜像至11111111-1111-1111-1111-111111111111目录**(必须存放在这个目录)**
    • 确认效果,进入Engine管理台存储->域页面,点击iso->镜像

engine-10

5 新建虚拟机

  • 查看文章
    ---------------------------------------------------engine-11.png