Virtualisation

Posted by Graham Stratton Mon, 09 Apr 2007 15:49:28 GMT

Virtualisation is the current big thing, and it’s easy to see why. But in many ways it opens up such a flood of possibilities that it’s hard to understand where to start. Virtualisation also has interesting implications for hardware and software vendors.

Products

By far the largest player in the virtualisation market is VMware. Microsoft are clearly not comfortable with this situation, and since their Virtual Server product cannot compete and they will not have anything new until at least 2008, they have announced support for VMWare’s main rival, XenSource, a company built around the Open Source Xen virtualisation platform.

The ways that Xen and VMWare work are quite fundamentally different. VMWare’s solution requires slightly more overhead, but means that pretty much any x86 OS will run in a VMWare virtual machine, and these virtual machines can be hosted on a variety of other OSes. Having got a bit of experience with VMWare’s VMWare Server, (which has become free for download since the increase in competition from the likes of Xen), I have to say that it is very professional and reliable. Install was straightforward and painless, and downloaded virtual machines just worked as you would hope.

Wikipedia has a useful overview of virtualisation. As a rough summary, the difficulty in implementing virtualisation is with a small set of instructions which need to be handled differently on a virtual operating system to how they would be on an OS running natively. VMWare works by replacing these calls with system calls before they are run. This is responsible for the overhead when using VMWare.

Xen requires guest OSes to be modified in advance in order to be able to run, taking out offending instructions replacing them with calls to Xen itself. This means that to run under Xen, operating systems have to be available for modification (for example open source ones), and have to actually have been modified (often only the most recent version). This clearly limits Xen’s potential.

However, Intel and AMD have recently added dedicated virtualisation extensions to their chips, in the form of VT-x and AMD-V extensions. These are similar extensions, and Xen manages to add a single abstration layer above both of them called HVM. These extensions enable an unmodified OS to be started as a virtual machine, after which the OS will call the hypervisor (the code which runs the virtual machine, eg Xen) whenever a ‘problem instruction’ is encountered. This enables many more operating systems, notably including Windows, to be run, and already compatible OSes to be run without modification.

VT-x technology is available in most Intel chips from the Core Duo onwards. The exception is a few budget and low-power chips. However, some hardware vendors disable the functionality, particularly in laptops.

Apple and Vistualisation

Apple are doing very well at the moment, and part of that is because since they moved to Intel processors it has been possible to run Windows on Macs. The means that the ‘I like Macs but won’t buy one in case I need to run some PC software’ crowd were all suddenly potential customers. But some people need to use Windows applications pretty much continuously, and for them the pain of having to reboot to a different OS for that is still too much. Along comes virtualisation, and suddenly they can run Windows and OSX simultaneously. Great. So now they’re potential customers.

But OS X on Intel is (somehow) restricted to only be able to run on Apple hardware. And currently this means that you can’t have an OS X virtual machine, even running on a Mac. So whilst I can have a few Linux virtual machines lying around for testing different things, I currently can’t have a second OS X install. Maybe this is a critical thing, maybe not. It does seem to limit Apple’s potential in the server market, though. Parallels does support Intel’s VT-x virtualisation extenstion, which enables guest OSes to run with no modification directly on the hardware, but it seems that this still isn’t enough.

I was just browsing the Parallels website, and encountered their new Coherence technology, allowing you to run Windows ‘in the background’ with Windows application windows floating around your desktop alongside you Mac apps. Very cool, if an obvious step on a route to confusion!

Applications of Virtualisation

So, what uses does virtualisation have? There are a few obvious savings where a number of different OSes need to be run simultaneously, for example for testing. And it can be useful in order to try out a different OS. But more interesting is to ask what problems currently exist, and consider whether virtualisation is a good solution.

As a web application developer, I spend a surprising amount of my time doing sys admin stuff, and I’m still far from having a good setup. I’d like a more solid backup strategy, and some sort of continual testing.

I offer my clients a hosting service, but at the moment if my server fails it will take a few hours of work on my part to get the sites hosted there back up and running (relying on some notes which I will have to pull out of Google’s cache!). If I had all of the sites backed up to a virtual machine, I could just copy the virtual machine onto another server and be ready to go.

Of course, the obvious next step here is to replace my server with a virtual server which is continually backed up. This doesn’t seem to be as popular an option as I was expected. None of the virtualisation vendors seem to be pushing the ability to do this. Possibly part of the reason is that even if you have a continual backup of the disk image, you are far from having a continual backup, as writes may be buffered. If you snapshot a disk image of a running system and run it, the OS will assume that it crashed. To take a snapshot of a running virtual machine, you have to snapshot the memory as well, which is entirely possible, but means you might have to back up more data (and certainly have more changes in incremental backups) than you might expect.

One feature which the Xen guys like to promote is the ability to transfer a virtual machine seamlessly from one host to another. This is a very nice and useful feature. The downtime is estimated at about 0.1 seconds, so provided that your network gear switches over quickly enough everything should go unnoticed. However, this requires a large amount of bandwidth, and therefore having a server continuously in a state where it could instantaneously fail-over is not practical, though maybe mirroring every ten seconds would not be unreasonable within a private network.

Overdoing it?

After first encountering virtualisation, I soon wanted to run everything in a separate machine. Then I began to ask why. Surely most operating systems are perfectly capable of running many separate services, and having a separate install of an operating system and lots of standard packages for one small task seems rather wasteful, particularly of memory (which isn’t quite free yet, unlike disk space).

So, is there a limit? It does make sense to run each service on a separate machine (say mailserver, webserver, firewall (virtual firewall??)), but what about individual web applications? Certainly some of my deployed apps require different libraries to others, and it might be handy to be able to upgrade them individually. But there’s workingenv to create a completely separate python environment, so only system libraries are an issue.

A few random thoughts

I haven’t yet seen anyone saying that they can dynamically move memory between systems. I wonder whether that’s possible?

End.

This post is getting a bit long, so I think I’ll return to ‘what virtualisation can do for me’ another time.

no comments

Comments

(leave url/email »)

   Comment Markup Help Preview comment