Dell 2950 Dual E5420 + CentOS + KVM + Eth0 Bridge Mode

今日代人入手 Dell 2950 , 拎完番來即”操”佢.

玩完佢個DRAC5 後,  就即安OS

安過VMware ESXi (但用Client 連線失敗), 之後都係直接安CentOS 5.4 64bit.

再玩Virtual Machine – KVM. 先係安個XP, 再安VISTA, 再安CentOS.
但發現Win XP 運行時係會拎個分俾佢用的CPU Full Loading. 但CentOS 又冇事.
找一找RH Doc, 佢話:
“Windows XP 32-BitOptimized with para-virtualized drivers (network driver only)”
咁我一心以為係死証, 就暫時冇搞XP, 去玩番KVM 下的CentOS.

KVM下的CentOS速度上也唔係慢太多. 運行
“ab -c 1000 -n 10000 http://127.0.0.1/phpinfo.php” 和非VM 也只是大約10%-20%之差.

再之後就請教左M群的LazyFai 兄有關Win XP @ KVM Full Loading CPU 問題, 佢也找了一陣, 替我CHECK 了一陣, 之後俾我地發現了原來係因為 KVM 運行XP 時正常係會以HAL Mode 運行, 從而導致CPU Loading 誤報問題
解決方法係在安XP 前要在其設定檔中加入acpi 設定:

vi /etc/libvirt/qemu/xxxx.xml
在 中加入
<acpi/>
<apic/>
便可以進行安裝XP

再者, 如果需要VM所用的NETWORK 有如直接連接到主網絡的話, 便需要設定最少一個Network Interface為Bridge Mode.
設定如下:

# Disable NetworkManager
chkconfig NetworkManager off
chkconfig network on
service NetworkManager stop
service network start

# Creating network initscripts
cd /etc/sysconfig/network-scripts
vi ifcfg-ethX

DEVICE=eth0
# change the hardware address to match the hardware address your NIC uses
HWADDR=00:16:76:D6:C9:45
ONBOOT=yes
BRIDGE=br0

vi ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=dhcp
ONBOOT=yes
DELAY=0

service network restart

# Forward All bridge traffic OR Disable iptables on bridges

iptables -I FORWARD -m physdev --physdev-is-bridged -j ACCEPT
service iptables save
service iptables restart


vi /etc/sysctl.conf
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
sysctl -p /etc/sysctl.conf

# Restart the libvirt daemon.
service libvirtd reload

# Verify Bridge Setting
brctl show

# Change VM to Bridge Interface
By GUI Remove Interface and Add new interface with bridged ethX
OR
Modifiy the VM’s xml “interface type” part

<interface type='bridge'>
<mac address='xx:xx:xx:xx:xx:xx' />
<source bridge='br0' />
</interface>

之後就再參考RH DOC 吧.

Reference:
Dell 2950
KVM VM Setting Sample
Red Hat Enterprise Linux 5 – Virtualization Guide

Leave a Reply

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.