#### iSCSI notes # useful packages scsi-target-utils iscsi-initiator-utils # nomenclature iscsi target = the storage device iscsi session = the connection between the initiator and target iscsi ports = ethernet ports which are used for communication between initiator and target IQN = iscsi qualified name (data host) # configuration iscsi-iname = command to generate IQN iscsiadm -m discovery -t st -p IP = discover iscsi targets available on data host iscsiadm -m node -T target_name -p IP:port --login = login to create session iscsiadm -m node -T target_name -p IP:port --logout = log out of a session iscsiadm -m node -T target_name -p IP:port -o update -n 'config' value = change a node db value iscsiadm -m node -T -p -o delete = remove entry from /var/lib/iscsi/nodes service iscsi needs to be started in order for automatic logins # status checks iscsiadm -m session -P{0..3} = display session settings # gotchas * watch out for 'duplicated' luns, etc. via multiple sessions * 'preferred' controllers should match port IP's when logging in/out of service * data hosts need at least 2 nics if using an array with multiple controllers /etc/iscsi/initiatorname.iscsi = contains name of initiator; do not use iscsi-iname by default # config locations /var/lib/iscsi/nodes = contains node records from discovery /var/lib/iscsi/'discovery_type' = contains records for discovery type # target creation: add target, add logical unit, bind # creating targets w/ tgtadm # is usually iscsi, is target ID, and is iscsi-iname tgtadm --lld --op new --mode target --tid --targetname tgtadm --lld --op new --mode logicalunit --tid --lun --backing-store # Deleting targets tgtadm --lld --op delete --mode target --tid # listing all targets (or a specific target) tgtadm --lld --op show --mode target (--tid ) # Binding to logical unit tgtadm --lld --op bind --mode target --tid --initiator-address
; ALL allows all initiators to access target tgtadm --lld --op bind --mode target --tid --iniator-name ; specify name to allow access to target (not required) # Portal stuff tgtadm --lld --op show --mode portal; list portals defined on target tgtadm --lld --op new --mode portal --param portal=n.n.n.n:3260; create new portal on target tgtadm --lld --op delete --mode portal --param portal=n.n.n.n:3260; remove portal on target