Virtualization

Ubuntu Open Week - Virtualization - Soren Hansen - Sat, May 3, 2008

=== jcastro changed the topic of #ubuntu-classroom to: Ubuntu Open Week | Information and Logs: https://wiki.ubuntu.com/UbuntuOpenWeek | How to ask questions: https://wiki.ubuntu.com/UbuntuOpenWeek/Rules | Ask questions in #ubuntu-classroom-chat, prefaced with "QUESTION:" |See https://wiki.ubuntu.com/UbuntuOpenWeek/JoiningIn to filter out channel noise | "Virtualization" Soren Hansen

[16:59] <jcastro> Next up will be a hot topic lately, Virtualization with Soren Hansen!

[17:00] <jcastro> In about 1 minute. Big Grin :)

[17:01] <jcastro> soren: take it away!

[17:02] <jcastro> hmm, let's give him a few minutes

[17:07] <jcastro> Ok, we're texting soren, thanks for being patient!

[17:10] <jcastro> Ok, soren is on his way!

[17:11] <soren> o/

[17:11] <soren> Sorry, guys!

[17:11] <soren> I was sure it wasn't for another two hours.

[17:11] <jcastro> No worries!

[17:11] <soren> Ok... Hi, everyone.

[17:11] <soren> I'm Soren Hansen, and I work for Canonical as virtualisation specialist.

[17:12] <soren> Er..

[17:12] <soren> This caught me a bit off guard Smile :)

[17:12] <soren> Are there any questions already or should I just talk about stuff?

[17:13] <soren> I guess not.

[17:13] <soren> Well, I can tell you what Ubuntu is focusing on and has focused on for Hardy.

[17:14] <soren> I think we're the first major distro to put out a major release with a virtualisation solution based on kvm.

[17:14] <soren> KVM is a modular hypervisor that runs in the linux kernel.

[17:15] <soren> It's in the official kernel tree, and is very well-maintained.

[17:15] <jcastro> Real quick soren, can you explain virtualization, hypervisor, and KVM?

[17:15] <soren> KVM relies on the presence of the virtualisation extensions that are found in recent processors from both AMD and Intel.

[17:16] <soren> jcastro: Ah.. Right Smile :)

[17:16] <soren> Virtualisation is not as well-defined as one would have hoped.

[17:16] <soren> The easiest way to think of it is "some method for running many operating systems on just one machine at the same time".

[17:17] <soren> That's a rather broad definition, though.

[17:17] <soren> You can divide virtualisation into various categories..

[17:17] <soren> There's containers, such as openvz and linux vserver.

[17:18] <soren> They basically allow you to have process running in a completely separate namespaces, thus separating the completely from one another.

[17:18] <soren> Then you have paravirtualisation.

[17:18] <soren> This is stuff like Xen.

[17:19] <soren> The idea is that instead of exposing what looks like a regular PC as we all know it, it exposes a different interface, on top of which you can run e.g. a specialised linux kernel.

[17:20] <soren> The there's full virtualisation.

[17:20] <soren> This is stuff like KVM and QEmu.

[17:20] <soren> The idea here is that run unmodified operating systems inside of it.

[17:21] <soren> To accomplish this, the virtualisation technology must make it looks exactly as though it's a regular PC.

[17:21] <soren> ...just like the one you've got under your desk.

[17:22] <soren> There are variour variations of these things, but that's basically the gist of it.

[17:22] <soren> A hypervisor is the bit of magic that makes this all possible.

[17:23] <soren> It's the "thing" that takes care of assigning resources to guest operating systems and such.

[17:24] <soren> I say "thing" because it's can be implemented in different ways. Xen works by booting a completely different system from the start and then you run Linux on top of it. (sort of)

[17:24] <soren> KVM works by loading a module in your regular system, which makes userspace processes able to use the virtualisation extensions in the CPU.

[17:24] <soren> So in this case, the hypervisor is the kernel module and the kvm userspace process.

[17:25] <soren> < highvoltage> QUESTION: Does that mean that KVM won't run on any of the older CPUs, like Qemu did?

[17:25] <soren> Short version: Yes.

[17:26] <soren> One thing to remember is that the percentage of machines that can't use kvm is constantly dropping.

[17:26] <soren> ..and due to this hardware requirement, KVM's design is very simple compared to most alternatives.

[17:27] <soren> < Toadinator> QUESTION: could you explain the benefits of virtualization to someone who doesn't run a virtual machine?

[17:27] <soren> Sure.

[17:27] <soren> Hardware is cheap these days.

[17:27] <soren> Most of the time, you fill up your data centers with the monstrous machines.

[17:28] <soren> If you run some form of virtualisation on top of that, you can have many separate operating systems running.

[17:29] <soren> If, some day, these virtual machines start to max out the server, all you need to do is migrate the virtual machine off to another physical machine.

[17:29] <soren> The virtual machine still sees the same hardware, so there's no reconfiguration to be done in the guest.

[17:30] <soren> The process of moving it is a simple matter of either copying a few disk images (regular files) ove rto another machine, or if you have some form of shared storage, you can just move the virtual ram over to another box and it can keep running there.

[17:30] <soren> I've heard people suggest it used as a power saving mechanism.

[17:31] <soren> Your servers are much busier during the day than they are at night, so at day, your virtual machines can be running on 200 servers, but at night you move them onto perhaps 25, and shut the other 175 down and save loads of power.

[17:31] <soren> ..and the rain forest.

[17:31] <soren> Smile :)

[17:31] <soren> The possibilities are endless.

[17:32] <soren> On your desktop, you can use virtualisation to run other operating system for testing or for that last application under Windows you just can't live without.

[17:32] <soren> < chell> QUESTION: what exactly does he mean by running a process in a different namespace? what kind of namespaces are we talking about here?

[17:32] <soren> Containers are sort of an extended version of a chroot jail.

[17:33] <soren> If you're in a chroot jail, device nodes, memory usage, processes are still the same as it is outside the chroot.

[17:33] <soren> Inside a container, you can't see processes from other containers, you can't access their device nodes, etc., etc.

[17:34] <soren> < chell> Question: so KVM is a program like vmware or virtual box?

[17:34] <soren> Yes, kvm is very much like those. The differences are that it's completely free and maintained in the mainline linux kernel.

[17:35] <soren> < smeg0l> QUESTION i find qemy very heavy what other alternatives do i have that wil run on hardy heron ?

[17:35] <soren> QEmu is very heavy indeed.

[17:35] <soren> Emulating a CPU is a very heavy process.

[17:35] <soren> KVM uses parts of QEmu, but not the cpu emulation parts.

[17:36] <soren> We also have virtualbox and Xen in universe and vmware server runs, too, so there are plenty of options.

[17:36] <soren> We've just chosed to focus mostly on Xen.

[17:36] <soren> Er..

[17:36] <soren> Damn, I did not just say that.

[17:36] <soren> I meant, of course, that we've chosed to focus mostly on kvm.

[17:37] <soren> QUESTION: does virtualization let the guest OS see your BIOS? I ask because I have a vista Express upgrade DVD which will only install in a virtual machine on THIS machine (the one it was distributed for)[D

[17:37] <soren> No, that's the entire point of virtualisation. The virtual machines don't see your hardware.

[17:37] <soren> < smeg0l> QUESTION what vitual maniger would cause the least trouble ?

[17:37] <soren> I don't understand the questin.

[17:38] <soren> < Salumu> QUESTION: How does hypervisors manage to run system calls from the applications in the virtual guest OS?

[17:38] <soren> This is where Xen and kvm differ very much.

[17:38] <soren> Well, one of the places, anyway.

[17:38] <soren> System calls in Xen are translated to hypercalls to the hypervisor.

[17:39] <soren> In Kvm guests, you're running a regular linux kernel. It turns into CPU instructions which the hypervisor execetes on the host CPU (expect for privileged instructions, which are trapped and handled differently).

[17:40] <soren> < DoruHush> QUESTION: What other requirements have to be mentioned beside the processor?

[17:40] <soren> Nothing, really.

[17:40] <soren> If your processor has the magic stuff and your bios doesn't block them, then you're set.

[17:41] <soren> Flyser> QUESTION: Can we expect a stable KVM release some day? (if yes, when? )

[17:41] <soren> I'm not sure what you mean by a stable KVM release.

[17:42] <soren> The KVM in Hardy is rather stable. It's been working for a quite a few people with different use cases.

[17:42] <soren> highvoltage> QUESTION: How stable is KVM compared to VMWare and Xen, and how does it compare performance wise?

[17:43] <soren> KVM as achieved massive results in a very short time. It's already very stable for a lot of different work loads and I'd say it's a strong competitor to Xen.

[17:43] <soren> I can't speak much of VMWare. I've not used it in any serious settings (only for small case testing on my desktop).

[17:44] <soren> < smeg0l> QUESTION what vitual manager would cause the least trouble ?

[17:44] <soren> I don't understand the question.

[17:45] <soren> tzeentch_> QUESTION: Why the focus on KVM? What advantages does it have over VirtualBoxOSS or Xen? Do you think Xen couldn't be wrapped up to provide easy to use virtualization solution?

[17:45] <soren> KVM as much, much simpler than Xen.

[17:45] <soren> It's actually something that we can reasonable maintain and support.

[17:45] <soren> Xen has famously been rejected by the linux kernel developers on several occasions.

[17:46] <soren> One of the primary reasons we didn't choose virtualbox is the lack of headless support in the free version.

[17:47] <soren> The non-free version offers an RDP server, so it's actually usable in server settings (which was our focus).

[17:47] <soren> Also, virtualbox is not in mainstream Linux. That really, *Really* means a lot.

[17:47] <soren> QUESTION: Do you know of any large uses of virtualisation, running on Ubuntu?

[17:48] <soren> Well, Hardy is the first release where it's a major feature, and Hardy's still quite young.

[17:48] <soren> Nevertheless, I do know of a rather large installation, but I'm not sure if I'm at liberty to tell you about it :/

[17:49] <soren> < bran_damage> QUESTION: Soren .. so I have hardy, I have AMD64 with VM extensions ... now what ? What do I do to get KVM running

[17:49] <soren> The easy way:

[17:49] <soren> sudo apt-get install kvm virt-manager libvirt-bin

[17:49] <soren> sudo adduser $USER libvirtd

[17:49] <soren> (log out, and log back in)

[17:49] <soren> virt-manager -c qemu:///system

[17:50] <soren> That'll give you a nice, graphical interface for managing your virtual machines.

[17:50] <soren> highvoltage> QUESTION: how scriptable is KVM? can I suspend it on host shutdown and start it again when the host starts?

[17:50] <soren> Yes, you can do that rather easily.

[17:51] <soren> It's recommended to use libvirt to manage your virtual machines, and if you do so, it's a simple matter of "virsh save name-of-domain saved.img" and then "virsh load saved.img", when you're back up.

[17:51] <soren> < smeg0l> QUESTION which virtual manager is the most userfriendly ?

[17:51] <soren> What do you mean by virtual manager?

[17:51] <soren> Do you mean hypervisor?

[17:52] <soren> If so, it's a matter of taste, I think.

[17:52] <jcastro> tip: screenshots of virtual manager: http://www.phoronix.com/scan.php?page=article&item=983&num=1

[17:52] <soren> VMWare server is still a bit ahead of virt-manager in many respects.

[17:52] <soren> VirtualBox, too.

[17:52] <soren> ...but the libvirt/virt-manager combination is really starting to shine, and it offers excellent scriptability, which is a major userfriendliness factor for me.

[17:53] <soren> Oh, I forgot part of this question:

[17:53] <soren> < ~tzeentch_> QUESTION: Why the focus on KVM? What advantages does it have over VirtualBoxOSS or Xen? Do you think Xen couldn't be wrapped up to provide easy to use virtualization solution?

[17:54] <soren> Anything's possible, but I'm very happy indeed that I don't need to support and maintain a Xen kernel for 5 years.

[17:54] <jcastro> We're starting to run out of time, can you tell everyone about

ubuntu-vm-builder after this question?

[17:54] <soren> livirt can manage Xen instances, too, so the userfriendliness can be about the same (from the user's POV).

[17:55] <soren> jcastro: Oh, sure.

[17:55] <soren> ubuntu-vm-builder started out as a bit of a pet project for me. In short, it's a script that creates an Ubuntu based virtual machine.

[17:56] <soren> It doesn't go through the regular installer, it doesn't even use any virtualisation technology.

[17:56] <soren> ..so it's really fast.

[17:56] <soren> I've built ubuntu virtual machines in less than 45 seconds.

[17:56] <jcastro> More info here: https://help.ubuntu.com/8.04/serverguide/C/ubuntu-vm-builder.html

[17:57] <soren> If you have further questions, #ubuntu-virt is the channel for virtualisation in Ubuntu. Feel free to stop by any time.

[17:57] <jcastro> thanks Soren!

[17:58] <soren> Thanks for stopping by, everyone!

MeetingLogs/openweekhardy/Virtualization (last edited 2008-08-06 17:00:19 by localhost)