Ovirt环境部署手册(barron测试通过)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ovirt环境部署手册(barron测试通过)相关的知识,希望对你有一定的参考价值。
通达Ovirt环境部署手册
目录
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 try again
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
解决:
[[email protected] ~]# 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 [[email protected] 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域
具体操作如下:
[[email protected] 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‘.
[[email protected] 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 [email protected] oVirt Engine user (CTRL+D to abort):
Uploading, please wait...
[[email protected] 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 [email protected] oVirt Engine user (CTRL+D to abort):
Uploading, please wait...
ERROR: mount.nfs: Connection timed out
解决方法:
关闭node节点防火墙 更改/etc/exports文件
如下:
[[email protected] /]# 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测试通过)的主要内容,如果未能解决你的问题,请参考以下文章