Deploy oVirt using nested virtualization environments

注意:

1.要是在vmware workstation的虚拟机中安装,虚拟机的processor一定要勾选上“Virtualize Intel VT-x/EPT or AMD-V/RVI”,否则会是ovirt无法支持的cpu类型,engine连接node的时候无法成功。要是用virsh命令创建的虚拟机需要修改engine和node的xml配置中的cpu


<cpu mode='host-model'/>      #Use host CPU model
<cpu match='exact'>#Specify a CPU model
   <model>core2duo</model>
    <feature policy='require' name='vmx'/>
</cpu>

2.engine至少要2G内存


安装(以libvirt创建的虚拟机为例):

1.先设置为光盘启动,安装系统:
<boot dev='cdrom'/>

2.再设置为硬盘启动,进入系统:
<boot dev='hd'/>

3.装好系统后首先启用eth0:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
ONBOOT=yes
service network restart

4.安装engine:
12.20号后novnc从epel去除了,要手动安装:
 安装python-websockify需要的setuptools:
http://mirror.fuel-infra.org/fwm/6.0/centos/os/x86_64/Packages/python-setuptools-0.7.2-7.mira1.noarch.rpm
python-setuptools-0.7.2-7.mira1.noarch.rpm
安装novnc需要的python-websockify:
wget http://mirror.fuel-infra.org/fwm/6.0/centos/os/x86_64/Packages/python-websockify-0.6.0-1.mira1.noarch.rpm
rpm -ivh python-websockify-0.6.0-1.mira1.noarch.rpm
安装novnc:
wget http://mirror.fuel-infra.org/fwm/6.0/centos/os/x86_64/Packages/novnc-0.4-8.el6.noarch.rpm
rpm -ivh novnc-0.4-8.el6.noarch.rpm

yum -y update
yum -y install http://plain.resources.ovirt.org/pub/yum-repo/ovirt-release35.rpmy
yum -y install ovirt-engine(插到上面的网口)
engine-setup

5.安装node:
(1)yum -y localinstall http://plain.resources.ovirt.org/pub/yum-repo/ovirt-release35.rpm

(2)修改/etc/sysconfig/iptables:
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [10765:598664]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT 
-A INPUT -p icmp -j ACCEPT 
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp --dport 22 -j ACCEPT
-A INPUT -p tcp --dport 16514 -j ACCEPT
-A INPUT -p tcp --dport 54321 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 5634:6166 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 49152:49216 -j ACCEPT  
-A INPUT -p tcp -m state --state NEW  
-A INPUT -j REJECT --reject-with icmp-host-prohibited 
-A FORWARD -m physdev ! --physdev-is-bridged -j REJECT --reject-with icmp-host-prohibited 
COMMIT

(3)修改参数

/etc/selinux/config SELINUX=disabled

chkconfig iptables on
service iptables restart


(4)yum -y install tar


(5)服务端node安装NFS:
yum -y install nfs-utils portmap
nfs-utils包提供了NFS服务器程序和相应的管理工具。
protmap是一个管理RPC连接的程序,portmap服务对NFS是必须的,因为它是NFS的动态端口分配守护进程,如果portmap不启动,NFS就是启动不了的。

配置NFS服务端,编辑/etc/exports文件(Remember that the NFS server must have user 36 (vdsm) and group 36 (kvm)and they must own the directory you're exporting.):

mkdir -p /export/iso /export/data /export/import_export
vi /etc/exports
/export/iso *(rw,sync,no_subtree_check,all_squash,anonuid=36,anongid=36) 
/export/data *(rw,sync,no_subtree_check,all_squash,anonuid=36,anongid=36) 
/export/import_export *(rw,sync,no_subtree_check,all_squash,anonuid=36,anongid=36)

service rpcbind start
service nfs start

修改nfs运行级别,使nfs开机自启:chkconfig --level 2345 nfs on
另:chkconfig小知识:
  chkconfig --list name  列出指定服务的运行级别情况
  chkconfig--add name  增加一个服务
  chkconfig --del name  删除一个服务
  chkconfig   [--level <levels>]  <name>  <on|off|reset>  更改/重设指定服务的运行级别
  我们输入chkconfig --level 345 nfs on,即可使NFS服务在运行级别3、4、5上自动运行。
 

6.node连接engine
(1)界面上连接之后修改node中nfs共享所属用户:
chown 36:36 /export/iso /export/data /export/import_export

7.上传镜像
实在不行就scp过去(http://comments.gmane.org/gmane.comp.emulators.ovirt.user/7821):
Just take the iso image and scp it directly to the iso domain the dir for iso images looks similar to this
...your_iso_domain_dir/ddd00568-fc55-4bd5-9a57-62f3acdebf95/images/11111111-1111-1111-1111-111111111111

完了之后一定不要忘了修改所属用户(after copying run ):

chown vdsm:kvm on the uploaded iso image.



execution failed. Exception: IRSNoMasterDomainException: IRSGenericException: IRSErrorException: IRSNoMasterDomainException: Cannot find master domain:



断掉之后再重启,要选择node的configure host has been rebooted


8.创建虚拟机
安装虚拟机之前要在edit和network interfaces两个地方添加网卡才可以有eth0,在network interfaces中添加的网卡驱动不能是virtio类型的


9.安装guest agent
yum install epel-release
yum install ovirt-guest-agent
service ovirt-guest-agent start
chkconfig --level 2345 ovirt-guest-agent on


10.在虚拟机中使用virsh命令认证不通过时,可以先改用户名密码
saslpasswd2 -a libvirt root


另:node和engine断了之后的操作
1.重启node
2.Confirm "Host has been Rebooted"
3.将node Maintenance
4.reinstall node
5.重启虚机

你可能感兴趣的:(nfs,nested,Ovirt,virtualizatio)