Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for iSCSI discovery #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bmeagherix
Copy link
Contributor

Add support for iSCSI discovery

This uses iscsi_discovery_sync which was added to libiscsi in version 1.18.0 (Oct 9 2016) in commit sahlberg/libiscsi@d3ef192

Have also added CHAP and Mutual CHAP support by plumbing iscsi_set_initiator_username_pwd and iscsi_set_target_username_pwd. The former is available since version 1.1.0 (commit sahlberg/libiscsi@40abe84), whereas the latter was added in version 1.14.0 (commit sahlberg/libiscsi@b1d0ac4)

Example usage:

import iscsi
import pprint
ctx = iscsi.Context('iqn.1993-08.org.debian:01:1da68ca3c4ec')
ctx.set_session_type(iscsi.ISCSI_SESSION_DISCOVERY)
ctx.set_header_digest(iscsi.ISCSI_HEADER_DIGEST_NONE)
# ctx.set_initiator_username_pwd("user1", "12charsecret")
# ctx.set_target_username_pwd("user2", "13charsecret1")
ctx.connect('192.168.100.101', -1)
result = ctx.discover()
ctx.disconnect()
pprint.pprint(result)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant