Linux-KVM: Using KVM on Oracle Linux 6
In my new role I am using Oracle Linux more and more, so as an exercise I have been replicating my builds on Oracle Linux. Here we are going to use Oracle Linux 6.2 x86_64 as a KVM hypervisor. Keep in mind that KVM is not Oracle’s preferred hypervisor, however it is supported, but if you plan on taking advantage of the reduced software licensing cost by limiting your cores for Oracle Products you will need to use Oracle VM, which is built on Xen not KVM. Read on to find out how to configure Oracle Linux as a KVM hypervisor.
Configure Oracle Linux Repositories
You can use Oracle’s Public Yum server. This provides free software updates and a package source for Oracle Linux. Keep in mind, these updates do not require a support contract and thus do not come with any support. If you need support you can buy it from the Oracle Store.
# cd /etc/yum.repos.d/ # wget http://public-yum.oracle.com/public-yum-ol6.repo
Install Latest Updates
I installed all of the latest updates, it came out to be around 120 updates. And it brought me up to the RHEL-Compatible Kernel 2.6.32-220.17.1.el6 and UEK 2.6.32-300.25.1.el6uek.
Configure Ethernet Bridge
# cat ifcfg-br0 DEVICE=br0 TYPE=Bridge NM_CONTROLLED=no ONBOOT=yes BOOTPROTO=dhcp
# cat ifcfg-eth1 DEVICE=eth1 NM_CONTROLLED=no ONBOOT=yes BRIDGE=br0
# /etc/init.d/network restart Shutting down interface eth1: bridge br0 does not exist! [ OK ] Shutting down loopback interface: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth1: [ OK ] Bringing up interface br0: Determining IP information for br0... done. [ OK ]
Install Required Software
The only things we really have to install is kvm, and libvirt if you want to use libvirt to manage it.
# yum install kvm libvirt
I also include the following software in my KVM builds as they add a lot of flexibility (vim and pv are not even hypervisor related but I use them extensively to edit xml and move disk images).
# yum install python-virtinst virt-top virt-manager virt-v2v virt-viewer vim pv
Once you have performed the install everything required for KVM is ready to go. Next we need to define a VM, this can be done with virt-manager. Or by using one of my previously documented methods.