9

I have a trio of CentOS 6.4 machines that I'm trying to configure to use iSCSI. Basically two different initiators talking to two different targets on a single host server.

On one machine, "the server", I have two targets defined in /etc/tgt/targets.conf each target points to a different logical disk. The configuration stanzas are nearly identical, varying only in their names and initiator-address fields.

These are the lines from /etc/tgt/targets.conf that aren't commented out.

default-driver iscsi

<target iqn.2013-08.com.example.group:backup>
  backing-store /dev/primary/backup
  initiator-address <ip address>
  incominguser username password
</target>

<target iqn.2013-08.com.example.group:migrations>
  backing-store /dev/primary/migrations
  initiator-address <ip address>
  incominguser username password
</target>

When I run tgt-admin -s I show two targets as expected. However, one of the targets shows only 1 LUN (0 Controller) while the other target shows 2 LUNs (a Controller and a Disk). I have no idea if this is significant.

Sadly, the first target (w/o a disk LUN) is able to be reached by it's initiator and the machine can mount the space and it's all peaches and cream. The second target (w/ the disk LUN) can't be reached by the initiator. When I run iscsiadm -m discovery -t sendtargets -p <ipaddr> I get back iscsiadm: No portals found.

What's worse, even if I when the second target to expect connection from the other address, or remove the initiator-address portion of the configuration, no other systems seem to see the second target.

OldTroll
  • 1,686
  • 2
  • 12
  • 18
  • Please share your targets.conf. – b13n1u Jan 13 '14 at 21:35
  • Did you add these targets at the same time? Or did you add the second one after you already started the service? – jaseeey Jan 13 '14 at 22:05
  • They should have been added at the same time originally. I have manually stopped and restarted the `tgtd` service more times today than I care to remember. – OldTroll Jan 13 '14 at 22:22
  • Have you tried to change the target name for example to iqn.2013-09.com.example.group:migrations ? – b13n1u Jan 14 '14 at 09:17
  • Tried renaming the migrations target's iqn. Did not change anything. – OldTroll Jan 14 '14 at 16:58
  • I just raised the above because the tgtd service doesn't stop properly if you still have initiators connected, so therefore the configuration doesn't get reloaded. If you stop the service, it's good to check it's actually stopped using 'ps awx | grep tgtd' - in the past, I've had to do a 'kill -9 ' to be able to start it again with the new configuration. – jaseeey Feb 05 '14 at 23:01
  • Jason -- I totally forgot about this, I found your answer out after a day or so. If you'll turn that into an answer I'll accept it. Thanks. – OldTroll Feb 06 '14 at 16:17

1 Answers1

3

Error:

iscsiadm: No portals found.

Issue: It's a acl issue.

Solution: Run below command in iSCSI-Target:

tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL  #In Target

Then run below command:

iscsiadm -m discoverydb -t st --p 192.168.1.5  #It will work... Enjoy.
mzhaase
  • 3,798
  • 2
  • 20
  • 32
  • Very good answer, it worked! However, it would be better if you would explain, what it did. – peterh Jan 25 '19 at 12:24