iscsi

package
v1.0.25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisconnectConnection

func DisconnectConnection(targets []Target) error

DisconnectConnection Close iscsi connection

func FindSysfsMultipathDM

func FindSysfsMultipathDM(deviceName string) (dmDeviceName string, err error)

FindSysfsMultipathDM Find the dm device name given a list of device names

func GetConnectionDevices

func GetConnectionDevices(targets []Target) ([]string, error)

GetConnectionDevices get volumes in paths

func GetDeviceName

func GetDeviceName(sessionID int, hctl *Hctl) (string, error)

GetDeviceName Add retry to get device name

func RemoveConnection

func RemoveConnection(targetDeviceNames []string, isMultiPath bool) error

RemoveConnection Remove LUNs and multipath associated with devices names

func ScanISCSI

func ScanISCSI(hctl *Hctl) error

ScanISCSI Send an iSCSI scan request given the host and optionally the ctl

Types

type Hctl

type Hctl struct {
	HostID    int
	ChannelID int
	TargetID  int
	HostLUNID int
}

Hctl is IDs of SCSI

func GetHctl

func GetHctl(id int, lun int) (*Hctl, error)

GetHctl Given an iSCSI session return the host, channel, target, and lun

type SessionIscsi

type SessionIscsi struct {
	Transport            string
	SessionID            int
	TargetPortal         string
	TargetPortalGroupTag int
	IQN                  string
	NodeType             string
}

func GetSessions

func GetSessions() ([]SessionIscsi, error)

GetSessions access to the iscsi sessions

type Target

type Target struct {
	Portal string
	Iqn    string
	Lun    int
}

Target a iscsi connection info

func DiscoverIscsiPortals

func DiscoverIscsiPortals(portal string, iqn string, luns int) []Target

DiscoverIscsiPortals get iscsi connection information

func NewTarget

func NewTarget(portals string, iqns string, luns int) Target

NewTarget Build a target object include portal, iqn, lun

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL