First, the principle of explanation
The concept of virtualization: Abstract server physical resources into logical resources, let a server become several or even hundreds of isolated virtual servers, we are no longer limited by the physical boundaries, but let the CPU, memory, disk, I/O and other hardware into a dynamic management of the "resource pool", thereby increasing the utilization of resources, Simplifies system management, enables server consolidation, and makes it more adaptable to business changes--------This is the virtualization of the server.
Xen is the best virtualization solution on Linux today, ideal for server applications, such as merging multiple servers into a single physical server to save operational costs (room space, power consumption), or for security reasons, different applications need to be partitioned to reduce security risks.
1. Noun:
Complete virtualization (full virtualization): Fully virtualized
Semi-virtualization (Para virtualization): paravirtualized
2, Xen operating environment: Domain-0 and Domain-u
Domain-0 is the virtual machine tool or host host, which is the same system as the Linux host, which starts with the Xen Linux kernel, and manages and controls the client.
Domain-u is called a virtual client or a VPS, and multiple virtual clients can be built on the Domain-0.
The difference between Domain-0 and domain-u is that Domain-0 is a virtual machine, domain-u is the operating system on a virtual machine. With VMware on Windows, the Domain-0 can be understood as VMware software, and Domain-u is the operating system running on VMware.
3, Xen mode of operation:
Xen is divided into multiple levels (layer) execution. It will modify the core of Linux, and then use the modified core boot, and after the boot load Xen Monitor (Hypervisor), and start the first operating system, called domain-0. In Xen, a so-called domain is a virtual machine.
Domain-0 was first loaded because Domain-0 contained the control instructions necessary to boot other virtual machines, and domain-0 was also an important master control system for controlling virtual devices. The most important thing in domain-0 is a xend process, and other domain is managed by this xend. As for naming, other than domain-0 virtual machines are called domain-1, domain-2 and so on, we collectively referred to as domain-u.
Domain-0 is important because it directly controls the Xen Monitor (Hypervisor) and grasps the real Linux driver (drivers). Other virtual machines (DOMAIN-U) interact with real hardware and domain-0 through the Xen Monitor. In order for domain-0 to be able to combine with Xen, we have to modify the core of domain-0 to run smoothly. And you need to use the core of domain-0 to boot. Domain-0 is the basis of all virtual machines, so it can be as concise as possible, other individual services can be placed in the not pop fashion information network in the same domain. Xend can manage the initiation and interaction between domain-0 and other domain, providing a terminal control (console) interface to allow domain-0 to log into other domain.
Second, the necessary conditions
1, Hardware Description:
Open virtual technology about CPUs in the server BIOS settings; Because the brand, the model is different please look carefully.
2, the system to see the CPU does not support virtualization
To see how the CPU supports virtualization:
Semi-virtualization support identity for Intel and AMD-PAE
# Cat/proc/cpuinfo | grep flags
FLAGS:FPU TSC MSR MCE cx8 APIC MTRR MCA cmov Pat PSE36 clflush DTS ACPI MMX FXSR SSE SSE2 SS NX Con STANT_TSC PNI SSSE3
Intel full virtualization Support identity-VMX
# Cat/proc/cpuinfo | grep flags
FLAGS:FPU TSC MSR MCE cx8 APIC MTRR MCA cmov Pat PSE36 clflush DTS ACPI MMX FXSR SSE SSE2 SS HT TM PBE NX LM constant_tsc up PNI monitor ds_cpl vmx est tm2 cx16 xtpr lahf_lm
AMD Full virtualization support identification-SVM
# Cat/proc/cpuinfo | grep flags
FLAGS:FPU VME de pse TSC MSR mce cx8 APIC Sep MTRR PGE MCA cmov Pat PSE36 Clflush MMX FXSR SSE SSE2 HT syscall NX Mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8legacy 3dnowprefetch ts FID VID TTP TM STC 100mhzsteps
Third, initial Xen
1. Configure Local disc Yum
The CentOS system can use the local source only if the disc is mounted.
2, installation Xen
#yum install Xen kernel-xen xen-lib Virt-manager python-virtinst–y
3, the role of understanding
Kernel-xen: Can run the Xen Linux core
Xen: The main Xen suite, including configuration files, startup scripts, and some function libraries
function libraries required by the Xen-libs:xen
Python-virtinst: Software for terminal installation
Virt-manager: For graphical interface Management Xen
View/etc/grub.conf
Select the kernel with Xen and use it instead
#init 6
After reboot, view kernel
#uname –r
2.6.18-274.12.1.e15xen
#xm List
Domain-0
Iv. installation of Xen (graphical)
1, open "Application" CentOS <wbr>xen <wbr> installation and use
2, open "System Tools", select "Virtual System"
3, select "localhost", the mouse Right click "New"
4, click "Forward"
5, Virtual machine naming
6. Select System architecture, most of which are determined by CPU
7, select the boot mode (ISO, PXE)
8, designated location
9, the specified hard disk size (allocate entire virtual disk now use the entire hard drive)
10. Designated Network
11. Specify Memory Size
12. All information of virtual machine
13. Start "Create"
14, installation background
V. Common error description and solutions
1. Unable to retrieve error occurred via HTTP or NFS installation client operating system: ....
Most of the reason is caused by firewalls, if you use the HTTP installation method can stop the firewall first, can also be resolved in the following ways:
Query with iptables-l command to open 80 ports or netstat TUNLP | grep httpd
Open ports
Iptables–i input–s 192.168.0.2/24-p tcp--dport 80-j ACCEPT
service iptables Save
2, there is a similar error:
POST operation Failed:xend_post:error from Xen daemon: (xend.err ' Error creating domain:i need 262144-KiB, but dom0_min _mem is 262144 and shrinking to 262144 KiB would leave only 244672 free.
Indicates that the new virtual host memory settings are too high, then the memory can be smaller.
Summarize
The above is the entire content of this article, I hope the content of this article for everyone to learn or use Xen virtual function to help, if you have questions you can message exchange.