Showing posts with label server. Show all posts
Showing posts with label server. Show all posts

Saturday, November 20, 2010

Nice New Server!

So, Microsoft is threatening to release a new version of Windows Home Server (I use it for automated backups of the predominant Windows client machines in the home) that is 64-bit only.
VMware ESXi 3.5 only supports 32 bit guests and the Dell PowerEdge 1600SC as nice (and quiet!) as it is only supports 32 bit hardware.

What's a guy to do?

Go and buy another server of course!

So after some researching, it seems that the Dell Poweredge 840 fits my bill:
1. Not too noisy
2. Will take at least Core2 processors
3. At least 4GB RAM
4. At least space for 4x HDD
5. 64 bit capable
6. Run VMware ESXi 4.0

After obtaining one on Ebay (and paying as much again for shipping, wow!) it was time to get some upgrades.

The unit was supplied with a double core Pentium 4 3.4GHz chip, which unfortunately didn't support virtual hardware extensions. Replacing that with the Intel Xeon X3230 gives it the fastest and "quaddiest" CPU that the machine can handle (again, limitations of the 1,066MHz bus...).

The next thing was to organise a DRAC4/P remote management card. I have found the one that was in the PE1600SC to be useful at times, although it didn't seem to be able to handle Linux once booted (I'm guessing I was missing the appropriate driver).
This was a bit of a mis-adventure, as I purchased a card without the obligatory cable - I couldn't even configure it from the BIOS! A few weeks later my bacon was saved in the form of buy another card with the cable, for the same price as the initial card and now it works fantastically.
I had trouble getting the DRAC interface to accept VMware ESXi ISO so just gave up and put the disk in manually.

The next revelation was that the supplied Dell PERC5/iR was actually a hardware RAID card, although it only supports RAID0 and RAID1. At the moment this will suffice (I have a 2TB drive in there at the moment... getting the second one soon) but I'm keeping an eye out for a PERC6/i to allow hardware RAID5 for the next upgrade.

In addition, this unit came with 4GB of RAM with an upper limit of 8GB. It's going to be a bit squeezy once I run up a MythTV server, but with the doubling of available RAM, it should suffice for now.

The server is extremely quiet... when it's cool! When the mercury rises, it can get significantly more noisy than the PE1600SC it's replacing.

Good thing it sits on a shelf in the laundry!

Thursday, July 22, 2010

Squid proxies, Disk space and VMware ESXi

Finally - a case that proves my point about having multiple partitions on multiple disks under VMware ESXi!

Yesterday, coming home from work I was greeted with a chorus - "The Internet stopped working!". Uh-oh. Bad news for any part-time administrator.

I have noticed on occassion that the OpenBSD machine can stop forwarding packets and the solution is to log into it, fire a packet across the WAN and then one into the LAN and it seems to pick-up from where it left off - it's strange but infrequent.

Not this time. Reboot the OpenBSD firewall and get nothing. Jump on to the machine, locally I can get web pages from the Internet, but not inside the network. Finally the penny drops when on my laptop I get a message saying that someone is "online on Skype".

Duh.

Something with the transparent web proxy. Sure enough, checking the logs I find:

Jul 21 18:11:46 cerberus squid[3627]: Write failure -- check your disk space and cache.log
Jul 21 18:11:46 cerberus squid[28891]: Squid Parent: child process 3627 exited due to signal 6
Jul 21 18:11:49 cerberus squid[28891]: Squid Parent: child process 18622 started
Jul 21 18:11:50 cerberus squid[18622]: Write failure -- check your disk space and cache.log
Jul 21 18:11:50 cerberus squid[28891]: Squid Parent: child process 18622 exited due to signal 6
Jul 21 18:11:53 cerberus squid[28891]: Squid Parent: child process 3621 started
Jul 21 18:11:54 cerberus squid[3621]: Write failure -- check your disk space and cache.log
Jul 21 18:11:54 cerberus squid[28891]: Squid Parent: child process 3621 exited due to signal 6
Jul 21 18:11:54 cerberus squid[28891]: Exiting due to repeated, frequent failures


So to all those that insist there's nothing wrong with one great big partition (more true if some fool does not over allocate space to his web cache server... but I digress!) the only thing that failed in this scenario was the web cache. Even the logging kept working (as most Unix'ers would know, logging to the /var directory) as it still had some space up it's sleeve as a root-user task.

Okay. That's pretty obvious. The easy answer is to reduce the space allocated for the cache, for example from 8192MB to 7000MB. The downside to this is then I'd have to nuke all of the cache to start again.

The much more insane solution is to say - hang it. I've paid for all of this data, so I'll expand the size of the partition. Now, being a smarty-pants, I've actually thought about this scenario before it happened. Most of the partitions live on disk 0 (/dev/sd0 - it's a SCSI disk), except for /var (where the cache files live) which is on disk 1.

Bewdy...

...nearly - unfortunately, I don't know how to expand partitions under OpenBSD (and the only references I could find at the time said that it wasn't possible) - but it's Vmware ESXi to the rescue.

So, a few clicks later, I've got a new 30GB virtual disk set up - run a SCSI bus rescan to pick it up and place it into the device pool.

disklabel -E sd2

To enter disklabel programme and edit the tables interactively
newfs /dev/sd2d

To format it and...
cd /mnt
sudo mkdir newvar
mount /dev/sd2d /mnt/newvar
cd newvar

to mount the new var into the file system and...
sudo dump -0 -a -u -f - /var | sudo restore -r -f -

to copy the old /var into the new /var.

Next we need to tell the file system that we're changing disks - so edit the /etc/fstab file to reflect the new location.

Finally, perform a reboot and it all worked great.

Reading the configuration options a little harder for squid, tells us that we should not allocate more than 80% of the disk space to the cache. Hmm... 10,000MB partition, 8,192MB cache. Oops. Now it's set up a little differently with a 20GB cache on a 30GB partition, which allows some more room to grow if neccessary.

Filesystem Size Used Avail Capacity Mounted on
/dev/sd0a 1008M 39.7M 918M 4% /
/dev/sd0i 707M 533M 139M 79% /home
/dev/sd0d 2.0G 2.0K 1.9G 0% /tmp
/dev/sd0e 3.9G 424M 3.3G 11% /usr
/dev/sd0f 3.9G 36.2M 3.7G 1% /usr/local
/dev/sd0h 2.0G 335M 1.5G 17% /usr/obj
/dev/sd0g 2.0G 647M 1.2G 34% /usr/src
/dev/sd2d 29.5G 9.4G 18.7G 33% /var
-bash-4.0$

Tuesday, July 6, 2010

Server Biology

Starting with the server... a bit more than a home server perhaps.

I acquired a Dell PowerEdge 1600SC over eBay a few years ago. After a few upgrades it looks like this:
. 2x Intel Xeon 2.4GHz HT CPU's
. 3GB DDR ECC RAM
. Dell PERC4 SCSI Hardware RAID Controller
.. 2x Seagate 146GB 10kRPM SCSI 68pin - configured as 1x 146GB RAID1 Array
. Adaptec ASR-2420SA SATA Hardware RAID Controller
.. 3x Samsung 1TB 5400RPM SATA - configured as 1x 2TB RAID5 Array
. Dell DRACIII/XT Remote Access Card
. Intel PCI-X Gigabit Ethernet adapter
. Intel PCI Fast Ethernet adapter
. LG IDE DVD-Burner

Next step was to backup my Gentoo Linux installation that was doing most of the serving (including NAT, firewalling and transparent web proxy) from the machine before blowing it away and installing VMware ESXi 3.5. Backup was done using my favourite piece of open-source, Clonezilla.

VMware ESXi 3.5 was installed in under a few minutes - from the reports on the web I put this down to having enough memory (apparently it will refuse to install if you don't have at least 1GB) and the SCSI disks (you can get around this with some creative installation techniques).
The first thing I learned was that to make it a silky smooth install you need to erase the partition table on the disks - this way ESXi assumes you want to use the entire disk and formats it up for you on the installation disk.
Once installed it was a case of restoring the backup... this is where things get a little interesting. Given that most of the PC's in the house are not Linux or FreeBSD based, I had an issue where ESXi doesn't recognise the USB backup disk and some fool formatted it in EXT3... oops!
Fortunately using my work copy of VMware Workstation on a laptop soon had my backups coming across the network at a snails pace...

Changing from "physical" to "virtual" is apparently easy when you have the machine there physically - that is, when you don't have to format it to install ESXi on the machine first. Fortunately, some quick thinking had me back up and running quickly through the use of CloneZilla! Quite simply, with my virtual copy of FreeBSD running on a laptop hosting an SSH session, I created a new virtual machine on the ESXi box and booted a CloneZilla ISO, connected by SSH to the laptop and pulled down about 10% of the backup.
What about the other 90% - all of the data, the movies, music and photographs? It was easier to file copy them on to the USB disk, so it was just a matter of booting into the new Gentoo VM and SSH them back from the laptop.

Interestingly, going to a virtual machine had an unintended bonus for expandability. When configuring up the hard disk it occurred to me that because everything was now virtual, I could make as many disks as I liked. So I now have one whole disk for the operating system (root, /etc, /usr...) and one disk each for /home and each of the movies, photographs and music folders. The advantage here is that on a conventional system if I want to expand the music partition (which happens to be located on a partition between the photographs and the movies) I would have to shuffle around partitions, potentially taking a lot of time and upsetting things. On ESXi, you can simply expand the disk in the "settings" menu and then expand the partition to cover the new space. Job done - no shuffling of partitions.

The obvious next question would be why have everything in partitions? Why not have an enourmous single partition? Well that is partially a hold-over from having two hard disk controllers and thus a minimum of two disks, as well as many years of configuring paranoid OpenBSD systems. The advantage of having partitions mean that if something goes crazy and fills up the /home partition, or any of the other data partitions then the process stops - the rest of the machine will not experience any problems as /var and /tmp are isolated.

The next most obvious question would be, why use ESXi (and lose those nice USB ports!) when you're only running one operating system to do it all?
Well, there are somethings that I trust Gentoo to do... and somethings I prefer to do with OpenBSD!! In addition to that I have searched high and low for an automatic backup solution for the family PC's and not found anything better than Windows Home Server... and when I say better, I mean easier!

But we'll save that for a later post...