产品实验室服务器之前安装的是xen,kvm作为后起之秀也值得测试一下,于是将其中一台服务器格了,重装CentOS6和kvm。
服务器硬件:
- 2 * Intel Xeon(支持虚拟化)
- 4 * broadcom千兆网卡
- 2 * SAS 300G硬盘
安装
这种安装方式还是不够简洁,可以尝试以下方式:
安装完之后需重启相关服务:
# service libvirtd status
如果libvirtd没有启动,需要先启动messagebus和avahi-daemon
至此,KVM的安装就结束了,非常简单。不过在生产环境中还需要考虑网络和存储,相对复杂一些,网络拓扑环境如下:
网络
- eth0/eth1做成bond0,通过br0与业务交换机(huawei S5328-1)相连
- eth2/eth3做成bond1,通过br1与存储交换机(huawei S5328-2)相连
以下是网络配置
配置网卡
配置bonding
假如没有/etc/modprobe.d/bonding.conf,就自己创建一个。
假如bonding还没有加载,那就手工加载。
配置bridge
最后重启网络:
# service network restart
检查
网络配置完成之后,可从其它机器ssh登录br1的ip地址,测试网络是否可正常工作。