前面介绍了oVirt engine和report的部署, 参考 :
这里要介绍一下使用ovirt engine管理平台进行oVirt宿主机的部署.
oVirt的架构介绍参考 :
部署oVirt宿主机, 宿主机需要联通网络, 配置ovirt yum源, 配置DNS可以解析ovirt yum源, 另外宿主机的CPU需要支持虚拟化, 同时在BIOS打开虚拟化开关, 等.
本文部署HOST节点的主机为DELL R610, E5504的CPU.
部署步骤 :
1. 首先检查宿主机的CPU是否支持虚拟化, 并且在BIOS开启它.
![oVirt host deploy - 德哥@Digoal - PostgreSQL research](http://img2.ph.126.net/unhjXvT-NJWXNGjys5bJsg==/6619232622537135725.png?x-oss-process=image/resize,w_1400/format,webp)
2. 然后需要给宿主机安装CentOS 6.x x64.
3. 配置宿主机的主机名, 最好整个oVirt环境部署DNS, 用于解析所有的宿主机和管理机, 存储的主机名.
没有的话, 需要配置/etc/hosts.
4. 配置防火墙, 打开宿主机和存储网络, 与ovirt engine的连通性.
5. 配置时钟同步
6. 关闭SELINUX
7. 配置limit.conf, sysctl.conf
8. 配置yum
9. 配置宿主机的硬件管理卡, 用户权限, 开放LAN IPMI功能, 测试fence接口.
# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
172.16.3.40 40.sky-mobi.com
# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=40.sky-mobi.com
# vi /etc/resolv.conf
nameserver 202.101.172.35
4. 配置防火墙, 打开宿主机和存储网络, 与ovirt engine的连通性.
# vi /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -s 192.168.0.0/16 -j ACCEPT
-A INPUT -s 10.0.0.0/8 -j ACCEPT
-A INPUT -s 172.16.0.0/16 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
# service iptables restart
5. 配置时钟同步
# yum install -y ntpdate
# crontab -e
8 * * * * /usr/sbin/ntpdate asia.pool.ntp.org && /sbin/hwclock --systohc
# /usr/sbin/ntpdate asia.pool.ntp.org && /sbin/hwclock --systohc
6. 关闭SELINUX
# setenforce 0
# vi /etc/selinux/config
SELINUX=disabled
7. 配置limit.conf, sysctl.conf
vi /etc/sysctl.conf
kernel.shmmni = 4096
kernel.sem = 50100 64128000 50100 1280
fs.file-max = 7672460
net.ipv4.ip_local_port_range = 9000 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_syn_backlog = 4096
net.core.netdev_max_backlog = 10000
vm.overcommit_memory = 0
net.ipv4.ip_conntrack_max = 655360
fs.aio-max-nr = 1048576
net.ipv4.tcp_timestamps = 0
# sysctl -p
# vi /etc/security/limits.conf
* soft nofile 131072
* hard nofile 131073
* soft nproc 131072
* hard nproc 131073
* soft core unlimited
* hard core unlimited
* soft memlock 50000000
* hard memlock 50000001
# vi /etc/security/limits.d/90-nproc.conf
#* soft nproc 1024
#root soft nproc unlimited
* soft nproc 131072
* hard nproc 131073
8. 配置yum
yum localinstall -y http://plain.resources.ovirt.org/pub/yum-repo/ovirt-release34.rpm
[root@40 ~]# cd /etc/yum.repos.d/
[root@40 yum.repos.d]# ll
total 24
-rw-r--r--. 1 root root 1926 Nov 27 2013 CentOS-Base.repo
-rw-r--r--. 1 root root 638 Nov 27 2013 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 630 Nov 27 2013 CentOS-Media.repo
-rw-r--r--. 1 root root 3664 Nov 27 2013 CentOS-Vault.repo
-rw-r--r--. 1 root root 1498 Jul 31 22:33 ovirt-3.4-dependencies.repo
-rw-r--r--. 1 root root 292 Jul 31 22:33 ovirt-3.4.repo
关闭gpg校验
# vi ovirt-3.4-dependencies.repo
# vi ovirt-3.4.repo
gpgcheck=0
9. 配置宿主机的硬件管理卡, 用户权限, 开放LAN IPMI功能, 测试fence接口.
![oVirt host deploy - 德哥@Digoal - PostgreSQL research](http://img0.ph.126.net/B2JdEyJYfFbpa5z8NCwR7Q==/6619520694583612377.png?x-oss-process=image/resize,w_1400/format,webp)
![oVirt host deploy - 德哥@Digoal - PostgreSQL research](http://img2.ph.126.net/K1jmke32diywqIAKClZ65A==/6619343673211541108.png?x-oss-process=image/resize,w_1400/format,webp)
10. 使用ovirt-engine管理平台添加主机, 并配置电源管理模块, 有很多FENCE接口, 我们这里使用ipmi, HP的话可以使用ilo. 其他厂商的自己参考一下厂商的说明.
![oVirt host deploy - 德哥@Digoal - PostgreSQL research](http://img1.ph.126.net/yoTtFCQufFHC5TcVLF0I3g==/6619379957095257466.png?x-oss-process=image/resize,w_1400/format,webp)
![oVirt host deploy - 德哥@Digoal - PostgreSQL research](http://img1.ph.126.net/tJvjak9xR_K87BxiVSpstA==/6619078690909246984.png?x-oss-process=image/resize,w_1400/format,webp)
11. 如果安装有错误的话, 可以查看host的event, 或者到ovirt engine主机查看日志 /var/log/ovirt-engine/host-deploy/*.log
![oVirt host deploy - 德哥@Digoal - PostgreSQL research](http://img0.ph.126.net/04x-D_U9GKpJlfhglEZ9-A==/6608580553887602124.png?x-oss-process=image/resize,w_1400/format,webp)
[其他]
1. 在HP DL360 G5 E5405的机器上部署host节点失败.
报错如下
processor : 7
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Xeon(R) CPU E5405 @ 2.00GHz
stepping : 6
cpu MHz : 2000.003
cache size : 6144 KB
physical id : 1
siblings : 4
core id : 3
cpu cores : 4
apicid : 7
initial apicid : 7
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx tm2 ssse3 cx16 xtpr pdcm dca sse4_1 lahf_lm dts tpr_shadow vnmi flexpriority
bogomips : 4000.00
clflush size : 64
cache_alignment : 64
address sizes : 38 bits physical, 48 bits virtual
power management:
报错如下
Host 176 is missing the NX cpu flag. This flag can be enabled via the host BIOS. Please set Disable Execute (XD) for an Intel host, or No Execute (NX) for AMD. Please make sure to completely power off the host for this change to take effect.
配置如下, nx 配置enable , disable都一样, 每次到配置的最后会自动重启, 并且无法配置虚拟网卡.
![oVirt host deploy - 德哥@Digoal - PostgreSQL research](http://img1.ph.126.net/33NSmbmDG6kw85DS8_ZraA==/6619429435118506885.png?x-oss-process=image/resize,w_1400/format,webp)
最终的报错信息2条, 貌似是CPU的问题, 少了一个特性 :
Host 176 does not comply with the cluster Default networks, the following networks are missing on host: 'ovirtmgmt'
Host 176 moved to Non-Operational state as host does not meet the cluster's minimum CPU level. Missing CPU features : model_Nehalem
罢了, 用这台老机器来做ovirt-engine节点吧, HOST节点还是用比较给力的CPU.