实验环境:falcon存储设备作服务器,redhat作客户端
IPStor控制台
首先挂载光盘,安装iscsi相关的rpm包
[root@localhost ~]# mkdir /data [root@localhost ~]# mount /dev/cdrom /data mount: block device /dev/sr0 is write-protected, mounting read-only [root@localhost data]# cd /data/Packages/ [root@localhost Packages]# ll iscsi* -r--r--r-- 66 root root 670688 Oct 31 2012 iscsi-initiator-utils-6.2.0.873-2.el6.x86_64.rpm [root@localhost Packages]# rpm -ivh iscsi-initiator-utils-6.2.0.873-2.el6.x86_64.rpm warning: iscsi-initiator-utils-6.2.0.873-2.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY Preparing... ########################################### [100%] 1:iscsi-initiator-utils ########################################### [100%] |
设置iscsi服务开机自动启动
[root@localhost Packages]# chkconfig --level 35 iscsi on [root@localhost Packages]# chkconfig --level 35 iscsid on [root@localhost Packages]# chkconfig --list | grep iscsi iscsi 0:off 1:off 2:off 3:on 4:on 5:on 6:off iscsid 0:off 1:off 2:off 3:on 4:on 5:on 6:off |
向服务器192.168.188.129发送请求
此时服务器并未发现该设备
[root@localhost Packages]# iscsiadm -h iscsiadm -m discoverydb [ -hV ] [ -d debug_level ] [-P printlevel] [ -t type -p ip :port -I ifaceN ... [ -Dl ] ] | [ [ -p ip:port -t type] [ -o operation ] [ -n name ] [ -v value ] [ -lD ] ] iscsiadm -m discovery [ -hV ] [ -d debug_level ] [-P printlevel] [ -t type -p ip:port -I ifaceN ... [ -l ] ] | [ [ -p ip:port ] [ -l | -D ] ] iscsiadm -m node [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -L all,manual,automatic ] [ -U all,manual,automatic ] [ -S ] [ [ -T targetname -p ip:port -I ifaceN ] [ -l | -u | -R | -s] ] [ [ -o operation ] [ -n name ] [ -v value ] ] iscsiadm -m session [ -hV ] [ -d debug_level ] [ -P printlevel] [ -r sessionid | sysfsdir [ -R | -u | -s ] [ -o operation ] [ -n name ] [ -v value ] ] iscsiadm -m iface [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -I ifacename | -H hostno|MAC ] [ [ -o operation ] [ -n name ] [ -v value ] ] [ -C ping [ -a ip ] [ -b packetsize ] [ -c count ] [ -i interval ] ] iscsiadm -m fw [ -l ] iscsiadm -m host [ -P printlevel ] [ -H hostno|MAC ] [ -C chap [ -o operation ] [ -v chap_tbl_idx ] ] iscsiadm -k priority [root@localhost Packages]# iscsiadm -m discovery -t sendtargets -p 192.168.188.129 Starting iscsid: [ OK ] 192.168.188.129:3260,0 iqn.2000-03.com.falconstor-ipstor.FalconStor-CDPVA.Everyone-iSCSI-0 |
此时要开启控制台,在控制台上扫描新设备,添加客户端,即可
为iscsi目标分配SAN资源:
然后为客户端分配资源
我们最终可以分配到3块san资源
重新启动服务,并再次发送请求,可以看到19e6f857b0b1-0已经找到
[root@localhost Packages]# service iscsi restart Stopping iscsi: [ OK ] Starting iscsi: [ OK ] [root@localhost Packages]# iscsiadm -m discovery -t sendtargets -p 192.168.188.129 192.168.188.129:3260,0 iqn.2000-03.com.falconstor-ipstor.FalconStor-CDPVA.19e6f857b0b1-0 192.168.188.129:3260,0 iqn.2000-03.com.falconstor-ipstor.FalconStor-CDPVA.Everyone-iSCSI-0 [root@localhost Packages]# iscsiadm -m node -T iqn.2000-03.com.falconstor-ipstor.FalconStor -CDPVA.19e6f857b0b1-0 -p 192.168.188.129 -l Logging in to [iface: default, target: iqn.2000-03.com.falconstor-ipstor.FalconStor -CDPVA.19e6f857b0b1-0, portal: 192.168.188.129,3260] (multiple) Login to [iface: default, target: iqn.2000-03.com.falconstor-ipstor.FalconStor-CDPVA. 19e6f857b0b1-0, portal: 192.168.188.129,3260] successful. |
查看分区,多出了sdb,sdc,sdd,此次连接成功。
[root@localhost Packages]# fdisk -l Disk /dev/sdb: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x95e53976 Device Boot Start End Blocks Id System /dev/sdb1 1 1306 10482688 7 HPFS/NTFS Disk /dev/sdc: 21.5 GB, 21474836480 bytes 64 heads, 32 sectors/track, 20480 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sdd: 21.5 GB, 21474836480 bytes 64 heads, 32 sectors/track, 20480 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 |