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.
FILEIO struct for backstore info.
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 }
FS represents the pseudo-filesystem configfs, which provides an interface to iscsi kernel data structures in sysfs as /sys and configfs as /sys/kernel/config.
type FS struct {
// contains filtered or unexported fields
}
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 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 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 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 FS) GetRDMCPPath(rdmcpNumber string, objectName string) (*RDMCP, error)
GetRDMCPPath is getting the actual info to build up RDMCP data.
func (fs FS) ISCSIStats() ([]*Stats, error)
ISCSIStats getting iscsi runtime information.
func (fs FS) Path(p ...string) string
Path is a helper function to get configfs path.
IBLOCK struct for backstore info.
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 }
LUN struct for sys logical unit number info.
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 }
RBD struct for backstore info.
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 }
RDMCP struct for backstore info.
type RDMCP struct { Name string // name of the rdm_cp ObjectName string // place holder for object name }
Stats struct for all targets info.
type Stats struct { Name string Tpgt []TPGT RootPath string }
func GetStats(iqnPath string) (*Stats, error)
GetStats is the main iscsi status information func for building the path and prepare info for enable iscsi.
TPGT struct for sys target portal group tag info.
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 }