Linode KVM (beta)

Avatar caker 4 years ago Linode Staff

Linode KVM (beta)

Linode started in 2003 with User Mode Linux as the virtualization technology. We switched to Xen in 2008. Now, the time of KVM is upon us! We've integrated KVM into our platform and we'd love your help testing. Why KVM? Read on…

What is KVM?

Kernel-based Virtual Machine (KVM) is a Linux feature that exposes CPU VT virtualization extensions (among other things), thereby turning Linux into the hypervisor. Enabling KVM in the Linux kernel does nothing on its own – it simply creates a /dev/kvm device node which userspace software can use to take advantage of KVM. In the Linux KVM world, that userspace tool is QEMU. QEMU is the virtualization container, which can run guests at near native speeds when using KVM.

What does this mean for Linodes?
* KVM has less overhead, and therefore Linodes will run much faster. We found that on a Linode 4G, a KVM Linode compiles a kernel 27% faster than a Xen Linode.

  • Linodes can now boot direct-from-disk, using your Master Boot Record (MBR) and your bootloader, and your distribution's/OS's kernel.

  • Linodes can be either 32 (or 64) bit, without any exceptions, tickets or special requests.

  • Linodes can now run any operating system, as we now support full virtualization, in addition to para-virtualization. This means you can run all sorts of operating systems - from BSD to Plan9.
    What are the guest differences?

The "Distro Helper" fixes these up for you on boot, depending on the hypervisor your Linode is booting under. So, you shouldn't need to worry about this – but, you'll need this info if you're running non-Linux OSs: KVM Linodes use /dev/ttyS0 for console and /dev/sd* for block device nodes. Xen uses /dev/hvc0 and /dev/xvd*, respectively.

Are there any beta limitations?
* The Linode KVM beta is now in all DCs except for Tokyo.

  • There is no graphical console, yet.
    How does the beta work?
    * We'll move one of your existing Linodes to one of these special hosts

  • There are limited slots available

  • This is experimental

  • You might lose all of your data

  • Participate at your own risk

  • This may be the LAST time you see that Linode

  • You really should have backups

  • Expect the unexpected

  • It is likely that you will experience downtime

  • This may cut you

  • No pain, no gain
    What do I do as a beta participant?

First, please do make sure you have backups of your system. There are no guarantees how stable this thing will be. Secondly, you don't need to do anything special. We want to get a good sense of how this will perform under real-world workloads. Thirdly, if you want, feel free to perform some benchmarking on your own, and share your experiences here.

We'd also like to see what weird OSs you guys can get running.

Is the beta currently open?

Yes! - Click here to apply and we'll move the Linode you specify over to the KVM beta.

If you find a bug, or an issue, we'd appreciate it if you start a new forum thread instead of replying to this one.

-Chris

  • Edit for Update 2: Added datacenters, and backup

15 Replies

"Linodes can now boot direct-from-disk, using your Master Boot Record (MBR) and your bootloader, and your distribution's/OS's kernel."

All I can say is… YES! Thank you!

Just booted up my first "direct-from-disk" image and it was smooth sailing! Performance seems to be on par with my Xen node. Network including IPv6 working like a charm!

I've been with Linode through the UML->Xen days and am excited for the transition to KVM!

Any ETA for production?

Just booted FreeBSD 10.1 RELEASE with direct-from-disk. Works like a champ. Only had to enable serial console in the FreeBSD bootloader. KVM is slick…..

@andersen:

Just booted FreeBSD 10.1 RELEASE with direct-from-disk. Works like a champ. Only had to enable serial console in the FreeBSD bootloader. KVM is slick…..

Neat..I need to ask a dumb question. How do you do direct from disk?

tnx

@fbroce:

@andersen:

Just booted FreeBSD 10.1 RELEASE with direct-from-disk. Works like a champ. Only had to enable serial console in the FreeBSD bootloader. KVM is slick…..

Neat..I need to ask a dumb question. How do you do direct from disk?

tnx

The basic idea is it is a disk image that includes the bootloader with it. Much like doing a raw dd from your hard drive including the Master Boot Record and embedded bootloader.

I'll publicly post what I PM'd to another member showing what I did to get FreeBSD up and running in Linode KVM. Hopefully that will give you some insight. Unfortunately FreeBSD doesn't ship with a VM with the serial console turned on or it would be a LOT easier (ie: you could skip steps 2-6). Note I'm not a FreeBSD guy so I used linux to prepare the disk image bootable for Linode KVM:

In order to get FreeBSD-10 up I did the following:

1. On my linux system downloaded the vm image:

$ curl ftp://ftp.freebsd.org/pub/FreeBSD/releases/VM-IMAGES/10.1-RELEASE/amd64/Latest/FreeBSD-10.1-RELEASE-amd64.raw.xz

2. Decompress (long wait)

$ xz -d FreeBSD-10.1-RELEASE-amd64.raw.xz

3. Boot the system with graphical console in kvm (loads bootloader and then the os)

$ qemu-system-x86_64 -enable-kvm -drive file=FreeBSD-10.1-RELEASE-amd64.raw,if=virtio

4. Login as root and enable serial console

$ echo 'console="comconsole"' >> /boot/loader.conf

5. Shutdown and test serial console in kvm

$ qemu-system-x86_64 -enable-kvm -nographic -drive file=FreeBSD-10.1-RELEASE-amd64.raw,if=virtio

6. Recompress (optional)

$ xz FreeBSD-10.1-RELEASE-amd64.raw

7. If that all works, then boot up finnix, upload the image and copy to linode raw disk

$ xzcat FreeBSD-10.1-RELEASE-amd64.raw.xz |dd of=/dev/sda

Create a direct-from-disk profile and boot….profit!

Thanks. I see how you did it.

I may give it a go. I installed freebsd on another host and set up up like my linux vm here. I notice

the Freebsd machine seems to grow the swap partition even though I optimized things.

I only have a 1g ram machine so maybe that's the problem. I expect it would not

happen on a 2g linode machine.

I may give it a go although even though I have run the BSD's off and on I still prefer Debian.

Sure seems like kvm opens a world of possibilities.

As I'm seeing KVM upgrade offers on all my Linode without having opted into the beta, am I correct in assuming that it's now considered out of beta? Or is Linode still treating KVM as beta?

@archon810:

As I'm seeing KVM upgrade offers on all my Linode without having opted into the beta, am I correct in assuming that it's now considered out of beta? Or is Linode still treating KVM as beta?

I saw this as well and have successfully tried it on a test Linode. It looks like it is production ready, but I am still assuming it is not for now until I've heard otherwise. On a related note, June 16th is Linode's birthday, so I'm assuming they'll save the announcement until then. :)

@Ghan_04:

@archon810:

As I'm seeing KVM upgrade offers on all my Linode without having opted into the beta, am I correct in assuming that it's now considered out of beta? Or is Linode still treating KVM as beta?

I saw this as well and have successfully tried it on a test Linode. It looks like it is production ready, but I am still assuming it is not for now until I've heard otherwise. On a related note, June 16th is Linode's birthday, so I'm assuming they'll save the announcement until then. :)

Hah, that's actually my birthday too. Would be nice indeed.

After switching to KVM I see increased CPU usage under the same load.

![](" />

KVM caused your network usage to increase (which also mirrors your cpu load)? I don't think so :)

-Chris

That's some serious bandwidth- odd how incoming and outgoing are near identical.

@caker:

KVM caused your network usage to increase (which also mirrors your cpu load)? I don't think so :)

-Chris

Sorry - I should have said the upgrade is just after 18:00 on the chart. OpenVPN throughput remains the same but CPU clearly increases.

EDIT: Could this possibly be a reporting error due to the change of CPU model/clock speed? (v2 to v3) My Linode 1G is now reporting 116% CPU utilisation!

@andersen:

4. Login as root and enable serial console

$ echo 'console="comconsole"' >> /boot/loader.conf

Protip that I discovered because I fat-fingered this. Just curl | xz the image straight from the FreeBSD servers to Finnix without activating the serial console. I used:

$ curl ftp://ftp.freebsd.org/pub/FreeBSD/relea … d64.raw.xz">ftp://ftp.freebsd.org/pub/FreeBSD/releases/VM-IMAGES/10.1-RELEASE/amd64/Latest/FreeBSD-10.1-RELEASE-amd64.raw.xz | xzcat | dd of=/dev/sda

Once it's done, connect to LISH and start the direct-disk configuration, and catch it in LISH at the boot menu (where you have the 10 seconds). Select the option to escape to the loader prompt, then type set console=comconsole at the OK prompt, and assuming no errors, type "boot".

Then login as root, and add the command to loader.conf, set a root password, and enjoy.

I wish I'd figured that out before I spent hours waiting for my disk image to extract, recompress, and upload on my piddly ADSL. :(

Hope that helps.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct