iSCSI connection command examples (Cheat Sheet)

Internet Small Computer System Interface (iSCSI) is an Internet Protocol (IP)–based storage standard that connects iSCSI initiators to iSCSI targets over IP networks. To put it simply, the SCSI packets are encapsulated in IP packets and sent over a standard IP network, where the initiators and targets reassemble the packets and interpret the commands carried by these packets.

iSCSI takes advantage of existing IP infrastructure, unlike Fibre Channel (FC), which requires special cables and switches.

Overview of iSCSI Connectivity

The main elements of iSCSI connectivity are initiators, targets, portals, sessions, and connections. I start with iSCSI sessions to provide a high-level connectivity overview, and then I cover the remaining elements in later sections of this chapter.

iSCSI Sessions

Each iSCSI initiator establishes a single session with each iSCSI target server via Transmission Control Protocol (TCP). Within that session, there can be one or more connections between initiators and portals on the target server. A portal is an IP address and TCP port combination.

iSCSI connection command examples

Below are few most commonly used iscsi connection commands.

1. Discover targets at a given IP address:

# iscsiadm --mode discoverydb --type sendtargets --portal 192.168.1.10 --discover

2. Login, must use a node record id found by the discovery:

# iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.1:3260 --login

3. Logout:

# iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.1:3260 --logout

4. List node records:

# iscsiadm --mode node

5. Display all data for a given node record:

# iscsiadm --mode node --targetname iqn.2001-05.com.doe:test --portal 192.168.1.1:3260
Related Post