To Hell with Virtualisation – Updated

These days virtualisation seems to be all the rage. There are some benefits to it. It’s a way to increase the utilsation of your hardware just as pipelining increases the utilisation of the processor’s execution units. But as pipelining it comes at a price. You might increase the throughput, but the latency gets higher. Furthermore the response times become highly random, as they now depend on all the other users on the machine.

Especially in the context of development this poses a few risks. I have been working in environments with the build servers using virtual machines and shared database servers. This leads to variable build (and test) times – usually not shorter ones though!

It leads developers to ignore the time the code takes to execute, because there is no reliable feedback and all problems tends to be blamed to the environment or the database. In the worst case it leads to integration tests being ignored and abandoned, because they fail for timeouts, which result from dead slow code and unreliable system performance.

It is often said that code is to be read by humans. This is true. But it is also true and to be borne in mind, that code is run on machines. Virtualisation is clearly obscuring this fact.

Update: Dale was making the interesting point, that virtualisation is giving you a more controlled environment, because you can save your virtual machine and go back to defined points. This seems like a good thing and makes things easier in the first place. I think this is a double edged sword. In my experience you actually start incurring dependencies to that very environment. In my opinion software should be written in a way that it manages and contains it’s state. I have seen projects where you had to install database servers into the operating system (registry!). Then install stuff into the database server. Of course you also needed an application server. Everything needs to be configured. Then you run another obscure unscriptable utility to get your test data into the database. There is a huge temptation just doing these things manually and then save a snapshot of your vm. The actual problems like the use of side-effect-laden tools, resource-leakage during runtime, and poor setup-scripts remain untacled.

Writing a system that can’t work without a reboot is not a good practice. It should be a good citizen in the operating system or on the virtual machine it runs on.


Posted

in

by

Tags:

Comments

3 responses to “To Hell with Virtualisation – Updated”

  1. Dale Avatar
    Dale

    Don’t blame virtualisation – blame the stingy IT department that is running 10 virtual machines on a spare old server thats hanging around.

    1 big advantage of virtualisation in build/deploy is the ability to throw away the machine state and start again. Each build and deploy can be on a completely fresh sytem – no chance of artifacts hanging round from a previous run to get in the way.

  2. Clinton Avatar
    Clinton

    +1 Dale. As both a developer and an administrator, I love virtualisation.

    As a developer it lets me run a production-like VM on my local machine that I can enjoy whether I’m at work or on an airplane. More importantly, it lets me do so for multiple projects.

    As an administrator, the benefits are too long to fit as a comment on a blog. 🙂 But the most important is consistency. If the underlying hardware/OS needs to change, the VM can stay the same. If the hardware needs to be upgraded, I can move the VM temporarily almost instantaneously, and do so without interruption in service. I can also reinstall the OS remotely (see SliceHost) etc. etc.. I can’t even go on, there’s too much.

    Performance is the one cost, which is minimal if the VM is 1:1 with physical machines, and obviously scales down from there. But that’s where Dale’s point comes in. It’s silly and cheap-minded to try to overload a server with too many VMs. I run VMs even if I have dedicated hardware available, even if it means 1 VM per box.

    Clinton

  3. Sriram Ram Narayanan Avatar
    Sriram Ram Narayanan

    I see that there are multiple issues you are trying to address:
    – occasionally unresponsive virtual machines
    – apps installs that require a reboot
    – being bound to a vm because you have installed some infrastructure apps into it (such as databases).

    For occasionally unresponsive systems, try using resource pools on VMWare ESX. That works. We’re running around 12 VMs on a regular blade in the Bangalore office and folks are fine with the performance. When I monitor the ESX server’s resources using the VMWare Infrastructure Client, I see that VMs that are allocated 2 GB RAM making use of 800 MB RAM, etc. This is 800 MB of the memory that is available to VMWare. Then VMWare goes on to use swap if needed. There are special settings for swap, where the person setting up the VM can choose to run the SWAP on a different drive from where the VMs are loaded.

    Having a SAN in the picture makes an impact too. I’m going to try to locate the swap file on the local hard disk while the VM comes from the high speed SAN.

    – app installs that require a reboot.
    Windows apps that require a reboot may either have post install actions that have to run at startup, or want to replace files that are in use at the time of installation, or perhaps the installer as written that way. All these situations are documented in the MS guidelines on installer best practices. I don’t recall the proper terminology for this, or the links, because I’d last read this information in 2004.

    – being bound to a VM because you have installed some apps into it (such as a database) and are now bound to it.
    That is how I have interpreted your statements to be. Please correct me if I have understood differently.
    You may want to consider such as VM as being a reusable resource itself. After all, you’re not going to change databases as often as you change application code. Such a database VM would be similar to having a Windows VM which has some service packs installed for you. In such a case, use the database initialization scripts on database VMs that come up from a snapshot on demand.

    Having VMWare tools installed also makes a lot of difference.

    Note, I’ve written all of the above based on my undersatnding of and day to day work with VMWare in the Bangalore office. I do know have experience with KVM or know of KVM having resource management etc a la VMWare. I do know that XVM Server (Xen by Sun) and VirtualBox both have a similar notion of “drivers” that recognize the underlying platform to be virtualized and which work in conjunction to help allocate resources such as CPU, RAM, Disk, Display, Network, USB, External Storage.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.