Rudi Ahlers
2011-Feb-15 13:54 UTC
[CentOS] working with multiple password protected iSCSI targets on one host
Hi, How do I setup multiple password protected iSCSI targets on Linux? I know that mounting a password protected iSCSI target requires modify these records with the appropriate values: node.session.auth.username = My_ISCSI_USR_NAME node.session.auth.password = MyPassword discovery.sendtargets.auth.username = My_ISCSI_USR_NAME discovery.sendtargets.auth.password = MyPassword But, now I need to mount another iSCSI target, from a different SAN that has a different username & password than whan I have configured here for the one already mounted. How do I tell iscsiadm which CHAP settings to use with which iSCSI target? -- Kind Regards Rudi Ahlers SoftDux Website: http://www.SoftDux.com Technical Blog: http://Blog.SoftDux.com Office: 087 805 9573 Cell: 082 554 7532
Santi Saez
2011-Feb-15 16:11 UTC
[CentOS] working with multiple password protected iSCSI targets on one host
El 15/02/2011 14:54, Rudi Ahlers escribi?: Hi Rudi,> How do I setup multiple password protected iSCSI targets on Linux? > > (..) > > But, now I need to mount another iSCSI target, from a different SAN > that has a different username& password than whan I have configured > here for the one already mounted. > > How do I tell iscsiadm which CHAP settings to use with which iSCSI target?I think there is not elegant way to do this.. I follow those steps: 1) Set discovery.sendtargets.{auth,password} in iscsid.conf for target-1 + restart iscsid service. 2) Set CHAP settings for target-1 + connect: # iscsiadm -m node --targetname ${TARGETNAME1} -p ${PORTAL1} -o update -n node.session.auth.username -v ${USERNAME} # iscsiadm -m node --targetname ${TARGETNAME1} -p ${PORTAL1} -o update -n node.session.auth.password -v ${PASSWORD} # iscsiadm -m node --targetname ${TARGETNAME1} -p ${PORTAL1} -l 3) Disconnect from target-1: # iscsiadm -m node --logoutall all 4) Set discovery.sendtargets.{auth,password} in iscsid.conf for target-2 + restart iscsid service. 5) Set CHAP settings for target-2 + connect: # iscsiadm -m node --targetname ${TARGETNAME2} -p ${PORTAL2} -o update -n node.session.auth.username -v ${USERNAME} # iscsiadm -m node --targetname ${TARGETNAME2} -p ${PORTAL2} -o update -n node.session.auth.password -v ${PASSWORD} # iscsiadm -m node --targetname ${TARGETNAME2} -p ${PORTAL2} -l It works! Now you can login/logout in both iSCSI targets: # iscsiadm -m node --logoutall all # iscsiadm -m node --loginall all Cheers, -- Santi Saez http://woop.es