I spent most of the last week, setting up and configuring a bunch of virtual servers using OpenVZ. I had a need to do some server maintenance at home and I thought it was a good time to experiment with a little virtualisation. Considering the fact that I only had low-powered VIA boards to work with, my virtualisation options were quite limited. I was not going to be able to run anything like KVM or even Xen. So, my only option was to go with either OpenVZ or VServer.
These virtualisation solutions are considered ‘light-weight’ ones. They are similar to BSD Jails and Solaris Containers. They are not the same as VirtualPC, VirtualBox, VMWare or Xen. They run using one single OS kernel and share the machine resources and hardware in a more transparent manner. According to the websites, each solution only adds about a 1%-3% overhead to a regular server.
I finally went with OpenVZ and installed it on a server with only 256Mb of RAM and a 533MHz processor. This is more than enough to run OpenVZ (according to its minimum requirements). Everything proceeded quite smoothly except for a couple of things and I thought that I should note them down here because it was not easy getting the information from the Internet.
Firstly, I could not use the stock OpenVZ kernel that came with Debian Lenny. It was a 686 kernel but the VIA processor that I was using did not have the CMOV instruction. I tried compiling my own kernel several times but had problems. So, instead of wasting my time, I just downloaded an older 486 kernel for Debian Etch. This worked without any problems and is, by far, the easiest way of getting OpenVZ to run on older platforms.
Secondly, after getting things up and running, I wanted to tweak each server’s private resources. Unfortunately, the OpenVZ came with only two sample configuration files and had lots of arcane formulas that are needed to work out the parameters. So, I started tweaking around but never seemed to get things right. Looking on the Internet didn’t help and it seemed that there were few example config files available for OpenVZ.
Then, I finally read the documentation and found out that I could generate a custom configuration based on my own server using
vzsplit, which is a utility that came with OpenVZ. So, I ended up generating a config suitable for running about 12 virtual servers on my low-powered VIA machine. That got things to work splendidly.
I managed to learn a few new things about Linux from setting up and observing these virtual servers run. I finally got to monitor the boot-up process in real-time.
The beauty of having this system set up is that I can now freely experiment with new software. All I needed to do is to create a new virtual server, test things out. Once done, I could just wipe out the virtual server. Furthermore, I could migrate these virtual servers from one host server onto another. This will mean that I would lose minimal down-time if I ever need to upgrade the server. All this will definitely come in handy in the future.
Virtualisation is the way to go if you need to administer stuff in a manageable way.