Xen is an Open Source Virtualization software developed by the Linux Foundation and is supported by Intel. Amazon AWS use Xen for powering its EC2 instances. Other alternative for Xen are KVM, OpenVZ, WMWare and LXC.
To install Xen on CentOS, run
yum install -y centos-release-xen yum update yum install -y xen
Now reboot the server, so server will boot with Xen kernal.
Verify Xen is running with command
xl info
[root@xen01 ~]# xl info host : xen01.hostonnet.com release : 4.9.13-22.el6.x86_64 version : #1 SMP Sun Feb 26 22:18:35 UTC 2017 machine : x86_64 nr_cpus : 8 max_cpu_id : 11 nr_nodes : 1 cores_per_socket : 4 threads_per_core : 2 cpu_mhz : 2666 hw_caps : bfebfbff:28000800:00000000:00003b00:0098e3bd:00000000:00000001:00000000 virt_caps : hvm total_memory : 8190 free_memory : 7072 sharing_freed_memory : 0 sharing_used_memory : 0 outstanding_claims : 0 free_cpus : 0 xen_major : 4 xen_minor : 6 xen_extra : .3-8.el6 xen_version : 4.6.3-8.el6 xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 xen_scheduler : credit xen_pagesize : 4096 platform_params : virt_start=0xffff800000000000 xen_changeset : Wed Feb 15 02:12:22 2017 -0600 git:35503e1-dirty xen_commandline : dom0_mem=1024M,max:1024M cpuinfo com1=115200,8n1 console=com1,tty loglvl=all guest_loglvl=all cc_compiler : gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17) cc_compile_by : mockbuild cc_compile_domain : centos.org cc_compile_date : Tue Feb 28 14:18:26 UTC 2017 xend_config_format : 4 [root@xen01 ~]#
Setting up Bridge Networking
For setting up bridge networking, see instruction for your OS. CentOS 6, CentOS 7
Xen tunning
Edit /etc/xen/xend-config.sxp, set dom0 memory to 512 mb and disable balooning to avoid domU use up dom0’s memory.
vi /etc/xen/xend-config.sxp
Set following values
(dom0-min-mem 512) (enable-dom0-ballooning no)
Disable Virtual Machines LVM volume showing up in boot menmu
Edit /etc/default/grub
vi /etc/default/grub
Add
GRUB_CMDLINE_XEN="dom0_mem=512M" GRUB_DISABLE_OS_PROBER=true