Virtually in Production with the Mac Mini and Parallels Desktop

(Part 1)

This is a little story about me using an Intel Mac Mini and Parallels Desktop to create a virtual machine room to replace my real home based machine room that was little bit overkill and had became a bit of a burden.

It all started as a downsizing of my home network. Over time, my network had grown to a couple of 19 inch, 1U Intel Celeron servers, running FreeBSD. The servers were left over from a small hosting business I had run in the past. A Mac Powerbook was being used as a "management" workstation. Network connectivity was and is still a DSL connection. I had also set up a private network. I had a small router and a switch. I had also added wireless for the laptops in the household. The equipment was all living in a closet that was air conditioned to keep the servers cool. I'd also added two twenty amp breakers to support the power requirements of the systems and air conditioning. All of this is used to host DNS, and SMTP/POP/IMAP email. I also host a number of web sites for friends, family and my pet projects. The most popular web site receives about 10,000 visitors a week. This was all just fine until oil prices started to go up.

I live in Hawaii on the island of Oahu. Almost all of the electricity on Oahu is produced by petroleum fired power plants. The local power authority wasted no time in raising their rates. At that point my little server farm became a financial burden. I didn't feel very "green" about all the power that it was using. Additionally, my little server room was lost space in my household, not available for other uses. As small as that infrastructure was, it was still a little too big for my requirements and my two bedroom apartment. I started to think about alternatives.

When the Intel Mac Mini came out as a dual, it really caught my attention. My pair of servers had Celeron processors. One was 1.7GHz and the other 2.0GHz. Both had 128KB L2 cache memory and 512MB of main memory. The Intel Mac Mini has a dual core, 1.66 GHz processor with a 2MB shared L2 cache. The Mini also has a 667 MHz front side bus and memory, faster than the front side bus on both my celeron servers. Some people have criticized the Mac Mini for the use of the Intel GMA950 graphics processor. In my case, that didn't really matter, I mostly run web sites on those servers. Overall, I felt like the performance of the Mac Mini might be enough for it to carry my servers as virtual systems.

Shortly after that, Parallels, Inc. started to ship Parallels Desktop for Mac, running on the Mac Intel workstations. It occurred to me that I could use the mini to host everything, and get rid of all the servers, switches, routers, wireless access points, cabling and air conditioning. It was too tempting to ignore. Using Parallels, I thought I might be able to host the FreeBSD servers without losing too much performance. I could share the Internet out to my laptops through the wireless card that comes with the Mini. I knew this would all be one giant, single point of failure, but I knew that if I kept backups on offline media, I'd be able to restore quickly enough to meet my modest uptime requirements. Hardware is also a lot more reliable than it used to be. With all this in mind, I went to work.

I went out and bought a Mac Mini core duo with 2 GB of main memory and a 100 GB internal drive. I added a 500 GB external firewire drive to store the virtual drives for the FreeBSD servers. I planned on getting a second 500 GB USB2 drive as a backup device. My old servers would act as the backup until I was satisfied that the virtual servers worked. I bought and installed Parallels Desktop for Mac (Build 1848, 12 June 2006).

I built two Virtual FreeBSD servers using FreeBSD 6.1. Based on the operational experience of the Celeron servers, I set the two virtual server main memory sizes to 384 MB, to allow room for other virtual systems. I set their network adaptors to bridged ethernet. I created each virtual server with two disk drives, 21505 MB and 128000 MB. The smaller drive is used for FreeBSD system partitions, specifically /, swap, /tmp, /var and /usr. The larger drive is used for non system data such as home directories and web site data. The maximum size for a Parallels virtual disk drive is 128000 MB. I also chose plain disk images to enhance performance. Next I needed to bring over the data from the old systems.

I started by shutting down all the services on the first server except sshd. I used tar and ssh to copy all the server data from the first server, including the configuration files for users, groups, mail, bind and the other services on the system. I copied the user mail spool to the virtual server. I then copied over the home directories and web site documents and logs. The user and web data amounted to more than 30 GB and was too large to use intermediate files. I used ssh to run tar on the old server and sent the standard output to tar on the virtual server, restoring the data on the fly. After restoring all the data to the new virtual machine, I set to putting the virtual server into production.

I placed the Mac Mini on the Internet with all it's service turned off. I merged in the /etc/rc.conf from my old server into the new virtual server. I copied the contents of /etc/ssh from the old server to the virtual server so the ssh identification would not change. I restored /etc/mail and /var/named/etc/named. I rebooted the virtual server putting it on the Internet in place of the old server. I pinged my default gateway and another local server to check the network. I tested my bind process on the virtual server to make sure that it was answering queries. Next was starting sendmail. I patched sendmail and restarted it. After that I added an IMAP4/POP3 server from the FreeBSD ports collection. I also added the rc scripts for my builds of postgresql and apache to /usr/local/etc/rc.d. I started both the database and the web server. I merged in my firewall rules from the old server and rebooted. After doing some testing, it looked like my first virtual server was working. So far, so good. If you wonder how it's doing, you're reading this web page from it.

In the next part, I'll talk about my experience bringing up the second server and my operational experiences with hosting this virtual machine room that I have created. Stay tuned.