24
Nov

Progress...

Posted on November 24, 2009 by justin

Once upon a time, man picked up two rocks, and bashed them together to see what would happen.

Thousands of years on, the most exciting thing in the scientific world, is STILL man taking two rocks[1], and bashing them together to see what happens.

 

In other news, TCL is really neat.My project this weekend was PXE booting diskless virtual machines. The idea was to have identical operating systems each serving up different websites. I achieved this by the following setup:

First off, was virtualbox on Linux Mint, and the uml-utilities installed. Create a virtual interface (tap0) using tunctl, and turn on ip forwarding. The virtual machines can then be configured using bridged networking, have internet access, not be hidden away by a NAT, and they won't pick up an address from other DHCP servers on the network.

My first virtual machine has a hard disk. This one has two packages (plus there deps) installed - nfs-utils and dnsmasq.

Dnsmasq does TFTP, DNS, and DHCP for the other virtual servers. The TFTP server has the packages for Django, Pysqlite, nfs-utils, and cherokee. Each ip address that gets used has a PXE config. These configs are identical except for their NFS mountpoints. Each IP address has a seperate mountpoint, and this is where the backups get stored and read from.

The backups are where the home directories and the cherokee config files are stored. These backups get loaded at each boot, and written every shutdown.

Since everything is booted into RAM, the first VM can die a horrible death, with the only impact on the diskless machines being that new ones can't start, old ones can't backup, and DNS stops working.

Setting up NFS had a fairly bumpy road, and the builtin tools in TC for PXE boot didn't want to respond to DHCP requests. But in the end, I have a system where I can provision a new webserver for a new django-based website in a matter of minutes.

Since the important files are all kept in one place, there's only one server to do backups for, even though there may be (20|30|100|1000) virtual machines. Even with the entire operating system booted into RAM, from a fresh boot only about 80~90MB of ram is being used. Compared to a Ubuntu based virtual server with 450MB of ram being used.

It will be interesting to load test one of these virtual servers, and see how TC fairs. A project for next weekend, maybe.

 

Also of note was that virtualbox VM's randomly lock up if more than two are running at once, using the default ubuntu package of virtualbox (2.2). The commonly recommended fix is to use "nohz=off" when booting, which was a dead end for me. I just removed 2.2 and installed the 3.0 package off the virtualbox website, problem (seems to be) solved.

 

[1] So they aren't actually rocks. And they're much smaller than rocks. And they go faster than rocks. We're still just smashing things into each other.

Comments

0 comments have been posted.

Post a comment