xen on CentOS 5.5 with vlan and multiple network interface
- Details
- Category: Virtualization
- Written by Mahdi Bahmani Ciahmard
- Hits: 124
cd /etc/yum.repos.d
wget -c http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm
wget --no-cache http://www.convirture.com/repos/definitions/rhel/5.x/convirt.repo
rpm -i rpmforge-release-0.5.1-1.el5.rf.*.rpm
yum update
yum install iscsi-initiator-utils convirt
yum install cutecom minicom dialog
# yum install xen kernel-xen
yum install xen-ia64-guest-firmware
yum install virt-manager libvirt libvirt-python python-virtinst
[root@xen02 ~]# cat /etc/iscsi/initiatorname.iscsi
InitiatorName=iqn.08-03-89-mbahmani-xen02-centos.gbgnetwork.net
[root@xen02 ~]#
[root@xen02 ~]# cat /etc/iscsi/iscsid.conf |grep -v '^#' |grep -v '^$'
node.startup = automatic
node.session.timeo.replacement_timeout = 120
node.conn[0].timeo.login_timeout = 15
node.conn[0].timeo.logout_timeout = 15
node.conn[0].timeo.noop_out_interval = 5
node.conn[0].timeo.noop_out_timeout = 5
node.session.err_timeo.abort_timeout = 15
node.session.err_timeo.lu_reset_timeout = 20
node.session.initial_login_retry_max = 8
node.session.cmds_max = 128
node.session.queue_depth = 32
node.session.iscsi.InitialR2T = No
node.session.iscsi.ImmediateData = Yes
node.session.iscsi.FirstBurstLength = 262144
node.session.iscsi.MaxBurstLength = 16776192
node.conn[0].iscsi.MaxRecvDataSegmentLength = 262144
discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768
node.conn[0].iscsi.HeaderDigest = None
node.session.iscsi.FastAbort = Yes
node.session.iscsi.FastAbort = No
[root@xen02 ~]#
[root@xen05 ~]# ls /etc/sysconfig/network-scripts/ifcfg*
/etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1xenbr30
/etc/sysconfig/network-scripts/ifcfg-eth0-vlan10 /etc/sysconfig/network-scripts/ifcfg-eth1xenbr47
/etc/sysconfig/network-scripts/ifcfg-eth0-vlan30 /etc/sysconfig/network-scripts/ifcfg-eth1xenbr49
/etc/sysconfig/network-scripts/ifcfg-eth0-vlan47 /etc/sysconfig/network-scripts/ifcfg-eth2
/etc/sysconfig/network-scripts/ifcfg-eth0-vlan49 /etc/sysconfig/network-scripts/ifcfg-eth3
/etc/sysconfig/network-scripts/ifcfg-eth1 /etc/sysconfig/network-scripts/ifcfg-lo
/etc/sysconfig/network-scripts/ifcfg-eth1-vlan10 /etc/sysconfig/network-scripts/ifcfg-xenconsole0
/etc/sysconfig/network-scripts/ifcfg-eth1-vlan30 /etc/sysconfig/network-scripts/ifcfg-xenconsole30
/etc/sysconfig/network-scripts/ifcfg-eth1-vlan47 /etc/sysconfig/network-scripts/ifcfg-xenconsole47
/etc/sysconfig/network-scripts/ifcfg-eth1-vlan49 /etc/sysconfig/network-scripts/ifcfg-xenconsole49
/etc/sysconfig/network-scripts/ifcfg-eth1xenbr10
[root@xen05 ~]#
[[root@xen05 ~]# for i in `ls /etc/sysconfig/network-scripts/ifcfg*`; do echo;cat $i;echo;echo; done
# Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
DEVICE=eth0
BOOTPROTO=static
#BROADCAST=172.21.0.63
HWADDR=00:26:55:2B:D8:9A
#IPADDR=172.21.0.62
#NETMASK=255.255.255.192
#NETWORK=172.21.0.0
ONBOOT=yes
VLAN=yes
DEVICE=eth0.10
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
BRIDGE=xenconsole0
VLAN=yes
DEVICE=eth0.30
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
BRIDGE=xenconsole30
VLAN=yes
DEVICE=eth0.47
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
BRIDGE=xenconsole47
VLAN=yes
DEVICE=eth0.49
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
BRIDGE=xenconsole49
# Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
DEVICE=eth1
#BOOTPROTO=dhcp
BOOTPROTO=static
HWADDR=00:26:55:2B:D8:9C
ONBOOT=yes
#HOTPLUG=no
#DHCP_HOSTNAME=xen05.gbgnetwork.net
VLAN=yes
DEVICE=eth1.10
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
BRIDGE=eth1xenbr10
VLAN=yes
DEVICE=eth1.30
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
BRIDGE=eth1xenbr30
VLAN=yes
DEVICE=eth1.47
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
BRIDGE=eth1xenbr47
VLAN=yes
DEVICE=eth1.49
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
BRIDGE=eth1xenbr49
DEVICE=eth1xenbr10
TYPE=Bridge
#STP=on # Turning this on doesn't help solve this problem
ONBOOT=yes
BOOTPROTO=static
DEVICE=eth1xenbr30
TYPE=Bridge
#STP=on # Turning this on doesn't help solve this problem
ONBOOT=yes
BOOTPROTO=static
DEVICE=eth1xenbr47
TYPE=Bridge
#STP=on # Turning this on doesn't help solve this problem
ONBOOT=yes
BOOTPROTO=static
DEVICE=eth1xenbr49
TYPE=Bridge
#STP=on # Turning this on doesn't help solve this problem
ONBOOT=yes
BOOTPROTO=static
# Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
DEVICE=eth2
BOOTPROTO=static
HWADDR=00:26:55:2B:D8:9E
ONBOOT=yes
#HOTPLUG=no
#DHCP_HOSTNAME=xen05.gbgnetwork.net
# Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
DEVICE=eth3
BOOTPROTO=static
HWADDR=00:26:55:2B:D8:A0
ONBOOT=yes
#HOTPLUG=no
#DHCP_HOSTNAME=xen05.gbgnetwork.net
DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback
DEVICE=xenconsole0
TYPE=Bridge
#STP=on # Turning this on doesn't help solve this problem
ONBOOT=yes
BOOTPROTO=static
IPADDR=172.21.0.62
BROADCAST=172.21.0.63
NETMASK=255.255.255.192
NETWORK=172.21.0.0
DEVICE=xenconsole30
TYPE=Bridge
#STP=on # Turning this on doesn't help solve this problem
ONBOOT=yes
BOOTPROTO=static
DEVICE=xenconsole47
TYPE=Bridge
#STP=on # Turning this on doesn't help solve this problem
ONBOOT=yes
BOOTPROTO=static
DEVICE=xenconsole49
TYPE=Bridge
#STP=on # Turning this on doesn't help solve this problem
ONBOOT=yes
BOOTPROTO=static
[root@xen05 ~]#
[root@xen02 ~]# cat /etc/sysctl.conf |grep ip_forward
#net.ipv4.ip_forward = 0
net.ipv4.ip_forward = 1
[root@xen02 ~]#
[root@xen02 ~]# brctl show[root@xen05 ~]# brctl show
bridge name bridge id STP enabled interfaces
eth1xenbr10 8000.0026552bd89c no vif21.0
tap0
vif20.0
tap1
eth1.10
eth1xenbr30 8000.0026552bd89c no eth1.30
eth1xenbr47 8000.0026552bd89c no eth1.47
eth1xenbr49 8000.0026552bd89c no eth1.49
virbr0 8000.000000000000 yes
xenconsole0 8000.0026552bd89a no eth0.10
xenconsole30 8000.0026552bd89a no eth0.30
xenconsole47 8000.0026552bd89a no eth0.47
xenconsole49 8000.0026552bd89a no eth0.49
[root@xen05 ~]#
[root@xen06 ~]# cat /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
ethtool -K eth0 tx off
ethtool -s eth0 speed 1000 duplex full
ethtool -K eth0 tso off
ethtool -K eth1 tx off
ethtool -s eth1 speed 1000 duplex full
ethtool -K eth1 tso off
xm mem-set 0 4091
ntpdate -s dc1
ethtool -s eth0 speed 1000 duplex full
ethtool -s eth1 speed 1000 duplex full
#ETHTOOL_OPTS="speed 1000 duplex full autoneg on"</p> <p style="text-align: left;"></p> <p style="text-align: left;">#iscsiadm -m discovery -t st -p 192.168.200.20
#iscsiadm -m node --targetname "iqn.1986-03.com.hp:storage.msa2312i.0938da0e3f" --portal "192.168.200.20:3260" --login
/sbin/vgchange -a y
/sbin/ip link set dev eth0 mtu 9000
/sbin/ip link set dev eth1 mtu 9000
# mkdir /etc/xen/vmlist
# ln -s /etc/xen/vmlist /var/cache/convirt/vm_configs
#/usr/share/convirt/install/managed_server/scripts/convirt-tool setup
touch /var/lock/subsys/local
[root@xen06 ~]#
http://wiki.centos.org/AdditionalResources/Repositories/RPMForge

