Computing in the real world
SEARCH FOR: IN:
Guest  Level 00    Register Log in

Real World Computing

SAN on the cheap

18th January 2006 [PC Pro]

machine1 10.0.0.46 drbddisk::r0 iscsi-target

where machine1 is the primary machine named as a node in the ha.cf file. The IP address is the one that will offer the service - it won't be an IP address that's normally used on the machine, but one that's transferred back and forth according to which machine is the primary. The final two entries tell the heartbeat software to use the DRBD disk resource 'r0' and start the iSCSI target service.

We did all of the above, started the heartbeat and up came the iSCSI target. Then, from our Windows machine, we mounted the new volume, formatted it, copied on some files and it all kept working, so we started to get nasty. We tried starting a large copy operation and shutting down the heartbeat on the primary machine to simulate a failure. There was a definite hang in the copying process while the Windows machine found the IP address again, but it did all work.

After that, we just started to get more and more destructive -because it kept working - eventually just pulling the power lead out of the primary to see what would happen. The heartbeat worked as expected and the service transferred to the secondary. Again, the Windows initiator seemed to pause, but then continued the copying and finished. Not quite believing it had worked, we ran an MD5 checksum tool on the files on the iSCSI drive and they reported the same checksum as the original files, which means it really did work and all the blocks were transferred successfully.

One final note on the iSCSI target software that's available for Linux: it will allow you to export any block device that, as we've seen, includes raw disks, partitions on disks and emulated block devices. In this case, we've used the DRBD emulated block device, but we could have also exported a software RAID device from the system. At the time of writing, the open-source implementations didn't support exporting character devices, which means you can't export a tape drive, although the iSCSI protocol allows this and some commercial implementations support character devices.

When we first started writing this article, we'll admit that, while we wanted to believe it was all going to work, we weren't sure whether it would. By the end of the article, though, we can be nothing but impressed by how well it works. Using off-the-peg open-source software, we've managed to put together a basic but compelling implementation of a SAN using iSCSI. We've only just touched on what a SAN is for and what iSCSI can do, but what a great start.

Continued....