Unable to discover iSCSI targets
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.
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.