Documentation
¶
Index ¶
- Constants
- Variables
- func AddLun(tid int, lun int, backingFile string, bstype string, bsopts string) error
- func AddLunBackedByFile(tid int, lun int, backingFile string) error
- func BindInitiator(tid int, initiator string) error
- func CheckForInitiatorExistence(nsexec *lhns.Executor) error
- func CheckTargetForBackingStore(name string) bool
- func CleanupScsiNodes(target string) error
- func CloseConnection(tid int, sid, cid string) error
- func CreateTarget(tid int, name string) error
- func DeleteDiscoveredTarget(ip, target string, nsexec *lhns.Executor) error
- func DeleteLun(tid int, lun int) error
- func DeleteTarget(tid int) error
- func DisableWriteCache(tid int, lun int) error
- func DiscoverTarget(ip, target string, nsexec *lhns.Executor) error
- func ExpandLun(tid, lun int, size int64) error
- func FindNextAvailableTargetID() (int, error)
- func GetDevice(ip, target string, lun int, nsexec *lhns.Executor) (*lhtypes.BlockDeviceInfo, error)
- func GetTargetConnections(tid int) (map[string][]string, error)
- func GetTargetTid(name string) (int, error)
- func IsTargetDiscovered(ip, target string, nsexec *lhns.Executor) bool
- func IsTargetLoggedIn(ip, target string, nsexec *lhns.Executor) bool
- func LoginTarget(ip, target string, nsexec *lhns.Executor) error
- func LogoutTarget(ip, target string, nsexec *lhns.Executor) error
- func RescanTarget(ip, target string, nsexec *lhns.Executor) error
- func SetLunThinProvisioning(tid int, lun int) error
- func ShutdownTgtd() error
- func StartDaemon(debug bool) error
- func UnbindInitiator(tid int, initiator string) error
- func UpdateIscsiDeviceAbortTimeout(target string, timeout int64, nsexec *lhns.Executor) error
- func UpdateLun(tid int, lun int, params map[string]string) error
- func UpdateScsiDeviceTimeout(devName string, timeout int64, nsexec *lhns.Executor) error
Constants ¶
const (
ScanTimeout = 10 * time.Second
)
Variables ¶
var ( DeviceWaitRetryCounts = 10 DeviceWaitRetryInterval = 1 * time.Second ScsiNodesDirs = []string{ "/etc/iscsi/nodes/", "/var/lib/iscsi/nodes/", } )
var ( TgtdRetryCounts = 5 TgtdRetryInterval = 1 * time.Second )
Functions ¶
func AddLun ¶
AddLun will add a LUN in an existing target, which backing by specified file, using AIO backing-store
func AddLunBackedByFile ¶
AddLunBackedByFile will add a LUN in an existing target, which backing by specified file.
func BindInitiator ¶
BindInitiator will add permission to allow certain initiator(s) to connect to certain target. "ALL" is a special initiator which is the wildcard
func CleanupScsiNodes ¶
func CloseConnection ¶
func CreateTarget ¶
CreateTarget will create a iSCSI target using the name specified. If name is unspecified, a name will be generated. Notice the name must comply with iSCSI name format.
func DeleteDiscoveredTarget ¶
func DeleteTarget ¶
DeleteTarget will remove a iSCSI target specified by tid
func DisableWriteCache ¶
DisableWriteCache will set param write-cache to false for the LUN
func ExpandLun ¶
ExpandLun will update the size for the LUN. This is valid only for the customized tgt https://github.com/rancher/tgt/
func GetTargetTid ¶
GetTargetTid If returned TID is -1, then target doesn't exist, but we won't return error
func IsTargetLoggedIn ¶
IsTargetLoggedIn check all portals if ip == ""
func LogoutTarget ¶
LogoutTarget will logout all sessions if ip == ""
func SetLunThinProvisioning ¶
SetLunThinProvisioning will set param thin_provisioning to true for the LUN
func ShutdownTgtd ¶
func ShutdownTgtd() error
func StartDaemon ¶
StartDaemon will start tgtd daemon, prepare for further commands
func UnbindInitiator ¶
UnbindInitiator will remove permission to allow certain initiator(s) to connect to certain target.
Types ¶
This section is empty.