Getting Familiar with iSCSI Part 1: How to Install the iSCSI Target
- select the contributor at the end of the page -
For a brief overview of iSCSI, please see the introduction section from Dave Lawlor's article, How to setup iSCSI Drive Using FreeNAS. Using iSCSI requires both a storage provider (iSCSI target) and a client (iSCSI initiator). iSCSI targets are sometimes network hard disk storage or computers running iSCSI target software on top of an operating system. Or another way to refer to them is as a set of disks in a disk subsystem. In this blog we'll cover installing the iSCSI target on Windows Server 2008 R2. Later we will cover configuring the Microsoft iSCSI initiator, which is installed by default on Windows 2008 and later, and also Windows 7.
Installing the Microsoft iSCSI Software Target
1. Download and extract the files to a location, such as c:\admin\ISCSI_Target\x64
The iSCSI target is downloaded from here: http://www.microsoft.com/download/en/details.aspx?id=19867
2. From the installation directory, navigate to the x64 directory and execute the iscsitarget_public.msi file. (Note: In my testing, executing the index.html in the root directory, and then selecting install the software on a Windows Server, failed because of a bad link.)
3. Click Next at the Welcome Screen.
4. Accept the licensing agreement and click Next.
5. Accept the default Destination Folder or provide an alternate location and click Next.
6. Click Next at the Join the Customer Experience Improvement Program.
7. Review Microsoft Update Screen, and select the appropriate option. “Use Microsoft Update when I check for Updates” is recommended to ensure the system is fully patched. Then click Next.
8. Click Install to begin the installation.
9. Click Finish to complete the installation.
Now that the iSCSI target is installed, in the next step we will create and mount an iSCSI target Virtual disk.
Configuring the Microsoft iSCSI Software Target
1. Launch the MMC console for the Microsoft iSCSI Software Target from the start menu.
Notice the three options below the Microsoft iSCSI Software Target:
- ISCSI Targets: this is used to configure which clients can connect to this server's iSCSI storage and to create the iSCSI Qualified Name for the storage. This is configured after the Devices are configured.
- Devices: this is used to define the physical storage files that hold the storage space. You can configure multiple devices per system. These are in .vhd (virtual hard disk) format. In this blog we will create the device.
- Snapshots: these are images of the virtual disks at a particular time, run either manually or on a scheduled basis. Snapshots do not interrupt access to the storage devices, so disk access does not need to be stopped. It provides one way to recover data in between standard backups.
As you can see below, the system is currently un-configured. The next step is to add storage devices to create the .vhd files that hold the data.
2. Right click on Devices, and select Create Virtual Disk.
3. Click Next on the Welcome Screen.
4. Enter the location and file name for the storage device and Click Next. The file is in virtual disk (.vhd) format. Enter the desired location/name.
5. Enter the default size in megabytes (for gigabytes, 1024 x # of gigabytes). Then click Next.
6. Enter a Virtual Disk Description. Then click Next.
7. Click Next since we have not configured the iSCSI initiator (client) that can access this virtual disk.
8. Click Finish to Complete the Create Virtual Disk Wizard.
Next we will test the storage by mounting the device on the local Windows 2008 R2 machine
Mounting the Virtual Disk Locally using the iSCSI Target Software
1. Launch the iSCSI Target. Right Click on Virtual Disk 0 and click Disk Access/ Mount Read/Write.
2. From Start/Control Panel/Administrative tools, Launch Computer Management, Disk Management and notice how the Initialize Disk window will display for Disk 1 (2 GB) since the disk is uninitialized. Since the disk size is only 2 GB, using the default Master Boot Record partition style is recommended. Disk 1 is currently unallocated storage. Click OK to continue.
3. Configure the volume via the New Simple Volume Wizard. Right click on the 2.00 GB Unallocated, and select New Simple Volume. Click Next.
4. Right click on the 2.00 GB, Unallocated section, and select New Simple Volume.
5. If desired, the volume can be split into multiple partitions. Select the default and click Next.
6. Assign a Drive Letter to the drive. Select the default drive (e.g. E in this case), then click Next.
7. Configure the format partition options. I recommend assigning a unique volume name in order to aid in identifying the partition (e.g. Test 1 Virtual Disk). Then click Next.
8. Verify the options and select Finish.
9. Formatting will take a few minutes. When it's finished, the new partition will look like the one below:
Now the logical E: drive can be used as storage on the local Windows machine, or can be accessed for use by remote systems. As discussed, all of the files for the E: drive will be physically stored within the .vhd storage file located on c:\sample\Virtual Disk 1.vhd.
Dismounting the Disk from the Local System
In order to prepare for Part 2, dismount the iSCSI partition:
1. From the ISCSI Target Software, click on Devices/Virtual Disk Index name (Virtual Disk 0) and select Disk Access/Dismount.
Now you've tried iSCSI and have a basis for how to format a new volume for use with the iSCSI target. In our next blog, we'll discuss connecting to the iSCSI target over the network and use snapshots to recover data.