iscsi

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RetryCount int = 10

Functions

func ConVolume

func ConVolume(portal string, iqn string, lun int) (string, error)

func DisconnectConnection

func DisconnectConnection(targets []Target) error

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(id int, hctl *Hctl) (string, error)

func LoginPortal

func LoginPortal(portal string, iqn string) error

LoginPortal login iscsi partal

func RemoveConnection

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

func ScanISCSI

func ScanISCSI(hctl *Hctl) error

ScanISCSI

Types

type AttachedISCSIDevice

type AttachedISCSIDevice struct {
	TargetIQN          string
	CurrentPortal      string
	HostID             int
	HostLUNID          int
	AttachedDeviceName string // ex: sda, sdb
}

AttachedISCSIDevice is device info

func GetAttachedSCSIDevices

func GetAttachedSCSIDevices() ([]AttachedISCSIDevice, error)

GetAttachedSCSIDevices retrieves attached iSCSI devices.

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 SessionP3Block

type SessionP3Block struct {
	Header string
	Body   []string
}

SessionP3Block is content of iSCSI session

type SessionP3Target

type SessionP3Target struct {
	IQN              string
	CurrentPortal    string
	PersistentPortal string
	Blocks           []SessionP3Block
}

SessionP3Target is detail of iSCSI session per iSCSI target

func ParseSessionP3

func ParseSessionP3(out []byte) ([]SessionP3Target, error)

ParseSessionP3 parse output of `iscsiadm -m session -P3

type Target

type Target struct {
	Portal string
	Iqn    string
	Lun    int
}

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

Jump to

Keyboard shortcuts

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