Tuesday, August 23, 2011

Initiator Error (02/01) and XenServer

I ran into an issue this past Sunday at a clients site. A newly built XenServer pool had been running just fine until the system had to be rebooted because of a physical move. When the XenServers came back online, they could not connect to their iSCSI targets. I tried disabling CHAP on the SAN, removing XenServers from the pool, you name it we tried it. Finally, I was able to get 1 server functional and moved all the VMs over to that server.

But, I still had a server that was not working and I did not know why. No matter what, I could not connect via iSCSI to the SAN. We had a CIFS share on the SAN and that server could connect just fine. After some digging, I finally found the issue. XenServer was set to use CHAP on discovery and for some reason my SAN did not like that and would refuse the connection giving me the error "Initiator error (02/01)". I checked this setting on the XenServer that was functional and sure enough, that XenServer was not set to use CHAP on discovery. So all I have to do now is disable CHAP during discovery, easy enough:

  1. SSH or use the console to log into the problematic XenServer
  2. Go to the local command shell of the problematic XenServer
  3. Navigate to the following director: /etc/iscsi/send_targets/[SAN IP, Port]
  4. Open the st_config file located underneath your target directory
  5. Add the following line: discovery.sendtargets.auth.authmethod = None
  6. Remove the following line: discovery.sendtargets.auth.username = [username]
  7. Remove the following line: discovery.sendtargets.auth.password = [password]
  8. Save the file
  9. Verify the problem has been resolved
  10. To make this change permanent, modify the following file with step # 5: /etc/iscsi/iscsid.conf
Let me know your comments, questions, or criticisms.

6 comments:

  1. Ok.. nice hint..
    But after a reboot of the xen-server you will get into same trouble again, because the send_target-file will be overwritten with some default stuff.

    Check this link for editing the default-values:
    http://forums.citrix.com/message.jspa?messageID=1016953

    Greets,
    SpeedCracker

    ReplyDelete
  2. Correct, to make this change permanent, you want to modify the /etc/iscsi/iscsid.conf.

    ReplyDelete
  3. thank you I had the same probelm with XenServer v6.02 and v6.1

    ReplyDelete
  4. what do you do when trying to install xenserver 6+ (6.2 in this case) on ISCSI? You don't have any director: /etc/iscsi/send_targets/[SAN IP, Port]
    I managed to make it see the disk but it cannot connect.

    ReplyDelete