An interesting experience with kernels, KVM, and hardware virtualization

debolaz

New Member
Jul 10, 2009
14
0
1
Before you keep reading this story, be clear that it's not a request for help and not intended as criticism. I'm simply writing about this because I didn't find any mention of a similar situation in the forum already and figured someone might find themselves looking for information about it.

Yesterday, I set up a new proxmox installation on a machine pretty much identical to the one we're already using, and connected the two in a cluster. On the machine we already were using for proxmox, let's simply call it A, there was a KVM instance which I tried to migrate over to the new machine, which I'll refer to as B.

On machine A, the KVM instance ran smoothly, but on machine B, the performance became abysmal or at least quite sluggish. There weren't any obvious problems indicated anywhere, I looked through the dmesg log of both the host and the KVM instance but nothing really out of the ordinary. Now, both hosts had the same kernel running, 2.6.18 and both were up to date. But the old host was updated to 1.5 from a 1.3 installation, so I figured that might be the reason for my problems, that something in the new fresh 1.5 installation weren't set up correctly. Yeah, I know, there weren't really much base for that assumption, but I didn't have a whole lot of ideas at the time.

I searched these forums for information on what might be the problem, and figuring the problem to be specific to the combination of FreeBSD (The guest OS) and KVM in some way, my search led me to a post that although probably was an entirely unrelated problem, actually would lead me to a solution. A reply to the original post described timing issues and a sluggish command line, symptoms very similar to the ones I experienced. The user behind said reply eventually tried switching his kernel to 2.6.24 and the problem went away so I figured it would be a smart thing to try the same, even though the current kernel worked fine on a different machine.

So I install the 2.6.24 kernel, reboot, and behold, I get error messages; Hardware virtualization was disabled. In hindsight, it's probably something I should've checked earlier but I was thrown off by the apparent fact that KVM actually seems to work without hardware virtualization enabled when you use a 2.6.18 kernel. No wonder my KVM instance was running so slowly, the poor thing was running in software mode.

Anyway, that's my story, in case someone finds themselves in a similar situation and tries searching the forum. :)