Since rhel6 version, red hat does not support Xen in its original version, but goes to KVM instead. Although KVM claims to support full virtualization of HVM technology, KVM started late after all, far less mature than Xen technology. When running multiple instances, system crashes often occur. Of course, KVM can be more efficient in the future. Therefore, there are only two ways to install Xen. One is to download the source code and compile it by yourself. However, this method consumes too much energy, so it is ignored. The other is to use a third-party software source for installation. The Internet has a large number of third-party sources and open-source organizations provide compiled source code. The xenmade easy open source project provides us with the installation of xen4 in rhel6 / centos6. This paper uses the third-party installation source provided by Xen made easy project website, which is convenient and fast.
Environment 1
Hardware: HP DL360 G6 (e5520,16g, 2 * 146gb)
System version: centos-6.6-x86_ 64- minimal.iso
2. System initialization
The code is as follows:
tar xzf lnmp-full.tar.gz
cd lnmp
/ install.sh #All choose No
Chkconfig iptables off ා turn off iptables
3. Install bridge utils
The code is as follows:
4. Installation crc.id.au Installation source
The code is as follows:
5. Install Xen virtualization
The code is as follows:
ls -l /boot/xen.gz
lrwxrwxrwx 1 root root 12 Dec 1 18:42 /boot/xen.gz -> xen-4.2.5.gz
6. Install Xen kernel
The code is as follows:
Note: kernel Xen installation depends on kernel Xen firmware. Since these two packages are relatively large, it is recommended to download them locally and use Yum – y localinstall kernel Xen * to complete the installation
The code is as follows:
Chkconfig xend on ා after restarting the system, it is found that the xend server is not configured to boot automatically
7. Configure the network card to bridge mode
Create a new file / etc / sysconfig / network scripts / ifcfg-xenbr0, and keep the following contents:
The code is as follows:
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 / etc / sysconfig / network scripts / ifcfg-eth0 to keep the following contents:
The code is as follows:
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 ා
Restart the server 8
Restart the system and enter the Xen kernel Linux. The test is as follows:
9. Install virtualization management toolset
The code is as follows:
Libvirt provides a hypervisor agnostic API to safely manage guest operating systems running on the host. 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 common functions implemented by supported hypervisors. Libvirt was originally designed as a Management API for Xen, and was later extended to support multiple hypervisors.
The code is as follows:
yum -y install python-virtinst
Contains a python module that uses libvirt to start and install the operating system version inside the virtual machine (such as commands: virt install, virt clone)
10. Configure the operating system installation source
Mount centos-6.6-x86 at 192.168.3.10:81_ 64- minimal.iso And copy the file to centos6.6 in the root directory of Apache website, so that it can be accessed on 192.168.3.20 http://192.168.3.10 : 81 / centos6.6 access to installation image
Note: there is a missing line in the image file. Treeinfo, which causes the kernel not to be found when installing the system. Keep the middle segment as follows:
The code is as follows:
kernel = images/pxeboot/vmlinuz
initrd = images/pxeboot/initrd.img
11. Character interface installation CentOS
The code is as follows:
virt-install -n vm21 -r 2048 –vcpus=2 –nographic –disk path=/data/xen/vm21.img,size=20 \
-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 = memory allocated by client virtual machine
-U — UUID = client UUID
–Vcpus = 2 number of vcpus of client
-V — HVM full virtualization
-P — paravirt semi virtualization
-L — location = localdir installation source
–VNC using VNC
-C — CDROM = CD drive installation path
-S — file size = uses the size of the disk image in GB
-F — file = file used as disk image
–Disk = use different options to use installation media as disks
12. Clone image
The code is as follows: