This three-part series explains step by step how to create a Xen high availability setup with only open source components. Part one covers how to implement an iSCSI storage area network (SAN) through SUSE Linux Enterprise Server (SLES) 11 . In the upcoming two installments, you will learn how to create shared storage on the SAN, and how to implement the high availability environment itself.
In a high availability environment, virtual machines (VMs) automatically restart the moment the host server goes down. For the VMs to be accessible, though, you need to make sure the virtual hard disks of those machines are still reachable. To accomplish this, you have to put them on a SAN.
There are two kinds of SANs: expensive proprietary offerings or free open source software. With open source Xen, you can achieve high availability without the need to pay extra. This article will explain how to set up an open source SAN using SUSE Linux Enterprise Server (SLES) 11.
Typically, free software-based SANs use the iSCSI protocol. iSCSI offers a SCSI implementation in which the SCSI cable is replaced by a network cable. To send SCSI packets, the protocol uses an iSCSI target and an iSCSI initiator. The iSCSI target is configured on the machine where you offer the shared storage, and the iSCSI initiator is used on the servers that need to access the shared storage. After connecting the iSCSI initiator to the iSCSI target, the initiator server will see a new device on the SCSI bus – all of which is connected to the SAN disk.
Setting up the iSCSI target
Setting up an iSCSI target is not difficult. It all starts with a server running SLES 11 with a lot of shared storage available. Here I will assume that you have an entire disk to share with the Linux device name /dev/sda (Note: If you'd like to share another device, substitute /dev/sdb with the device name you'd like to use).
To configure the iSCSI target, log in as root ,and from the SLES 11 computer menu, start the Yet another Setup tool (YaST) administration program. Next, select Network Services, then iSCSI Target. When prompted to install the iscsitarget package now, make sure the SLES 11 installation DVD is accessible, and click Install.
Now you'll see the iSCSI target configuration interface. From the Service tab, select the When Booting option to start the service automatically. Then, in the Targets tab, remove the example target that is created by default. Click Add to create your own iSCSI target. Once you are in the configuration interface, enter the device name that you want to share. From there, click Next after specifying the name of this device (and also after verifying that the device is not used for anything else). Then, you'll see the iSCSI target added to the device overview (see Figure 1).
At this point, you can finish the installation procedure by accepting all the default choices. Once complete, the iSCSI target device has been added.
Configuring the iSCSI initiator
Now that the iSCSI SAN is operational, access it. To do this, you need to configure the iSCSI initiator (Note: This may be a part of the iSCSI host bus adapter in your server. In this scenario, I cover how to configure a software iSCSI initiator that is a part of SLES 11). After logging in as root on the server, connect to the SAN and start YaST. From there, start Network Services > iSCSI initiator. On the Service tab, select When Booting and next activate the Discovered Targets tab. After that, click Discovery and enter the SAN's IP address (not the DNS name). This should bring up the iSCSI target disk that you've just configured (see figure 2).
Once you see the iSCSI target disk, click Log in. Then, click Next to pass the authentication credentials screen in the secured environment. Now go to the Connected Targets window and click Toggle Startup. Under the Startup option, select Automatic. At this point, you can click Finish to finalize the installation of the iSCSI target.
The last test is on the servers you have connected to the SAN. Use the lsscsi command to list the available SCSI devices. You should see the iSCSI disk, which is indicated as the iSCSI Enterprise Target (IET) type disk device, as seen below:
node1:~ # lsscsi [0:0:0:0] disk VMware, VMware Virtual S 1.0 /dev/sda [2:0:0:0] cd/dvd NECVMWar VMware IDE CDR10 1.00 /dev/sr0 [3:0:0:0] disk IET VIRTUAL-DISK 0 /dev/sdb
After successfully connecting a server to the iSCSI SAN, you'll see a new IET disk device type. Repeat this procedure on the rest of the servers you want to connect to the iSCSI SAN.
Sander van Vugt is an independent trainer and consultant based in the Netherlands. Van Vugt is an expert in Linux high availability, virtualization and performance and has completed several projects that implement all three. He is also the writer of various Linux-related books, such as Beginning the Linux Command Line, Beginning Ubuntu Server Administration and Pro Ubuntu Server Administration.