Two mistakes I made with VMs today

April 24, 2013

For reasons that kind of boil down to 'laziness', I only rarely delete or create VMs in my use of virtualization. Instead I mostly recycle or re-purpose already created VMs by reinstalling OSes on them, or sometimes not even reinstalling but just slapping some additional packages on to the existing VM image. When I'm in much doubt about the state of a VM or need it to be in a different one, I reinstall. Usually this works well, but today I discovered that I'd wound up with two accidents.

The smaller discovery was that both of my primary VMs (currently both being used for some testing) had lingering disk snapshots from months ago when each of them was being used for very different things. At a minimum this was taking up extra disk space. It may also have been slowing down disk IO due to copy-on-write issues, although after months of churn and OS reinstalls that may have wound up a non-issue.

The larger discovery was, well, let me put it this way: ZFS on Linux turns out not to be very happy when you try to run it on a VM with a 32-bit kernel and only 512 MB of RAM, especially if you're also using multipathed iSCSI. In retrospect I'm kind of impressed that the ZFS code didn't detonate on contact with that environment (although it did start producing kernel panics when I put it under enough load). Such is the drawback of repurposing existing VMs without paying much attention to their configuration.

(You might wonder how I could possibly get into that situation. The short answer is that it all started when I was doing some testing of low-memory web server setups and reused the same VM for a quick 'does it actually run' test of ZFS on Linux. Then later I came back to do more testing without actively noticing the VM's configuration and thinking about it.)

I don't have any clever ways of avoiding this in the future; it's just something that I'll have to keep an eye out for every so often, especially if I (temporarily) configure a VM into an unusual state (such as having low memory).


Comments on this page:

From 99.241.170.29 at 2013-04-24 23:22:02:

You could use some VM templates. Create a couple of base images with the OSes you like. When you need a new VM clone from the template, do your work, and delete it. Cloning from a template should be considerably faster then reinstalling.

IMHO VM templates are one of the big advantages of virtual machines.

From 160.218.178.18 at 2013-04-25 00:40:37:

Hi,

This is exactly the case when i use OpenNebula. It is one of the "cloud" sollutions, but that complicated. Having some basic images means, that testing something means creating instance of the template and when you are done, delete the vm. In many situations its only one-click action. In basic setup, OpenNebula does not need complicated setup... 15mins operation with binary packages.

The good thing is that you do not mix testing enviroments in one OSes and could have only the needed running.

-jhr.

Written on 24 April 2013.
« Goodbye, djb dnscache
How SuS probably requires the 'run at least once' xargs behavior »

Page tools: View Source, View Normal, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Wed Apr 24 01:01:52 2013
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.