KVM VMs - Sysadmin+

I'm getting to grips with VM management. It all seemed easy enough - just create some VMs and get going. In practice, it's nearly as easy as that, but there are some gotchas you've got to keep an eye on.

The gotchas are mostly to do with guest OSes and kernels. I've found, for example that kernel- works just fine, but a system running kernel- will constantly consume 15-20% CPU on the hypervisor, even if the guest is completely idle. Likewise, some Centos guests will consume about 30% CPU on the hypervisor, unless you add in some settings to drop it down to <5%.

In my particular case, I'm using KVM as my hypervisor, which has a few foibles. Networking proved to be a big one for me - the semi-default "virtio" networking is great, but doesn't perform as well as using "tunctl" TAPs. When I say it doesn't perform, I really mean it too - a VM web server, talking to a VM MySQL server on the same physical box went painfully slowly, but with TAPs in place, it's going super-fast (tips on how to do it here).

The pros, on the other hand are that you can fiddle about with systems like crazy and if it all goes wrong, you can revert it back in minutes. For example, in trying to work out why one of my VMs consumed so much CPU, I was able to build, upgrade, rebuild, downgrade, boot, reboot and re-network a VM really quickly and really easily. There are umpteen snapshot and backup options, as well as cloning and rescuing options, all of which give you a lot of flexibility.

Also, if you want to run some graphical VMs (either Linux or Windows), then you can do that and get a VNC server specifically for your VM - and all the while, your VM "thinks" it's got a graphics card all to itself. That's really handy if your VMs are hidden away in a computer room or something (*ahem* the loft *ahem*).

So I'm really enjoying virtualisation, but it's by no means "install and forget" - it takes a bit of care and attention in some new places you're probably not expecting. It's still well worth it though...

Submitted by coofercat on Mon, 2010-09-27 19:16