CentOS 7
Sponsored Link

Xen : Install2016/01/25

 
Install Xen to build Virtualization Environment.
[1] Enable CentOS Xen Repository and install some packgaes.
[root@dlp ~]#
yum -y install centos-release-xen
[root@dlp ~]#
sed -i -e "s/enabled=1/enabled=0/g" /etc/yum.repos.d/CentOS-Xen.repo

[root@dlp ~]#
yum --enablerepo=centos-virt-xen -y update kernel
[root@dlp ~]#
yum --enablerepo=centos-virt-xen -y install xen
[root@dlp ~]#
vi /etc/default/grub
# change memory amount for Domain0 (specify proper value on your system)

GRUB_CMDLINE_XEN_DEFAULT="dom0_mem=
4096M
,max:
4096M
cpuinfo com1=115200,8n1 .....
[root@dlp ~]#
/bin/grub-bootxen.sh

[root@dlp ~]#
# display info

[root@dlp ~]#
xl info

host                   : dlp.srv.world
release                : 3.18.21-17.el7.x86_64
version                : #1 SMP Fri Dec 18 18:04:14 UTC 2015
machine                : x86_64
nr_cpus                : 6
max_cpu_id             : 5
nr_nodes               : 1
cores_per_socket       : 1
threads_per_core       : 1
cpu_mhz                : 2594
hw_caps                : xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
virt_caps              : hvm
total_memory           : 12287
free_memory            : 8054
sharing_freed_memory   : 0
sharing_used_memory    : 0
outstanding_claims     : 0
free_cpus              : 0
xen_major              : 4
xen_minor              : 6
xen_extra              : .0-9.el7
xen_version            : 4.6.0-9.el7
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          : Thu Jan 14 15:35:35 2016 +0000 git:6e8597a-dirty
xen_commandline        : placeholder dom0_mem=4096M,max:4096M cpuinfo com1=115200,8n1 
                         console=com1,tty loglvl=all guest_loglvl=all
cc_compiler            : gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
cc_compile_by          : mockbuild
cc_compile_domain      : centos.org
cc_compile_date        : Wed Jan 20 12:25:53 UTC 2016
xend_config_format     : 4
[2] Configure Bridge networking for KVM virtual machine.
Replace the interface name "eno16777736" for your own environment's one.
# add bridge "br0"

[root@dlp ~]#
nmcli c add type bridge autoconnect yes con-name br0 ifname br0

Connection 'br0' (0f4b7bc8-8c7a-461a-bff1-d516b941a6ec) successfully added.
# set IP for br0

[root@dlp ~]#
nmcli c modify br0 ipv4.addresses 10.0.0.30/24 ipv4.method manual

# set Gateway for br0

[root@dlp ~]#
nmcli c modify br0 ipv4.gateway 10.0.0.1

# set DNS for "br0"

[root@dlp ~]#
nmcli c modify br0 ipv4.dns 10.0.0.1

# remove the current setting

[root@dlp ~]#
nmcli c delete eno16777736

# add an interface again as a member of br0

[root@dlp ~]#
nmcli c add type bridge-slave autoconnect yes con-name eno16777736 ifname eno16777736 master br0

# stop and start NetworkManager

[root@dlp ~]#
systemctl stop NetworkManager; systemctl start NetworkManager

[root@dlp ~]#
ip addr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> 
    mtu 1500 qdisc pfifo_fast master br0 state UP group default qlen 1000
    link/ether 00:0c:29:9f:9b:d3 brd ff:ff:ff:ff:ff:ff
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 00:0c:29:9f:9b:d3 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.30/24 brd 10.0.0.255 scope global br0
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe9f:9bd3/64 scope link
       valid_lft forever preferred_lft forever
Matched Content