Since the RHEL6 version, Redhat is not the original support Xen, instead of the embrace of KVM. Although KVM claims to support the full virtualization of HVM technology, KVM started late after all, far less mature than Xen technology, the system crashes often occur when running multiple instances, and certainly does not exclude the possibility that future KVM will be more efficient. So there are only two ways to install Xen, one is to download the source code itself, but this method is too time-consuming, so ignore, the other is to use a Third-party software source to install. The internet has a large number of third-party sources and open source organizations to provide compiled source code, where the Xen made Easy open source project for us to provide XEN4 in the RHEL6/CENTOS6 installation, this article uses the Xen made Easy Project site to provide Third-party installation source, convenient and quick.
1. Environmental
Hardware: HP DL360 G6 (E5520,16G,2*146GB)
System version: Centos-6.6-x86_64-minimal.iso
2. System initialization
wget http://blog.linuxeye.com/lnmp-full.tar.gz
Tar xzf lnmp-full.tar.gz
CD LNMP
./install.sh #所有都选择no
Chkconfig iptables off #关闭iptables
3. Install Bridge-utils
Yum-y Install Bridge-utils
4. Install crc.id.au installation Source
Yum-y Install http://au1.mirror.crc.id.au/repo/el6/x86_64/kernel-xen-release-6-7.noarch.rpm
5. Installation of Xen Virtualization
Yum-y Install Xen
Ls-l/boot/xen.gz
lrwxrwxrwx 1 root Dec 1 18:42/boot/xen.gz-> xen-4.2.5.gz
6. Install Xen kernel
Yum-y Install Kernel-xen
Note: Kernel-xen installation relies on Kernel-xen-firmware, because these two packages are relatively large, we recommend downloading to local yum-y localinstall kernel-xen* Complete Installation
Cat/boot/grub/grub.conf #如下图, next time it starts with the Xen kernel
Chkconfig xend on #重启系统后发现xend服务器没有配置开机自启动
7. Configure the network card for bridging mode
New file/etc/sysconfig/network-scripts/ifcfg-xenbr0, keep the contents as follows:
Device=xenbr0
Type=bridge
Onboot=yes
Delay=0
Nm_controlled=no
Bootproto=static
ipaddr=192.168.3.20
netmask=255.255.255.0
gateway=192.168.3.1
Modify the/etc/sysconfig/network-scripts/ifcfg-eth0 to keep the contents as follows:
Device=eth0
Hwaddr=f4:ce:46:85:64:34
Type=ethernet
uuid=c27373b9-a698-4ac8-9afe-a4dee87f5704
Onboot=yes
Bridge=xenbr0
Nm_controlled=no
Service Network Restart #重启网络
8. Reboot the server
Reboot the system and go to the Xen Linux kernel and test the following diagram:
9. Install Virtualization Management Toolset
Yum-y Install Libvirt
Libvirt provides an agnostic API for virtual machine monitors to securely manage guest operating systems running on hosts. Libvirt itself is not a tool, it is an API that can build tools to manage guest operating systems. Libvirt itself is built on an abstract concept. It provides a common API for the common functions that are implemented by the supported virtual machine monitor programs. Libvirt was originally a management API specifically designed for Xen and was later extended to support multiple virtual machine monitoring programs.
Service LIBVIRTD Start
Yum-y Install Python-virtinst
Contains a Python module that uses Libvirt to start the installation of the operating system version within the virtual machine (such as commands: Virt-install, Virt-clone)
10. Configure the operating system installation source
Mount the Centos-6.6-x86_64-minimal.iso on the 192.168.3.10:81 and copy the files inside the Apache web site centos6.6 to 192.168.3.20 through http:// 192.168.3.10:81/centos6.6 access to installation mirrors
Note: The mirrored file. Treeinfo is missing a row, causing the kernel to be found when the system is installed, keeping the middle segment as follows:
[Images-xen]
Kernel = Images/pxeboot/vmlinuz
INITRD = images/pxeboot/initrd.img
11. Character Interface Installation CentOS
Mkdir-p/data/xen
Virt-install-n vm21-r 2048--vcpus=2--nographic--disk
-L http://192.168.3.10:81/centos6.6/--bridge=xenbr0,model=virtio
Virt-install Command parameters:
-N--name= Client virtual machine name
-R--ram= Client virtual machine allocated memory
-U--uuid= Client uuid
Number of VCPU--vcpus=2 clients
-V--HVM Full virtualization
-P--paravirt Semi-virtualization
-L--LOCATION=LOCALDIR Installation Source
--vnc using VNC
-C--cdrom= Optical Drive installation path
-S--file-size= uses a disk image size unit of GB
-F--file= files used as disk images
--disk= use different options for disk installation media
12. Clone Mirror
Virt-clone-o vm21-n vm22-f/data/xen/vm22.img