Why ? For example the OVH default kernel is too secure and does not handle module loading.

Install some prerequisite (compiler, library, etc.)

yum install make
yum install gcc
yum install ncurses-devel

Download kernel sources : http://www.kernel.org

cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.2.31.tar.bz2
tar xf linux-3.2.31.tar.bz2
cd linux-3.2.31
make mrproper

Download default OVH configuration : ftp://ftp.ovh.net/made-in-ovh/bzImage/

wget ftp://ftp.ovh.net/made-in-ovh/bzImage/3.2-config-xxxx-std-ipv6-64
mv 3.2-config-xxxx-std-ipv6-64 .config

Launch the configuration tool

make menuconfig

The following menu appears:

– Select “Load an Alternate Configuration File”. Select .config configuration file previously downloaded.
– Tick “Enable loadable module support” and other needed sub-options.
– Exit and Save

Start compilation (very very long)

make

Copy the new kernel in /boot

cp arch/x86_64/boot/bzImage /boot/bzImage-modules-on-3.2.31-xxxx-grs-ipv6-64

Configure grub

vi /boot/grub/grub.conf
default=0
timeout=5

title linux centos6_64
kernel /bzImage-modules-on-3.2.31-xxxx-grs-ipv6-64 root=/dev/sda2 ro
root (hd0,0)

Reboot the server

init 6

Check the kernel version

uname -r
3.2.31-xxxx-std-ipv6-64

That’s all folks.

Source : http://fr.wikitwist.com/ovh-compiler-kernel-personnalise

Another great article on the same subject (french) : http://wiki.9fevrier.com/wiki/Installation_d%27un_serveur_de_machines_virtuelles_KVM%2BQEMU_chez_OVH