For my Virtual Machines needs, some LUNS are presented to my VMware vSphere 5.1 Servers and until now,
my lab storage was handle by
FreeNas using iSCSI.
For tests purposes, I replaced this FreeNas by Windows Server 2012 to take care of that part.
Note: Before writing this post, I grouped my physical disks together into a container called
storage pools to manage those disks as a single storage space. Afterwards, in these storage pools, I created
virtual disks (aka LUN) on which I specify a layout, ... which is simply a raid level.
Overview
In the following post I will talk about the following points:
- Quick iSCSI Terminology
- Quick look at iSCSI Target Management (GUI and PowerShell iSCSI Modules)
- Installing the Windows Feature iSCSI Server Target (PowerShell)
- Creating a iSCSI Virtual Disk (aka LUN) (PowerShell)
- Creating a iSCSI Target and assigning it to one or more initiator(s) (PowerShell)
- Finding the iSCSI Qualified Name (IQN) (vSphere Client and PowerCLI)
- Assigning a iSCSI Virtual Disk (LUN) to a iSCSI Target (PowerShell)
Terminology
Note: The iSCSI protocol is fully documented by
the RFC 3720 and
RFC 3721
iSCSI: iSCSI stands for
Internet Small Computer System Interface.
It's an Internet Protocol (IP)-based storage networking standard for linking data storage facilities.
iSCSI is used to facilitate data transfers over a network (LAN, WAN or Internet) and transferring data by carrying SCSI commands over IP networks. iSCSI leverages the Ethernet network and does not require any specialized hardware
iSCSI Target Server: is the server that shares the storage, it runs the iSCSI Target. The server (machine) consumes the storage is called iSCSI initiator.
iSCSI Initiator: Typically, it is an application server. For example, iSCSI Target provides storage to a SQL server, the SQL server will be the iSCSI initiator in this deployment.
Target: It is an object which allows the iSCSI initiator to make a connection. The Target keeps track of the initiators which are allowed to be connected to it. The Target also keeps track of the iSCSI virtual disks which are associated with it. Once the initiator establishes the connection to the Target, all the iSCSI virtual disks associated with the Target will be accessible by the initiator.
iSCSI Virtual Disk: It also referred to as
iSCSI LUN. It is the object which can be mounted by the iSCSI initiator. On Windows Server 2012, the iSCSI virtual disk is backed by the VHD file.
iSCSI Connection: iSCSI initiator makes a connection to the iSCSI Target Server by logging on to a Target. There could be multiple Targets on the iSCSI Target Server, each Target can be accessed by a defined list of initiators. Multiple initiators can make connections to the same Target. However, this type of configuration is only supported with clustering. Because when multiple initiators connects to the same Target, all the initiators can read/write to the same set of iSCSI virtual disks, if there is no clustering (or equivalent process) to govern the disk access, corruption will occur. With Clustering, only one machine is allowed to access the iSCSI virtual disk at one time.
IQN: iSCSI Qualified Name. It is a unique identifier of the Target or Initiator. The Target IQN is shown when it is created on the Server. The initiator IQN can be found by typing a simple "
iscsicli" cmd in the command window or using
Get-InitiatorPort in PowerShell
|
Using iscsicli |
|
Using PowerShell (module iSCSI) with the Cmdlet Get-InitiatorPort |