iscsi

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadWriteOPS

func ReadWriteOPS(iqnPath string, tpgt string, lun string) (readmb uint64,
	writemb uint64, iops uint64, err error)

ReadWriteOPS read and return the stat of read and write in megabytes, and total commands that send to the target

Types

type FILEIO

type FILEIO struct {
	Name       string // name of the fileio
	Fnumber    string // number related to the backstore
	ObjectName string // place holder for object in iscsi object
	Filename   string // link to the actual file being export
}

FILEIO struct for backstore info

type FS

type FS struct {
	// contains filtered or unexported fields
}

FS represents the pseudo-filesystem configfs, which provides an interface to iscsi kernel data structures in sysfs as /sys configfs as /sys/kernel/config

func NewFS

func NewFS(sysfsPath string, configfsMountPoint string) (FS, error)

NewFS returns a new configfs mounted under the given mount point. It will error and return empty FS if the mount point can't be read. For the ease of use, an empty string parameter configfsMountPoint will call internal fs for the default sys path as /sys/kernel/config

func (FS) GetFileioUdev

func (fs FS) GetFileioUdev(fileioNumber string, objectName string) (*FILEIO, error)

GetFileioUdev is getting the actual info to build up the FILEIO data and match with the enable target

func (FS) GetIblockUdev

func (fs FS) GetIblockUdev(iblockNumber string, objectName string) (*IBLOCK, error)

GetIblockUdev is getting the actual info to build up the IBLOCK data and match with the enable target

func (FS) GetRBDMatch

func (fs FS) GetRBDMatch(rbdNumber string, poolImage string) (*RBD, error)

GetRBDMatch is getting the actual info to build up the RBD data and match with the enable target

func (FS) GetRDMCPPath

func (fs FS) GetRDMCPPath(rdmcpNumber string, objectName string) (*RDMCP, error)

GetRDMCPPath is getting the actual info to build up RDMCP data

func (FS) ISCSIStats

func (fs FS) ISCSIStats() ([]*Stats, error)

ISCSIStats getting iscsi runtime information

func (FS) Path

func (fs FS) Path(p ...string) string

helper function to get configfs path

type IBLOCK

type IBLOCK struct {
	Name       string // name of the iblock
	Bnumber    string // number related to the backstore
	ObjectName string // place holder for object in iscsi object
	Iblock     string // link to the actual block being export
}

IBLOCK struct for backstore info

type LUN

type LUN struct {
	Name       string // name of the lun
	LunPath    string // file path of the lun
	Backstore  string // backstore of the lun
	ObjectName string // place holder for object
	TypeNumber string // place holder for number of the device
}

LUN struct for sys logical unit number info

type RBD

type RBD struct {
	Name    string // name of the rbd
	Rnumber string // number related to the backstore
	Pool    string // place holder for the rbd pool
	Image   string // place holder for the rbd image
}

RBD struct for backstore info

type RDMCP

type RDMCP struct {
	Name       string // name of the rdm_cp
	ObjectName string // place holder for object name
}

RDMCP struct for backstore info

type Stats

type Stats struct {
	Name     string
	Tpgt     []TPGT
	RootPath string
}

Stats struct for all targets info

func GetStats

func GetStats(iqnPath string) (*Stats, error)

GetStats is the main iscsi status information func building the path and prepare info for enable iscsi

type TPGT

type TPGT struct {
	Name     string // name of the tpgt group
	TpgtPath string // file path of tpgt
	IsEnable bool   // is the tpgt enable
	Luns     []LUN  // the Luns that tpgt has
}

TPGT struct for sys target portal group tag info

Jump to

Keyboard shortcuts

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