系统安装
首先添加ovirt官方repo
yum install -y http://resources.ovirt.org/pub/yum-repo/ovirt-release42.rpm
安装createrepo工具
yum install -y createrepo
修改YUM配置
接下来修改YUM配置,用来保留随后进行安装时候会下载到的所有包。注意这一步一定要放在添加ovirt官方repo后面,否则将上面那个ovirt-release42.rpm也会缓存下来,我们一会儿要做的离线包不需要它。
vi /etc/yum.conf
修改keepcache = 1制作ovirt-engine离线安装包
刚才准备好的这两台一模一样的设备先用一个,跟之前笔记中的过程一样,先正常安装ovirt-engine。yum install -y ovirt-engine --nogpgcheck
刷刷刷的安装一大堆东西,装完之后就行了,不需要进行后面engine-setup的过程,我们要的只是这些rpm包。生成repo相关数据
cd /var/cache/yum/x86_64/7/
createrepo -v ./
至此,ovirt-engine的离线安装包就准备好了,使用WinSCP连过去将这个x86_64的文件夹拷出来。离线安装ovirt-engine
重新安装一遍CentOS 7最小化模式系统,啥都不用装,还用WinSCP将之前拷出来的那个x86_64文件夹传回来至/var/cache/yum/里面
关闭防火墙和SE
启动: systemctl start firewalld
关闭: systemctl stop firewalld
查看状态: systemctl status firewalld
开机禁用 : systemctl disable firewalld
开机启用 : systemctl enable firewalld
systemctl stop firewalld
setenforce 0创建本地repo配置文件
cd /etc/yum.repo.d
mkdir bak
mv *.repo ./bak
vi local.repo
[local]
name=local-repo
baseurl=file:///var/cache/yum/x86_64/7
gpgcheck=0
enabled=1安装ovirt-engine
yum install -y ovirt-engine
配置ovirt-engine
[root@localhost yum]# 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-20190302095742-cd1dl1.log
Version: otopi-1.7.8 (otopi-1.7.8-1.el7)
[ INFO ] Stage: Environment packages setup
[ INFO ] Stage: Programs detection
[ INFO ] Stage: Environment setup
[ INFO ] Stage: Environment customization
-== PRODUCT OPTIONS ==-
Configure Engine on this host (Yes, No) [Yes]: 回车
Configure ovirt-provider-ovn (Yes, No) [Yes]: 回车(OVN:Open Virtual Network,配置虚拟网络)
Configure Image I/O Proxy on this host (Yes, No) [Yes]: 回车(Image I/O Proxy可以支持向oVirt平台中上传虚拟机的磁盘镜像)
Configure WebSocket Proxy on this host (Yes, No) [Yes]: 回车(WebSocket Proxy用来支持使用noVNC远程登录虚拟机图形界面管理)
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]: 回车(支持访问虚拟机的串口console通信)
-== PACKAGES ==-
[ INFO ] Checking for product updates...
[ INFO ] No product updates found
-== NETWORK CONFIGURATION ==-
Host fully qualified DNS name of this server [localhost.localdomain]: 回车(使用默认hostname就行,反正是准备用IP地址访问无所谓)
[WARNING] Failed to resolve localhost.localdomain 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 no回车(因为之前已经把防火墙服务给关掉了,所以就不用再配置防火墙的具体设置了)
-== DATABASE CONFIGURATION ==-
Where is the DWH database located? (Local, Remote) [Local]: 回车(DWH:Data WareHouse使用本地数据库)
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]: 回车(自动配置PostGreSQL数据库)
Where is the Engine database located? (Local, Remote) [Local]: 回车(Engine用到的数据库位于本机)
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]: 回车(使用安装程序自动创建Engine数据库)
-== OVIRT ENGINE CONFIGURATION ==-
Engine admin password: 输入后台管理员admin的密码回车
Confirm engine admin password: 再输入一遍密码回车
[WARNING] Password is weak: 过短
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]: 回车(使用默认的admin@internal内部管理员账号)
-== STORAGE CONFIGURATION ==-
Default SAN wipe after delete (Yes, No) [No]: 回车(yes的话在删除虚拟机的虚拟磁盘后会擦除存储设备上的对应块)
-== PKI CONFIGURATION ==-
Organization name for certificate [localdomain]: 回车
-== 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]: 回车(使用apache作为web服务器)
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]: 回车(自动配置CA证书)
-== 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] Cannot validate host name settings, reason: resolved host does not match any of the local addresses
[WARNING] Less than 16384MB of memory is available
-== CONFIGURATION PREVIEW ==-
Application mode : both
Default SAN wipe after delete : False
Update Firewall : False
Host FQDN : localhost.localdomain
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 : localdomain
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
[ INFO ] Stage: Package installation
[ INFO ] Stage: Misc configuration
[ ERROR ] Failed to execute stage 'Misc configuration': Failed to start service 'openvswitch'
[ INFO ] Yum Performing yum transaction rollback
[ INFO ] Stage: Clean up
Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20190302095742-cd1dl1.log
[ INFO ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20190302100052-setup.conf'
[ INFO ] Stage: Pre-termination
[ INFO ] Stage: Termination
[ ERROR ] Execution of setup failed
[root@localhost yum]# setenforce 0
[root@localhost yum]# getenforce
Permissive
[root@localhost yum]# vim /etc/selinux/config
[root@localhost yum]#
[root@localhost yum]#
[root@localhost yum]#
[root@localhost yum]# 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-20190302100309-btbu2z.log
Version: otopi-1.7.8 (otopi-1.7.8-1.el7)
[ INFO ] Stage: Environment packages setup
[ INFO ] Stage: Programs detection
[ INFO ] Stage: Environment setup
[ INFO ] Stage: Environment customization
-== PRODUCT OPTIONS ==-
Configure Engine on this host (Yes, No) [Yes]:
Configure ovirt-provider-ovn (Yes, No) [Yes]:
Configure Image I/O Proxy on this host (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]:
-== PACKAGES ==-
[ INFO ] Checking for product updates...
[ INFO ] No product updates found
-== NETWORK CONFIGURATION ==-
Host fully qualified DNS name of this server [localhost.localdomain]:
[WARNING] Failed to resolve localhost.localdomain 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 [localdomain]:
-== 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] Cannot validate host name settings, reason: resolved host does not match any of the local addresses
[WARNING] Less than 16384MB of memory is available
-== CONFIGURATION PREVIEW ==-
Application mode : both
Default SAN wipe after delete : False
Update Firewall : False
Host FQDN : localhost.localdomain
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 : localdomain
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
[ 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://localhost.localdomain:80/ovirt-engine
https://localhost.localdomain:443/ovirt-engine
Internal CA 7F:EA:4E:B6:A0:D5:F8:C8:0F:D6:7E:DB:25:64:C8:56:C2:53:6D:0A
SSH fingerprint: SHA256:li65CVFIL5rSVEgs0ssSDhyOQMAVYTi6mjm+C3WYK48
[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-20190302100309-btbu2z.log
[ INFO ] Generating answer file '/var/lib/ovirt-engine/setup/answers/20190302100533-setup.conf'
[ INFO ] Stage: Pre-termination
[ INFO ] Stage: Termination
[ INFO ] Execution of setup completed successfully
访问地址:http://IP/ovirt-enginx
解决方法:增加一个配置文件如下
vim /etc/ovirt-engine/engine.conf.d/99-sso.conf
SSO_CALLBACK_PREFIX_CHECK=false
重启ovirt-engine服务
service ovirt-engine restart
即可制作Host离线安装包
Host离线安装包的制作过程跟上面的ovirt-engine差不多,但是由于host里面用到的包都是由engine从web管理界面中执行的安装脚本在后台自动完成的,因此我们在配置完yum.conf让它保留cache后,正常从engine的管理后台鼠标流将这台服务器添加到虚拟化集群里面,并等待后台脚本从官网正常下载安装完成所有需要的包,等这台host完成安装,状态变成up后,来到yum的缓存目录里面生成一下repo相关文件后WinSCP拷出来就行了
首先添加ovirt官方repo
yum install -y http://resources.ovirt.org/pub/yum-repo/ovirt-release42.rpm
安装createrepo工具
systemctl stop firewalld
setenforce 0
vim /etc/yum.conf
修改keepcache = 1
yum install -y createrepo
yum -y updatecd /var/cache/yum/x86_64/7/
createrepo -v ./
创建本地repo配置文件
cd /etc/yum.repo.d
mkdir bak
mv *.repo ./bak
vi local.repo
[local]
name=local-repo
baseurl=file:///var/cache/yum/x86_64/7
gpgcheck=0
enabled=1
同理在进行离线安装Host的时候也是将上面拷出来的这个文件夹怼到新的空白服务器里,创建/etc/yum.repo.d/local.repo文件(跟上面一样),到这里就不用管了,直接在engine的web界面鼠标流添加这台host,所需要的包就会自动从本地的源里面进行安装啦
注意:因为KVM是依赖硬件虚拟化,所以需要开机英特尔的CPUvt-x技术,AMD-V
虚拟机在CPU选项处设置
物理机在主板boss处设置
离线安装包后续会上传到百度云:
--