device_connectivity

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DevPath                     = "/dev"
	ConnectionTypeISCSI         = "iscsi"
	ConnectionTypeFC            = "fc"
	WaitForMpathRetries         = 5
	WaitForMpathWaitIntervalSec = 1
	FC_HOST_SYSFS_PATH          = "/sys/class/fc_remote_ports/rport-*/port_name"
	IscsiHostRexExPath          = "/sys/class/iscsi_host/host*/device/session*/iscsi_session/session*/targetname"
	MpathdSeparator             = ","

	VolumeIdDelimiter         = ":"
	VolumeStorageIdsDelimiter = ";"
)

Variables

View Source
var (
	TimeOutMultipathCmd  = 60 * 1000
	TimeOutMultipathdCmd = 10 * 1000
)

Functions

This section is empty.

Types

type ConnectivityIdentifierStorageTargetNotFoundError added in v0.9.0

type ConnectivityIdentifierStorageTargetNotFoundError struct {
	StorageTargetName string
	DirectoryPath     string
}

func (*ConnectivityIdentifierStorageTargetNotFoundError) Error added in v0.9.0

type ErrorNoRegexWwnMatchInScsiInq added in v1.3.0

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

func (*ErrorNoRegexWwnMatchInScsiInq) Error added in v1.3.0

type ErrorNotFoundArrayIdentifiers added in v0.9.0

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

func (*ErrorNotFoundArrayIdentifiers) Error added in v0.9.0

type ErrorNothingWasWrittenToScanFileError

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

func (*ErrorNothingWasWrittenToScanFileError) Error

type ErrorWrongDeviceFound added in v1.3.0

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

func (*ErrorWrongDeviceFound) Error added in v1.3.0

func (e *ErrorWrongDeviceFound) Error() string

type GetDmsPathHelperGeneric added in v1.3.0

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

func (GetDmsPathHelperGeneric) WaitForDmToExist added in v1.3.0

func (o GetDmsPathHelperGeneric) WaitForDmToExist(volumeUuid string, maxRetries int, intervalSeconds int) (string, error)

type GetDmsPathHelperInterface added in v1.3.0

type GetDmsPathHelperInterface interface {
	WaitForDmToExist(volumeUuid string, maxRetries int, intervalSeconds int) (string, error)
}

func NewGetDmsPathHelperGeneric added in v1.3.0

func NewGetDmsPathHelperGeneric(executer executer.ExecuterInterface) GetDmsPathHelperInterface

type MultipathDeviceNotFoundForVolumeError added in v1.3.0

type MultipathDeviceNotFoundForVolumeError struct {
	VolumeId string
}

func (*MultipathDeviceNotFoundForVolumeError) Error added in v1.3.0

type MultipleDeviceNotFoundError

type MultipleDeviceNotFoundError struct {
	DiskByPathDevice     string
	LinkToPhysicalDevice string
}

func (*MultipleDeviceNotFoundError) Error

type MultipleDmDevicesError

type MultipleDmDevicesError struct {
	VolumeId         string
	MultipathDevices map[string]bool
}

func (*MultipleDmDevicesError) Error

func (e *MultipleDmDevicesError) Error() string

type OsDeviceConnectivityFc added in v0.9.0

type OsDeviceConnectivityFc struct {
	Executer          executer.ExecuterInterface
	HelperScsiGeneric OsDeviceConnectivityHelperScsiGenericInterface
}

func (OsDeviceConnectivityFc) EnsureLogin added in v1.1.0

func (r OsDeviceConnectivityFc) EnsureLogin(_ map[string][]string)

func (OsDeviceConnectivityFc) FlushMultipathDevice added in v0.9.0

func (r OsDeviceConnectivityFc) FlushMultipathDevice(mpathDevice string) error

func (OsDeviceConnectivityFc) GetMpathDevice added in v0.9.0

func (r OsDeviceConnectivityFc) GetMpathDevice(volumeId string) (string, error)

func (OsDeviceConnectivityFc) RemovePhysicalDevice added in v0.9.0

func (r OsDeviceConnectivityFc) RemovePhysicalDevice(sysDevices []string) error

func (OsDeviceConnectivityFc) RescanDevices added in v0.9.0

func (r OsDeviceConnectivityFc) RescanDevices(lunId int, arrayIdentifiers []string) error

type OsDeviceConnectivityHelperGeneric added in v0.9.0

type OsDeviceConnectivityHelperGeneric struct {
	Executer executer.ExecuterInterface
	Helper   GetDmsPathHelperInterface
}

func (OsDeviceConnectivityHelperGeneric) GetDmsPath added in v1.3.0

func (o OsDeviceConnectivityHelperGeneric) GetDmsPath(volumeId string) (string, error)

func (OsDeviceConnectivityHelperGeneric) GetHostsIdByArrayIdentifier added in v0.9.0

func (o OsDeviceConnectivityHelperGeneric) GetHostsIdByArrayIdentifier(arrayIdentifier string) ([]int, error)

func (OsDeviceConnectivityHelperGeneric) GetWwnByScsiInq added in v1.3.0

func (o OsDeviceConnectivityHelperGeneric) GetWwnByScsiInq(dev string) (string, error)

func (OsDeviceConnectivityHelperGeneric) ReloadMultipath added in v1.3.0

func (o OsDeviceConnectivityHelperGeneric) ReloadMultipath() error

type OsDeviceConnectivityHelperInterface added in v0.9.0

type OsDeviceConnectivityHelperInterface interface {
	/*
		This is helper interface for OsDeviceConnectivityScsiGeneric.
		Mainly for writting clean unit testing, so we can Mock this interface in order to unit test OsDeviceConnectivityHelperGeneric logic.
	*/
	GetHostsIdByArrayIdentifier(arrayIdentifier string) ([]int, error)
	GetDmsPath(volumeId string) (string, error)
	GetWwnByScsiInq(dev string) (string, error)
	ReloadMultipath() error
}

func NewOsDeviceConnectivityHelperGeneric added in v0.9.0

func NewOsDeviceConnectivityHelperGeneric(executer executer.ExecuterInterface) OsDeviceConnectivityHelperInterface

type OsDeviceConnectivityHelperScsiGeneric added in v0.9.0

type OsDeviceConnectivityHelperScsiGeneric struct {
	Executer        executer.ExecuterInterface
	Helper          OsDeviceConnectivityHelperInterface
	MutexMultipathF *sync.Mutex
}

func (OsDeviceConnectivityHelperScsiGeneric) FlushMultipathDevice added in v0.9.0

func (r OsDeviceConnectivityHelperScsiGeneric) FlushMultipathDevice(mpathDevice string) error

func (OsDeviceConnectivityHelperScsiGeneric) GetMpathDevice added in v0.9.0

func (r OsDeviceConnectivityHelperScsiGeneric) GetMpathDevice(volumeId string) (string, error)

func (OsDeviceConnectivityHelperScsiGeneric) RemovePhysicalDevice added in v0.9.0

func (r OsDeviceConnectivityHelperScsiGeneric) RemovePhysicalDevice(sysDevices []string) error

func (OsDeviceConnectivityHelperScsiGeneric) RescanDevices added in v0.9.0

func (r OsDeviceConnectivityHelperScsiGeneric) RescanDevices(lunId int, arrayIdentifiers []string) error

type OsDeviceConnectivityHelperScsiGenericInterface added in v0.9.0

type OsDeviceConnectivityHelperScsiGenericInterface interface {
	/*
		This is helper interface for OsDeviceConnectivityHelperScsiGenericInterface.
		Mainly for writing clean unit testing, so we can Mock this interface in order to unit test logic.
	*/
	RescanDevices(lunId int, arrayIdentifiers []string) error
	GetMpathDevice(volumeId string) (string, error)
	FlushMultipathDevice(mpathDevice string) error
	RemovePhysicalDevice(sysDevices []string) error
}

func NewOsDeviceConnectivityHelperScsiGeneric added in v0.9.0

func NewOsDeviceConnectivityHelperScsiGeneric(executer executer.ExecuterInterface) OsDeviceConnectivityHelperScsiGenericInterface

type OsDeviceConnectivityInterface

type OsDeviceConnectivityInterface interface {
	EnsureLogin(ipsByArrayIdentifier map[string][]string)    // For iSCSI login
	RescanDevices(lunId int, arrayIdentifier []string) error // For NVME lunID will be namespace ID.
	GetMpathDevice(volumeId string) (string, error)
	FlushMultipathDevice(mpathDevice string) error
	RemovePhysicalDevice(sysDevices []string) error
}

func NewOsDeviceConnectivityFc added in v0.9.0

func NewOsDeviceConnectivityFc(executer executer.ExecuterInterface) OsDeviceConnectivityInterface

type OsDeviceConnectivityIscsi

type OsDeviceConnectivityIscsi struct {
	Executer          executer.ExecuterInterface
	HelperScsiGeneric OsDeviceConnectivityHelperScsiGenericInterface
}

func (OsDeviceConnectivityIscsi) EnsureLogin added in v1.1.0

func (r OsDeviceConnectivityIscsi) EnsureLogin(allPortalsByTarget map[string][]string)

func (OsDeviceConnectivityIscsi) FlushMultipathDevice

func (r OsDeviceConnectivityIscsi) FlushMultipathDevice(mpathDevice string) error

func (OsDeviceConnectivityIscsi) GetMpathDevice

func (r OsDeviceConnectivityIscsi) GetMpathDevice(volumeId string) (string, error)

func (OsDeviceConnectivityIscsi) RemovePhysicalDevice

func (r OsDeviceConnectivityIscsi) RemovePhysicalDevice(sysDevices []string) error

func (OsDeviceConnectivityIscsi) RescanDevices

func (r OsDeviceConnectivityIscsi) RescanDevices(lunId int, arrayIdentifiers []string) error

type WaitForMpathResult added in v1.2.0

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

Jump to

Keyboard shortcuts

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