Search This Blog

Monday, April 22, 2013

Another XenServer - iscsi gotcha - problems connecting to an QNAP iSCSI target

Xenserver can decide (ie some how be set) to use Chap authentication on discovery
Chris Keim document this at
I had this problem with a new Qnap 870 NAS I could connect using a NFS share, but not using iSCSI.

I wanted to use iSCSI as detailed in this post - as a particular disk with a lot of small files would generate errors and hang the Xenserver.

To diagnose
1) connect from another iSCSI initiator (e.g. Windows). Note you can connect, discover targets and connect to a LUN.
2) attempt from Xenserver - both XenCenter and the command line.
3) attempt to connect using iscsadm

[root@xennet2 ~]# iscsiadm  --mode discovery --type sendtargets --portal
iscsiadm: Login failed to authenticate with target
iscsiadm: discovery login to rejected: initiator error (02/01), n                                         on-retryable, giving up
iscsiadm: Could not perform SendTargets discovery.

The clue is the error - "failed to authenticate with target". The Qnap NAS doesn't like the authentication passed during the discovery.

To fix - as documented in  Chris' blog, edit the st_config file - in /etc/iscsi/send_targets/,3260
remove the lines
discovery.sendtargets.auth.username = <user>
discovery.sendtargets.auth.username = <password>

and add:
discovery.sendtargets.authmethod = none

To be persistent (after reboots) make sure /etc/iscsid.conf also has auth.method set to none for discovery.sendtargets (or is commented out).

1 comment:

  1. I am using XenServer 6.2 and after reboot the st_config files are regenerated with the CHAP credentials and it appears that the "discovery.sendtargets.authmethod = none" in /etc/iscsid.conf is being ignored and CHAP is being using for discovery anyway.

    What version of XenServer are you using?