I’ve spent a good chunk of today trying to prepare a clustered virtual machine demonstration using the Microsoft iSCSI Initiator and Target.
I’ve done this before but only on training courses and I was more than a little bit rusty when it came to configuring iSCSI. It’s actually quite straightforward and I found Jose Barreto’s blog post on using the Microsoft iSCSI software target with Hyper-V a very useful guide (even though the Hyper-V part was irrelevant to me, the iSCSI configuration is useful).
The basic steps are:
- Install the iSCSI Target (server) and Initiator (client) software (the Initiator is already supplied with Windows Vista and Server 2008).
- Set up a separate network for iSCSI traffic (this step is optional – I didn’t do this in my demo environment – but it is recommended).
- On the client(s):
- Load the iSCSI Initiator, and answer yes to the questions about starting the iSCSI Service automatically and about allowing iSCSI traffic through the firewall.
- Examine the iSCSI Initiator properties and make a note of the initiator name on the General page (it should be something like iqn.1991-05.com.microsoft:clientdnsname).
- On the Discovery page, add a target portal, using the DNS name or IP address of the iSCSI Target and the appropriate port number (default is 3260).
- On the iSCSI server:
- Create a new target, supplying a target name and the identifiers of all the clients that will require access. This is where the IQNs from the initiators will be required (you can also use DNS name, IP or MAC address but IQN is the normal configuration method).
- Add one or more LUN(s) to the target (the Microsoft implementation uses the virtual hard disk format for this, so the method is to create a virtual disk within the iSCSI Target console).
- Make a note of the IQN for the target on the Target properties and ensure that it is enabled (checkbox on the General page).
- Back on the client(s):
- Move to the Target properties page and refresh to see the details of the new target.
- Click the Log on button and select the checkbox to automatically restore the connection when the computer starts.
- Bring the disk online and initialise it in Disk Management, before creating one or more volume(s) as required.
After completing these steps, the iSCSI storage should be available for access as though it were a local disk.
It’s worth noting that the Microsoft iSCSI Target is not easy to come by (unless you have access to a Windows Storage Server). It is possible to get hold of an evaluation copy of Storage Server though and Jose explains how to install this in another blog post. Alternatively, you can use a third party iSCSI software target (it must support persistent reservations) or, even better, use a hardware solution.