Ovirt环境部署手册

Ovirt环境部署手册

目录

1系统环境:

2安装 oVirt

3安装前准备

4安装 oVirt Engine

5节点的安装

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

  1. 所有更新安装完毕后重启服务器

  2. 安装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

解决:

[root@ovirt-code ~]# 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

  1. [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代码失败,它只能在本地解决

       安装程序可以自动配置此系统上的防火墙。

       注意:防火墙的自动配置可能会覆盖当前设置。

       您要安装程序配置防火墙吗? (是,否)[是]:
  1.      The following firewall managers were detected on this system: iptables
    
       Firewall manager to configure (iptables):
    

在此系统上检测到以下防火墙管理员:iptables

       防火墙管理器配置(iptables):iptables
  1. Where is the Engine database located? (Local, Remote) [Local]:

Engine数据库位于哪里? (本地,远程)[本地]:

  1.      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并创建引擎数据库,还是更喜欢手动执行? (自动,手动)[自动]:
  1. Application mode (Both, Virt, Gluster) [Both]:

应用模式(两者,Virt,Gluster)[Both]:

  1. Engine admin password:root

引擎管理员密码:root

Confirm engine admin password:

确认密码:root

  1. [WARNING] Password is weak: it is too short

       Use weak password? (Yes, No) [No]:
    

[警告]密码很弱:太短

       使用弱密码? (是,否)[否]:
  1. Organization name for certificate [Test]:

证书的组织名称[测试]:

  1.      --== 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。
    
         你希望安装程序配置,还是更喜欢手动执行? (自动,手动)[自动]:
    
  1.      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服务器的默认页面? (是,否)[是]:
  1. Configure WebSocket Proxy on this machine? (Yes, No) [Yes]:

在本机上配置WebSocket代理? (是,否)[是]:

  1. Configure an NFS share on this server to be used as an ISO Domain? (Yes, No) [Yes]:

在此服务器上配置NFS共享以用作ISO域? (是,否)[是]:

  1. Local ISO domain path [/var/lib/exports/iso]:

本地ISO域路径[/ var / lib / exports / iso]:

  1. Local ISO domain ACL [0.0.0.0/0.0.0.0(rw)]:

本地ISO域ACL [0.0.0.0/0.0.0.0(rw)]:

  1. 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。

       你想要安装程序继续,内存量少于推荐量吗? (是,否)[否]:

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

spacer.gif

显示安装成功:

下面进行测试:

看到以下界面成功了一半:

spacer.gif

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页面端添加主机

spacer.gif

等待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 [root@ovirt-code rh]# cat /etc/exports

原因是因为nfs需要挂载的目录权限不对 Vdsm 权限代码为 36

解决方法:

chown -R 36.36 需要挂载的目录,例如/NFS/iso

即可重新挂载成功

spacer.gif

三.镜像文件

拷贝到engine主机的该目录下

spacer.gif

数据域:数据域包含数据中心内所有虚拟机和模板的虚拟硬盘和OVF文件,不能跨数据中心共享。多个类型的数据域(iSCSI,NFS,FC,POSIX和Gluster)可以添加到同一个数据中心,只要它们是共享的而不是本地域。

重要说明:您必须拥有一台状态为“ Up并且已将数据域附加到数据中心”的主机,然后才能附加ISO域和导出域。

ISO域: ISO域存储用于为虚拟机安装和引导操作系统和应用程序的ISO文件(或逻辑CD),并可以跨不同的数据中心共享。ISO域去除了数据中心对物理介质的需求。ISO域只能是基于NFS的。只有一个ISO域可以添加到数据中心。

导出域:导出域是临时存储库,用于在数据中心和oVirt环境之间复制和移动图像。导出域可用于备份虚拟机。导出域可以在数据中心之间移动,但是一次只能在一个数据中心中激活。导出域只能是基于NFS的。只有一个导出域可以添加到数据中心。

操作如下:

spacer.gif

导入ISO文件到ISO域

具体操作如下:

[root@ovirt-engine 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’.

[root@ovirt-engine 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 admin@internal oVirt Engine user (CTRL+D to abort):

Uploading, please wait…

[root@ovirt-engine 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 admin@internal oVirt Engine user (CTRL+D to abort):

Uploading, please wait…

ERROR: mount.nfs: Connection timed out

解决方法:

关闭node节点防火墙 更改/etc/exports文件

如下:

[root@ovirt-node /]# 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

完成之后显示如下

添加虚拟机,等操作参考

本文转自 Barron1 51CTO博客,原文链接:http://blog.51cto.com/13172370/1980375,如需转载请自行联系原作者

相关资源:oVirt-KVM云平台部署实战_ovirt部署云桌面,ovirt桌面云-Java文档…

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值