一、xen介绍
xen使得用户可以创建更多的虚拟机,每一个虚拟机都是运行在同一个操作系统上的实例。
Xen虚拟机有两种运行方式:完全虚拟化(full virtualization)和半虚拟化(para virtualization)。
1、完全虚拟化提供底层物理系统的全部抽象化,且创建一个新的虚拟系统,客户机操作系统可以在里面运行。不需要对客户机操作系统或者应用程序进行修改(客户机操作系统或者应用程序像往常一样运行,意识不到虚拟环境的存在)。可以创建Linux、FreeBSD和Windows客户机。
2、半虚拟化需要对运行在虚拟机上的客户机操作系统进行修改(这些客户机操作系统会意识到它们运行在虚拟环境里)并提供相近的性能,但半虚拟化的性能要比完全虚拟化更优越。支持RHEL4.5以上版本的客户机。
二、xen安装
1、确定你的服务器是否支持完全虚拟化或者半虚拟化
如果有 pae标志出现的话,就表示你的处理器支持半虚拟化。对Intel的CPU,如果有 vmx标志出现的话,就表示你的处理器支持完全虚拟化。 对AMD的CPU,如果有 svm标志出现的话,就表示你的处理器支持完全虚拟化。
注:某些Intel服务器,默认"Virtualizaton Technology"功能没有打开,需要到BIOS中将其打开。
- [root@localhost ~]# grep flags /proc/cpuinfo
- flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss nx lm constant_tsc up ida nonstop_tsc pni ssse3 cx16 sse4_1 lahf_lm [8]
2、 检查是否已经安装xen
查看是否已经安装了xen或者已经安装的xen版本以及linux内核是否有针对xen的补丁。
- [root@localhost ~]# rpm -qa | grep xen
- [root@localhost ~]# ls /boot/
- config-2.6.18-194.el5 grub initrd-2.6.18-194.el5.img lost+found symvers-2.6.18-194.el5.gz System.map-2.6.18-194.el5 vmlinuz-2.6.18-194.el5
- [root@localhost ~]#
3、安装
3.1、在redhat linux下使用yum出现:Loaded plugins: rhnplugin, security,解决方法:
- --检查yum是否安装,默认都是安装的
- [root@oraweb yum.repos.d]# rpm -qa |grep yum
- yum-updatesd-0.9-2.el5
- yum-metadata-parser-1.1.2-3.el5
- yum-security-1.1.16-13.el5
- yum-3.2.22-26.el5
- --编辑配置文件,配置yum更新源
- [root@oraweb yum.repos.d]# vi /etc/yum.repos.d/CentOS-Base.repo
- [base]
- name=CentOS-5-Base
- #mirrorlist=http://mirrorlist.centos.org/?release=$releasever5&arch=$basearch&repo=os
- #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
- baseurl=http://ftp.sjtu.edu.cn/centos/5/os/$basearch/
- gpgcheck=0
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
- #released updates
- [update]
- name=CentOS-5-Updates
- #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=updates
- baseurl=http://ftp.sjtu.edu.cn/centos/5/updates/$basearch/
- gpgcheck=0
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
- #packages used/produced in the build but not released
- [addons]
- name=CentOS-5-Addons
- #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=addons
- baseurl=http://ftp.sjtu.edu.cn/centos/5/addons/$basearch/
- gpgcheck=0
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
- #additional packages that may be useful
- [extras]
- name=CentOS-5-Extras
- #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=extras
- baseurl=http://ftp.sjtu.edu.cn/centos/5/extras/$basearch/
- gpgcheck=0
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
- #additional packages that extend functionality of existing packages
- [centosplus]
- name=CentOS-5-Plus
- #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=centosplus
- baseurl=http://ftp.sjtu.edu.cn/centos/5/centosplus/$basearch/
- gpgcheck=0
- enabled=0
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
- #contrib - packages by Centos Users
- [contrib]
- name=CentOS-5-Contrib
- #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=contrib
- baseurl=http://ftp.sjtu.edu.cn/centos/5/contrib/$basearch/
- gpgcheck=0
- enabled=0
- gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
- # vi dag.repo
- [dag]
- name=Dag RPM Repository for RHEL5
- baseurl=http://ftp.riken.jp/Linux/dag/redhat/el5/en/$basearch/dag/
- enabled=1
- gpgcheck=0
- gpgkey=http://ftp.riken.jp/Linux/dag/packages/RPM-GPG-KEY.dag.txt
- --导入key
- [root@oraweb yum.repos.d]# rpm --import http://ftp.sjtu.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
转载于:https://blog.51cto.com/oracle521/1082997