Xen virtualization combat under CentOS 6.6

Because from the RHEL6 version, RedHat does not support Xen natively, and instead goes to the embrace of KVM. Although KVM claims to support the full virtualization of HVM technology, KVM started late after all and is far less mature than Xen technology. System crashes often occur when running multiple instances. Of course, it does not exclude the possibility that KVM will be more efficient in the future. So there are only two ways to install Xen. One is to download the source code and compile it yourself, but this method is too energy-consuming, so ignore it, and the other is to install it using a third-party software source. There are a large number of third-party sources and open source organizations on the Internet to provide compiled source code. The Xen made Easy open source project provides us with the installation of Xen4 on RHEL6/CentOS6. This article uses the third-party installation source provided by the Xen Made Easy project website, which is convenient and quick. .

1. surroundings
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 #All select nochkconfig iptables off#Close 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. Install xen virtualization

yum -y install xen

ls -l /boot/xen.gz
lrwxrwxrwx 1 root root 12 Dec  118:42/boot/xen.gz -> xen-4.2.5.gz

6. Install xen kernel

yum -y install kernel-xen

Note: The installation of kernel-xen depends on kernel-xen-firmware. Because these two packages are relatively large, it is recommended to download to the local and use yum -y localinstall kernel-xen* to complete the installation

cat /boot/grub/grub.conf #As shown in the figure below, next time it will be booted with xen kernel

chkconfig xend on #After restarting the system, it is found that the xend server is not configured to start automatically

7. Configure the network card in bridge mode
Create a new file /etc/sysconfig/network-scripts/ifcfg-xenbr0 and keep the content as follows:

DEVICE=xenbr0
TYPE=BridgeONBOOT=yes
DELAY=0NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=192.168.3.20NETMASK=255.255.255.0GATEWAY=192.168.3.1

Modify /etc/sysconfig/network-scripts/ifcfg-eth0 and keep the content as follows:

DEVICE=eth0
HWADDR=F4:CE:46:85:64:34TYPE=EthernetUUID=c27373b9-a698-4ac8-9afe-a4dee87f5704
ONBOOT=yes
BRIDGE=xenbr0
NM_CONTROLLED=no
service network restart #Restart network

8. Restart the server
Restart the system and enter the Xen kernel Linux, test as shown below:

9. Install virtualization management tool set

yum -y install libvirt

libvirt provides a hypervisor agnostic API to safely manage the guest operating system 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 common APIs for common functions implemented by supported hypervisors. Libvirt was originally a management API designed specifically for Xen, and was later extended to support multiple hypervisors.

service libvirtd start
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 operating system installation source
Mount CentOS-6.6-x86_64-minimal.iso at 192.168.3.10:81, and copy the files inside to centos6.6 under the root directory of the apache website, so that http://192.168.3.10:81 can be passed on 192.168.3.20 /centos6.6 access to the installation image
Note: The image file .treeinfo lacks a line, which results in the kernel not being found when installing the system. Keep the middle section as follows:

[ images-xen]kernel = images/pxeboot/vmlinuz
initrd = images/pxeboot/initrd.img

11. Install CentOS with character interface

mkdir -p /data/xen
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 the client virtual machine-u --uuid=Client UUID--vcpus=2 The number of vcpus on the client-v --hvm full virtualization-p --paravirt-l --location=localdir installation source--vnc use vnc-c --cdrom=CD-ROM installation method-s --file-size=The size unit of the disk image used is GB-f --file=Files used as disk images--disk=Use different options to use installation media as disks

12. Clone image

virt-clone -o vm21 -n vm22 -f /data/xen/vm22.img

Recommended Posts

Xen virtualization combat under CentOS 6.6
The actual combat of rpm packaging under CentOS6
Deploy GitBook under CentOS7
Compile Hadoop-2.7.6 under CentOS7.4
Install mysql5.7 under CentOS7
Install ActiveMQ under Centos7
Install PostgreSQL12 under CentOS7
Install CentOS under VMware
Deploy JDK+Tomcat8 under CentOS
Install mysql under Centos 7
Configure lamp under centos6.8
Install Jenkins under Centos 7
Redis3 installation under Centos7
Install MariaDB under MariaDB Centos7
Install mysql5.1 under CentOS6.5
KVM virtualization in centos
[CentOS environment deployment] Java7/Java8 deployment under CentOS
Build docker environment under Centos6.5
Build OpenV** Server under CentOS7
Build OpenLDAP server under CentOS7
Redis cluster installation under CentOS
Configure static IP under CentOS 7
Install Oracle11gR2 database under CentOS6.9
3 partitioning tools under CentOS Linux
Install MySQL under Linux (CentOS 7)
Redis cluster installation under CentOS
Root password cracking under CentOS 7
SELinux security settings under CentOS
Install Java JDK8 under CentOS6
Install MongoDB database under CentOS7
CentOS 6.8 under linux install mongodb
Set static IP under Centos
Install Mesos tutorial under CentOS7
Install and configure keepalived under CentOS 5.9
Compile and install LAMP under Centos 5.2
Use Nginx and u under CentOS
[Introduction to redis] Install redis under Centos
RabbitMQ cluster deployment record under Centos6.9
Installation under centos6.9 of jenkins learning
Build a PXC cluster under CentOS8
Elasticsearch cluster deployment record under CentOS7
Upgrade OpenSSL and OpenSSH under CentOS7
Deploy and optimize Tomcat under Centos
Install Harbor mirror warehouse under CentOS
Build an FTP server under centos7
Java-JDK installation and configuration under CentOS
Install Python3 and ansible under CentOS8
Install the latest OpenCV4.3 under Centos8
Install and use docker under CentOS 6.8
Compile FFMPEG source code under CentOS7
Install Python3 and Py under CentOS7
Manually upgrade node version under CentOs
FFmpeg environment deployment record under centos7
Manually upgrade node version under CentOs
Erlang 20.2 installation and deployment under CentOS 7
PPTP environment deployment record under Centos
Install Mono 3.2 and Jexus 5.4 under CentOS 6.3