系統安裝
首先添加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]: <span style="color: #4f4f4f"><strong>回車</strong> </span>
Configure ovirt-provider-ovn (Yes, No) [Yes]: <span style="color: #4f4f4f"><strong>回車(OVN:Open Virtual Network,配置虛擬網絡)</strong></span>
Configure Image I/O Proxy on this host (Yes, No) [Yes]: <span style="color: #4f4f4f"><strong>回車(Image I/O Proxy可以支持向oVirt平臺中上傳虛擬機的磁盤鏡像)</strong></span>
Configure WebSocket Proxy on this host (Yes, No) [Yes]: <span style="color: #4f4f4f"><strong>回車(WebSocket Proxy用來支持使用noVNC遠程登錄虛擬機圖形</strong></span><span style="color: #6795b5"><strong>界面</strong></span><span style="color: #4f4f4f"><strong>管理)</strong></span>
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]: <span style="color: #4f4f4f"><strong>回車(在本機配置數據庫)</strong></span>
Configure VM Console Proxy on this host (Yes, No) [Yes]: <span style="color: #4f4f4f"><strong>回車(支持訪問虛擬機的串口console通信)</strong></span>
-== PACKAGES ==-
[ INFO ] Checking for product updates...
[ INFO ] No product updates found
-== NETWORK CONFIGURATION ==-
Host fully qualified DNS name of this server [localhost.localdomain]: <span style="color: #4f4f4f"><strong>回車(使用默認hostname就行,反正是準備用IP地址訪問無所謂)</strong></span>
[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<span style="color: #4f4f4f"> <strong>no回車(因爲之前已經把防火牆服務給關掉了,所以就不用再配置防火牆的具體設置了)</strong></span>
-== DATABASE CONFIGURATION ==-
Where is the DWH database located? (Local, Remote) [Local]: <span style="color: #4f4f4f"><strong>回車(DWH:Data WareHouse使用本地數據庫)</strong></span>
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]: <span style="color: #4f4f4f"><strong>回車(自動配置PostGreSQL數據庫)</strong></span>
Where is the Engine database located? (Local, Remote) [Local]: <span style="color: #4f4f4f"><strong>回車(Engine用到的數據庫位於本機)</strong></span>
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]: <span style="color: #4f4f4f"><strong>回車(使用安裝程序自動創建Engine數據庫)</strong></span>
-== OVIRT ENGINE CONFIGURATION ==-
Engine admin password: <span style="color: #4f4f4f"> <strong>輸入後臺管理員admin的密碼回車</strong></span>
Confirm engine admin password: <span style="color: #4f4f4f"><strong>再輸入一遍密碼回車</strong></span>
[WARNING] Password is weak: 過短
Use weak password? (Yes, No) [No]: yes
Application mode (Virt, Gluster, Both) [Both]: <span style="color: #4f4f4f"><strong>回車</strong></span>
Use default credentials (admin@internal) for ovirt-provider-ovn (Yes, No) [Yes]: <span style="color: #4f4f4f"><strong>回車(使用默認的admin@internal內部管理員賬號)</strong></span>
-== STORAGE CONFIGURATION ==-
Default SAN wipe after delete (Yes, No) [No]: <span style="color: #4f4f4f"><strong>回車(yes的話在刪除虛擬機的虛擬磁盤後會擦除存儲設備上的對應塊)</strong></span>
-== PKI CONFIGURATION ==-
Organization name for certificate [localdomain]: <span style="color: #4f4f4f"><strong>回車</strong></span>
-== 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]: <span style="color: #4f4f4f"><strong>回車(使用apache作爲web服務器)</strong></span>
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]: <span style="color: #4f4f4f"> <strong>回車(自動配置CA證書)</strong></span>
-== SYSTEM CONFIGURATION ==-
-== MISC CONFIGURATION ==-
Please choose Data Warehouse sampling scale:
(1) Basic
(2) Full
(1, 2)[1]: <span style="color: #4f4f4f"><strong>回車(使用基本的數據庫示例初始化數據)</strong></span>
-== 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]: <span style="color: #4f4f4f"><strong>回車</strong></span>
[ 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
<span style="color: #4f4f4f">解決方法:增加一個配置文件如下</span>
vim /etc/ovirt-engine/engine.conf.d/99-sso.conf
SSO_CALLBACK_PREFIX_CHECK=false
<span style="color: #4f4f4f">重啓ovirt-engine服務</span>
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處設置
離線安裝包後續會上傳到百度雲:
--