1

I've tried searching for this but I'm not sure if I'm wording it right.

I have a single physical server I want to use as iSCSI target. I have two volume groups but I want each volume group to only be available on a specific subnet by iSCSI. So for example, vg_1 is available on vlan_1 and vg_2 is available on vlan_2. I'm using Centos 7.9 for host OS with two Intel 10G X550T.

How do I bind, or more precisely where can I find how to bind the two different iSCSI nodes or IQNs to the different NICs? Is it possible? Is it advisable? Thank you.

2

1 Answer 1

2

Thank you all for the comments. Very helpful. I just created one IQN, then created two TPGs assigning each block device to each TPG then binding the different vlan IP addresses to the respective TPG's portals. Here's the targetcli commands I used

//Create the backstore off block devices
/backstores/block> create name=block_ds1 dev=/dev/sdb
Created block storage object block_ds1 using /dev/sdb.
/backstores/block> create name=block_ds2 dev=/dev/sdc
Created block storage object block_ds2 using /dev/sdc.

//create target
/iscsi> create
Created target
iqn.2003-01.org.linux-iscsi.dsrv26-virstor.x8664:sn.dd4ab7d436a3
Created TPG1

//portal default already created on all addresses. Need to delete so we can bind portal to specific address
/iscsi/iqn.20.../tpg1/portals> delete 0.0.0.0 3260
Deleted network portal 0.0.0.0:3260
/iscsi/iqn.20.../tpg1/portals> create 192.168.253.2
Using default IP port 3260
Created network portal 192.168.253.2:3260.

//create tpg2 and bind portal to ip address
/iscsi/iqn.20....dd4ab7d436a3> create tpg2
Created TPG 2.
Default portal not created, TPGs within a target cannot share ip:port.

/iscsi/iqn.20....dd4ab7d436a3> cd tpg2/portals
/iscsi/iqn.20.../tpg2/portals> create 192.168.254.2
Using default IP port 3260
Created network portal 192.168.254.2:3260.

//create LUNs from block backstores
/iscsi/iqn.20....dd4ab7d436a3> cd tpg1
/iscsi/iqn.20...b7d436a3/tpg1> luns/ create /backstores/block/block_ds1
Created LUN 0.
/iscsi/iqn.20...b7d436a3/tpg1> cd ..
/iscsi/iqn.20....dd4ab7d436a3> cd tpg2
/iscsi/iqn.20...b7d436a3/tpg2> luns/ create /backstores/block/block_ds2
Created LUN 0.

Edit: Yes I didn't create the volume groups with LVM and just left the block devices (RAID 6 arrays) as is.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .