lib/iscsi.pm

SYNOPSIS

Library for easy use of iSCSI server and client tools

iscsi_discovery

iscsi_discovery( $target );

Runs iscsiadm -m discovery -t st -p $target in the SUT, to discover iSCSI targets on the $target which could be IP address or host name

iscsi_login

iscsi_login( $iqn, $target );

Runs iscsiadm -m node --targetname $iqn -p $target -l in the SUT, to login client to the iSCSI IQN $iqn on the iSCSI server $target

iscsi_logout

iscsi_logout( $iqn, $target);

Runs iscsiadm -m node --targetname $iqn -p $target -u in the SUT, to logout client from the iSCSI IQN $iqn on the iSCSI server $target

tgt_show

tgt_show();

Usable only with TGTD iSCSI server Runs the tgtadm --lld iscsi --op show --mode target in the SUT, to show up configured iSCSI LUNs

tgt_new_lun

tgt_new_lun( $tid, $lun, $device );

Usable only with TGTD iSCSI server Runs tgtadm --lld iscsi --op new --mode logicalunit --tid $tid --lun $lun -b $device in the SUT, to add new LUN $lun from device $device to the existing TARGET with ID $tid

tgt_update_lun_params

tgt_update_lun_params( $tid, $lun, $params );

Usable only with TGTD iSCSI server Runs tgtadm --lld iscsi --op update --mode logicalunit --tid $tid --lun $lun --params $params in the SUT, updates parameters $params of existing LUN $lun on iSCSI target ID $tid

tgt_auth_all

tgt_auth_all( $tid );

Usable only with TGTD iSCSI server Runs tgtadm --lld iscsi --op bind --mode target --tid $tid -I ALL in the SUT, to allow all clients to use list of targets $tid on the iSCSI server

lio_show

lio_show();

Usable only on the LIO iSCSI server Runs targetcli ls iscsi in the SUT to show up configured iSCSI LUNs

lio_new_target

lio_new_target( $tid, $iqn );

Usable only on the LIO iSCSI server Runs targetcli /iscsi create $iqn:$tid in the SUT, Creates new iSCSI target on LIO iSCSI server with IQN $iqn and ID $tid

lio_new_lun

lio_new_lun( $tid, $iqn, $device );

Usable only on the LIO iSCSI server Creates new back store from the device $device (full path to) and assign it to the new LUN on target with IQN $iqn and ID $tid

lio_new_portal

lio_new_portal( $tid, $iqn, $ip, $port );

Usable only on the LIO iSCSI server Assign IP address $ip and port $post to the LUN on target with IQN $iqn and ID $tid

lio_auth_all

lio_auth_all( $tid, $iqn );

Usable only on the LIO iSCSI server Allow access to all clients to use target IQN $iqn with ID $tid on the LIO iSCSI server

lio_update_lun_attr

lio_update_lun_attr( $tid, $iqn, $attribute );

Usable only on the LIO iSCSI server Update attribute $attribute on the IQN $iqn with ID $tid on the LIO iSCSI server