XEN 环境安装

CentOS5.10_x64位 系统上安装 xen-3.4.4

1,服务器网络配置

 yum install bridge-utils  -y

对网卡1和网卡2进行bond 配置,建立网桥br0

echo 'alias bond0 bonding'  >> /etc/modprobe.conf

echo 'options bonding mode=1 miimon=100'  >> /etc/modprobe.conf


echo 'DEVICE=eth1' >/etc/sysconfig/network-scripts/ifcfg-eth1

echo 'USERCTL=no ' >>/etc/sysconfig/network-scripts/ifcfg-eth1

echo 'ONBOOT=yes'  >>/etc/sysconfig/network-scripts/ifcfg-eth1

echo 'MASTER=bond0' >>/etc/sysconfig/network-scripts/ifcfg-eth1

echo 'SLAVE=yes'   >>/etc/sysconfig/network-scripts/ifcfg-eth1

echo 'BOOTPROTO=none'  >>/etc/sysconfig/network-scripts/ifcfg-eth1

echo 'DEVICE=eth2' >/etc/sysconfig/network-scripts/ifcfg-eth2

echo 'USERCTL=no'  >>/etc/sysconfig/network-scripts/ifcfg-eth2

echo 'ONBOOT=yes'  >>/etc/sysconfig/network-scripts/ifcfg-eth2

echo 'MASTER=bond0'  >>/etc/sysconfig/network-scripts/ifcfg-eth2

echo 'SLAVE=yes'     >>/etc/sysconfig/network-scripts/ifcfg-eth2

echo 'BOOTPROTO=none'  >>/etc/sysconfig/network-scripts/ifcfg-eth2

echo 'BOOTPROTO=none'  >>/etc/sysconfig/network-scripts/ifcfg-bond0

echo 'ONBOOT=yes'  >>/etc/sysconfig/network-scripts/ifcfg-bond0

echo 'BRIDGE=br0'  >>/etc/sysconfig/network-scripts/ifcfg-bond0 

echo 'DEVICE=bond0' >/etc/sysconfig/network-scripts/ifcfg-bond0

echo 'DEVICE=br0' >/etc/sysconfig/network-scripts/ifcfg-br0

echo 'ONBOOT=yes' >>/etc/sysconfig/network-scripts/ifcfg-br0

echo 'BOOTPROTO=none' >>/etc/sysconfig/network-scripts/ifcfg-br0

echo "IPADDR=10.1.1.11 " >>/etc/sysconfig/network-scripts/ifcfg-br0

echo 'GATEWAY=10.1.0.10'  >>/etc/sysconfig/network-scripts/ifcfg-br0

echo 'NETMASK=255.255.0.0' >>/etc/sysconfig/network-scripts/ifcfg-br0

echo 'NO_ALIASROUTING=yes '>>/etc/sysconfig/network-scripts/ifcfg-br0

echo 'TYPE=Bridge'   >>/etc/sysconfig/network-scripts/ifcfg-br0


/etc/init.d/network restart


2,xen 安装配置


安装xen环境

cd /etc/yum.repos.d/

wget http://www.gitco.de/repo/GITCO-XEN3.4.4_x86_64.repo

yum -y install libvirt-0.7.0-6.el5 libvirt-python-0.7.0-6.el5 libvirt-debuginfo-0.7.0-6.el5 xen-3.4.4-2.el5


配置VNC

sed -i 's/(network-script network-bridge)/#(network-script network-bridge)/' /etc/xen/xend-config.sxp

sed -i "s/#(vnc-listen '127.0.0.1')/(vnc-listen '0.0.0.0')/" /etc/xen/xend-config.sxp

sed -i "s/(vncpasswd '')/(vncpasswd 'password')/" /etc/xen/xend-config.sxp


3,  修改系统启动内核 并设置dom0内存

Modify grub:

vim /etc/grub.conf

sed -i 's/default=1/default=0/' /etc/grub.conf

sed -i 's/xen.gz-3.4.4/xen.gz-3.4.4 dom0_mem=8192m /' /etc/grub.conf

sed -i 's/MINIMUM_RESTART_TIME = 60/MINIMUM_RESTART_TIME = 20/' /usr/lib64/python2.4/site-packages/xen/xend/XendConstants.py


4,配置虚拟机存储

fdisk /dev/sdb 

pvcreate /dev/sdb

vgcreate vg /dev/sdb


安装完成,重启服务器,进入xen系统。


你可能感兴趣的:(虚拟机,云计算,xen)