Ovirt環境部署手冊(barron測試通過)
通達Ovirt環境部署手冊
目錄
1系統環境:
2安裝 oVirt
3安裝前準備
4安裝 oVirt Engine
5節點的安裝
1系統環境:
Linux ovirt-code 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
CentOS release 6.5 (Final)
註意安裝版本 測試3.5版本最容易匹配 Centos6.5系統
如果安裝的是CentOS, CentOS 6.5 + oVirt 3.5.x是最佳匹配。
2安裝 oVirt
oVirt 平臺由至少一個 oVirt Engine 服務器和一個以上的節點主機組成。
oVirt Engine服務提供一個圖形化的用戶界,讓管理員去管理基於oVirt架構的物理主機和邏輯資源; Engine可以部署在Fedora 19, Red Hat Enterprise Linux 6 或者 CentOS 6 操作系統的服務器上,同時可以通過客戶端安裝的Firefox瀏覽器進行訪問。
3安裝前準備
第一步:
系統安裝完成之後需要進行系統升級:
1)# yum update -y
2) 所有更新安裝完畢後重啟服務器
3) 安裝oVirt project數據源。要安裝oVirt3.6 就安裝 ovirt-release36.rpm; 要安裝oVirt 3.5 就安裝 ovirt-release35.rpm, 以此類推:
yum install http://plain.resources.ovirt.org/pub/yum-repo/ovirt-release35.rpm
4安裝 oVirt Engine
執行命令:
yum -y install ovirt-engine
安裝完成之後
執行:
engine-setup
遇到錯誤:
1. [ INFO ] Checking for product updates...
2. [ ERROR ] Yum: Cannot retrieve repository metadata (repomd.xml) for repository: ovirt-3.4-glusterfs-epel. Please verify its path and
3. [ INFO ] Yum: Performing yum transaction rollback
4. [ ERROR ] Failed to execute stage ‘Environment customization‘: Cannot retrieve repository metadata (repomd.xml) for repository: ovirt-3.4-glusterfs-epel. Please verify its path and try again
5. [ INFO ] Stage: Clean up
6. Log file is located at /var/log/ovirt-engine/setup/ovirt-engine-setup-20171026033058-w7kml2.log
7. [ INFO ] Generating answer file ‘/var/lib/ovirt-engine/setup/answers/20171026033240-setup.conf‘
8. [ INFO ] Stage: Pre-termination
9. [ INFO ] Stage: Termination
10. [ ERROR ] Execution of setup failed
解決:
engine-setup --offline
安裝過程:
1)Host fully qualified DNS name of this server [ovirt-code]:
主機完全限定此服務器的DNS名稱[ovirt-code]:
出現錯誤:
[ ERROR ] Host name is not valid did not resolve into an IP address
解決:
[root@ovirt-code ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.98.137 ovirt-code localhost
2) [WARNING] Failed to resolve ovirt-code 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]:
[警告]使用DNS解決ovirt代碼失敗,它只能在本地解決
安裝程序可以自動配置此系統上的防火墻。
註意:防火墻的自動配置可能會覆蓋當前設置。
您要安裝程序配置防火墻嗎? (是,否)[是]:
3) The following firewall managers were detected on this system: iptables
Firewall manager to configure (iptables):
在此系統上檢測到以下防火墻管理員:iptables
防火墻管理器配置(iptables):iptables
4) Where is the Engine database located? (Local, Remote) [Local]:
Engine數據庫位於哪裏? (本地,遠程)[本地]:
5) 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]:
安裝程序可以自動配置本地postgresql服務器以使引擎運行。 這可能與現有應用程序沖突。
您希望安裝程序自動配置postgresql並創建引擎數據庫,還是更喜歡手動執行? (自動,手動)[自動]:
6) Application mode (Both, Virt, Gluster) [Both]:
應用模式(兩者,Virt,Gluster)[Both]:
7) Engine admin password:root
引擎管理員密碼:root
Confirm engine admin password:
確認密碼:root
8) [WARNING] Password is weak: it is too short
Use weak password? (Yes, No) [No]:
[警告]密碼很弱:太短
使用弱密碼? (是,否)[否]:
9) Organization name for certificate [Test]:
證書的組織名稱[測試]:
10) --== APACHE CONFIGURATION ==--
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]:
- == APACHE CONFIGURATION == -
安裝程序可以配置apache使用從內部CA頒發的證書使用SSL。
你希望安裝程序配置,還是更喜歡手動執行? (自動,手動)[自動]:
11) 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]:
安裝程序可以配置Web服務器的默認頁面來呈現應用程序主頁。 這可能與現有應用程序沖突。
您是否希望將應用程序設置為Web服務器的默認頁面? (是,否)[是]:
12) Configure WebSocket Proxy on this machine? (Yes, No) [Yes]:
在本機上配置WebSocket代理? (是,否)[是]:
13) Configure an NFS share on this server to be used as an ISO Domain? (Yes, No) [Yes]:
在此服務器上配置NFS共享以用作ISO域? (是,否)[是]:
14) Local ISO domain path [/var/lib/exports/iso]:
本地ISO域路徑[/ var / lib / exports / iso]:
15) Local ISO domain ACL [0.0.0.0/0.0.0.0(rw)]:
本地ISO域ACL [0.0.0.0/0.0.0.0(rw)]:
16) Local ISO domain name [ISO_DOMAIN]:
--== MISC CONFIGURATION ==--
--== END OF CONFIGURATION ==--
[ INFO ] Stage: Setup validation
[WARNING] Warning: Not enough memory is available on the host. Minimum requirement is 4096MB, and 16384MB is recommended.
Do you want Setup to continue, with amount of memory less than recommended?
本地ISO域名[ISO_DOMAIN]:
- == MISC CONFIGURATION == -
- ==配置結束== -
[INFO]階段:設置驗證
[警告]警告:主機上沒有足夠的內存可用。 最低要求為4096MB,建議使用16384MB。
你想要安裝程序繼續,內存量少於推薦量嗎? (是,否)[否]:
17)
Engine database name : engine
Engine database secured connection : False
Engine database host : localhost
Engine database user name : engine
Engine database host name validation : False
Engine database port : 5432
NFS setup : True
PKI organization : Test
Datacenter storage type : False
Application mode : both
Firewall manager : iptables
Update Firewall : True
Configure WebSocket Proxy : True
Host FQDN : ovirt-code
NFS export ACL : 0.0.0.0/0.0.0.0(rw)
NFS mount point : /var/lib/exports/iso
Configure local Engine database : True
Set application as default page : True
Configure Apache SSL : True
Please confirm installation settings (OK, Cancel) [OK]:
[WARNING] Warning: Not enough memory is available on the host. Minimum requirement is 4096MB, and 16384MB is recommended.
SSH fingerprint: 8C:5C:49:47:F9:05:02:3D:FC:A4:25:82:BE:2C:47:67
Internal CA F1:5D:DF:29:AE:71:A8:4A:50:1D:26:3B:2C:6C:56:8B:50:6D:C0:FC
Web access is enabled at:
http://ovirt-code:80/ovirt-engine
https://ovirt-code:443/ovirt-engine
Please use the user "admin" and password specified in order to login
顯示安裝成功:
下面進行測試:
看到以下界面成功了一半:
5節點的安裝
一.添加主機
第一種:在現有操作系統上安裝:Ovrit-vdsm
檢查系統安裝時是否安裝了KVM組件
egrep ‘(vmx|svm)‘ /proc/cpuinfo //檢查CPU是否支持虛擬化
modprobe kvm_intel //加載kvm模塊
lsmod | grep kvm //檢查系統是否KVM模塊
yum install -y qemu-kvm libvirt virt-manager
yum localinstall http://plain.resources.ovirt.org/pub/yum-repo/ovirt-release35.rpm
再在web頁面端添加主機
等待10分鐘左右後顯示為綠色則表示添加成功
二.添加存儲
為了能夠使用共享存儲我們這裏使用nfs
node節點主機設置nfs掛載目錄
vim /etc/exports
添加一下內容
/NFS/iso * (rw, sync, no_root_squash)
掛載目錄 任何IP都可以訪問 rw讀寫權限 sync同步 同步用戶
出現問題:
Thread-21716::DEBUG::2017-11-09 09:06:15,434::task::595::Storage.TaskManager.Task::(_updateState) Task=`4b1a20b8-532b-4d56-857f-225625c1176f`::moving from state init -> state preparing
Thread-21716::INFO::2017-11-09 09:06:15,435::logUtils::44::dispatcher::(wrapper) Run and protect: getSpmStatus(spUUID=‘00000002-0002-0002-0002-000000000268‘, options=None)
Thread-21716::INFO::2017-11-09 09:06:15,443::logUtils::47::dispatcher::(wrapper) Run and protect: getSpmStatus, Return response: {‘spm_st‘: {‘spmId‘: 1, ‘spmStatus‘: ‘SPM‘, ‘spmLver‘: 2L}}
Thread-21716::DEBUG::2017-11-09 09:06:15,444::task::1191::Storage.TaskManager.Task::(prepare) Task=`4b1a20b8-532b-4d56-857f-225625c1176f`::finished: {‘spm_st‘: {‘spmId‘: 1, ‘spmStatus‘: ‘SPM‘, ‘spmLver‘: 2L}}
Thread-21716::DEBUG::2017-11-09 09:06:15,444::task::595::Storage.TaskManager.Task::(_updateState) Task=`4b1a20b8-532b-4d56-857f-225625c1176f`::moving from state preparing -> state finished
Thread-21716::DEBUG::2017-11-09 09:06:15,445::resourceManager::940::Storage.ResourceManager.Owner::(releaseAll) Owner.releaseAll requests {} resources {}
Thread-21716::DEBUG::2017-11-09 09:06:15,445::resourceManager::977::Storage.ResourceManager.Owner::(cancelAll) Owner.cancelAll requests {}
Thread-21716::DEBUG::2017-11-09 09:06:15,446::task::993::Storage.TaskManager.Task::(_decref) Task=`4b1a20b8-532b-4d56-857f-225625c1176f`::ref 0 aborting False [root@ovirt-code rh]# cat /etc/exports
原因是因為nfs需要掛載的目錄權限不對 Vdsm 權限代碼為 36
解決方法:
chown -R 36.36 需要掛載的目錄,例如/NFS/iso
即可重新掛載成功
三.鏡像文件
拷貝到engine主機的該目錄下
數據域:數據域包含數據中心內所有虛擬機和模板的虛擬硬盤和OVF文件,不能跨數據中心共享。多個類型的數據域(iSCSI,NFS,FC,POSIX和Gluster)可以添加到同一個數據中心,只要它們是共享的而不是本地域。
重要說明:您必須擁有一臺狀態為“ Up並且已將數據域附加到數據中心”的主機,然後才能附加ISO域和導出域。
ISO域: ISO域存儲用於為虛擬機安裝和引導操作系統和應用程序的ISO文件(或邏輯CD),並可以跨不同的數據中心共享。ISO域去除了數據中心對物理介質的需求。ISO域只能是基於NFS的。只有一個ISO域可以添加到數據中心。
導出域:導出域是臨時存儲庫,用於在數據中心和oVirt環境之間復制和移動圖像。導出域可用於備份虛擬機。導出域可以在數據中心之間移動,但是一次只能在一個數據中心中激活。導出域只能是基於NFS的。只有一個導出域可以添加到數據中心。
操作如下:
導入ISO文件到ISO域
具體操作如下:
[root@ovirt-engine exports]# engine-iso-uploader --iso-domain=ISO /var/lib/exports/iso/14fa3e30-4aa4-48ee-be0b-1530202820fd/images/11111111-1111-1111-1111-111111111111/ovirt-node-iso-3.5-0.201502231653.el6.iso
ERROR: /var/lib/exports/iso/14fa3e30-4aa4-48ee-be0b-1530202820fd/images/11111111-1111-1111-1111-111111111111/ovirt-node-iso-3.5-0.201502231653.el6.iso is not a valid command. Valid commands are ‘list‘ or ‘upload‘.
[root@ovirt-engine exports]# engine-iso-uploader --iso-domain=ISO upload /var/lib/exports/iso/14fa3e30-4aa4-48ee-be0b-1530202820fd/images/11111111-1111-1111-1111-111111111111/ovirt-node-iso-3.5-0.201502231653.el6.iso
Please provide the REST API password for the admin@internal oVirt Engine user (CTRL+D to abort):
Uploading, please wait...
[root@ovirt-engine exports]# engine-iso-uploader --iso-domain=ISO upload /var/lib/exports/iso/14fa3e30-4aa4-48ee-be0b-1530202820fd/images/11111111-1111-1111-1111-111111111111/ovirt-node-iso-3.5-0.201502231653.el6.iso
Please provide the REST API password for the admin@internal oVirt Engine user (CTRL+D to abort):
Uploading, please wait...
ERROR: mount.nfs: Connection timed out
解決方法:
關閉node節點防火墻 更改/etc/exports文件
如下:
[root@ovirt-node /]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
vim /etc/exports
/NFS/data 192.168.98.0/24(rw,sync)
/NFS/iso 192.168.98.0/24(rw,sync)
/ISO 192.168.98.0/24(rw,sync)
service nfs restart
完成之後顯示如下
添加虛擬機,等操作參考
本文出自 “barron日記” 博客,請務必保留此出處http://13172370.blog.51cto.com/13162370/1980375
Ovirt環境部署手冊(barron測試通過)