Chinaunix首页 | 论坛 | 博客
  • 博客访问: 32576
  • 博文数量: 8
  • 博客积分: 357
  • 博客等级: 一等列兵
  • 技术积分: 110
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-12 13:27
个人简介

IT老人

文章分类

全部博文(8)

文章存档

2017年(1)

2010年(7)

我的朋友

分类: LINUX

2010-06-18 15:38:01

虚拟化是将具有强大处理能力的X86计算机上的硬件资源(包括CPU\RAM\硬盘和网络控制器),以创建功能齐全、可像真实计算机一样运行其自身操作系统和应用程序的虚拟机,因而得以在多个环境间共享这一台计算机的资源。不同虚拟机可以在同一台物理机上运行不能的操作系统以及多个应用程序。

在未来,通过虚拟数据中心操作系统可以跨数百台互连的物理机和存储设备进行扩展,从而形成一个完整的虚拟基础架构。无需为每个应用程序永久地分配服务器、存储空间或网络带宽。相反,硬件资源会在需要时动态分配到所需的位置,形成内部云计算机环境。这就意味着优先级最高的应用程序总是能得到其所需的资源,因而无需浪费资金去置办仅在高峰时需要的多余资源。内部云计算机环境可以连接到外部云计算环境,从而为企业提供了茁壮成长所需的灵活性、可用性和可扩展性。

结合目前的研发需要、测试需要、网络策略、工作流程等多方面原因,考虑使用虚拟化软件可以从以下几个方面提高工作效率:

1.  提高现有资源利用程度:通过服务器整合,把共用的基础架构资源聚合在池中,使用虚拟化技术打破原有的“一台服务器一个应用程序”模式

2.  通过减少物理基础架构降低数据中心成本:由于服务器及相关硬件更少,因此减少了占地空间,同时减少电力和制冷需求。

3.  提高硬件和应用程序的可用性,进而提高业务的连续性:可以安全备份和迁移整个虚拟环境而不会出现服务中断。消除计划内停机,并可从计划外故障中立即恢复

4.  实现运营灵活性:采用动态资源管理、加快服务器部署并改进桌面和应用程序部署,因此可响应市场的变化

5.  提高桌面的可管理性和安全性:几乎可在所有标准台式机、笔记本电脑或是TabletPC上部署、管理和监视桌面环境,无论是否能连接到网络,用户都可以在本地或以远程方式对这种环境进行访问

 

目前XenVMware是市场上主流的两大虚拟化产品。这两个产品背后的架构区别将带来不同的应用体验。

Vmwarej是业内著名的虚拟机产品,主打产品是VI3Vmware Infrastructure3)软件套装。VI3以杰出的管理能力,受到广大数据中心的青睐

Vmware中,最核心的软件是ESX Server.ESX Server直接安装在裸机上,在硬件和操作系统之间形成一个虚拟层。ESX Server将一台物理服务器划分为多个可移植的虚拟机环境。ESX的虚拟层级实际上包裹了硬件,ESX创建一个硬件接口层,所有虚拟机如果想跟硬件通信,必须经过这个硬件接口层,完成诸如内存偏移转换的工作。这里要强调的是,ESX是完全包裹硬件,不允许程序直接访问硬件

ESX只是Vmware最基础的技术,VI3中其余工具,用于完善虚拟化和可视化管理。其中DRSDistributed Resourced Scheduler)可以将多个ESX Server资源合并为群集,同时按照假定所有资源都在一台主机上的方法简单管理群集。Virtual SMP可以让单个虚拟机同时使用多个处理器。Vmware Vmotion可以使虚拟机从一台物理服务器迁移到另一台物理服务器,迁移过程中不用宕机。此外,它也提供虚拟的双机热务和集成备份等功能。最后,所有虚拟化复杂的管理,都可以由Virtual Center虚拟中心控制台完成

Xen VMM(Virtual Machine Monitor)它能够让我们创建更多虚拟机,每个虚拟机都是运行在同一个操作系统上的实例

这些客户OS可以是修补过的Linux 2.42.6内核,也可以是修补过的NetBSD/FreeBSD内核。

用户应用程序就运行在这些客户OS上,并不需要修改任何代码。但是,随着将来的处理器能支持虚拟化的特性,内核也就不需要打补丁了。比如IntelVTAMDPacifica处理器都将包括这种功能。

Xen中, “系统管理程序”运行在0环,客户OS运行在1环,应用程序运行在3环。这种关系对于x64有一点不同,就是客户内核和应用程序都运行在3环上。

Xen自称为"系统管理程序",是因为它比客户OS所需的系统管理代码运行的特权级还高。当系统引导的时候,Xen装载到0环的内存中。它在1环上启动修补过的内核,称做domain 0(domain是指一个运行中的虚拟机,在其上有一个guest OS在执行)。从这个domain开始,可以创建更多的domain,也可以销毁它们,还可以进行domain迁移、设置参数等。系统创建的那些domain也运行在1环内核中,用户应用程序运行在3环。

目前,修补过的Linux 2.42.6内核可以作为domain0。据Xen开发者所说,将来domain0仅支持2.6的内核补丁。构造domain0的大部分工作是在xen/arch/x86/domain_build.c中的construct_dom0()方法中实现的。物理设备驱动程序只能运行在特权级,也就是domain 0上。Xen依靠Linux或其他修补过的OS内核对它所管理的设备提供虚拟化支持。这样的好处就是Xen的开发者不必再去开发设备驱动程序。在一个有标签TLB的处理器上使用Xen能够大大提高性能。标签TLB能够把ASID(Address Space Identifier)放在TLB入口处。有了这个特性,当处理器在系统管理程序和客户OS之间切换时就不需要刷新TLB了,这大大减少了系统开销。

分析目前项目的研发测试需求,从现有的主流虚拟化软件中选择了ORACLE VM,主要从以下几点考虑:

1.   ORACLE VM采用典型的软件免费,服务收费的模式。ORACLE VM分为ServerManager两部分。ORACLE VM Server中的所有包都开放源代码,源代码和二进制ISO映像都可以在Oracle Edelivery网站下载。Oracle VM Manager基于Oracle ADF,Oracle Database XE,OC4J等开发,不开放源代码。两者都可以免费使用,但是要获得Oracle支持,必须购买服务

2.   Oracle VM Server基于Xen开源项目。

3.   Oracle VM Server可以独立运行。Oracle的企业级软件(DBFusion MiddlewareEBS)都将在该平台认证,并且会成为Oracle软件的唯一认证的虚拟化平台。也就是说,要在虚拟化平台使用认证的Oracle软件,就要使用Oracle VM

4.   下一版本的Oracle 企业管理软件(EM, Enterprise Manager)将包含对Oracle VM的支持。

5.   Oracle VM性能是其他服务器虚拟产品的三倍,但是价格却不到三分之一。

 

在研发环境中的实现

目前在研发环境中使用三台服务器和一台存储集群搭建ORACLE VM虚拟环境。

 

IBM3500 //Oracle VM Server20    ip addre:192.168.51.119

IBM3550 M2  //Oracle VM Server10    ip addre: 192.168.51.10

IBM3550 M2  //Oracle VM Manager     ip addre: 192.168.51.5

IPSAN AMAi3008  //存储集群          ip addre: 192.168.51.90

 

192.168.51.90划分多个存储空间供虚拟机使用

192.168.51.10安装Oracle VM Server 并创建虚拟机存储池HSP01

192.168.51.119安装Oracle VM Server 并创建虚拟机存储池HSP02

192.168.51.5安装Oracle VM Manager管理、监控、调配两个存储池HSP01/HSP02的硬件资源

 

1.安装前的准备

l  下载ORACLE VMORACLE VM Server ORACLE VM Manager)我们对3550选择的是64位的安装包。

l  硬件需求

准备一台末装操作系统的计算机用于安装ORACLE VM Server

准备一台Linux4 Update5Linux5安装ORACLE VM Manager

l  下载并安装VNC Client

适用于LinuxVNC

 

2.ORACLE VM Server安装

设置光盘启动,插入光盘,按照系统提示,使用默认设置安装ORACLE VM Server就可以了。在此略过

NODE:至强5500系列仅有ORACLE VM2.2及以后的版本支持(以下例子均在IBM3550 M2上验证通过)

 

3.ORACLE VM Manager安装

安装Manager之前请确认以下几件事情:

1.  硬件需求

Items                            Minimum Value

Memory                           2GB

Processor Speed                  1.83GHz * 1

Swap Space                       2GB

Hard Disk Space                  4GB

2.  系统未安装JDK,Apache

3.  TCP端口888888994443未被占用

4.  操作系统需求

Oracle Enterprise Linux4 update5 or later

Red Hat Enterprise Linux Release4 or later

5.  浏览器需求:

Firefox 1.5 or later

Internet Explorer6 or later

 

(1).安装流程

1.  安装linux操作系统,为根分区分配10G以上分区

2.  运行光盘中的runInstaller.sh

Please enter the choice: [1|2|3]

1. Install Oracle VM Manager

2. Uninstall Oracle VM Manager

3. Upgrade Oracle VM Manager

3.  1继续,删除并安装一个新的ORACLE EX database

Do you want to install a new database or use an existing one? [1|2]

              1. Install a new Oracle XE database on localhost

              2. Use an existing Oracle database in my network

4.  安装过程采用一问一答的方式,可根据实际情况安装。在此不就一一叙述

Prepare to install the Oracle XE database ...

Checking the supported platforms ... Done

 

Checking the prerequisite packages are installed ... Done

 

Checking the available disk space ... Done

 

Installing the oracle-xe-univ package (rpm) now ...

 Done

 

 

Oracle Database 10g Express Edition Configuration

-------------------------------------------------

This will configure on-boot properties of Oracle Database 10g Express

Edition.  The following questions will determine whether the database should

be starting upon system boot, the ports it will use, and the passwords that

will be used for database accounts.  Press to accept the defaults.

Ctrl-C will abort.

 

Specify the HTTP port that will be used for Oracle Application Express [8080]:

 

Specify a port that will be used for the database listener [1521]:

 

Specify a password to be used for database accounts.  Note that the same

password will be used for SYS and SYSTEM.  Oracle recommends the use of

different passwords for each database account.  This can be done after

initial configuration:

Confirm the password:

 

Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]:

 

Starting Oracle Net Listener...Done

Configuring Database...Done

Starting Oracle Database 10g Express Edition Instance...Done

Installation Completed Successfully.

To access the Database Home Page go to ""

 

Checking the availability of the database ...

 

Set default database schema to 'OVS'.

Please enter the password for account 'OVS':

Confirm the password:

 

Creating the Oracle VM Manager database schema ...Done

 

Installing the ovs-manager package (rpm) ...

Done

 

Installing the oc4j package (rpm) ...

Done

 

Please enter the password for account 'oc4jadmin':

Confirm the password:

 

Starting OC4J ... Done.

To access the OC4J Home Page and change the password go to

 

Deploying Oracle VM Manager application to OC4J container.

Creating connection pool ... Done

Creating data source ... Done

Deploying application help ... Done

Deploying application ... Done

 

Please enter the keystore password for the Web Service:

Confirm the password:

 

Setting keystore password for Web Service ... Done

Do you want to use HTTPS access for Oracle VM Manager (Y|n)?y 

 

Configuring OC4J to use HTTPS ... Done

Stopping OC4J ... Done

Starting OC4J ... Done

 

Please enter the password for the default account 'admin':

Confirm the password:

 

Configuring SMTP server ...

Please enter the outgoing SMTP mail server(e.g. - mail.abc.com, mail.abc.com:25): hisun.hisunsray.com

Mail server checking, may need some time, please wait ...

Mail server 'hisun.hisunsray.com' check failed, enter Y to change the name and retry or N to keep hostname and continue(Y|n)?n

Setting the SMTP server to hisun.hisunsray.com ...

Done

 

Please enter an e-mail address for account 'admin': zhangchao@hisunsray.com

Confirm the e-mail address : zhangchao@hisunsray.com

Unable to send an email to 'zhangchao@hisunsray.com', would you like to change the email address(Y|n)?n

Updating e-mail address for account 'admin' to 'zhangchao@hisunsray.com' ...

Done

 

The console feature is not enabled by default.

For detailed setup, refer to Oracle VM Manager User's Guide

 

Installation of Oracle VM Manager completed successfully.

 

To access the Oracle VM Manager 2.2 home page go to:

 

 

To access the Oracle VM Manager web services WSDL page go to:

  WS/LifecycleService.wsdl

  WS/ResourceService.wsdl

  WS/PluginService.wsdl

  WS/ServerPoolService.wsdl

  WS/VirtualMachineService.wsdl

  WS/AdminService.wsdl

 

To access the Oracle VM Manager help page go to:

 

5.  安装完成后重启,打开filefox在地址栏中输入

如果打开SSL支持使用

Username:admin

Password:oracle //安装时设定的密码,本例使用oracle

6.  首次登录时需求先创建Server Pool,点击Next

7.  录入Server Pool信息点击Add -> Next

8.  录入用户信息点击Next(注意Server Name 应该填写主机名,不能是数字的IP地址,否则创建时会报错)

9.  打开Resource TABLE页,在ISO Files链接里添加ISO资源

10. 打开Virtual Machines TABLE页,创建超虚拟机(根据需要,按照下图流程虚拟机)

 

4.创建超虚拟化机之前的准备

NFS环境搭建及相关软件准备

1.   root身份连接到ORACLE VM Server。在以root身份连接到ORACLE VM Server后,将连接到dom0

2.   ORACLE VM Server的安装将创建一个/OVS目录。验证该目录是否存在

[root@vmserver01 ~]# ls –al /OVS

3.   查看目录/OVS/running_pool /OVS/iso_pool是否存在,如果不存在就创建它们

[root@vmserver01 ~]# ls –al /OVS/running_pool

[root@vmserver01 ~]# ls –al /OVS/iso_pool

目录running_pool将包含虚拟机。目录iso_pool将包含ISO文件

4.   创建目录/media/iso/el/EL5-x86。目录/media/iso将用作ISO文件的挂载点。目录/el/EL5-x86将包含操作系统安装软件,并将导出至虚拟机

[root@vmserver01 ~]# mkdir /media/iso

[root@vmserver01 ~]# mkdir –p /el/EL5-x86

5.   将得到的ISO文件放到/OVS/iso_pool

6.   挂载ISO文件

Mount –t iso9660 –o ro,loop /OVS/iso_pool/ubuntu-9.10-desktop-i386.iso /el/EL5-x86

7.   确保与NFS相关的服务已启动

[root@vmserver01 ~]# service portmap start

[root@vmserver01 ~]# service nfs start

8.   导出挂载点以使其可用于domU.以下第一条命令将导出目录。第二条和第三条命令验证导出

[root@vmserver01 ~]# exportfs *:/el/EL5-x86

[root@vmserver01 ~]# exportfs

[root@vmserver01 ~]# showmount –e vmserver01

 

5.命令行创建超虚拟化机 (LINUX Install)

1.  在运行脚本创建虚拟机前要了解的一些信息

l  虚拟机名称:vm300

l  要分配给虚拟机的内存量(以兆字节为单位)300

l  磁盘路径:/OVS/running_pool/名称>/System.img

l  磁盘大小以GB为单位:10

l  启用图形支持:yes

l  安装介质位置:nfs:oraclevm_server_ip_address:/el/EL5-x86

2.  创建包含虚拟机文件的目录/OVS/running_pool/vm300

[root@vmserver01 ~]# mkdir /OVS/running_pool/vm300

3.  通过执行命令virt-install创建虚拟机

4.  回答提示:

What is the name of your virtual machine? vm300

How much RAM should be allocated (in megabytes)?300

What would you like to use as the disk (path)?/OVS/running_pool/vm300/System.img

How large would you like the disk to be (in gigabytes)?10

Would you like to enable graphics support? Yes

What is the install location? nfs:oraclevm_server_ip_address:/el/EL5-x86

*// 标红部分为创建半虚拟化机时提示信息//*

5.  接下来,将看到类似如下的提示内容

Starting install...

libvir: Xen Daemon error: GET operation failed:

Unable to connect to graphical host: DISPLAY is not set.

Please connect to localhost :5900

Domain installation still in progress.  You can reconnect

to the console to complete the installation process.

6.  VNC Client中使用oraclevm_server_hostname:port连接至domU,默认端口5900

7.  安装系统(略)

8.  安装完系统后系统重启,超虚拟化机关闭。VNC会话连接也会关闭。必须重启domU以继续进行安装。连接到dum0终端窗口执行以下命令重启动domU:

[root@vmserver01 ~]# xm create vm300

9.  VNC Client中使用oraclevm_server_hostname:port连接至domU,继续剩下的安装

10. 为了更好的使用超虚拟机,如:提高鼠标的准确度。可以为新安装的超虚拟机配置VNC Server

 

6.命令行创建超虚拟机(WINDOWS 2003

创建WIN2003和创建LINUX的第二到七步是一样的。区别在于超虚拟机reboot后的操作

1.  运行脚本创建虚拟机前要了解的一些信息

l  虚拟机名称:vm2003

l  要分配给虚拟机的内存量(以兆字节为单位)300

l  磁盘路径:/OVS/running_pool/名称>/System.img

l  磁盘大小以GB为单位:10

l  启用图形支持:yes

l  安装介质位置:nfs:oraclevm_server_ip_address:/el/EL5-x86

2.  执行创建LINUX的第二到七步(安装过程中重启)

3.  拷贝并创建WIN2003的配置文件

[root@vmserver01 ~]# cp /etc/xen/vm2003 /OVS/running_pool/vm2003/vm.cfg

4.  编辑vm.cfg (标红的部分需要手动添加)

# Automatically generated xen config file

name = "win2003"

builder = "hvm"

memory = "300"

#disk = [ 'file:/OVS/running_pool/vm2003/System.img,hda,w', ]

disk = [ 'file:/OVS/running_pool/vm2003/System.img,hda,w','file:/media/iso/WIN2003_Enterprise.iso,hdc:cdrom,r', ]

vif = [ 'type=ioemu, mac=00:16:3e:10:2b:97, bridge=xenbr0', ]

uuid = "cb5870b2-4d8b-b32e-ed7c-ecf5892548d7"

device_model = "/usr/lib/xen/bin/qemu-dm"

kernel = "/usr/lib/xen/boot/hvmloader"

vnc=1

vncunused=1

vnclisten='0.0.0.0'

timer_mode=0

apic=1

acpi=1

pae=1

 

vcpus=1

serial = "pty" # enable serial console

on_reboot   = 'restart'

on_crash    = 'restart'

"vm.cfg" 22L, 623C

5.  使用该配置文件启动超虚拟机

[root@vmserver01 vm2003]# xm create vm.cfg

Using config file"./vm.cfg"

Stated domain vm2003

[root@vmserver01 vm2003]#

6.  查看超虚拟机(vm2003)VNC端口

[root@vmserver01 ~]# xm list –l

……………………

(domain

    (domid 57)

    (on_crash restart)

    (uuid cb5870b2-4d8b-b32e-ed7c-ecf5892548d7)

    (bootloader_args )

    (vcpus 1)

    (name vm2003)        //标识了这个超虚拟机的名字:vm2003

    (on_poweroff destroy)

(on_reboot restart)

    ……………………

            (device

        (vfb

            (vncunused 1)

            (vnclisten 0.0.0.0)

            (vnc 1)

            (uuid 43cd45e2-138a-a6b9-04b8-525c878e9fa4)

            (location 0.0.0.0:5901)     //超虚拟机使用的端口:5901

        )

    ……………………

7.  VNC Client中使用oraclevm_server_hostname:port连接至domU,使用端口5901

8.  继续WINDOWS2003剩下的安装

9.  重启后重新执行五到七步

10. 打开WINDOWS 2003的远程桌面服务

 

研发人员使用管理提供的机器名使用VNC等远程桌面连接工具,连接到虚拟服务器执行开发任务。任务执行过程中如果需要对服务器执行重启、关机等操作。可以使用浏览器访问管理员提供的URL链接对服务器进行操作

服务器环境下可以提供多达可定制的CPU和的磁盘存储环境,提供多个带有1-多个CPU的虚拟服务器。

通过提供的虚拟机模板和克隆的功能,快速安装和复制虚拟服务器,便于备份和快速安装服务器系统。

完整的用户管理,开发人员或虚拟机用户可以通过WEB界面,自行管理(开启,关闭,重启)分配给他们的虚拟机。

总之,提高了设备的利用率,简化了服务器的管理,为服务器的使用者提供了方便快捷的工具与手段,提高了工作效率。是服务器的安装使用突破了物理服务器的限制。

阅读(5784) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-07-01 22:19:32

想请教一下,这个磁盘阵列的存储是分配给oracle vm server的,还是等安装完各个虚拟机后再分配给各自的虚拟机?