开源虚拟化管理平台Ovirt简介和配置环境搭建


一Ovirt简介

Ovirt是什么?

Ovirt是一个开源的虚拟化管理平台,是redhat 虚拟化管理平台RHEV的开源版本。

Ovirt的构架是什么样的?

Ovirt由两部分组成,

客户端ovirt-node 类似于vmware esxi,是由fedaro 16订制而成。也可以在linux系统上安装vdsm服务而得到一个ovirt客户端。

管理端overt-engine 类似于 vmware vcenter,但是是基于web页面的。

Ovirt能做什么,不能做什么?

Ovirt现在已有的功能:

1. 对宿主机节点的管理,支持基于数据中心,集群的管理,比较有特色的一个功能是可以管理ilo idarc等硬件管理卡;

2. 对虚拟机的管理,可以完成虚拟机的创建、快照、删除、基于模版的克隆等常见操作;

3. 迁移,在线及离线迁移虚拟机;

4. 高可用,当一台宿主机宕机,在另外一台宿主机上自动开启虚机;

5. 宿主机、虚拟机性能查看及统计;

6. 支持nfs,iscsi,fc等存储方式;

7. 支持多端口的网口绑定;

8. 提供一个命令行,可以完成图形界面的大部分功能;

9. 活动目录集成;

10. 提供python api接口,可以api编程;

11. 没有授权限制;

和vmware相比,目前没有的功能:

1. 稳定目前较差,经常出现崩溃,连接出现问题;

2. 易用性较差,设计不人性化;

3. 没有cpu 内存很精细的调节限制功能;

4. 没有FT(Fault Tolerance)功能;

5. 宿主机、虚拟机性能查看及统计功能很简单,远没有vmware丰富;

6. 不支持分布式交换机;

二 Ovirt测试环境的搭建

本次测试环境:

硬件环境

Ovirt Node 1 Dell r610

CPU E5645 2颗(2.4G 6核)

内存 48G

硬盘 300G*2 raid 1

Ovirt Node 2 HP 380G7

CPU E5620 2颗(2.4G 4核)

内存 8G

硬盘 146G*4 raid 10

Ovirt engine vmware虚拟机

CPU 2颗2.4G

内存 4G

硬盘 255G

软件环境

Ovirt Node 1 安装f16 更新最新软件包,然后安装vdsm软件包

Ovirt Node 2 安装f16订制的ovirt-node-image 2.2.2版本

Ovirt engine 安装f16更新最新软件包,然后安装ovirt engine软件包

Ovirt配置

注意事项:因为ovirt的程序调用是用全局域名FQDN,因此应该保证每台测试机器的机器名能被解析,需要配置dns,或者确保/etc/hosts文件内容一致。

1 ovirt-engine 安装

1) 先将系统升级到最新

yum –y update

2) 下载ovirt的yum配置文件

wget http://ovirt.org/releases/stable/ovirt-engine.repo -O /etc/yum.repos.d/ovirtengine.repo
 
3) 如果安装了classpathx-jaf组件,删除,因为会和ovirt使用的jboss冲突yum remove classpathx-jaf

 

4) 通过yum命令安装ovirt-engine

yum install overt-engine

5) 通过engine-setup 配置,会启动一个向导,按照提示操作

engine-setup

[root@ovirt yum.repos.d]# engine-setup

Welcome to oVirt Engine setup utility

HTTP Port [8080] :

HTTPS Port [8443] :

Host fully qualified domain name, note that this name should be fully resolvable [ovirt.engine] :

ovirt.engine did not resolve into an IP address

User input failed validation, do you still wish to use it? (yes|no): yes

Password for Administrator (admin@internal) :

Confirm password :

Database password (required for secure authentication with the locally created d atabase) :

Confirm password :

Organization Name for the Certificate: ovirttest

The default storage type you will be using ['NFS'| 'FC'| 'ISCSI'] [NFS] :

Should the installer configure NFS share on this server to be used as an ISO Dom ain? ['yes'| 'no'] [yes] :

Mount point path: /nfsios

Display name for the ISO Domain: iso

Firewall ports need to be opened.

You can let the installer configure iptables automatically overriding the curren t configuration. The old configuration will be backed up.

Alternately you can configure the firewall later using an example iptables file found under /usr/share/ovirt-engine/conf/iptables.example

Configure iptables ? ['yes'| 'no']: yes

oVirt Engine will be installed using the following configuration:

=================================================================

http-port: 8080

https-port: 8443

host-fqdn: ovirt.engine

auth-pass: ********

db-pass: ********

org-name: ovirttest

default-dc-type: NFS

nfs-mp: /nfsios

iso-domain-name: iso

override-iptables: yes

Proceed with the configuration listed above? (yes|no): yes

Installing:

Configuring oVirt-engine... [ DONE ]

Creating CA... [ DONE ]

Editing JBoss Configuration... [ DONE ]

Setting Database Security... [ DONE ]

Creating Database... [ DONE ]

Updating the Default Data Center Storage Type... [ DONE ]

Editing oVirt Engine Configuration... [ DONE ]

Configuring the Default ISO Domain... [ DONE ]

Configuring Firewall (iptables)... [ DONE ]

Starting JBoss Service... [ DONE ]

**** Installation completed successfully ******

(Please allow oVirt Engine a few moments to start up.....)

Additional information:

* There is less than 4 GB available free memory on the Host.

It is recommended to have at least 4 GB available memory to run the RHEV Manage r.

* SSL Certificate fingerprint: 0F:C8:10:80:CC:D6:09:51:B7:85:62:50:60:46:61:B5: 22:7D:17:ED

* SSH Public key fingerprint: 57:5b:03:c4:e8:cd:48:b4:2f:72:16:83:16:fa:79:ad

* A default ISO share has been created on this host.

If IP based access restrictions are required, please edit /nfsios entry in /e tc/exports

* The firewall has been updated, the old iptables configuration file was saved to /usr/share/ovirt-engine/conf/iptables.backup.102859-02162012_26054

* The installation log file is available at: /var/log/ovirt-engine/engine-setup _2012_02_16_10_26_24.log

* Please use the user "admin" and password specified in order to login into oVi rt Engine

* To configure additional users, first configure authentication domains using t he 'engine-manage-domains' utility

* To access oVirt Engine please go to the following URL: http://ovirt.engine:80 80

[root@ovirt yum.repos.d]#

6) 安装spice

yum install spice* -y

安装完成后,在浏览器里输入http://ip:8080,就可以访问ovirt-engine
 
2 ovirt-node 安装
 
从http://ovirt.org/releases/stable/binary/ovirt-node-image-2.2.2-2.2.fc16.iso 下载ovirt-node-image的iso文件,刻录光盘启动安装。

 

clip_image002[1]

直接回车

clip_image004[1]

 

clip_image006[1]

 

 

clip_image008[1]

安装完成,重启后界面如下:

clip_image010[1]

设置网络

clip_image012[1]

开启ssh

clip_image014[1]

在这里输入engine服务器的ip和管理员密码,将ovirt-node添加到engine中

clip_image016[1]

 

有时候重启后会出现如下的情况,等待约10分钟后会正常启动起来

clip_image018[1]

 

3 ovirt-vdsm在f16上的 安装

1) 安装f16,并升级到最新,

Yum –y update

2) 安装kvm libvirt 等虚拟化组件,并编辑一个桥,用于ovirt的管理

vim /etc/sysconfig/network-scripts/ifcfg-ovirtmgmt:

DEVICE=ovirtmgmt

TYPE=Bridge

ONBOOT=yes

DELAY=0

BOOTPROTO=static

IPADDR=192.168.1.110

NETMASK=255.255.255.0

GATEWAY=192.168.1.1

vim /etc/sysconfig/network-scripts/ifcfg-em1:

DEVICE=em1

ONBOOT=yes

BRIDGE=ovirtmgmt

3) 停止网络管理服务

systemctl stop NetworkManager.service

systemctl disable NetworkManager.service

4) 下载ovirt yum配置文件,并安装vdsmd服务

wget http://www.ovirt.org/releases/nightly/fedora/16/ovirt-engine.repo -P /etc/yum.repos.d/

yum install -y vdsm vdsm-cli

5) 在engine中添加安装的节点

clip_image020[1]

clip_image022[1]

clip_image024[1]

 

4 虚拟机创建

点击 New Server创建虚拟机

clip_image026[1]clip_image028[1]clip_image030[1]clip_image032[1]clip_image034[1]

5 存储管理

在Storage菜单,点击New Domain添加新的村吃

clip_image036[1]clip_image038[1]

支持nfs iscsi fc存储模式的添加

添加成功后,可以给虚拟机添加磁盘

clip_image040[1]

6 网络管理

在host菜单--点击宿主机—logical network,可以配置宿主机的网络

clip_image042[1]

点击物理网卡,配置逻辑网络,

clip_image044[1]

clip_image046[1]

clip_image048[1]

完成后,可以在虚拟机里面配置虚拟机的网络

clip_image050[1]

虚拟机创建,添加好网络,存储设备后,就可以想普通机器一样的安装了。

7 高可用

设置高可用,运行虚拟机在任何host上运行

clip_image052[1]

开启高可用

clip_image054[1]

开启虚拟机,并一直ping

clip_image056[1]

关掉虚拟机的host

clip_image058[1]

可以看到虚拟机又在另外一台host上重新重启起来了

clip_image060[1]

8 在线迁移

迁移很简单,点击迁移菜单就可以完成。

clip_image062[1]clip_image064[1]clip_image066[1]clip_image068[1]

9命令行的使用

1) 下载并安装相应的组件

http://www.ovirt.org/releases/nightly/fedora/16/ovirt-engine-sdk-1.5-1.fc16.noarch.rpm

http://www.ovirt.org/releases/nightly/fedora/16/ovirt-engine-cli-2.0-1.fc16.noarch.rpm2)

启动命令行,使用命令ovirt-shell

 

clip_image070[1]

摘自 xiaoli110的博客

相关内容

    暂无相关文章