Ovirt4.3简易搭建

一、准备工作:
准备两台机器一台oVirt Engine管理节点
一台oVirt iNode计算节点
给oVirt Engine虚拟机4G内存
inode节点四个处理器2G内存
oVirt Engine可以使用克隆机器
oVirt inode可以不可以使用克隆机器需要重新装一台Centos7。
1、修改主机名
[[email protected] ~]# hostname Virt
[[email protected] ~]# bash
[[email protected] ~]# vim /etc/hostname
Ovirt4.3简易搭建

2、配置Centos7网络环境可以ping通www.baidu.com
使用VMnet8
[[email protected] ~]# vim /etc/sysconfig/network-scripts/ifcfg-eno16777736
Ovirt4.3简易搭建
[[email protected] ~]# /etc/init.d/network restart
3、更换阿里云yum源,先将已有的repo文件移动到bak目录下
[[email protected] ~]# yum install wget -y
[[email protected] ~]# cd /etc/yum.repos.d/
[[email protected] yum.repos.d]# ls
[[email protected] yum.repos.d]# mv abc.repo bak/(根据自身情况)
[[email protected] yum.repos.d]# mv CentOS-* bak/
[[email protected] yum.repos.d]# wget http://mirrors.aliyun.com/repo/Centos-7.repo
4、关闭主机防火墙
[[email protected] ~]# systemctl stop firewalld
[[email protected] ~]# systemctl disable firewalld
二、安装oVirt引擎包
1、在开始安装oVirt之前,添加官方存储库:
[[email protected] ~]# yum install http://resources.ovirt.org/pub/yum-repo/ovirt-release43.rpm
[[email protected] ~]# yum update
[[email protected] ~]# yum install ovirt-engine
[[email protected] ~]# engine-setup
Configure Engine on this host (Yes, No) [Yes]:yes

Configure Image I/O Proxy on this host? (Yes, No) [Yes]:yes

Configure WebSocket Proxy on this machine? (Yes, No) [Yes]: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]:yes

Configure VM Console Proxy on this host (Yes, No) [Yes]:yes

Configure ovirt-provider-ovn (Yes, No) [Yes]:yes

Host fully qualified DNS name of this server [autodetected host name]:Virt

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]:yes

Where is the DWH database located? (Local, Remote) [Local]: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]:Automatic

Where is the Engine database located? (Local, Remote) [Local]: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]:Automatic

Engine admin password:[email protected]#
Confirm engine admin password:[email protected]#

Application mode (Both, Virt, Gluster) [Both]:Both

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 web page of the server? (Yes, No) [Yes]: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]:Automatic

Please choose Data Warehouse sampling scale:
(1) Basic
(2) Full
(1, 2)[1]:1

Please confirm installation settings (OK, Cancel) [OK]:OK

三、修改host文件
[[email protected] ~]# vim /etc/hosts
Ovirt4.3简易搭建

本机hosts文件
Ovirt4.3简易搭建

此时便可以访问ovirt管理页面
Ovirt4.3简易搭建
此时已经成功一半
四、配置oVirt inode
Ovirt Node支持两种部署方式,可由普通Linux系统安装VDSM和KVM服务组建Node节点,也可以在服务器之间安装oVirt Node定制的Linux操作系统。本次部署采用由普通Linux系统部署服务的方法。
1、准备工作
修改主机名
[[email protected] ~]# hostname inode
[[email protected] ~]# bash
[[email protected] ~]# vim /etc/hostname
Ovirt4.3简易搭建
配置hosts文件
[[email protected] ~]# vim /etc/hosts
Ovirt4.3简易搭建
修改本地hosts文件
Ovirt4.3简易搭建
192.168.218.131 inode
2、配置网络环境
更换yum源(具体步骤参照oVirt Engine)
关闭防火墙
selinux改为permissive
[[email protected] ~]# vim /etc/selinux/config
Ovirt4.3简易搭建

3、在开始安装inode之前,同样添加官方存储库:
[[email protected] ~]# yum install http://resources.ovirt.org/pub/yum-repo/ovirt-release43.rpm
[[email protected] ~]# yum -y install vdsm
五、安装节点主机
访问ovirt页面登录用户名使用admin
密码是安装Engine时设置的密码我这里是[email protected]#
Ovirt4.3简易搭建
添加数据中心
Ovirt4.3简易搭建
根据提示
名称根据自己喜好填写
描述、注释可以不写不影响实验
Ovirt4.3简易搭建
点击确定配置集群
点击配置集群
Ovirt4.3简易搭建
描述、注释可不写
CPU架构我这里是X86_64
其他可参照图示Ovirt4.3简易搭建
配置主机Ovirt4.3简易搭建
进入计算->主机选项安装主机大概需要20~30分钟左右。
总结报错原因:
一、没有关闭防火墙,更改selinux。
二、本地host文件没有写正确。
Ovirt4.3简易搭建

名称可凭自己喜好填写
Hostname是自己inode节点地址
密码是inode节点主机的root用户密码

配置完数据中心是不会上线的,需要接下来配置存储域

六、添加存储域
配置NFS存储
[[email protected] ~]# mkdir -pv /export/iso
该目录用于存放系统镜像
[[email protected] ~]# mkdir -pv /export/data
该目录用于存放虚拟机数据
[[email protected] ~]# chown 36:36 -R /export/
赋予VDSM权限
[[email protected] ~]# chmod 0755 -R /export/
赋予执行权限
[[email protected] ~]# vim /etc/exports
[[email protected] ~]# cat /etc/exportsOvirt4.3简易搭建
[[email protected] ~]# systemctl start nfs.service
启动nfs服务
[[email protected] ~]# systemctl enable nfs.service
设置nfs服务开机自启

ovirt管理界面新建存储域
这个域用于存放镜像
Ovirt4.3简易搭建

这个域用于存放虚拟机数据
Ovirt4.3简易搭建

注意导出路径是inode节点的赋予VDSM的那个目录
然后点击确定
此时数据中心不出意外状态会变为UP
Ovirt4.3简易搭建

八、上传镜像文件
ovirt管理页面找到磁盘
然后右上角新建
先添加一个5G大小的磁盘
Ovirt4.3简易搭建

然后右上角找到上传,我这里将Winxp镜像上传
Ovirt4.3简易搭建

上传之前确保ovirt-imageio-proxy服务正确配置,如果配置不正确的话请重启ovirt-engine服务
重启虚拟机或者重启本机,解决该问题,上传成功之后
Ovirt4.3简易搭建

状态会显示为OK
九、创建虚拟机
Ovirt4.3简易搭建

实例镜像指定之前创建5G大小的磁盘
windows下磁盘接口更改为IDE
Ovirt4.3简易搭建

添加两个VM网络接口

引导选项第一个设备为CD-ROM
附加CD打对勾启用引导菜单,然后点击确定
等带虚拟机添加之后便可以开启。
十、安装控制台
控制台设置如下
Ovirt4.3简易搭建

点击控制台客户端资源
进入这个链接
Ovirt4.3简易搭建

下载这个工具
Ovirt4.3简易搭建

安装之后点击
Ovirt4.3简易搭建

便会下载.vv文件使用刚才安装好的软件打开
Ovirt4.3简易搭建

便会到此界面,此时表明虚拟机已经创建成功。

Ovirt4.3简易搭建