Installing KVM with RHEL5.4 is pretty easy. These were some of my notes that I hope you can somewhat follow along with. I have since done it with RHEL5.5 with the same results. Here’s how I got my virtual machine up:
1. Install Packages
yum -y install kvm python-virtinst libvirt libvirt-python virt-manager virt-viewer
** Note: I got some of these packages from xCAT’s distribution which has some updates. But some of these should still work.
2. Start libvirt
chkconfig –level 345 libvirtd on
service libvirtd start
3. Configure Bridge Network
In my set up I want my virtual machines to be able to access the network. I also want machines on the network to access my virtual machine. In my setup, eth1 is on the internal network to my cluster. What I will do is create a bridge with eth1. I also need to make a few aliases to handle my different networks.
# Intel Corporation 80003ES2LAN Gigabit Ethernet Controller (Copper)
4. Create Virtual Machine
virt-install –name xcatmgr –ram 1024 –connect qemu:///system –disk path=/install/libvirt/images/xcat.img,size=10 –vnc –cdrom=/install/isos/RHEL5.4-Server-20090819.0-x86_64-DVD.iso -b br0 –os-variant=rhel5
4.2 Copying Virtual Appliance
I created an xCAT appliance that I wanted to run:
service libvirshd restart
Then import my machine:
(or just copy it to /etc/libvirtd/qemu and restart libvirshd)
From there it just booted up, launched virt-viewer and away it went. I’m doing this on 1TB SATA disks, and the performance is just horrible.
Even though I did this all with RHEL5.4, this post was very helpful as well.
Now, I also want my nodes to bridge directly to the physical network.
service libvirtd stop
ip link set virbr0 down
brctl delbr virbr0
create br0 with /etc/sysconfig/network-scripts
bind it to eth1
then make new net:
brctl setfd vlan1 0
ip addr add dev vlan1 172.20.1.19/16
brctl addif vlan1 eth0
ip addr del dev eth0 172.20.1.19/16
ip link set vlan1 up
Other good notes: