Mittwoch, 23. Januar 2013

Installing SRPT on Scientific Linux 6.3/6.x PART-2

Configuring SCST.
For installing SCST please look the previous post.

Configuration:

Assuming you have on machineA blockdevice/RAID6  on /dev/vg00/lv_01 and you wont to export it to machineB as a block device/scsi device.

1) vim   /etc/modprobe.d/ib_srpt.conf
 options ib_srpt use_node_guid_in_target_name=1
2) add module for auto load in:
/etc/init.d/scst about line 101

    SCST_MODULES="scst ib_srpt"

/etc/init.d/scst restart
WARNING: if you get error loading kernel module and unknown symbols, then the kernel loads wrong ib_srpt module, find that and delete it.

3) Let us export something:
Now let’s find out what targets we have available to scstadmin
scstadmin --list_target
you will ge something like:
Driver  Target            
    ---------------------------
    ib_srpt 0002:c903:0018:4c40
each IB card has a unique GUID

for management please install if you need it

yum install srptools

assuming you have on machineA /dev/vg00/lv_01 and you wont to export it to machineB
machineA is a target machineB is a initiator. In normal language machineA is exporting the block device and machineB is a client.
1) in machineA edit /etc/scst.conf
############
HANDLER vdisk_blockio {
        DEVICE disk01 {
                filename /dev/vg00/lv_01
                                threads_num 1
                                nv_cache 1
                                write_through 1
        }
}

TARGET_DRIVER ib_srpt {
        TARGET 0002:c903:0018:4c40 {
                LUN 0 disk01
                enabled 1
        }
 
############
Warning: do not forget to restart scst
/etc/init.d/scst restart 

Please replace TARGET to your IB GUID (the result from scstadmin --list_target on machineA)

2) on machineB
modprobe ib_srp
if no errors you should get device in:
/sys/class/infiniband_srp/srp-/add_target

ibsrpdm -c will print list of exported targets visible in the IB network.
I get in my machine something like this:
id_ext=0002c90300184c40,ioc_guid=0002c90300184c40,dgid=fe800000000000000002c90300184c41,pkey=ffff,service_id=0002c90300184c40

to mount it you should:

echo "id_ext=0002c90300184c40,ioc_guid=0002c90300184c40,dgid=fe800000000000000002c90300184c41,pkey=ffff,service_id=0002c90300184c40" >>/sys/class/infiniband_srp/srp-mlx4_0-1/add_target

then lsscsi will show new scsi device:
[7:0:0:0]    disk    SCST_BIO disk01    300  /dev/sdc

So that's it.

If you need more automated mounts of targets, you can use multipathd with srp_daemon combination.
But this is another story.

Keine Kommentare: