Skip to content

Instantly share code, notes, and snippets.

@skarllot
Last active January 2, 2016 02:39
Show Gist options
  • Save skarllot/8238311 to your computer and use it in GitHub Desktop.
Save skarllot/8238311 to your computer and use it in GitHub Desktop.
Managing iSCSI into Linux
# Create ifaces
iscsiadm -m iface -I iface0 -o new
iscsiadm -m iface -I iface0
iscsiadm -m iface -o update -I iface0 -n iface.net_ifacename -v eth0
# Discovery
iscsiadm -m discovery -t sendtargets -p 192.168.0.1 -I iface0 -I iface1
# Delete undesired targets
iscsiadm -m node -T iqn.2014-01.com.example:vol0 -p 192.168.0.1 -o delete
# Login to target
iscsiadm -m node -l -T iqn.2014-01.com.example:vol0 -p 192.168.0.1
# Get device name
iscsiadm -m session -P 3
# Get SCSI WWID
scsi_id -g -u -d /dev/sda
# Get device vendor
cat /sys/block/sdb/device/vendor
# Get device product
cat /sys/block/sdb/device/model
blacklist {
wwid "*"
}
blacklist_exceptions {
wwid "0123456789abcdef"
}
multipaths {
multipath {
wwid 0123456789abcdef
alias DEV0
}
}
devices {
device {
vendor "FreeBSD"
product "iSCSI Disk"
path_grouping_policy multibus
getuid_callout "/sbin/scsi_id -g -u -d /dev/%n"
features "1 queue_if_no_path"
path_checker readsector0
failback immediate
path_selector "round-robin 0"
rr_min_io 10
rr_weight uniform
no_path_retry fail
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment