文档章节

About iSCSI Storage

icheer
 icheer
发布于 2014/01/25 13:06
字数 1325
阅读 41
收藏 0

The Internet Small Computer System Interface (iSCSI) is an IP-based standard for connecting storage devices. iSCSI encapsulates SCSI commands in IP network packets, which allows data transfer over long distances and sharing of storage by client systems. As iSCSI uses the existing IP infrastructure, it does not require the purchase and installation of fiber-optic cabling and interface adapters that are needed to implement Fibre Channel (FC) storage area networks.

A client system (iSCSI initiator) accesses the storage server (iSCSI target) over an IP network. To an iSCSI initiator, the storage appears to be locally attached.

Figure 16.1 shows a simple network where several iSCSI initiators are able to access the shared storage that is attached to an iSCSI target.

Figure 16.1 iSCSI Initiators and an iSCSI Target Connected via an IP-based Network

The diagram shows a simple Ethernet network where several iSCSI initiators are able to access the shared storage that is attached to an iSCSI target.


A hardware-based iSCSI initiator uses a dedicated iSCSI HBA. Oracle Linux supports iSCSI initiator functionality in software. The kernel-resident device driver uses the existing network interface card (NIC) and network stack to emulate a hardware iSCSI initiator. As the iSCSI initiator functionality is not available at the level of the system BIOS, you cannot boot an Oracle Linux system from iSCSI storage .

To improve performance, some network cards implement TCP/IP Offload Engines (TOE) that can create a TCP frame for the iSCSI packet in hardware. Oracle Linux does not support TOE, although suitable drivers may be available directly from the card vendor.

16.6.1 Configuring an iSCSI Target

An iSCSI target is typically a dedicated, network-connected storage device but it can also be a general-purpose computer. The procedure in this section demonstrates how to set up a simple iSCSI target.

To configure an Oracle Linux system as an iSCSI target:

  1. Install the scsi-target-utils package:

    # yum install scsi-target-utils
  2. Edit /etc/tgt/targets.conf and create entries for the iSCSI target and the storage devices (LUNs) that it will make available, for example:

    <target iqn.2012-01.com.mydom.host01:target1>
        direct-store /dev/sdb # LUN 1
        direct-store /dev/sdc # LUN 2
    </target>

    The /etc/tgt/targets.conf file contains several sample configurations that you can use as templates.

    In the example, the target is uniquely identified by its iSCSI Qualified Name (IQN), which takes the format:

    iqn.YYYY-MM.reverse_FQDN[:target_name]

    where:

    • YYYY-MM

    • Specifies the year and month that the naming authority took ownership of the domain.

    • reverse_FQDN

    • Specifies the reverse fully qualified domain name of the naming authority.

    • target_name

    • Specifies an optional target name, which identifies the target at a site.

  3. Start the iSCSI target service, tgtd, and configure it to start after the system reboots:

    # service tgtd start# chkconfig tgtd on
  4. Use the tgtadm command to verify that the iSCSI target is available:

    # tgtadm -o show -m target
    Target 1: iqn.2012-01.com.mydom.host01:target1
        System information:
            Driver: iscsi
            State: ready
        I_T nexus information:
        LUN information:
            LUN: 0
                Type: controller
                SCSI ID: deadbeaf1:0
                SCSI SN: beaf10
                Size: 0 MB
                Online: Yes
                Removable media: No
                Backing store: No backing store
            LUN: 1
                Type: disk
                SCSI ID: deadbeaf1:1
                SCSI SN: beaf11
                Size: 10737 MB
                Online: Yes
                Removable media: No
                Backing store: No
    ...

You can use the tgtadm utility to monitor and configure iSCSI targets. In addition, the tgt-admin script provides a simplifed interface to the tgtadm commands that create, delete, and show target information. The tgt-setup-lunscript allows you to create targets, add devices to targets, and define which iSCSI initiators are allowed to connect to a target.

For more information, see the targets.conf(5)tgt-admin(8)tgt-setup-lun(8), and tgtadm(8) manual pages.

16.6.2 Configuring an iSCSI Initiator

To configure an Oracle Linux system as an iSCSI initiator:

  1. Install the iscsi-initiator-utils package:

    # yum install iscsi-initiator-utils
  2. Use the SendTargets discovery method to discover the iSCSI targets at a specified IP address:

    # iscsiadm -m discovery --type sendtargets –p 10.150.30.72Starting iscsid:                               [ OK ]
    10.150.30.72:3260,1 iqn.2012-01.com.mydom.host01:target1
    10.150.30.72:3260,1 iqn.2012-01.com.mydom.host01:target2

    Note

    An alternate discovery method is Internet Storage Name Service (iSNS).

    The command also starts the iscsid service if it is not already running.

    The following command displays information about the targets that is now stored in the discovery database:

    # iscsiadm -m discoverydb –t st –p 10.150.30.72# BEGIN RECORD 2.0-872.41.el6
    discovery.startup = manual
    discovery.type = sendtargets
    discovery.sendtargets.address = 10.150.30.72
    discovery.sendtargets.port = 3260
    discovery.sendtargets.auth.authmethod = None
    discovery.sendtargets.auth.username_in = <empty>
    discovery.sendtargets.auth.password_in = <empty>
    discovery.sendtargets.timeo.login_timeout = 15
    discovery.sendtargets.use_discoveryd = No
    discovery.sendtargets.discoveryd_poll_inval = 30
    discovery.sendtargets.repoen_max = 5
    discovery.sendtargets.timeo.auth_timeout = 45
    discovery.sendtargets.timeo.active_timeout = 30
    discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768
  3. Establish a session and log in to a specific target:

    # iscsiadm -m node -l# iscsiadm -m node --targetname iqn.2012-01.com.mydom.host01:target1 \  –p 10.150.30.72:3260 -lLogin to [iface: default, target: iqn.2012-01.com.mydom.host01:target1, 
    portal: 10.150.30.72:3260] successful.
  4. Verify that the session is active, and display the available LUNs:

    # iscsiadm -m session –P 3Target: iqn.2012-01.com.mydom.host01:target1
    Current Portal: 10.150.30.72:3260,1
    Persistent Portal: 10.150.30.72:3260,1
    **********
    Interface:
    **********
    Iface Name: default
    Iface Transport: tcp
    Iface Initiatorname: iqn.1988-12.com.oracle:392a7cee2f
    Iface IPaddress: 192.0.2.101
    Iface HWaddress: <empty>
    Iface Netdev: <empty>
    SID: 1
    iSCSI Connection State: LOGGED IN
    iSCSI Session State: LOGGED IN
    Internal iscsid Session State: NO CHANGE
    .
    .
    .
    ************************
    Attached SCSI devices:
    ************************
    Host Number: 4 State: running
    scsi10 Channel 00 Id 0 Lun:0
    scsi10 Channel 00 Id 0 Lun:1
        Attached scsi disk sdb
    State: running
    scsi10 Channel 00 Id 0 Lun:2
        Attached scsi disk sdc
    State: running

    The LUNs are represented as SCSI block devices (sd*) in the local /dev directory, for example:

    # fdisk –l | grep /dev/sd[bc]Disk /dev/sdb: 10.7 GB, 10737418240 bytes
    Disk /dev/sdc: 10.7 GB, 10737418240 bytes

    To distinguish between target LUNs, examine their paths under /dev/disk/by-path:

    # ls -l /dev/disk/by-path/lrwxrwxrwx  1 root root  9 May 15 21:05
      ip-10.150.30.72:3260-iscsi-iqn.2012-01.com.mydom.host01:02:
      084591f8-6b8b-c857-f002-ecf8a3b387f3-lun-1 -> ../../sdb
    lrwxrwxrwx 1 root root  9 May 15 21:05
      ip-10.150.30.72:3260-iscsi-iqn.2012-01.com.mydom.host01:02:
      084591f8-6b8b-c857-f002-ecf8a3b387f3-lun-2 -> ../../sdc

    You can view the initialization messages for the LUNs in the /var/log/messages file:

    # grep -i scsi /var/log/messagesApr 8 15:08:53 host02 kernel: scsi12 : iSCSI Initiator over TCP/IP
    Apr 8 15:08:53 host02 kernel: sd 4:0:0:1: [sdb] Attached SCSI disk
    Apr 8 15:08:53 host02 kernel: sd 4:0:0:2: [sdc] Attached SCSI disk

    You can configure and use a LUN in the same way as you would any other physical storage device. For example, you can configure it as an LVM physical volume, file system, swap partition, Automatic Storage Management (ASM) disk, or raw device.

    Specify the _netdev option when creating mount entries for iSCSI LUNs in /etc/fstab, for example:

    UUID=084591f8-6b8b-c857-f002-ecf8a3b387f3     /iscsi_mount_point     ext4     _netdev   0  0

    This option indicates the file system resides on a device that requires network access, and prevents the system from attempting to mount the file system until the network has been enabled.

    Note

    Specify an iSCSI LUN in /etc/fstab by using UUID=UUID or LABEL=label rather than the device path. A device path can change after re-connecting the storage or rebooting the system.

    Any discovered LUNs remain available across reboots provided that the target continues to serve those LUNs and you do not log the system off the target.

For more information, see the iscsiadm(8) and iscsid(8) manual pages.

16.6.3 Updating the Discovery Database

If the LUNs that are available on an iSCSI target change, you can use the iscsiadm command on an iSCSI initiator to update the entries in its discovery database. The following example assume that the target supports the SendTargets discovery method

To add new records that are not currently in the database:

# iscsiadm -m discoverydb –t st –p 10.150.30.72 –o new --discover

To update existing records in the database:

# iscsiadm -m discoverydb –t st –p 10.150.30.72 –o update --discover

To delete records from the database that are no longer supported by the target:

# iscsiadm -m discoverydb –t st –p 10.150.30.72 –o delete --discover

For more information, see the iscsiadm(8) manual page.


本文转载自:http://docs.oracle.com/cd/E37670_01/E41138/html/ch16s06.html

icheer
粉丝 36
博文 206
码字总数 30712
作品 0
深圳
程序员
私信 提问
Use targetcli to setup iscsi target

First, a block device should be available linux-lokb:~ # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vdb 254:16 0 100G 0 disk 1. start "targetcli" and execute "ls" linux-lokb:......

认真即可
2016/08/03
207
0
vnx通过iscsi连接esxi主机,并挂载nfs和block

主要步骤: 1) vnx上创建一个nas folder,这个nas里面有一个放了一个vm文件夹 2) esxi上挂载nfs 3) vnx上创建block pool与lun 4) vnx上设置iscsi连接-> 设置iscsi的port以及连接vcenter 5...

UVN2015
2017/08/24
0
0
linux--iscsi 的应用

ISCSI: (iSCSI:InternetSmallComputerSystemInterface) Internet小型计算机系统接口 iscsi 是一个供硬件设备使用的可以在IP协议的上层运行的SCSI指令集,这种指令集合可以实现在IP网络上...

無緣
2017/12/15
0
0
磁盘共享------iscsi

前边说过的cifs以及nfs这个文件共享系统虽然已经是比较成熟的了,但是在客户机端连接到服务器端上传文件时,先会将文件转换为2进制文件,在接受端接受到2进制文件后在转化为相应的格式显示出...

技术小白JDY
2017/12/12
0
0
linux学习笔记 第七篇 (samba(一))(iscsi)

alias: alias xie='vim'(退出再登陆不可用) alias vim .bashrc(只有root用户可用:用户级变量) alias xie='vim' source .bashrc vim /etc/bashrc(系统级别变量:其他用户可用) 函数: vthm......

当当要加油
2016/12/20
0
0

没有更多内容

加载失败,请刷新页面

加载更多

ubuntu 19.4 安装virtual

ubuntu 安装virtual 后报错 Solve “Result Code: NS_ERROR_FAILURE (0x80004005)” VirtualBox Error In Arch Linux $ sudo /sbin/vboxconfig 报错 “debconf: DbDriver ”config“: confi......

internetafei
4分钟前
1
0
思维导图技术分享

- by 文恒

程序员的自我成长
6分钟前
1
0
《将博客搬至CSDN》

将blog,也同步到CSDN中

温安适
15分钟前
2
0
watchbog再升级,企业黄金修补期不断缩小,或面临蠕虫和恶意攻击

概要 近日,阿里云安全团队发现wacthbo挖矿团伙[1]新增了CVE_2019_5475 的漏洞利用代码,并开始进行尝试性攻击。 通过对CVE_2019_5475漏洞的生命周期进行分析后发现,漏洞批量化利用的速度正...

大涛学长
18分钟前
2
0
深入理解JVM,虚拟机类加载机制

本人免费整理了Java高级资料,一共30G,需要自己领取; 传送门:https://mp.weixin.qq.com/s/JzddfH-7yNudmkjT0IRL8Q 类加载过程概览 类从被加载到虚拟机内存中开始,到卸载出内存为止,它的...

李红欧巴
19分钟前
2
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部